chiplet 0.3.0-dev.3 → 0.3.0-dev.4
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 +5 -4
- package/dist/component/button/Interactive.js +1 -0
- package/dist/component/button/Interactive.js.map +1 -1
- package/dist/component/button/style/index.css +37 -37
- package/dist/component/button/style/index.css.vanilla.js +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/index.js +2 -0
- package/dist/component/checkbox/icon/index.js.map +1 -1
- package/dist/component/checkbox/style/index.css +79 -71
- package/dist/component/checkbox/style/index.css.vanilla.js +10 -10
- 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 +1 -0
- package/dist/component/input/SearchInput.js.map +1 -1
- package/dist/component/input/style/index.css +29 -30
- package/dist/component/input/style/index.css.vanilla.js +4 -4
- package/dist/component/menu/Menu.js +2 -0
- 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 +2 -0
- package/dist/component/menu/MenuItemCheckbox.js.map +1 -1
- package/dist/component/menu/MenuItemRadio.js +2 -0
- 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 +96 -104
- package/dist/component/popover/style/index.css.vanilla.js +4 -4
- package/dist/component/select/AutoComplete.js +2 -0
- 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 +2 -0
- package/dist/component/select/Select.js.map +1 -1
- package/dist/component/select/style/index.css +78 -75
- package/dist/component/select/style/index.css.vanilla.js +12 -11
- package/dist/component/select/style/index.css.vanilla.js.map +1 -1
- package/dist/component/style/article.css +143 -0
- 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/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 +1 -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 +2 -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/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/infra/logging/logger.js +10 -12
- package/dist/infra/logging/logger.js.map +1 -1
- package/dist/theme/defineTheme.js +1 -0
- package/dist/theme/defineTheme.js.map +1 -1
- package/dist/theme/global.css +7 -7
- package/dist/theme/global.css.vanilla.js +8 -8
- package/dist/theme/theme.css +23 -27
- package/dist/theme/theme.css.vanilla.js +1 -1
- package/dist/util/document/accessibility.css.vanilla.js +4 -4
- 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 +77 -80
- package/src/component/button/style/index.css.ts +1 -1
- package/src/component/checkbox/Checkbox.tsx +1 -1
- package/src/component/checkbox/style/index.css.ts +34 -25
- package/src/component/index.ts +1 -0
- package/src/component/input/style/index.css.ts +42 -41
- package/src/component/popover/style/index.css.ts +100 -103
- package/src/component/select/Group.tsx +11 -3
- 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/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/popover/useLightDismiss.ts +1 -1
- package/src/hook/popover/usePopover.ts +6 -12
- package/src/hook/popover/useTooltip.ts +2 -1
- package/src/hook/react/useActivate.ts +1 -1
- package/src/hook/react/useUniqueId.ts +2 -2
- package/src/infra/logging/logger.ts +26 -13
- 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/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
|
@@ -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: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useUniqueId } from '#hook'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import {
|
|
4
|
+
GroupHeaderStyle,
|
|
4
5
|
GroupLabelStyle,
|
|
5
6
|
GroupNestedListStyle,
|
|
6
7
|
GroupStyle,
|
|
@@ -17,6 +18,7 @@ export interface GroupProps
|
|
|
17
18
|
label?: string | undefined
|
|
18
19
|
slot?: {
|
|
19
20
|
root?: React.ComponentProps<'li'> | undefined
|
|
21
|
+
header?: React.ComponentProps<'div'> | undefined
|
|
20
22
|
label?: React.ComponentProps<'div'> | undefined
|
|
21
23
|
nested?: React.ComponentProps<'ul'> | undefined
|
|
22
24
|
}
|
|
@@ -39,11 +41,17 @@ export function Group(props: GroupProps) {
|
|
|
39
41
|
>
|
|
40
42
|
{label != null && (
|
|
41
43
|
<div
|
|
42
|
-
{...
|
|
43
|
-
className={clsx(
|
|
44
|
+
{...slot?.header}
|
|
45
|
+
className={clsx(GroupHeaderStyle, slot?.header?.className)}
|
|
44
46
|
role='none'
|
|
45
47
|
>
|
|
46
|
-
|
|
48
|
+
<div
|
|
49
|
+
{...labelProps}
|
|
50
|
+
className={clsx(GroupLabelStyle, labelProps.className)}
|
|
51
|
+
role='none'
|
|
52
|
+
>
|
|
53
|
+
{label}
|
|
54
|
+
</div>
|
|
47
55
|
</div>
|
|
48
56
|
)}
|
|
49
57
|
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
ActiveSelector,
|
|
3
3
|
DisabledSelector,
|
|
4
4
|
HighlightName,
|
|
5
|
+
radiusVar,
|
|
6
|
+
SquircleStyle,
|
|
5
7
|
theme,
|
|
6
8
|
TRANSPARENT,
|
|
7
9
|
} from '#theme'
|
|
@@ -10,7 +12,6 @@ import { recipe } from '@vanilla-extract/recipes'
|
|
|
10
12
|
|
|
11
13
|
const gap = createVar()
|
|
12
14
|
const width = createVar()
|
|
13
|
-
const height = createVar()
|
|
14
15
|
const padding = createVar()
|
|
15
16
|
const paddingBlock = createVar()
|
|
16
17
|
const paddingInline = createVar()
|
|
@@ -18,8 +19,6 @@ const margin = createVar()
|
|
|
18
19
|
const marginBlock = createVar()
|
|
19
20
|
const marginInline = createVar()
|
|
20
21
|
const font = createVar()
|
|
21
|
-
const fontSize = createVar()
|
|
22
|
-
const lineHeight = createVar()
|
|
23
22
|
const icon = createVar()
|
|
24
23
|
const color = createVar()
|
|
25
24
|
const colorChecked = createVar()
|
|
@@ -32,10 +31,10 @@ const backgroundActive = createVar()
|
|
|
32
31
|
const backgroundDisabled = createVar()
|
|
33
32
|
const border = createVar()
|
|
34
33
|
const borderSize = createVar()
|
|
35
|
-
const radius = createVar()
|
|
36
34
|
|
|
37
35
|
const gridTemplate = "'a b c' / auto 1fr auto"
|
|
38
36
|
const gridColumn = 'span 3'
|
|
37
|
+
const paddingBlockValue = `calc((${theme.item.height} - 1lh) / 2)`
|
|
39
38
|
|
|
40
39
|
export const ListStyle = style({
|
|
41
40
|
vars: {
|
|
@@ -52,6 +51,8 @@ export const ListStyle = style({
|
|
|
52
51
|
padding,
|
|
53
52
|
margin: '0',
|
|
54
53
|
overflow: 'auto',
|
|
54
|
+
scrollSnapType: 'both mandatory',
|
|
55
|
+
scrollPadding: padding,
|
|
55
56
|
selectors: {
|
|
56
57
|
[`&::highlight(${HighlightName})`]: {
|
|
57
58
|
textDecorationLine: 'underline',
|
|
@@ -60,59 +61,57 @@ export const ListStyle = style({
|
|
|
60
61
|
})
|
|
61
62
|
|
|
62
63
|
export const ItemStyle = recipe({
|
|
63
|
-
base:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
[height]: theme.item.height,
|
|
67
|
-
[padding]: `${paddingBlock} ${paddingInline}`,
|
|
68
|
-
[paddingBlock]: `calc((${height} - ${lineHeight}) / 2)`,
|
|
69
|
-
[paddingInline]: theme.item.padding,
|
|
70
|
-
[fontSize]: theme.item.fontSize,
|
|
71
|
-
[lineHeight]: theme.item.lineHeight,
|
|
72
|
-
[icon]: theme.item.icon,
|
|
73
|
-
[color]: 'inherit',
|
|
74
|
-
[colorDisabled]: theme.disabled.color,
|
|
75
|
-
[cursor]: 'pointer',
|
|
76
|
-
[cursorDisabled]: 'not-allowed',
|
|
77
|
-
[background]: 'none',
|
|
78
|
-
[backgroundHover]: theme.hover.background,
|
|
79
|
-
[backgroundActive]: theme.active.background,
|
|
80
|
-
[backgroundDisabled]: 'none',
|
|
81
|
-
[radius]: theme.item.radius,
|
|
82
|
-
},
|
|
83
|
-
display: 'grid',
|
|
84
|
-
gridTemplateRows: 'subgrid',
|
|
85
|
-
gridTemplateColumns: 'subgrid',
|
|
86
|
-
gridColumn,
|
|
87
|
-
gap,
|
|
88
|
-
placeItems: 'start',
|
|
89
|
-
padding,
|
|
90
|
-
fontSize,
|
|
91
|
-
lineHeight,
|
|
92
|
-
color,
|
|
93
|
-
cursor,
|
|
94
|
-
background,
|
|
95
|
-
borderRadius: radius,
|
|
96
|
-
':hover': {
|
|
64
|
+
base: [
|
|
65
|
+
SquircleStyle,
|
|
66
|
+
{
|
|
97
67
|
vars: {
|
|
98
|
-
[
|
|
68
|
+
[gap]: theme.item.gap,
|
|
69
|
+
[padding]: `${paddingBlock} ${paddingInline}`,
|
|
70
|
+
[paddingBlock]: paddingBlockValue,
|
|
71
|
+
[paddingInline]: theme.item.padding,
|
|
72
|
+
[icon]: theme.item.icon,
|
|
73
|
+
[color]: 'inherit',
|
|
74
|
+
[colorDisabled]: theme.disabled.color,
|
|
75
|
+
[cursor]: 'pointer',
|
|
76
|
+
[cursorDisabled]: 'not-allowed',
|
|
77
|
+
[background]: 'none',
|
|
78
|
+
[backgroundHover]: theme.hover.background,
|
|
79
|
+
[backgroundActive]: theme.active.background,
|
|
80
|
+
[backgroundDisabled]: 'none',
|
|
81
|
+
[radiusVar]: theme.item.radius,
|
|
99
82
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
83
|
+
display: 'grid',
|
|
84
|
+
gridTemplateRows: 'subgrid',
|
|
85
|
+
gridTemplateColumns: 'subgrid',
|
|
86
|
+
gridColumn,
|
|
87
|
+
gap,
|
|
88
|
+
placeItems: 'start',
|
|
89
|
+
padding,
|
|
90
|
+
color,
|
|
91
|
+
cursor,
|
|
92
|
+
scrollSnapAlign: 'center',
|
|
93
|
+
background,
|
|
94
|
+
':hover': {
|
|
103
95
|
vars: {
|
|
104
|
-
[background]:
|
|
96
|
+
[background]: backgroundHover,
|
|
105
97
|
},
|
|
106
98
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
selectors: {
|
|
100
|
+
[`&${ActiveSelector}`]: {
|
|
101
|
+
vars: {
|
|
102
|
+
[background]: backgroundActive,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
[`&${DisabledSelector}`]: {
|
|
106
|
+
vars: {
|
|
107
|
+
[color]: colorDisabled,
|
|
108
|
+
[cursor]: cursorDisabled,
|
|
109
|
+
[background]: backgroundDisabled,
|
|
110
|
+
},
|
|
112
111
|
},
|
|
113
112
|
},
|
|
114
113
|
},
|
|
115
|
-
|
|
114
|
+
],
|
|
116
115
|
variants: {
|
|
117
116
|
danger: {
|
|
118
117
|
true: {
|
|
@@ -148,7 +147,7 @@ export const ItemAfterStyle = style({
|
|
|
148
147
|
|
|
149
148
|
export const ItemIconStyle = style({
|
|
150
149
|
vars: {
|
|
151
|
-
[marginBlock]: `calc((
|
|
150
|
+
[marginBlock]: `calc((1lh - ${icon}) / 2)`,
|
|
152
151
|
[color]: TRANSPARENT,
|
|
153
152
|
[colorChecked]: 'inherit',
|
|
154
153
|
},
|
|
@@ -168,7 +167,7 @@ export const ItemIconStyle = style({
|
|
|
168
167
|
export const SeparatorStyle = style({
|
|
169
168
|
vars: {
|
|
170
169
|
[margin]: `${marginBlock} ${marginInline}`,
|
|
171
|
-
[marginBlock]:
|
|
170
|
+
[marginBlock]: paddingBlockValue,
|
|
172
171
|
[marginInline]: '0',
|
|
173
172
|
[color]: theme.separator.color,
|
|
174
173
|
[border]: `${borderSize} solid`,
|
|
@@ -189,18 +188,25 @@ export const GroupStyle = style({
|
|
|
189
188
|
gap: 'inherit',
|
|
190
189
|
})
|
|
191
190
|
|
|
192
|
-
export const
|
|
191
|
+
export const GroupHeaderStyle = style({
|
|
193
192
|
vars: {
|
|
194
193
|
[padding]: `${paddingBlock} ${paddingInline}`,
|
|
195
|
-
[paddingBlock]:
|
|
194
|
+
[paddingBlock]: paddingBlockValue,
|
|
196
195
|
[paddingInline]: theme.item.padding,
|
|
197
196
|
[font]: theme.group.font,
|
|
198
197
|
[color]: theme.group.color,
|
|
199
198
|
},
|
|
200
199
|
position: 'sticky',
|
|
201
200
|
insetBlockStart: '0',
|
|
201
|
+
display: 'grid',
|
|
202
|
+
gridTemplateColumns: 'subgrid',
|
|
202
203
|
gridColumn,
|
|
204
|
+
gap: 'inherit',
|
|
203
205
|
padding,
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
export const GroupLabelStyle = style({
|
|
209
|
+
gridColumn,
|
|
204
210
|
font,
|
|
205
211
|
color,
|
|
206
212
|
})
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { createVar, globalStyle, style } from '@vanilla-extract/css'
|
|
2
|
+
|
|
3
|
+
const gap = createVar()
|
|
4
|
+
const width = createVar()
|
|
5
|
+
const color = createVar()
|
|
6
|
+
const background = createVar()
|
|
7
|
+
|
|
8
|
+
export const ArticleStyle = style({
|
|
9
|
+
vars: {
|
|
10
|
+
[width]: '48rem',
|
|
11
|
+
[color]: 'light-dark(#131313, #fff)',
|
|
12
|
+
[background]: 'light-dark(#fff, #131313)',
|
|
13
|
+
},
|
|
14
|
+
maxInlineSize: width,
|
|
15
|
+
paddingInline: '1.5rem',
|
|
16
|
+
margin: 'auto',
|
|
17
|
+
fontFamily: `'Proxima Nova', 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif`,
|
|
18
|
+
fontSize: '0.875rem',
|
|
19
|
+
lineHeight: '1.25rem',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
globalStyle(`${ArticleStyle} h1, ${ArticleStyle} section`, {
|
|
23
|
+
color,
|
|
24
|
+
background,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
globalStyle(
|
|
28
|
+
['h1', 'h2', 'h3', 'p', 'ul', 'ol', 'pre', 'hr', 'section']
|
|
29
|
+
.map((selector) => `${ArticleStyle} ${selector}`)
|
|
30
|
+
.join(', '),
|
|
31
|
+
{
|
|
32
|
+
maxInlineSize: width,
|
|
33
|
+
margin: 'auto',
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
globalStyle(`${ArticleStyle} h1`, {
|
|
38
|
+
padding: '2.5rem 2rem',
|
|
39
|
+
fontFamily: `'Proxima Nova', 'Segoe UI Light', Quicksand, 'Myriad Set Pro', 'Lucida Grande', sans-serif`,
|
|
40
|
+
fontSize: '2rem',
|
|
41
|
+
lineHeight: '3rem',
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
globalStyle(`${ArticleStyle} h2`, {
|
|
46
|
+
padding: '1rem 1.5rem 0.75rem 1.25rem',
|
|
47
|
+
fontSize: '1.125rem',
|
|
48
|
+
lineHeight: '1.75rem',
|
|
49
|
+
borderInlineStart: '0.25rem solid #aaf',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
globalStyle(`${ArticleStyle} h3`, {
|
|
53
|
+
position: 'relative',
|
|
54
|
+
marginBlock: '1.25rem',
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
globalStyle(`${ArticleStyle} h3::before`, {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
insetBlock: '0.1875rem 0.375rem',
|
|
60
|
+
insetInlineStart: '-1.5rem',
|
|
61
|
+
content: '',
|
|
62
|
+
borderInlineStart: '0.25rem solid #999',
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
globalStyle(`${ArticleStyle} p, ${ArticleStyle} li`, {
|
|
66
|
+
marginBlock: '1.25rem',
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
globalStyle(`${ArticleStyle} ul`, {
|
|
70
|
+
paddingInlineStart: '1em',
|
|
71
|
+
listStyle: 'circle',
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
globalStyle(`${ArticleStyle} ol`, {
|
|
75
|
+
paddingInlineStart: '1em',
|
|
76
|
+
listStyle: 'auto',
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
globalStyle(`${ArticleStyle} a`, {
|
|
80
|
+
color: '#08c',
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
globalStyle(`${ArticleStyle} a:hover`, {
|
|
84
|
+
color: '#15c',
|
|
85
|
+
textDecoration: 'underline',
|
|
86
|
+
textDecorationColor: '#58e',
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
globalStyle(`${ArticleStyle} a:focus-visible`, {
|
|
90
|
+
outline: '1px dotted rgb(0 0 0 / 75%)',
|
|
91
|
+
outlineOffset: '2px',
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
globalStyle(`${ArticleStyle} a[download]`, {
|
|
95
|
+
vars: {
|
|
96
|
+
[color]: 'light-dark(#fff, #fff)',
|
|
97
|
+
[background]: 'light-dark(#acc, #222)',
|
|
98
|
+
},
|
|
99
|
+
display: 'inline-block',
|
|
100
|
+
blockSize: '1.75rem',
|
|
101
|
+
padding: '0 0.5rem',
|
|
102
|
+
fontSize: '0.875rem',
|
|
103
|
+
lineHeight: '1.75rem',
|
|
104
|
+
color,
|
|
105
|
+
background,
|
|
106
|
+
borderRadius: '0.125rem',
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
globalStyle(`${ArticleStyle} :has(> a[download]:only-child)`, {
|
|
110
|
+
paddingInline: '1.5rem',
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
globalStyle(`${ArticleStyle} a[download]:hover`, {
|
|
114
|
+
color: '#fff',
|
|
115
|
+
textDecoration: 'none',
|
|
116
|
+
background: '#8aa',
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
globalStyle(`${ArticleStyle} a[download]:focus-visible`, {
|
|
120
|
+
outline: '2px solid rgb(102 136 136 / 40%)',
|
|
121
|
+
outlineOffset: '1px',
|
|
122
|
+
background: '#688',
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
globalStyle(`${ArticleStyle} code`, {
|
|
126
|
+
display: 'inline-block',
|
|
127
|
+
padding: '0.125rem',
|
|
128
|
+
fontFamily: `Monaco, 'Andale Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace`,
|
|
129
|
+
fontSize: '0.875rem',
|
|
130
|
+
lineHeight: '1rem',
|
|
131
|
+
verticalAlign: 'top',
|
|
132
|
+
color: '#333',
|
|
133
|
+
whiteSpace: 'pre',
|
|
134
|
+
background: '#e5e5e5',
|
|
135
|
+
borderRadius: '0.125rem',
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
globalStyle(`${ArticleStyle} code::selection`, {
|
|
139
|
+
background: '#bbb',
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
globalStyle(`${ArticleStyle} section`, {
|
|
143
|
+
padding: '0.25rem 1.5rem',
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
globalStyle(`${ArticleStyle} footer`, {
|
|
147
|
+
vars: {
|
|
148
|
+
[gap]: '1.25rem',
|
|
149
|
+
[color]: '#aaf',
|
|
150
|
+
},
|
|
151
|
+
display: 'flex',
|
|
152
|
+
gap,
|
|
153
|
+
placeContent: 'center',
|
|
154
|
+
placeItems: 'center',
|
|
155
|
+
marginBlock: '2.5rem',
|
|
156
|
+
overflow: 'clip',
|
|
157
|
+
color,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
globalStyle(`${ArticleStyle} footer::selection`, {
|
|
161
|
+
color: '#88d',
|
|
162
|
+
background: '#ccc',
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
globalStyle(`${ArticleStyle} footer strong, ${ArticleStyle} footer time`, {
|
|
166
|
+
position: 'relative',
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
globalStyle(
|
|
170
|
+
`${ArticleStyle} footer strong::before, ${ArticleStyle} footer time::after`,
|
|
171
|
+
{
|
|
172
|
+
position: 'absolute',
|
|
173
|
+
insetBlockStart: '0.5625rem',
|
|
174
|
+
inlineSize: width,
|
|
175
|
+
blockSize: '0.125rem',
|
|
176
|
+
content: '',
|
|
177
|
+
background: color,
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
globalStyle(`${ArticleStyle} footer strong::before`, {
|
|
182
|
+
insetInlineEnd: '100%',
|
|
183
|
+
marginInlineEnd: gap,
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
globalStyle(`${ArticleStyle} footer time::after`, {
|
|
187
|
+
insetInlineStart: '100%',
|
|
188
|
+
marginInlineStart: gap,
|
|
189
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './article.css'
|