Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tag onRemove preview #4498

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions aries-site/src/examples/components/tag/TagSimple.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import React from 'react';
import { Tag } from 'grommet';
import { Box, Tag } from 'grommet';

export const TagSimple = () => <Tag name="Location" value="San Jose" />;
export const TagSimple = () => (
<Box gap="small">
{['xsmall', 'small', 'medium', 'large', 'xlarge'].map(size => (
<Tag
alignSelf="start"
name="Location"
value="San Jose"
size={size}
onRemove={() => {}}
/>
))}
</Box>
);
94 changes: 94 additions & 0 deletions aries-site/src/themes/aries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { hpe, hpePop } from 'grommet-theme-hpe';
import { deepMerge } from 'grommet/utils';
import { Info } from 'grommet-icons';
import { Close } from 'grommet-icons/icons/Close';

export const aries = deepMerge(hpe, {
defaultMode: 'dark',
Expand All @@ -11,6 +12,99 @@ export const aries = deepMerge(hpe, {
// any Box props
gap: 'small',
},
button: {
size: {
xsmall: {
border: {
radius: '2em',
},
iconOnly: {
pad: '5px',
},
},
},
},
icon: {
size: {
xsmall: '14px',
},
},
tag: {
icons: {
remove: Close,
},
remove: {
kind: 'default',
},
size: {
xsmall: {
icon: {
size: undefined,
},
remove: {
size: 'xsmall',
margin: {
right: 'none',
left: '-5px', // shifting for button padding
top: '-1px', // account for border
bottom: '-1px', // account for border
},
},
},
small: {
icon: {
size: undefined,
},
remove: {
size: 'xsmall',
margin: {
right: '2px',
left: '-5px', // shifting for button padding
},
},
},
medium: {
icon: {
size: undefined,
},
remove: {
size: 'small',
margin: {
right: 'xxsmall',
left: '-7px', // shifting for button padding
},
},
},
large: {
icon: {
size: undefined,
},
remove: {
size: 'medium',
margin: {
right: '2px',
left: '-9px', // shifting for button padding
},
},
},
xlarge: {
icon: {
size: undefined,
},
pad: {
vertical: '21px',
horizontal: 'medium',
},
remove: {
size: 'large',
margin: {
right: 'xsmall',
left: '-13px', // shifting for button padding
},
},
},
},
},
feedback: {
closeButton: {
a11yTitle: `You are in a dialog containing a form to submit feedback.
Expand Down