@chotot/clad-ui 2.2.0 → 2.3.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Button/Button.styles.js +12 -12
- package/dist/components/Button/GhostButton.styles.js +10 -10
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +2 -2
- package/dist/components/Chip/Chip.stories.d.ts +11 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
- package/dist/components/Chip/Chip.stories.js +81 -24
- package/dist/components/Chip/Chip.styles.d.ts.map +1 -1
- package/dist/components/Chip/Chip.styles.js +64 -58
- package/dist/components/Input/Input.styles.d.ts.map +1 -1
- package/dist/components/Input/Input.styles.js +33 -19
- package/dist/components/RowItem/RowItem.styles.d.ts.map +1 -1
- package/dist/components/RowItem/RowItem.styles.js +8 -0
- package/dist/components/Snack/Snack.d.ts +9 -0
- package/dist/components/Snack/Snack.d.ts.map +1 -1
- package/dist/components/Snack/Snack.js +7 -4
- package/dist/components/Snack/Snack.stories.d.ts +22 -0
- package/dist/components/Snack/Snack.stories.d.ts.map +1 -1
- package/dist/components/Snack/Snack.stories.js +137 -0
- package/dist/components/Snack/Snack.styles.d.ts +7 -1
- package/dist/components/Snack/Snack.styles.d.ts.map +1 -1
- package/dist/components/Snack/Snack.styles.js +44 -3
- package/dist/components/TextArea/TextArea.styles.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.styles.js +12 -8
- package/dist/icons/ChevronDown.d.ts.map +1 -1
- package/dist/icons/ChevronDown.js +1 -3
- package/dist/icons/ChevronLeft.d.ts.map +1 -1
- package/dist/icons/ChevronLeft.js +1 -3
- package/dist/icons/ChevronRight.d.ts.map +1 -1
- package/dist/icons/ChevronRight.js +1 -3
- package/dist/icons/ChevronUp.d.ts.map +1 -1
- package/dist/icons/ChevronUp.js +1 -3
- package/dist/patterns/Drawer/Drawer.d.ts +19 -10
- package/dist/patterns/Drawer/Drawer.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.js +30 -18
- package/dist/patterns/Drawer/Drawer.stories.d.ts +20 -0
- package/dist/patterns/Drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.stories.js +329 -42
- package/dist/patterns/Drawer/Drawer.styles.d.ts +1 -1
- package/dist/patterns/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.styles.js +11 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts.map +1 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts.map +1 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.js +1 -5
- package/dist/storybook/Type.d.ts +1 -1
- package/dist/theme/chotot.d.ts +3 -2
- package/dist/theme/chotot.d.ts.map +1 -1
- package/dist/theme/chotot.js +3 -2
- package/dist/theme/ct-job.d.ts +3 -2
- package/dist/theme/ct-job.d.ts.map +1 -1
- package/dist/theme/ct-pty.d.ts +3 -2
- package/dist/theme/ct-pty.d.ts.map +1 -1
- package/dist/theme/ct-veh.d.ts +3 -2
- package/dist/theme/ct-veh.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- badges -->
|
|
2
2
|
|
|
3
|
-
[<img src="https://img.shields.io/badge/@chotot/clad--ui-2.1.
|
|
3
|
+
[<img src="https://img.shields.io/badge/@chotot/clad--ui-2.3.1--next.1-FFBA00" alt="@chotot/clad-ui npm version" />](https://www.npmjs.com/package/@chotot/clad-ui)
|
|
4
4
|
[<img src="https://img.shields.io/badge/@chotot/charts-1.0.2-FFBA00" alt="@chotot/charts npm version" />](https://www.npmjs.com/package/@chotot/charts)
|
|
5
5
|
[<img src="https://img.shields.io/badge/react-%3E=16.8-0088CC" alt="React dependency version" />](https://github.com/facebook/react/)
|
|
6
6
|
[<img src="https://img.shields.io/badge/linaria-^4.2.10-DE2D68" alt="Linaria dependency version" />](https://github.com/callstack/linaria)
|
|
@@ -45,14 +45,14 @@ const buttonClass = css `
|
|
|
45
45
|
|
|
46
46
|
/* Sizes */
|
|
47
47
|
&.small {
|
|
48
|
-
padding: ${space.none}
|
|
48
|
+
padding: ${space.none} 10px;
|
|
49
49
|
border-radius: 6px;
|
|
50
|
-
height: ${sizes.
|
|
50
|
+
height: ${sizes.md};
|
|
51
51
|
|
|
52
52
|
${typo.label.caption}
|
|
53
53
|
|
|
54
54
|
&.icon {
|
|
55
|
-
padding:
|
|
55
|
+
padding: 5px;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
& > svg {
|
|
@@ -62,14 +62,14 @@ const buttonClass = css `
|
|
|
62
62
|
|
|
63
63
|
&,
|
|
64
64
|
&.medium {
|
|
65
|
-
height:
|
|
66
|
-
padding: ${space.none}
|
|
65
|
+
height: 36px;
|
|
66
|
+
padding: ${space.none} 14px;
|
|
67
67
|
border-radius: ${radii.md};
|
|
68
68
|
|
|
69
69
|
${typo.label.section}
|
|
70
70
|
|
|
71
71
|
&.icon {
|
|
72
|
-
padding:
|
|
72
|
+
padding: 7px;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
& > svg {
|
|
@@ -78,14 +78,14 @@ const buttonClass = css `
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
&.large {
|
|
81
|
-
height:
|
|
82
|
-
padding: ${space.none} ${space.md};
|
|
81
|
+
height: 44px;
|
|
82
|
+
padding: ${space.none} ${space.md};
|
|
83
83
|
border-radius: ${radii.md};
|
|
84
84
|
|
|
85
85
|
${typo.label.page}
|
|
86
86
|
|
|
87
87
|
&.icon {
|
|
88
|
-
padding:
|
|
88
|
+
padding: 9px;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
& > svg {
|
|
@@ -94,14 +94,14 @@ const buttonClass = css `
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
&.xlarge {
|
|
97
|
-
height:
|
|
98
|
-
padding: ${space.none} ${space.
|
|
97
|
+
height: 56px;
|
|
98
|
+
padding: ${space.none} ${space.mdl};
|
|
99
99
|
border-radius: ${radii.md};
|
|
100
100
|
|
|
101
101
|
${typo.label.page}
|
|
102
102
|
|
|
103
103
|
&.icon {
|
|
104
|
-
padding:
|
|
104
|
+
padding: 15px;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
& > svg {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import theme from '@clad-ui/theme';
|
|
2
2
|
import { css } from '@linaria/core';
|
|
3
|
-
const { colors, radii, fontSizes, fontWeights, typo,
|
|
3
|
+
const { colors, radii, fontSizes, fontWeights, typo, space } = theme;
|
|
4
4
|
const buttonClass = css `
|
|
5
5
|
/* Standard highlight for manual testing & verification */
|
|
6
6
|
outline: 1px solid var(--cladebug);
|
|
@@ -130,36 +130,36 @@ const buttonClass = css `
|
|
|
130
130
|
|
|
131
131
|
/* Sizes */
|
|
132
132
|
&.small {
|
|
133
|
-
/* outer height:
|
|
133
|
+
/* outer height: 28px */
|
|
134
134
|
font-size: ${fontSizes.xs};
|
|
135
135
|
line-height: 1;
|
|
136
|
-
padding:
|
|
136
|
+
padding: 7px; /* minus borders */
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
&,
|
|
140
140
|
&.medium {
|
|
141
|
-
/* outer height:
|
|
141
|
+
/* outer height: 36px */
|
|
142
142
|
font-size: ${fontSizes.sm};
|
|
143
143
|
line-height: 1;
|
|
144
|
-
padding:
|
|
144
|
+
padding: 10px;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
&.large {
|
|
148
|
-
/* outer height:
|
|
148
|
+
/* outer height: 44px */
|
|
149
149
|
font-size: ${fontSizes.md};
|
|
150
150
|
line-height: 1.25;
|
|
151
|
-
padding:
|
|
151
|
+
padding: 11px; /* minus borders */
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
&.xlarge {
|
|
155
|
-
height:
|
|
156
|
-
padding: ${space.none} ${space.
|
|
155
|
+
height: 56px;
|
|
156
|
+
padding: ${space.none} ${space.mdl};
|
|
157
157
|
border-radius: ${radii.md};
|
|
158
158
|
|
|
159
159
|
${typo.label.page}
|
|
160
160
|
|
|
161
161
|
&.icon {
|
|
162
|
-
padding:
|
|
162
|
+
padding: 13px; /* minus border */
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
& > svg {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,QAAA,MAAM,WAAW,mCAA8C,CAAC;AAChE,KAAK,IAAI,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,QAAA,MAAM,WAAW,mCAA8C,CAAC;AAChE,KAAK,IAAI,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AAEH,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA4D7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import theme from '@clad-ui/theme';
|
|
4
4
|
import { cx } from '../../utils';
|
|
5
|
-
import {
|
|
5
|
+
import { ChevronDown, Close } from '../../icons';
|
|
6
6
|
import { CloseButton, StyledChip, ChipInteractiveCss, DisabledChipCss } from './Chip.styles';
|
|
7
7
|
const { sizes } = theme;
|
|
8
8
|
const keysOfSizes = ['initial', ...Object.keys(sizes)];
|
|
@@ -29,7 +29,7 @@ const Chip = ({ value, size = 'lg', active = false, className = '', href = null,
|
|
|
29
29
|
}}>
|
|
30
30
|
<Close />
|
|
31
31
|
</CloseButton>)}
|
|
32
|
-
{dropdownIcon ? <
|
|
32
|
+
{dropdownIcon ? <ChevronDown /> : null}
|
|
33
33
|
</StyledChip>);
|
|
34
34
|
};
|
|
35
35
|
export default Chip;
|
|
@@ -63,6 +63,17 @@ export declare const OutlineVariant: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
+
export declare const GhostVariant: {
|
|
67
|
+
render: () => JSX.Element;
|
|
68
|
+
name: string;
|
|
69
|
+
parameters: {
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
story: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
66
77
|
export declare const DisabledChip: {
|
|
67
78
|
render: () => JSX.Element;
|
|
68
79
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChB,CAAC;AAEF,eAAe,WAAW,CAAC;AAa3B,eAAO,MAAM,QAAQ;;CAepB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChB,CAAC;AAEF,eAAe,WAAW,CAAC;AAa3B,eAAO,MAAM,QAAQ;;CAepB,CAAC;AAKF,eAAO,MAAM,aAAa;;;;;;;;;;CAqBzB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;CA+B1B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CAgCxB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CAmBxB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CAmBxB,CAAC;AAGF,eAAO,MAAM,gBAAgB;;;;;;;;;;CA0B5B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;CAqBvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CA8BxB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;CA4DpB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;CA6BlB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CA6BzB,CAAC"}
|
|
@@ -64,31 +64,80 @@ export const Overview = {
|
|
|
64
64
|
</>);
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
|
+
const Br = () => <p style={{ display: 'block', content: ' ', height: '10px' }}/>;
|
|
67
68
|
export const NormalVariant = {
|
|
68
69
|
render: () => (<>
|
|
69
|
-
<Chip>Normal Chip</Chip>
|
|
70
|
+
<Chip>Normal Chip</Chip>{' '}
|
|
71
|
+
<Chip active>Active Normal Chip</Chip>{' '}
|
|
72
|
+
<Chip disabled>Disabled Normal Chip</Chip>
|
|
73
|
+
<Br />
|
|
74
|
+
<Chip onClose={onChipClosed}>Normal with Close</Chip>{' '}
|
|
75
|
+
<Chip dropdownIcon>Normal with Dropdown</Chip>{' '}
|
|
76
|
+
<Chip icon={<Label />}>Normal with Icon</Chip>
|
|
70
77
|
</>),
|
|
71
78
|
name: 'Normal variant',
|
|
72
79
|
parameters: {
|
|
73
80
|
docs: {
|
|
74
81
|
description: {
|
|
75
|
-
story: 'Normal is the default variant',
|
|
82
|
+
story: 'Normal is the default variant with filled background.',
|
|
76
83
|
},
|
|
77
84
|
},
|
|
78
85
|
},
|
|
79
86
|
};
|
|
80
87
|
export const OutlineVariant = {
|
|
81
88
|
render: () => (<>
|
|
82
|
-
<Chip variant="outline">Outline Chip</Chip>
|
|
89
|
+
<Chip variant="outline">Outline Chip</Chip>{' '}
|
|
83
90
|
<Chip variant="outline" active>
|
|
84
91
|
Active Outline Chip
|
|
92
|
+
</Chip>{' '}
|
|
93
|
+
<Chip variant="outline" disabled>
|
|
94
|
+
Disabled Outline Chip
|
|
95
|
+
</Chip>
|
|
96
|
+
<Br />
|
|
97
|
+
<Chip variant="outline" onClose={onChipClosed}>
|
|
98
|
+
Outline with Close
|
|
99
|
+
</Chip>{' '}
|
|
100
|
+
<Chip variant="outline" dropdownIcon>
|
|
101
|
+
Outline with Dropdown
|
|
102
|
+
</Chip>{' '}
|
|
103
|
+
<Chip variant="outline" icon={<Label />}>
|
|
104
|
+
Outline with Icon
|
|
85
105
|
</Chip>
|
|
86
106
|
</>),
|
|
87
107
|
name: 'Outline variant',
|
|
88
108
|
parameters: {
|
|
89
109
|
docs: {
|
|
90
110
|
description: {
|
|
91
|
-
story: 'Use prop variant="outline" to select outline variant',
|
|
111
|
+
story: 'Use prop variant="outline" to select outline variant with border.',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
export const GhostVariant = {
|
|
117
|
+
render: () => (<>
|
|
118
|
+
<Chip variant="ghost">Ghost Chip</Chip>{' '}
|
|
119
|
+
<Chip variant="ghost" active>
|
|
120
|
+
Active Ghost Chip
|
|
121
|
+
</Chip>{' '}
|
|
122
|
+
<Chip variant="ghost" disabled>
|
|
123
|
+
Disabled Ghost Chip
|
|
124
|
+
</Chip>
|
|
125
|
+
<Br />
|
|
126
|
+
<Chip variant="ghost" onClose={onChipClosed}>
|
|
127
|
+
Ghost with Close
|
|
128
|
+
</Chip>{' '}
|
|
129
|
+
<Chip variant="ghost" dropdownIcon>
|
|
130
|
+
Ghost with Dropdown
|
|
131
|
+
</Chip>{' '}
|
|
132
|
+
<Chip variant="ghost" icon={<Label />}>
|
|
133
|
+
Ghost with Icon
|
|
134
|
+
</Chip>
|
|
135
|
+
</>),
|
|
136
|
+
name: 'Ghost variant',
|
|
137
|
+
parameters: {
|
|
138
|
+
docs: {
|
|
139
|
+
description: {
|
|
140
|
+
story: 'Use prop variant="ghost" to select ghost variant. Ghost chips have white background by default, light background on hover, and gray background when active.',
|
|
92
141
|
},
|
|
93
142
|
},
|
|
94
143
|
},
|
|
@@ -125,7 +174,6 @@ export const WithLeftIcon = {
|
|
|
125
174
|
},
|
|
126
175
|
},
|
|
127
176
|
};
|
|
128
|
-
const Br = () => <p style={{ display: 'block', content: ' ', height: '10px' }}/>;
|
|
129
177
|
export const WithDropdownIcon = {
|
|
130
178
|
render: () => (<div>
|
|
131
179
|
<Chip dropdownIcon>Default Chip</Chip>
|
|
@@ -196,47 +244,56 @@ export const WithMinWidth = {
|
|
|
196
244
|
};
|
|
197
245
|
export const WithSize = {
|
|
198
246
|
render: () => (<>
|
|
199
|
-
<p>Size sm with height=24px</p>
|
|
247
|
+
<p>Size sm with height=24px, icon 16px, gap 2px</p>
|
|
200
248
|
<Chip size="sm">Size sm</Chip>
|
|
201
249
|
<Chip size="sm" active>
|
|
202
|
-
|
|
250
|
+
Active
|
|
251
|
+
</Chip>
|
|
252
|
+
<Chip size="sm" icon={<Label />}>
|
|
253
|
+
With Icon
|
|
203
254
|
</Chip>
|
|
204
|
-
<Chip size="sm"
|
|
205
|
-
|
|
255
|
+
<Chip size="sm" onClose={onChipClosed}>
|
|
256
|
+
With Close
|
|
206
257
|
</Chip>
|
|
207
|
-
<Chip size="sm"
|
|
208
|
-
|
|
258
|
+
<Chip size="sm" dropdownIcon>
|
|
259
|
+
With Dropdown
|
|
209
260
|
</Chip>
|
|
210
261
|
<Br />
|
|
211
|
-
<p>Size lg with height=32px</p>
|
|
262
|
+
<p>Size lg with height=32px, icon 20px, gap 4px (default)</p>
|
|
212
263
|
<Chip size="lg">Size lg</Chip>
|
|
213
264
|
<Chip size="lg" active>
|
|
214
|
-
|
|
265
|
+
Active
|
|
215
266
|
</Chip>
|
|
216
|
-
<Chip size="lg"
|
|
217
|
-
|
|
267
|
+
<Chip size="lg" icon={<Label />}>
|
|
268
|
+
With Icon
|
|
218
269
|
</Chip>
|
|
219
|
-
<Chip size="lg"
|
|
220
|
-
|
|
270
|
+
<Chip size="lg" onClose={onChipClosed}>
|
|
271
|
+
With Close
|
|
272
|
+
</Chip>
|
|
273
|
+
<Chip size="lg" dropdownIcon>
|
|
274
|
+
With Dropdown
|
|
221
275
|
</Chip>
|
|
222
276
|
<Br />
|
|
223
|
-
<p>Size xl with height=40px</p>
|
|
277
|
+
<p>Size xl with height=40px, icon 24px, gap 4px</p>
|
|
224
278
|
<Chip size="xl">Size xl</Chip>
|
|
225
279
|
<Chip size="xl" active>
|
|
226
|
-
|
|
280
|
+
Active
|
|
281
|
+
</Chip>
|
|
282
|
+
<Chip size="xl" icon={<Label />}>
|
|
283
|
+
With Icon
|
|
227
284
|
</Chip>
|
|
228
|
-
<Chip size="xl"
|
|
229
|
-
|
|
285
|
+
<Chip size="xl" onClose={onChipClosed}>
|
|
286
|
+
With Close
|
|
230
287
|
</Chip>
|
|
231
|
-
<Chip size="xl"
|
|
232
|
-
|
|
288
|
+
<Chip size="xl" dropdownIcon>
|
|
289
|
+
With Dropdown
|
|
233
290
|
</Chip>
|
|
234
291
|
</>),
|
|
235
292
|
name: 'With size',
|
|
236
293
|
parameters: {
|
|
237
294
|
docs: {
|
|
238
295
|
description: {
|
|
239
|
-
story: 'Chip with size
|
|
296
|
+
story: 'Chip with different sizes. Each size has different height, icon size, and gap between icon and text. Size sm: 16px icon with 2px gap. Size lg: 20px icon with 4px gap (default). Size xl: 24px icon with 4px gap.',
|
|
240
297
|
},
|
|
241
298
|
},
|
|
242
299
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.styles.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.styles.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,UAAU;UACR,MAAM;cACF,MAAM;;;
|
|
1
|
+
{"version":3,"file":"Chip.styles.d.ts","sourceRoot":"","sources":["../../../components/Chip/Chip.styles.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,UAAU;UACR,MAAM;cACF,MAAM;;;EAuGjB,CAAC;AAEF,QAAA,MAAM,kBAAkB,0CAmCvB,CAAC;AAEF,QAAA,MAAM,eAAe,0CAwBpB,CAAC;AAEF,QAAA,MAAM,WAAW;;EAYhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -10,7 +10,7 @@ const StyledChip = styled.span `
|
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
|
-
gap:
|
|
13
|
+
gap: 4px;
|
|
14
14
|
height: ${({ size }) => sizes[size]};
|
|
15
15
|
width: fit-content;
|
|
16
16
|
border-radius: ${radii.pill};
|
|
@@ -18,22 +18,24 @@ const StyledChip = styled.span `
|
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
min-width: ${({ minWidth }) => minWidth};
|
|
20
20
|
text-align: center;
|
|
21
|
+
vertical-align: middle;
|
|
21
22
|
|
|
22
23
|
&.size-sm {
|
|
23
|
-
height: ${sizes.
|
|
24
|
-
padding: 3px
|
|
25
|
-
|
|
24
|
+
height: ${sizes.md};
|
|
25
|
+
padding: 3px 10px;
|
|
26
|
+
gap: 2px;
|
|
27
|
+
${typo.header.annotation};
|
|
26
28
|
|
|
27
29
|
svg {
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
&.size-lg {
|
|
34
|
-
height:
|
|
35
|
-
padding: ${space.xxs}
|
|
36
|
-
${typo.
|
|
36
|
+
height: 36px;
|
|
37
|
+
padding: ${space.xxs} 14px;
|
|
38
|
+
${typo.header.caption};
|
|
37
39
|
|
|
38
40
|
svg {
|
|
39
41
|
width: 20px;
|
|
@@ -42,13 +44,13 @@ const StyledChip = styled.span `
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
&.size-xl {
|
|
45
|
-
height:
|
|
47
|
+
height: 44px;
|
|
46
48
|
padding: ${space.xs} ${space.md};
|
|
47
|
-
${typo.
|
|
49
|
+
${typo.header.section};
|
|
48
50
|
|
|
49
51
|
svg {
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
52
|
+
width: 24px;
|
|
53
|
+
height: 24px;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -58,11 +60,31 @@ const StyledChip = styled.span `
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
&.variant-outline.active {
|
|
61
|
-
border: ${borderWidths.sm} solid ${colors.
|
|
63
|
+
border: ${borderWidths.sm} solid ${colors.borderBold};
|
|
62
64
|
background-color: ${colors.backgroundSecondary};
|
|
63
65
|
color: ${colors.textPrimary};
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
&.variant-ghost {
|
|
69
|
+
background-color: ${colors.backgroundPrimary};
|
|
70
|
+
color: ${colors.textPrimary};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.variant-ghost:not(.active):hover {
|
|
74
|
+
background-color: ${colors.interactionNeutralLightHover};
|
|
75
|
+
color: ${colors.textPrimary};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.variant-ghost.active {
|
|
79
|
+
background-color: ${colors.backgroundSecondary};
|
|
80
|
+
color: ${colors.textPrimary};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.variant-ghost.active:hover {
|
|
84
|
+
background-color: ${colors.interactionNeutralLightHover};
|
|
85
|
+
color: ${colors.textPrimary};
|
|
86
|
+
}
|
|
87
|
+
|
|
66
88
|
&:hover {
|
|
67
89
|
background-color: ${colors.interactionNeutralLightHover};
|
|
68
90
|
}
|
|
@@ -106,12 +128,25 @@ const ChipInteractiveCss = css `
|
|
|
106
128
|
background-color: ${colors.interactionNeutralLightHover};
|
|
107
129
|
color: ${colors.textPrimary};
|
|
108
130
|
}
|
|
131
|
+
|
|
132
|
+
&.variant-ghost:not([href]):hover,
|
|
133
|
+
&.variant-ghost:hover {
|
|
134
|
+
background-color: ${colors.interactionNeutralLightHover};
|
|
135
|
+
color: ${colors.textPrimary};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.variant-ghost.active:not([href]):hover,
|
|
139
|
+
&.variant-ghost.active:hover {
|
|
140
|
+
background-color: ${colors.interactionNeutralLightHover};
|
|
141
|
+
color: ${colors.textPrimary};
|
|
142
|
+
}
|
|
109
143
|
`;
|
|
110
144
|
const DisabledChipCss = css `
|
|
111
145
|
/* stylelint-disable declaration-no-important */
|
|
112
146
|
color: ${colors.textDisabled} !important;
|
|
113
147
|
user-select: none;
|
|
114
148
|
cursor: not-allowed;
|
|
149
|
+
|
|
115
150
|
&.variant-normal,
|
|
116
151
|
&.variant-normal:hover,
|
|
117
152
|
&.variant-outline,
|
|
@@ -122,55 +157,26 @@ const DisabledChipCss = css `
|
|
|
122
157
|
&.variant-outline {
|
|
123
158
|
border: 1px solid ${colors.borderThin};
|
|
124
159
|
}
|
|
160
|
+
|
|
161
|
+
&.variant-ghost,
|
|
162
|
+
&.variant-ghost:hover,
|
|
163
|
+
&.variant-ghost.active,
|
|
164
|
+
&.variant-ghost.active:hover {
|
|
165
|
+
background-color: ${colors.backgroundPrimary} !important;
|
|
166
|
+
color: ${colors.textDisabled} !important;
|
|
167
|
+
}
|
|
125
168
|
`;
|
|
126
169
|
const CloseButton = styled.button `
|
|
127
170
|
background: transparent;
|
|
171
|
+
border: none;
|
|
128
172
|
display: flex;
|
|
129
173
|
justify-content: center;
|
|
130
174
|
align-items: center;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
padding:
|
|
134
|
-
margin:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
svg {
|
|
138
|
-
background-color: ${colors.iconTertiary};
|
|
139
|
-
border-radius: ${radii.circle};
|
|
140
|
-
color: ${colors.buttonBlank};
|
|
141
|
-
}
|
|
142
|
-
&:hover {
|
|
143
|
-
svg {
|
|
144
|
-
background-color: ${colors.gray300};
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
&:active {
|
|
148
|
-
svg {
|
|
149
|
-
background-color: ${colors.gray500};
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
&:focus {
|
|
153
|
-
outline: none;
|
|
154
|
-
}
|
|
155
|
-
&.size-sm {
|
|
156
|
-
svg {
|
|
157
|
-
width: 12px;
|
|
158
|
-
height: 12px;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&.size-lg {
|
|
163
|
-
svg {
|
|
164
|
-
width: 14px;
|
|
165
|
-
height: 14px;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&.size-xl {
|
|
170
|
-
svg {
|
|
171
|
-
width: 16px;
|
|
172
|
-
height: 16px;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
+
width: 24px;
|
|
176
|
+
height: 24px;
|
|
177
|
+
padding: 0;
|
|
178
|
+
margin: 0;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
color: inherit;
|
|
175
181
|
`;
|
|
176
182
|
export { CloseButton, StyledChip, ChipInteractiveCss, DisabledChipCss };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.styles.d.ts","sourceRoot":"","sources":["../../../components/Input/Input.styles.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"Input.styles.d.ts","sourceRoot":"","sources":["../../../components/Input/Input.styles.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,0CAiEjB,CAAC;AAEF,eAAe,YAAY,CAAC;AAE5B,QAAA,MAAM,iBAAiB,0CAMtB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,SAAS;oBACG,MAAM;;;EAOvB,CAAC;AAEF,QAAA,MAAM,SAAS;;EAQd,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,YAAY;mBACD,MAAM;;;EA2GtB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,cAAc;;EA2DnB,CAAC;AAEF,QAAA,MAAM,cAAc;;EAInB,CAAC;AAEF,QAAA,MAAM,QAAQ;;EAOb,CAAC;AAEF,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,SAAS,EACT,cAAc,EACd,cAAc,EACd,QAAQ,GACT,CAAC"}
|