chiplet 0.3.0-dev.3 → 0.3.0
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/LICENSE +1 -1
- package/README.md +46 -13
- package/dist/article.css +143 -0
- package/dist/component/button/Button.js.map +1 -1
- package/dist/component/button/Interactive.js +1 -0
- package/dist/component/button/Interactive.js.map +1 -1
- package/dist/component/button/style/index.css.vanilla.js +5 -5
- package/dist/component/button/style/index.css.vanilla.js.map +1 -1
- package/dist/component/checkbox/Checkbox.js +1 -1
- package/dist/component/checkbox/Checkbox.js.map +1 -1
- package/dist/component/checkbox/CheckboxGroup.js +1 -0
- package/dist/component/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/component/checkbox/Radio.js +1 -0
- package/dist/component/checkbox/Radio.js.map +1 -1
- package/dist/component/checkbox/RadioGroup.js +1 -0
- package/dist/component/checkbox/RadioGroup.js.map +1 -1
- package/dist/component/checkbox/icon/CheckboxChecked.svg.js.map +1 -1
- package/dist/component/checkbox/icon/CheckboxIndeterminate.svg.js.map +1 -1
- package/dist/component/checkbox/icon/CheckboxUnchecked.svg.js.map +1 -1
- package/dist/component/checkbox/icon/RadioChecked.svg.js.map +1 -1
- package/dist/component/checkbox/icon/RadioUnchecked.svg.js.map +1 -1
- package/dist/component/checkbox/icon/index.js +7 -5
- package/dist/component/checkbox/icon/index.js.map +1 -1
- package/dist/component/checkbox/style/index.css.vanilla.js +14 -14
- package/dist/component/checkbox/style/index.css.vanilla.js.map +1 -1
- package/dist/component/header/style/index.css.vanilla.js +1 -1
- package/dist/component/header/style/index.css.vanilla.js.map +1 -1
- package/dist/component/icon/set/Checkmark24Filled.svg.js.map +1 -1
- package/dist/component/icon/set/Checkmark24Regular.svg.js.map +1 -1
- package/dist/component/icon/set/ChevronDown24Filled.svg.js.map +1 -1
- package/dist/component/icon/set/ChevronDown24Regular.svg.js.map +1 -1
- package/dist/component/icon/set/Dismiss24Filled.svg.js.map +1 -1
- package/dist/component/icon/set/Dismiss24Regular.svg.js.map +1 -1
- package/dist/component/icon/set/Search24Filled.svg.js.map +1 -1
- package/dist/component/icon/set/Search24Regular.svg.js.map +1 -1
- package/dist/component/index.js +1 -0
- package/dist/component/index.js.map +1 -1
- package/dist/component/input/Input.js +1 -0
- package/dist/component/input/Input.js.map +1 -1
- package/dist/component/input/SearchInput.js +4 -1
- package/dist/component/input/SearchInput.js.map +1 -1
- package/dist/component/input/style/index.css.vanilla.js +8 -8
- package/dist/component/input/style/index.css.vanilla.js.map +1 -1
- package/dist/component/menu/Menu.js +7 -5
- package/dist/component/menu/Menu.js.map +1 -1
- package/dist/component/menu/MenuItem.js +1 -0
- package/dist/component/menu/MenuItem.js.map +1 -1
- package/dist/component/menu/MenuItemCheckbox.js +7 -5
- package/dist/component/menu/MenuItemCheckbox.js.map +1 -1
- package/dist/component/menu/MenuItemRadio.js +7 -5
- package/dist/component/menu/MenuItemRadio.js.map +1 -1
- package/dist/component/popover/Dialog.js +1 -0
- package/dist/component/popover/Dialog.js.map +1 -1
- package/dist/component/popover/DismissButton.js +1 -0
- package/dist/component/popover/DismissButton.js.map +1 -1
- package/dist/component/popover/Popover.js +1 -0
- package/dist/component/popover/Popover.js.map +1 -1
- package/dist/component/popover/Tooltip.js +1 -0
- package/dist/component/popover/Tooltip.js.map +1 -1
- package/dist/component/popover/style/index.css.vanilla.js +8 -8
- package/dist/component/popover/style/index.css.vanilla.js.map +1 -1
- package/dist/component/progress/style/index.css.vanilla.js +4 -4
- package/dist/component/progress/style/index.css.vanilla.js.map +1 -1
- package/dist/component/select/AutoComplete.js +7 -5
- package/dist/component/select/AutoComplete.js.map +1 -1
- package/dist/component/select/Group.js +13 -4
- package/dist/component/select/Group.js.map +1 -1
- package/dist/component/select/Option.js +1 -0
- package/dist/component/select/Option.js.map +1 -1
- package/dist/component/select/Select.js +7 -5
- package/dist/component/select/Select.js.map +1 -1
- package/dist/component/select/style/index.css.vanilla.js +16 -15
- package/dist/component/select/style/index.css.vanilla.js.map +1 -1
- package/dist/component/style/article.css.vanilla.js +6 -0
- package/dist/component/style/article.css.vanilla.js.map +1 -0
- package/dist/component/style/index.js +3 -0
- package/dist/component/style/index.js.map +1 -0
- package/dist/component/typography/style/index.css.vanilla.js +4 -4
- package/dist/component/typography/style/index.css.vanilla.js.map +1 -1
- package/dist/{theme/global.css → global.css} +7 -7
- package/dist/hook/accessibility/keyboard/Keyboard.js +7 -2
- package/dist/hook/accessibility/keyboard/Keyboard.js.map +1 -1
- package/dist/hook/accessibility/keyboard/Roving.js +1 -0
- package/dist/hook/accessibility/keyboard/Roving.js.map +1 -1
- package/dist/hook/accessibility/keyboard/hook/useLastFocused.js +1 -0
- package/dist/hook/accessibility/keyboard/hook/useLastFocused.js.map +1 -1
- package/dist/hook/accessibility/keyboard/hook/useMoveFocus.js.map +1 -1
- package/dist/hook/accessibility/keyboard/hook/useNavigate.js +2 -4
- package/dist/hook/accessibility/keyboard/hook/useNavigate.js.map +1 -1
- package/dist/hook/accessibility/keyboard/resolve.js +1 -0
- package/dist/hook/accessibility/keyboard/resolve.js.map +1 -1
- package/dist/hook/accessibility/keyboard/sort.js +1 -1
- package/dist/hook/accessibility/keyboard/sort.js.map +1 -1
- package/dist/hook/accessibility/keyboard/tree.js +1 -0
- package/dist/hook/accessibility/keyboard/tree.js.map +1 -1
- package/dist/hook/accessibility/keyboard/useController.js +1 -0
- package/dist/hook/accessibility/keyboard/useController.js.map +1 -1
- package/dist/hook/accessibility/keyboard/useKeyboard.js +1 -0
- package/dist/hook/accessibility/keyboard/useKeyboard.js.map +1 -1
- package/dist/hook/document/useHighlight.js +1 -1
- package/dist/hook/document/useHighlight.js.map +1 -1
- package/dist/hook/form/useAutoComplete.js +1 -3
- package/dist/hook/form/useAutoComplete.js.map +1 -1
- package/dist/hook/form/useCheckbox.js +1 -0
- package/dist/hook/form/useCheckbox.js.map +1 -1
- package/dist/hook/form/useChecked.js +1 -0
- package/dist/hook/form/useChecked.js.map +1 -1
- package/dist/hook/form/useDefault.js +2 -0
- package/dist/hook/form/useDefault.js.map +1 -1
- package/dist/hook/form/useForm.js +2 -1
- package/dist/hook/form/useForm.js.map +1 -1
- package/dist/hook/form/useGroup.js +2 -0
- package/dist/hook/form/useGroup.js.map +1 -1
- package/dist/hook/form/useOption.js +1 -0
- package/dist/hook/form/useOption.js.map +1 -1
- package/dist/hook/form/useRadio.js +1 -0
- package/dist/hook/form/useRadio.js.map +1 -1
- package/dist/hook/form/useSelect.js +1 -0
- package/dist/hook/form/useSelect.js.map +1 -1
- package/dist/hook/form/useValue.js +1 -0
- package/dist/hook/form/useValue.js.map +1 -1
- package/dist/hook/popover/useAnchorPositioning.js +1 -0
- package/dist/hook/popover/useAnchorPositioning.js.map +1 -1
- package/dist/hook/popover/useDialog.js +1 -0
- package/dist/hook/popover/useDialog.js.map +1 -1
- package/dist/hook/popover/useLightDismiss.js +1 -1
- package/dist/hook/popover/useLightDismiss.js.map +1 -1
- package/dist/hook/popover/useOverlay.js +1 -0
- package/dist/hook/popover/useOverlay.js.map +1 -1
- package/dist/hook/popover/usePopover.js +6 -2
- package/dist/hook/popover/usePopover.js.map +1 -1
- package/dist/hook/popover/usePositioning.js +1 -0
- package/dist/hook/popover/usePositioning.js.map +1 -1
- package/dist/hook/popover/useTooltip.js +3 -1
- package/dist/hook/popover/useTooltip.js.map +1 -1
- package/dist/hook/react/refValue.js +1 -0
- package/dist/hook/react/refValue.js.map +1 -1
- package/dist/hook/react/useActivate.js +1 -1
- package/dist/hook/react/useActivate.js.map +1 -1
- package/dist/hook/react/useConst.js.map +1 -1
- package/dist/hook/react/useInteractive.js +1 -0
- package/dist/hook/react/useInteractive.js.map +1 -1
- package/dist/hook/react/useUniqueId.js +3 -2
- package/dist/hook/react/useUniqueId.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index3.css +138 -0
- package/dist/index5.css +167 -0
- package/dist/{component/checkbox/style/index.css → index6.css} +79 -71
- package/dist/{component/input/style/index.css → index7.css} +29 -30
- package/dist/{component/button/style/index.css → index8.css} +37 -37
- package/dist/infra/logging/logger.js +10 -12
- package/dist/infra/logging/logger.js.map +1 -1
- package/dist/theme/ColorScheme.js.map +1 -1
- package/dist/theme/defineTheme.js +1 -0
- package/dist/theme/defineTheme.js.map +1 -1
- package/dist/theme/global.css.vanilla.js +11 -11
- package/dist/theme/global.css.vanilla.js.map +1 -1
- package/dist/theme/theme.css.vanilla.js +3 -3
- package/dist/theme/theme.css.vanilla.js.map +1 -1
- package/dist/theme/token.css.vanilla.js +1 -1
- package/dist/theme/token.css.vanilla.js.map +1 -1
- package/dist/{theme/theme.css → theme.css} +23 -27
- package/dist/util/document/accessibility.css.vanilla.js +4 -4
- package/dist/util/document/accessibility.css.vanilla.js.map +1 -1
- package/dist/util/index.js +4 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/random/generateDeterministicId.js +12 -0
- package/dist/util/random/generateDeterministicId.js.map +1 -0
- package/dist/util/random/generateDigest.js +12 -0
- package/dist/util/random/generateDigest.js.map +1 -0
- package/dist/util/random/generateUniqueId.js +9 -0
- package/dist/util/random/generateUniqueId.js.map +1 -0
- package/dist/util/random/index.js +4 -1
- package/dist/util/random/index.js.map +1 -1
- package/dist/util/random/toHex.js +10 -0
- package/dist/util/random/toHex.js.map +1 -0
- package/package.json +102 -105
- package/src/component/button/Button.tsx +1 -5
- package/src/component/button/style/index.css.ts +1 -1
- package/src/component/checkbox/Checkbox.tsx +2 -3
- package/src/component/checkbox/Radio.tsx +1 -2
- package/src/component/checkbox/RadioGroup.tsx +1 -2
- package/src/component/checkbox/style/index.css.ts +34 -25
- package/src/component/icon/README.md +17 -3
- package/src/component/index.ts +1 -0
- package/src/component/input/Input.tsx +1 -2
- package/src/component/input/SearchInput.tsx +4 -3
- package/src/component/input/style/index.css.ts +42 -41
- package/src/component/popover/Tooltip.tsx +1 -3
- package/src/component/popover/style/index.css.ts +100 -103
- package/src/component/select/Group.tsx +11 -3
- package/src/component/select/Option.tsx +1 -2
- package/src/component/select/style/index.css.ts +59 -53
- package/src/component/style/article.css.ts +189 -0
- package/src/component/style/index.ts +1 -0
- package/src/hook/accessibility/keyboard/Keyboard.tsx +6 -1
- package/src/hook/accessibility/keyboard/hook/useLastFocused.ts +1 -0
- package/src/hook/accessibility/keyboard/hook/useMoveFocus.ts +2 -0
- package/src/hook/accessibility/keyboard/hook/useNavigate.ts +5 -5
- package/src/hook/accessibility/keyboard/sort.ts +1 -1
- package/src/hook/document/useHighlight.ts +1 -27
- package/src/hook/form/useAutoComplete.ts +3 -3
- package/src/hook/form/useDefault.ts +2 -0
- package/src/hook/form/useForm.ts +2 -2
- package/src/hook/form/useGroup.ts +2 -1
- package/src/hook/popover/useLightDismiss.ts +1 -1
- package/src/hook/popover/usePopover.ts +7 -12
- package/src/hook/popover/usePositioning.ts +2 -1
- package/src/hook/popover/useTooltip.ts +3 -1
- package/src/hook/react/useActivate.ts +1 -1
- package/src/hook/react/useConst.ts +1 -1
- package/src/hook/react/useUniqueId.ts +2 -2
- package/src/infra/logging/logger.ts +26 -13
- package/src/theme/ColorScheme.tsx +1 -5
- package/src/theme/global.css.ts +2 -2
- package/src/theme/theme.css.ts +1 -5
- package/src/util/document/accessibility.css.ts +3 -3
- package/src/util/random/generateDeterministicId.ts +10 -0
- package/src/util/random/generateDigest.ts +11 -0
- package/src/util/random/{createUniqueId.ts → generateUniqueId.ts} +4 -6
- package/src/util/random/index.ts +4 -1
- package/src/util/random/toHex.ts +6 -0
- package/dist/component/popover/style/index.css +0 -175
- package/dist/component/select/style/index.css +0 -135
- package/dist/util/random/createUniqueId.js +0 -8
- package/dist/util/random/createUniqueId.js.map +0 -1
- package/src/component/style/font/font.css +0 -23
- package/src/component/style/font/proxima-nova-bold.woff +0 -0
- package/src/component/style/font/proxima-nova-light.woff +0 -0
- package/src/component/style/font/proxima-nova-regular.woff +0 -0
- package/src/component/style/font/proxima-nova-semibold.woff +0 -0
- package/src/component/style/press.module.css +0 -204
- /package/dist/{component/select/index.css → index.css} +0 -0
- /package/dist/{component/select/index2.css → index2.css} +0 -0
- /package/dist/{component/progress/style/index.css → index4.css} +0 -0
- /package/dist/{theme/token.css → token.css} +0 -0
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from '@vanilla-extract/css'
|
|
8
8
|
import { recipe } from '@vanilla-extract/recipes'
|
|
9
9
|
|
|
10
|
+
const outset = createVar()
|
|
10
11
|
const gap = createVar()
|
|
11
12
|
const width = createVar()
|
|
12
13
|
const height = createVar()
|
|
13
|
-
const margin = createVar()
|
|
14
|
-
const padding = createVar()
|
|
15
14
|
const size = createVar()
|
|
15
|
+
const padding = createVar()
|
|
16
16
|
const color = createVar()
|
|
17
17
|
const colorHover = createVar()
|
|
18
18
|
const colorActive = createVar()
|
|
@@ -27,9 +27,10 @@ const backgroundChecked = createVar()
|
|
|
27
27
|
const backgroundDisabled = createVar()
|
|
28
28
|
const scale = createVar()
|
|
29
29
|
const scaleActive = createVar()
|
|
30
|
+
const scaleDisabled = createVar()
|
|
31
|
+
const translate = createVar()
|
|
32
|
+
const translateChecked = createVar()
|
|
30
33
|
const transition = createVar()
|
|
31
|
-
const offset = createVar()
|
|
32
|
-
const offsetChecked = createVar()
|
|
33
34
|
|
|
34
35
|
export const CheckboxGroupStyle = style({
|
|
35
36
|
vars: {
|
|
@@ -83,16 +84,16 @@ export const CheckboxStyle = recipe({
|
|
|
83
84
|
outlineOffset: theme.checkbox.outline,
|
|
84
85
|
transition,
|
|
85
86
|
selectors: {
|
|
86
|
-
// https://larsmagnus.co/blog/focus-visible-within-the-missing-pseudo-class#using-has-to-emulate-focus-visible-within
|
|
87
|
-
'&:has(:focus-visible)': {
|
|
88
|
-
outline: theme.outline,
|
|
89
|
-
},
|
|
90
87
|
// https://kizu.dev/label-to-input/
|
|
91
|
-
'&:has(:focus-visible
|
|
88
|
+
'&:has(:hover, :focus-visible)': {
|
|
92
89
|
vars: {
|
|
93
90
|
[color]: colorHover,
|
|
94
91
|
},
|
|
95
92
|
},
|
|
93
|
+
// https://larsmagnus.co/blog/focus-visible-within-the-missing-pseudo-class#using-has-to-emulate-focus-visible-within
|
|
94
|
+
'&:has(:focus-visible)': {
|
|
95
|
+
outline: theme.outline,
|
|
96
|
+
},
|
|
96
97
|
'&:has(:active)': {
|
|
97
98
|
vars: {
|
|
98
99
|
[color]: colorActive,
|
|
@@ -103,7 +104,7 @@ export const CheckboxStyle = recipe({
|
|
|
103
104
|
[color]: colorChecked,
|
|
104
105
|
},
|
|
105
106
|
},
|
|
106
|
-
'&:has(:indeterminate, :checked):where(:has(:focus-visible
|
|
107
|
+
'&:has(:indeterminate, :checked):where(:has(:hover, :focus-visible))': {
|
|
107
108
|
vars: {
|
|
108
109
|
[color]: colorCheckedHover,
|
|
109
110
|
},
|
|
@@ -125,19 +126,19 @@ export const CheckboxStyle = recipe({
|
|
|
125
126
|
size: {
|
|
126
127
|
small: {
|
|
127
128
|
vars: {
|
|
128
|
-
[
|
|
129
|
+
[outset]: theme.checkbox.outset,
|
|
129
130
|
[size]: theme.checkbox.size.small,
|
|
130
131
|
},
|
|
131
132
|
},
|
|
132
133
|
medium: {
|
|
133
134
|
vars: {
|
|
134
|
-
[
|
|
135
|
+
[outset]: theme.checkbox.outset,
|
|
135
136
|
[size]: theme.checkbox.size.medium,
|
|
136
137
|
},
|
|
137
138
|
},
|
|
138
139
|
large: {
|
|
139
140
|
vars: {
|
|
140
|
-
[
|
|
141
|
+
[outset]: theme.checkbox.outset,
|
|
141
142
|
[size]: theme.checkbox.size.large,
|
|
142
143
|
},
|
|
143
144
|
},
|
|
@@ -147,7 +148,7 @@ export const CheckboxStyle = recipe({
|
|
|
147
148
|
|
|
148
149
|
globalStyle(`${CheckboxStyle.classNames.base} > input`, {
|
|
149
150
|
position: 'absolute',
|
|
150
|
-
inset: `calc(-1 * ${
|
|
151
|
+
inset: `calc(-1 * ${outset})`,
|
|
151
152
|
margin: '0',
|
|
152
153
|
appearance: 'none',
|
|
153
154
|
cursor: 'inherit',
|
|
@@ -227,13 +228,20 @@ export const SwitchStyle = recipe({
|
|
|
227
228
|
[backgroundDisabled]: theme.disabled.background,
|
|
228
229
|
[scale]: '1',
|
|
229
230
|
[scaleActive]: '1.25',
|
|
231
|
+
[scaleDisabled]: '1',
|
|
232
|
+
[translate]: padding,
|
|
233
|
+
[translateChecked]: `calc(${width} - ${size} * ${scale} - ${padding})`,
|
|
230
234
|
[transition]: theme.switch.transition,
|
|
231
|
-
[offset]: padding,
|
|
232
|
-
[offsetChecked]: `calc(100% - ${size} * ${scale} - ${padding})`,
|
|
233
235
|
},
|
|
234
236
|
position: 'relative',
|
|
237
|
+
boxSizing: 'border-box',
|
|
238
|
+
display: 'inline-flex',
|
|
239
|
+
flexShrink: '0',
|
|
240
|
+
placeContent: 'center',
|
|
241
|
+
placeItems: 'center',
|
|
235
242
|
inlineSize: width,
|
|
236
243
|
blockSize: height,
|
|
244
|
+
padding,
|
|
237
245
|
color,
|
|
238
246
|
cursor,
|
|
239
247
|
outlineOffset: theme.switch.outline,
|
|
@@ -242,14 +250,14 @@ export const SwitchStyle = recipe({
|
|
|
242
250
|
transition,
|
|
243
251
|
'::after': {
|
|
244
252
|
position: 'absolute',
|
|
245
|
-
|
|
246
|
-
insetInlineStart: offset,
|
|
253
|
+
insetInlineStart: '0',
|
|
247
254
|
inlineSize: `calc(${size} * ${scale})`,
|
|
248
255
|
blockSize: size,
|
|
249
256
|
pointerEvents: 'none',
|
|
250
257
|
content: '',
|
|
251
258
|
background: 'currentcolor',
|
|
252
|
-
borderRadius:
|
|
259
|
+
borderRadius: 'inherit',
|
|
260
|
+
translate,
|
|
253
261
|
transition: 'inherit',
|
|
254
262
|
},
|
|
255
263
|
selectors: {
|
|
@@ -265,14 +273,15 @@ export const SwitchStyle = recipe({
|
|
|
265
273
|
vars: {
|
|
266
274
|
[color]: colorChecked,
|
|
267
275
|
[background]: backgroundChecked,
|
|
268
|
-
[
|
|
276
|
+
[translate]: translateChecked,
|
|
269
277
|
},
|
|
270
278
|
},
|
|
271
279
|
'&:has(:disabled)': {
|
|
272
280
|
vars: {
|
|
273
281
|
[color]: colorDisabled,
|
|
274
|
-
[background]: backgroundDisabled,
|
|
275
282
|
[cursor]: cursorDisabled,
|
|
283
|
+
[background]: backgroundDisabled,
|
|
284
|
+
[scale]: scaleDisabled,
|
|
276
285
|
},
|
|
277
286
|
},
|
|
278
287
|
},
|
|
@@ -281,26 +290,26 @@ export const SwitchStyle = recipe({
|
|
|
281
290
|
size: {
|
|
282
291
|
small: {
|
|
283
292
|
vars: {
|
|
293
|
+
[outset]: theme.switch.outset,
|
|
284
294
|
[width]: theme.switch.width.small,
|
|
285
295
|
[height]: theme.switch.height.small,
|
|
286
296
|
[padding]: theme.switch.padding.small,
|
|
287
|
-
[margin]: theme.switch.outset,
|
|
288
297
|
},
|
|
289
298
|
},
|
|
290
299
|
medium: {
|
|
291
300
|
vars: {
|
|
301
|
+
[outset]: theme.switch.outset,
|
|
292
302
|
[width]: theme.switch.width.medium,
|
|
293
303
|
[height]: theme.switch.height.medium,
|
|
294
304
|
[padding]: theme.switch.padding.medium,
|
|
295
|
-
[margin]: theme.switch.outset,
|
|
296
305
|
},
|
|
297
306
|
},
|
|
298
307
|
large: {
|
|
299
308
|
vars: {
|
|
309
|
+
[outset]: theme.switch.outset,
|
|
300
310
|
[width]: theme.switch.width.large,
|
|
301
311
|
[height]: theme.switch.height.large,
|
|
302
312
|
[padding]: theme.switch.padding.large,
|
|
303
|
-
[margin]: theme.switch.outset,
|
|
304
313
|
},
|
|
305
314
|
},
|
|
306
315
|
},
|
|
@@ -309,7 +318,7 @@ export const SwitchStyle = recipe({
|
|
|
309
318
|
|
|
310
319
|
export const SwitchInputStyle = style({
|
|
311
320
|
position: 'absolute',
|
|
312
|
-
inset: `calc(-1 * ${
|
|
321
|
+
inset: `calc(-1 * ${outset})`,
|
|
313
322
|
margin: '0',
|
|
314
323
|
appearance: 'none',
|
|
315
324
|
cursor: 'inherit',
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Simplify SVG files
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Install picosvg:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
python3 -m pip install picosvg
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
From the repository root, write simplified copies to a separate directory so the originals remain unchanged:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
mkdir -p "$TMPDIR/chiplet-icons"
|
|
13
|
+
for svg in src/component/icon/set/*.svg; do
|
|
14
|
+
python3 -m picosvg.picosvg "$svg" --output_file "$TMPDIR/chiplet-icons/$(basename "$svg")" || exit 1
|
|
15
|
+
done
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Review the generated files before replacing any source icons.
|
package/src/component/index.ts
CHANGED
|
@@ -16,8 +16,7 @@ export interface InputProps extends Omit<
|
|
|
16
16
|
defaultValue?: string | undefined
|
|
17
17
|
value?: string | undefined
|
|
18
18
|
onChange?:
|
|
19
|
-
|
|
20
|
-
| undefined
|
|
19
|
+
ChangeCallback<React.ChangeEvent<HTMLInputElement>, string> | undefined
|
|
21
20
|
before?: JSX.Element | null | undefined
|
|
22
21
|
after?: JSX.Element | null | undefined
|
|
23
22
|
slot?: {
|
|
@@ -2,14 +2,13 @@ import type { ChangeCallback } from '#hook'
|
|
|
2
2
|
import { isEnterKey } from '#util'
|
|
3
3
|
import clsx from 'clsx'
|
|
4
4
|
import { useCallback } from 'react'
|
|
5
|
+
import { Input, type InputProps } from '.'
|
|
5
6
|
import { Search24Regular } from '../icon'
|
|
6
7
|
import { InputBeforeStyle, SearchInputBeforeStyle } from './style/index.css'
|
|
7
|
-
import { Input, type InputProps } from '.'
|
|
8
8
|
|
|
9
9
|
export interface SearchInputProps extends InputProps {
|
|
10
10
|
onSearch?:
|
|
11
|
-
|
|
12
|
-
| undefined
|
|
11
|
+
ChangeCallback<React.KeyboardEvent<HTMLInputElement>, string> | undefined
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export function SearchInput(props: SearchInputProps) {
|
|
@@ -28,6 +27,7 @@ export function SearchInput(props: SearchInputProps) {
|
|
|
28
27
|
const { onKeyDown } = attrs
|
|
29
28
|
|
|
30
29
|
attrs.onKeyDown = useCallback<NonNullable<typeof onKeyDown>>(
|
|
30
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
31
31
|
(ev) => {
|
|
32
32
|
onKeyDown?.(ev)
|
|
33
33
|
|
|
@@ -35,6 +35,7 @@ export function SearchInput(props: SearchInputProps) {
|
|
|
35
35
|
onSearch?.(ev, ev.currentTarget.value)
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
38
39
|
[onKeyDown, onSearch]
|
|
39
40
|
)
|
|
40
41
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stretch, theme } from '#theme'
|
|
1
|
+
import { radiusVar, SquircleStyle, stretch, theme } from '#theme'
|
|
2
2
|
import { createVar, globalStyle, style } from '@vanilla-extract/css'
|
|
3
3
|
import { recipe } from '@vanilla-extract/recipes'
|
|
4
4
|
|
|
@@ -19,52 +19,53 @@ const borderColorHover = createVar()
|
|
|
19
19
|
const borderColorFocus = createVar()
|
|
20
20
|
const borderColorDisabled = createVar()
|
|
21
21
|
const borderSize = createVar()
|
|
22
|
-
const radius = createVar()
|
|
23
22
|
const placeholder = createVar()
|
|
24
23
|
const before = createVar()
|
|
25
24
|
const after = createVar()
|
|
26
25
|
|
|
27
26
|
export const InputStyle = recipe({
|
|
28
|
-
base:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[placeholder]: theme.input.placeholder,
|
|
32
|
-
[before]: theme.input.before,
|
|
33
|
-
[after]: theme.input.after,
|
|
34
|
-
},
|
|
35
|
-
boxSizing: 'border-box',
|
|
36
|
-
display: 'flex',
|
|
37
|
-
placeItems: 'center',
|
|
38
|
-
blockSize: height,
|
|
39
|
-
font,
|
|
40
|
-
color,
|
|
41
|
-
background,
|
|
42
|
-
border,
|
|
43
|
-
borderColor,
|
|
44
|
-
borderRadius: radius,
|
|
45
|
-
':hover': {
|
|
27
|
+
base: [
|
|
28
|
+
SquircleStyle,
|
|
29
|
+
{
|
|
46
30
|
vars: {
|
|
47
|
-
[
|
|
48
|
-
[
|
|
31
|
+
[border]: `${borderSize} solid`,
|
|
32
|
+
[placeholder]: theme.input.placeholder,
|
|
33
|
+
[before]: theme.input.before,
|
|
34
|
+
[after]: theme.input.after,
|
|
49
35
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
boxSizing: 'border-box',
|
|
37
|
+
display: 'flex',
|
|
38
|
+
placeItems: 'center',
|
|
39
|
+
blockSize: height,
|
|
40
|
+
font,
|
|
41
|
+
color,
|
|
42
|
+
background,
|
|
43
|
+
border,
|
|
44
|
+
borderColor,
|
|
45
|
+
':hover': {
|
|
46
|
+
vars: {
|
|
47
|
+
[background]: backgroundHover,
|
|
48
|
+
[borderColor]: borderColorHover,
|
|
49
|
+
},
|
|
55
50
|
},
|
|
56
|
-
|
|
57
|
-
selectors: {
|
|
58
|
-
'&:has(> input:disabled)': {
|
|
51
|
+
':focus-within': {
|
|
59
52
|
vars: {
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
[background]: backgroundFocus,
|
|
54
|
+
[borderColor]: borderColorFocus,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
selectors: {
|
|
58
|
+
'&:has(> input:disabled)': {
|
|
59
|
+
vars: {
|
|
60
|
+
[color]: colorDisabled,
|
|
61
|
+
[background]: backgroundDisabled,
|
|
62
|
+
[borderColor]: borderColorDisabled,
|
|
63
|
+
[placeholder]: color,
|
|
64
|
+
},
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
67
|
},
|
|
67
|
-
|
|
68
|
+
],
|
|
68
69
|
variants: {
|
|
69
70
|
variant: {
|
|
70
71
|
primary: {
|
|
@@ -103,9 +104,9 @@ export const InputStyle = recipe({
|
|
|
103
104
|
[height]: theme.input.height.small,
|
|
104
105
|
[padding]: theme.input.padding.small,
|
|
105
106
|
[font]: theme.input.font.small,
|
|
106
|
-
[borderSize]: theme.input.border.small,
|
|
107
|
-
[radius]: theme.input.radius.small,
|
|
108
107
|
[icon]: theme.icon.size.small,
|
|
108
|
+
[borderSize]: theme.input.border.small,
|
|
109
|
+
[radiusVar]: theme.input.radius.small,
|
|
109
110
|
},
|
|
110
111
|
},
|
|
111
112
|
medium: {
|
|
@@ -114,9 +115,9 @@ export const InputStyle = recipe({
|
|
|
114
115
|
[height]: theme.input.height.medium,
|
|
115
116
|
[padding]: theme.input.padding.medium,
|
|
116
117
|
[font]: theme.input.font.medium,
|
|
117
|
-
[borderSize]: theme.input.border.medium,
|
|
118
|
-
[radius]: theme.input.radius.medium,
|
|
119
118
|
[icon]: theme.icon.size.medium,
|
|
119
|
+
[borderSize]: theme.input.border.medium,
|
|
120
|
+
[radiusVar]: theme.input.radius.medium,
|
|
120
121
|
},
|
|
121
122
|
},
|
|
122
123
|
large: {
|
|
@@ -125,9 +126,9 @@ export const InputStyle = recipe({
|
|
|
125
126
|
[height]: theme.input.height.large,
|
|
126
127
|
[padding]: theme.input.padding.large,
|
|
127
128
|
[font]: theme.input.font.large,
|
|
128
|
-
[borderSize]: theme.input.border.large,
|
|
129
|
-
[radius]: theme.input.radius.large,
|
|
130
129
|
[icon]: theme.icon.size.large,
|
|
130
|
+
[borderSize]: theme.input.border.large,
|
|
131
|
+
[radiusVar]: theme.input.radius.large,
|
|
131
132
|
},
|
|
132
133
|
},
|
|
133
134
|
},
|
|
@@ -9,9 +9,7 @@ import { Portal } from './Portal'
|
|
|
9
9
|
import { TooltipArrowStyle, TooltipStyle } from './style/index.css'
|
|
10
10
|
|
|
11
11
|
export type TooltipContent =
|
|
12
|
-
|
|
13
|
-
| string
|
|
14
|
-
| React.ReactElement
|
|
12
|
+
((tooltip: Tooltip) => React.ReactNode) | string | React.ReactElement
|
|
15
13
|
|
|
16
14
|
export interface TooltipProps
|
|
17
15
|
extends
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { stretch, theme } from '#theme'
|
|
1
|
+
import { radiusVar, SquircleStyle, stretch, theme } from '#theme'
|
|
2
2
|
import { createVar, style } from '@vanilla-extract/css'
|
|
3
3
|
import { recipe } from '@vanilla-extract/recipes'
|
|
4
4
|
|
|
5
5
|
const width = createVar()
|
|
6
6
|
const maxWidth = createVar()
|
|
7
|
-
const minHeight = createVar()
|
|
8
7
|
const maxHeight = createVar()
|
|
9
8
|
const padding = createVar()
|
|
10
9
|
const paddingBlock = createVar()
|
|
11
10
|
const paddingInline = createVar()
|
|
12
11
|
const margin = createVar()
|
|
13
|
-
const fontSize = createVar()
|
|
14
|
-
const lineHeight = createVar()
|
|
15
12
|
const color = createVar()
|
|
16
13
|
const background = createVar()
|
|
17
14
|
const border = createVar()
|
|
18
|
-
const radius = createVar()
|
|
19
15
|
const shadow = createVar()
|
|
20
16
|
const backdrop = createVar()
|
|
21
17
|
const filter = createVar()
|
|
@@ -27,48 +23,50 @@ const transition = createVar()
|
|
|
27
23
|
const transitionProperty = `background, opacity, transform, display, overlay`
|
|
28
24
|
|
|
29
25
|
export const DialogStyle = recipe({
|
|
30
|
-
base:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
background: backdrop,
|
|
60
|
-
backdropFilter: filter,
|
|
61
|
-
transition: 'inherit',
|
|
62
|
-
},
|
|
63
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@starting-style
|
|
64
|
-
'@starting-style': {
|
|
65
|
-
opacity: 0,
|
|
66
|
-
transform,
|
|
26
|
+
base: [
|
|
27
|
+
SquircleStyle,
|
|
28
|
+
{
|
|
29
|
+
vars: {
|
|
30
|
+
[maxWidth]: `calc(100% - 2 * ${margin})`,
|
|
31
|
+
[maxHeight]: `calc(100% - 2 * ${margin})`,
|
|
32
|
+
[margin]: theme.dialog.margin,
|
|
33
|
+
[color]: theme.dialog.color,
|
|
34
|
+
[background]: theme.dialog.background,
|
|
35
|
+
[backdrop]: theme.dialog.backdrop,
|
|
36
|
+
[radiusVar]: theme.dialog.radius,
|
|
37
|
+
[shadow]: theme.dialog.shadow,
|
|
38
|
+
[filter]: theme.dialog.filter,
|
|
39
|
+
[transform]: 'none',
|
|
40
|
+
[transition]: theme.dialog.transition,
|
|
41
|
+
},
|
|
42
|
+
boxSizing: 'border-box',
|
|
43
|
+
maxInlineSize: maxWidth,
|
|
44
|
+
maxBlockSize: maxHeight,
|
|
45
|
+
padding: '0',
|
|
46
|
+
margin: 'auto',
|
|
47
|
+
overflow: 'clip auto',
|
|
48
|
+
color,
|
|
49
|
+
background,
|
|
50
|
+
border: 'none',
|
|
51
|
+
boxShadow: shadow,
|
|
52
|
+
transform: 'none',
|
|
53
|
+
transition,
|
|
54
|
+
transitionProperty,
|
|
67
55
|
'::backdrop': {
|
|
68
|
-
background:
|
|
56
|
+
background: backdrop,
|
|
57
|
+
backdropFilter: filter,
|
|
58
|
+
transition: 'inherit',
|
|
59
|
+
},
|
|
60
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@starting-style
|
|
61
|
+
'@starting-style': {
|
|
62
|
+
opacity: 0,
|
|
63
|
+
transform,
|
|
64
|
+
'::backdrop': {
|
|
65
|
+
background: 'none',
|
|
66
|
+
},
|
|
69
67
|
},
|
|
70
68
|
},
|
|
71
|
-
|
|
69
|
+
],
|
|
72
70
|
variants: {
|
|
73
71
|
size: {
|
|
74
72
|
auto: {
|
|
@@ -91,37 +89,39 @@ export const DialogStyle = recipe({
|
|
|
91
89
|
})
|
|
92
90
|
|
|
93
91
|
export const PopoverStyle = recipe({
|
|
94
|
-
base:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
92
|
+
base: [
|
|
93
|
+
SquircleStyle,
|
|
94
|
+
{
|
|
95
|
+
vars: {
|
|
96
|
+
[color]: theme.popover.color,
|
|
97
|
+
[background]: theme.popover.background,
|
|
98
|
+
[border]: theme.popover.border,
|
|
99
|
+
[radiusVar]: theme.popover.radius,
|
|
100
|
+
[shadow]: theme.popover.shadow,
|
|
101
|
+
[transform]: `${translate} scale(0.95)`,
|
|
102
|
+
[translateValue]: '0.5rem',
|
|
103
|
+
[transition]: theme.popover.transition,
|
|
104
|
+
},
|
|
105
|
+
boxSizing: 'border-box',
|
|
106
|
+
padding: '0',
|
|
107
|
+
margin: '0',
|
|
108
|
+
overflow: 'clip auto',
|
|
109
|
+
color,
|
|
110
|
+
background,
|
|
111
|
+
border,
|
|
112
|
+
boxShadow: shadow,
|
|
113
|
+
transform: 'none',
|
|
114
|
+
transformOrigin,
|
|
115
|
+
transition,
|
|
116
|
+
transitionProperty,
|
|
117
|
+
'@starting-style': {
|
|
118
|
+
opacity: 0,
|
|
119
|
+
// Do not set the CSS 'translate' property here;
|
|
120
|
+
// it is controlled by the 'usePositioning' hook.
|
|
121
|
+
transform,
|
|
122
|
+
},
|
|
123
123
|
},
|
|
124
|
-
|
|
124
|
+
],
|
|
125
125
|
variants: {
|
|
126
126
|
position: {
|
|
127
127
|
'above': {
|
|
@@ -200,47 +200,44 @@ export const PopoverStyle = recipe({
|
|
|
200
200
|
},
|
|
201
201
|
})
|
|
202
202
|
|
|
203
|
-
export const TooltipStyle = style(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
203
|
+
export const TooltipStyle = style([
|
|
204
|
+
SquircleStyle,
|
|
205
|
+
{
|
|
206
|
+
vars: {
|
|
207
|
+
[padding]: `${paddingBlock} ${paddingInline}`,
|
|
208
|
+
[paddingBlock]: `calc((${theme.tooltip.minHeight} - 1lh) / 2)`,
|
|
209
|
+
[paddingInline]: theme.tooltip.padding,
|
|
210
|
+
[color]: theme.tooltip.color,
|
|
211
|
+
[background]: theme.tooltip.background,
|
|
212
|
+
[border]: theme.tooltip.border,
|
|
213
|
+
[radiusVar]: theme.tooltip.radius,
|
|
214
|
+
[filter]: theme.tooltip.filter,
|
|
215
|
+
},
|
|
216
|
+
boxSizing: 'border-box',
|
|
217
|
+
inlineSize: 'fit-content',
|
|
218
|
+
blockSize: 'fit-content',
|
|
219
|
+
padding,
|
|
220
|
+
margin: '0',
|
|
221
|
+
overflow: 'visible',
|
|
222
|
+
color,
|
|
223
|
+
background,
|
|
224
|
+
border,
|
|
225
|
+
filter,
|
|
216
226
|
},
|
|
217
|
-
|
|
218
|
-
inlineSize: 'fit-content',
|
|
219
|
-
blockSize: 'fit-content',
|
|
220
|
-
padding,
|
|
221
|
-
margin: '0',
|
|
222
|
-
overflow: 'visible',
|
|
223
|
-
fontSize,
|
|
224
|
-
lineHeight,
|
|
225
|
-
color,
|
|
226
|
-
background,
|
|
227
|
-
border,
|
|
228
|
-
borderRadius: radius,
|
|
229
|
-
filter,
|
|
230
|
-
})
|
|
227
|
+
])
|
|
231
228
|
|
|
232
229
|
export const TooltipArrowStyle = recipe({
|
|
233
230
|
base: {
|
|
234
231
|
vars: {
|
|
235
232
|
[width]: theme.tooltip.arrow.size,
|
|
236
|
-
[
|
|
233
|
+
[radiusVar]: theme.tooltip.arrow.radius,
|
|
237
234
|
},
|
|
238
235
|
position: 'absolute',
|
|
239
236
|
zIndex: '-1',
|
|
240
237
|
inlineSize: width,
|
|
241
238
|
aspectRatio: '1 / 1',
|
|
242
239
|
background: 'inherit',
|
|
243
|
-
borderRadius:
|
|
240
|
+
borderRadius: radiusVar,
|
|
244
241
|
transform: 'skew(15deg, 15deg)',
|
|
245
242
|
},
|
|
246
243
|
variants: {
|