@duro-app/ui 4.5.0 → 5.1.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/dist/Table-BkrgH0jb.js +1199 -0
- package/dist/Table-BkrgH0jb.js.map +1 -0
- package/dist/components/ActionBar/ActionBar.stories.d.ts.map +1 -1
- package/dist/components/ActionBar/styles.css.d.ts +7 -7
- package/dist/components/ActionBar/styles.css.d.ts.map +1 -1
- package/dist/components/Alert/styles.css.d.ts +2 -2
- package/dist/components/Alert/styles.css.d.ts.map +1 -1
- package/dist/components/Badge/styles.css.d.ts +2 -2
- package/dist/components/Button/styles.css.d.ts +5 -5
- package/dist/components/Button/styles.css.d.ts.map +1 -1
- package/dist/components/Callout/styles.css.d.ts +1 -1
- package/dist/components/Callout/styles.css.d.ts.map +1 -1
- package/dist/components/Card/Card.stories.d.ts.map +1 -1
- package/dist/components/Card/styles.css.d.ts +3 -3
- package/dist/components/Card/styles.css.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/styles.css.d.ts +7 -11
- package/dist/components/Checkbox/styles.css.d.ts.map +1 -1
- package/dist/components/Cluster/Cluster.stories.d.ts.map +1 -1
- package/dist/components/ColorInput/styles.css.d.ts +6 -6
- package/dist/components/ColorInput/styles.css.d.ts.map +1 -1
- package/dist/components/ColorMode/styles.css.d.ts +3 -3
- package/dist/components/ColorMode/styles.css.d.ts.map +1 -1
- package/dist/components/Combobox/styles.css.d.ts +3 -3
- package/dist/components/Combobox/styles.css.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.stories.d.ts.map +1 -1
- package/dist/components/DetailPanel/styles.css.d.ts +19 -10
- package/dist/components/DetailPanel/styles.css.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/components/Dialog/styles.css.d.ts +18 -9
- package/dist/components/Dialog/styles.css.d.ts.map +1 -1
- package/dist/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/components/DragDrop/DragDrop.stories.d.ts.map +1 -1
- package/dist/components/DragDrop/styles.css.d.ts +0 -6
- package/dist/components/DragDrop/styles.css.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/styles.css.d.ts +19 -10
- package/dist/components/Drawer/styles.css.d.ts.map +1 -1
- package/dist/components/Field/Field.stories.d.ts.map +1 -1
- package/dist/components/Field/styles.css.d.ts +1 -1
- package/dist/components/Field/styles.css.d.ts.map +1 -1
- package/dist/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/components/Grid/Grid.d.ts +6 -4
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/components/Grid/styles.css.d.ts +5 -5
- package/dist/components/Grid/styles.css.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/Input/styles.css.d.ts +3 -3
- package/dist/components/Input/styles.css.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +4 -2
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.stories.d.ts.map +1 -1
- package/dist/components/InputGroup/styles.css.d.ts +3 -3
- package/dist/components/InputGroup/styles.css.d.ts.map +1 -1
- package/dist/components/LinkButton/styles.css.d.ts +1 -1
- package/dist/components/LinkButton/styles.css.d.ts.map +1 -1
- package/dist/components/List/List.stories.d.ts.map +1 -1
- package/dist/components/List/styles.css.d.ts +3 -3
- package/dist/components/List/styles.css.d.ts.map +1 -1
- package/dist/components/Menu/styles.css.d.ts +4 -4
- package/dist/components/Menu/styles.css.d.ts.map +1 -1
- package/dist/components/PageShell/styles.css.d.ts +3 -3
- package/dist/components/PageShell/styles.css.d.ts.map +1 -1
- package/dist/components/Panel/styles.css.d.ts +3 -3
- package/dist/components/Panel/styles.css.d.ts.map +1 -1
- package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/components/Popover/styles.css.d.ts +2 -2
- package/dist/components/Popover/styles.css.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/styles.css.d.ts +5 -9
- package/dist/components/RadioGroup/styles.css.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.ts +2 -1
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/components/ScrollArea/styles.css.d.ts +8 -8
- package/dist/components/ScrollArea/styles.css.d.ts.map +1 -1
- package/dist/components/Select/styles.css.d.ts +4 -4
- package/dist/components/Select/styles.css.d.ts.map +1 -1
- package/dist/components/SideNav/styles.css.d.ts +7 -7
- package/dist/components/SideNav/styles.css.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/styles.css.d.ts +10 -14
- package/dist/components/Spinner/styles.css.d.ts.map +1 -1
- package/dist/components/StatusIcon/StatusIcon.stories.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/styles.css.d.ts +10 -14
- package/dist/components/Switch/styles.css.d.ts.map +1 -1
- package/dist/components/Table/ColumnFilter.d.ts.map +1 -1
- package/dist/components/Table/FromTanstack.d.ts +2 -1
- package/dist/components/Table/FromTanstack.d.ts.map +1 -1
- package/dist/components/Table/Pagination.d.ts.map +1 -1
- package/dist/components/Table/SortIndicator.d.ts.map +1 -1
- package/dist/components/Table/Table.d.ts +11 -9
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/Table/styles.css.d.ts +6 -6
- package/dist/components/Table/styles.css.d.ts.map +1 -1
- package/dist/components/Tabs/styles.css.d.ts +8 -8
- package/dist/components/Tabs/styles.css.d.ts.map +1 -1
- package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/components/Tag/styles.css.d.ts +4 -4
- package/dist/components/Tag/styles.css.d.ts.map +1 -1
- package/dist/components/TagGroup/TagGroup.d.ts.map +1 -1
- package/dist/components/TagGroup/styles.css.d.ts +4 -10
- package/dist/components/TagGroup/styles.css.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/Textarea/styles.css.d.ts +3 -3
- package/dist/components/Textarea/styles.css.d.ts.map +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -1
- package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/Toast/styles.css.d.ts +12 -12
- package/dist/components/Toast/styles.css.d.ts.map +1 -1
- package/dist/components/Toggle/styles.css.d.ts +8 -8
- package/dist/components/Toggle/styles.css.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/ToggleGroup/styles.css.d.ts +1 -1
- package/dist/components/ToggleGroup/styles.css.d.ts.map +1 -1
- package/dist/components/Tooltip/styles.css.d.ts +1 -1
- package/dist/components/Tooltip/styles.css.d.ts.map +1 -1
- package/dist/components/Tree/styles.css.d.ts +4 -4
- package/dist/components/Tree/styles.css.d.ts.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.d.ts +2 -1
- package/dist/components/VirtualTable/VirtualTable.d.ts.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.stories.d.ts.map +1 -1
- package/dist/components/VirtualTable/styles.css.d.ts +7 -7
- package/dist/components/VirtualTable/styles.css.d.ts.map +1 -1
- package/dist/docs/Spacing.stories.d.ts.map +1 -1
- package/dist/docs/Typography.stories.d.ts.map +1 -1
- package/dist/docs/helpers.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +2833 -2828
- package/dist/index.js.map +1 -1
- package/dist/shared/length.d.ts +29 -0
- package/dist/shared/length.d.ts.map +1 -0
- package/dist/shared/length.typecheck.d.ts +31 -0
- package/dist/shared/length.typecheck.d.ts.map +1 -0
- package/dist/styles/visually-hidden.css.d.ts +10 -0
- package/dist/styles/visually-hidden.css.d.ts.map +1 -0
- package/dist/table.js +166 -166
- package/dist/table.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ActionBar/ActionBar.stories.tsx +4 -2
- package/src/components/ActionBar/styles.css.ts +11 -9
- package/src/components/Alert/styles.css.ts +4 -3
- package/src/components/Badge/styles.css.ts +3 -3
- package/src/components/Button/styles.css.ts +8 -7
- package/src/components/Callout/styles.css.ts +2 -1
- package/src/components/Card/Card.stories.tsx +2 -1
- package/src/components/Card/styles.css.ts +4 -3
- package/src/components/Checkbox/Checkbox.tsx +2 -1
- package/src/components/Checkbox/styles.css.ts +10 -11
- package/src/components/Cluster/Cluster.stories.tsx +2 -1
- package/src/components/ColorInput/styles.css.ts +9 -7
- package/src/components/ColorMode/styles.css.ts +4 -3
- package/src/components/Combobox/styles.css.ts +5 -3
- package/src/components/DetailPanel/DetailPanel.stories.tsx +5 -3
- package/src/components/DetailPanel/DetailPanel.tsx +3 -0
- package/src/components/DetailPanel/styles.css.ts +17 -11
- package/src/components/Dialog/Dialog.stories.tsx +2 -1
- package/src/components/Dialog/Dialog.tsx +3 -0
- package/src/components/Dialog/styles.css.ts +14 -9
- package/src/components/DragDrop/DragDrop.stories.tsx +2 -1
- package/src/components/DragDrop/DragDrop.tsx +2 -1
- package/src/components/DragDrop/styles.css.ts +0 -7
- package/src/components/Drawer/Drawer.tsx +3 -0
- package/src/components/Drawer/DrawerScroll.stories.tsx +5 -5
- package/src/components/Drawer/styles.css.ts +15 -10
- package/src/components/Field/Field.stories.tsx +3 -2
- package/src/components/Field/styles.css.ts +2 -1
- package/src/components/Form/Form.stories.tsx +4 -3
- package/src/components/Grid/Grid.meta.ts +2 -2
- package/src/components/Grid/Grid.stories.tsx +3 -2
- package/src/components/Grid/Grid.tsx +8 -6
- package/src/components/Grid/styles.css.ts +5 -4
- package/src/components/Input/Input.stories.tsx +2 -1
- package/src/components/Input/styles.css.ts +4 -3
- package/src/components/InputGroup/InputGroup.stories.tsx +3 -2
- package/src/components/InputGroup/InputGroup.tsx +5 -3
- package/src/components/InputGroup/styles.css.ts +4 -3
- package/src/components/LinkButton/styles.css.ts +2 -1
- package/src/components/List/List.stories.tsx +4 -2
- package/src/components/List/styles.css.ts +6 -4
- package/src/components/Menu/styles.css.ts +6 -4
- package/src/components/PageShell/styles.css.ts +4 -3
- package/src/components/Panel/styles.css.ts +4 -3
- package/src/components/Popover/Popover.stories.tsx +6 -4
- package/src/components/Popover/styles.css.ts +3 -2
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/RadioGroup/styles.css.ts +8 -9
- package/src/components/ScrollArea/ScrollArea.meta.ts +1 -1
- package/src/components/ScrollArea/ScrollArea.stories.tsx +7 -5
- package/src/components/ScrollArea/ScrollArea.tsx +7 -2
- package/src/components/ScrollArea/styles.css.ts +10 -9
- package/src/components/Select/styles.css.ts +6 -4
- package/src/components/SideNav/styles.css.ts +10 -8
- package/src/components/Spinner/Spinner.tsx +2 -1
- package/src/components/Spinner/styles.css.ts +14 -14
- package/src/components/StatusIcon/StatusIcon.stories.tsx +2 -2
- package/src/components/Switch/Switch.tsx +2 -1
- package/src/components/Switch/styles.css.ts +15 -15
- package/src/components/Table/ColumnFilter.tsx +5 -4
- package/src/components/Table/FromTanstack.tsx +2 -1
- package/src/components/Table/Pagination.tsx +6 -4
- package/src/components/Table/SortIndicator.tsx +4 -2
- package/src/components/Table/Table.stories.tsx +47 -8
- package/src/components/Table/Table.tsx +19 -15
- package/src/components/Table/styles.css.ts +9 -7
- package/src/components/Tabs/styles.css.ts +11 -9
- package/src/components/Tag/Tag.stories.tsx +4 -2
- package/src/components/Tag/styles.css.ts +6 -5
- package/src/components/TagGroup/TagGroup.tsx +2 -1
- package/src/components/TagGroup/styles.css.ts +6 -10
- package/src/components/Textarea/Textarea.stories.tsx +2 -1
- package/src/components/Textarea/styles.css.ts +4 -3
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +7 -5
- package/src/components/Toast/Toast.stories.tsx +2 -1
- package/src/components/Toast/styles.css.ts +16 -14
- package/src/components/Toggle/Toggle.meta.ts +1 -1
- package/src/components/Toggle/styles.css.ts +12 -10
- package/src/components/ToggleGroup/ToggleGroup.meta.ts +1 -1
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +7 -6
- package/src/components/ToggleGroup/styles.css.ts +7 -6
- package/src/components/Tooltip/styles.css.ts +2 -1
- package/src/components/Tree/styles.css.ts +8 -6
- package/src/components/VirtualTable/VirtualTable.stories.tsx +4 -3
- package/src/components/VirtualTable/VirtualTable.tsx +5 -3
- package/src/components/VirtualTable/styles.css.ts +9 -8
- package/src/docs/Spacing.stories.tsx +11 -10
- package/src/docs/Typography.stories.tsx +8 -6
- package/src/docs/helpers.tsx +3 -2
- package/src/shared/length.ts +70 -0
- package/src/shared/length.typecheck.tsx +56 -0
- package/src/styles/visually-hidden.css.ts +16 -0
- package/dist/Table-CUp12BKZ.js +0 -1099
- package/dist/Table-CUp12BKZ.js.map +0 -1
- package/dist/components/Toggle/rowHeight.d.ts +0 -17
- package/dist/components/Toggle/rowHeight.d.ts.map +0 -1
- package/src/components/Toggle/rowHeight.ts +0 -12
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {spacing
|
|
3
|
+
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
7
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
8
|
|
|
7
9
|
export const styles = css.create({
|
|
8
10
|
root: {
|
|
@@ -15,7 +17,7 @@ export const styles = css.create({
|
|
|
15
17
|
list: {
|
|
16
18
|
display: 'flex',
|
|
17
19
|
flexDirection: 'row',
|
|
18
|
-
borderBottomWidth:
|
|
20
|
+
borderBottomWidth: borders.hairline,
|
|
19
21
|
borderBottomStyle: 'solid',
|
|
20
22
|
borderBottomColor: colors.border,
|
|
21
23
|
gap: spacing.xs,
|
|
@@ -25,7 +27,7 @@ export const styles = css.create({
|
|
|
25
27
|
listVertical: {
|
|
26
28
|
flexDirection: 'column',
|
|
27
29
|
borderBottomWidth: 0,
|
|
28
|
-
borderRightWidth:
|
|
30
|
+
borderRightWidth: borders.hairline,
|
|
29
31
|
borderRightStyle: 'solid',
|
|
30
32
|
borderRightColor: colors.border,
|
|
31
33
|
gap: 0,
|
|
@@ -47,7 +49,7 @@ export const styles = css.create({
|
|
|
47
49
|
},
|
|
48
50
|
backgroundColor: 'transparent',
|
|
49
51
|
borderWidth: 0,
|
|
50
|
-
borderBottomWidth:
|
|
52
|
+
borderBottomWidth: borders.strong,
|
|
51
53
|
borderBottomStyle: 'solid',
|
|
52
54
|
borderBottomColor: 'transparent',
|
|
53
55
|
cursor: 'pointer',
|
|
@@ -56,7 +58,7 @@ export const styles = css.create({
|
|
|
56
58
|
transitionTimingFunction: easing.standard,
|
|
57
59
|
outlineWidth: {
|
|
58
60
|
default: 0,
|
|
59
|
-
':focus-visible':
|
|
61
|
+
':focus-visible': borders.focusRing,
|
|
60
62
|
},
|
|
61
63
|
outlineStyle: {
|
|
62
64
|
default: 'none',
|
|
@@ -68,13 +70,13 @@ export const styles = css.create({
|
|
|
68
70
|
},
|
|
69
71
|
outlineOffset: {
|
|
70
72
|
default: 0,
|
|
71
|
-
':focus-visible': -
|
|
73
|
+
':focus-visible': `calc(-1 * ${borders.focusOffset})`,
|
|
72
74
|
},
|
|
73
75
|
},
|
|
74
76
|
tabVertical: {
|
|
75
77
|
justifyContent: 'flex-start',
|
|
76
78
|
borderBottomWidth: 0,
|
|
77
|
-
borderRightWidth:
|
|
79
|
+
borderRightWidth: borders.strong,
|
|
78
80
|
borderRightStyle: 'solid',
|
|
79
81
|
borderRightColor: 'transparent',
|
|
80
82
|
},
|
|
@@ -105,12 +107,12 @@ export const styles = css.create({
|
|
|
105
107
|
indicatorHorizontal: {
|
|
106
108
|
bottom: -1,
|
|
107
109
|
left: 0,
|
|
108
|
-
height:
|
|
110
|
+
height: sizes.tabIndicator,
|
|
109
111
|
},
|
|
110
112
|
indicatorVertical: {
|
|
111
113
|
right: -1,
|
|
112
114
|
top: 0,
|
|
113
|
-
width:
|
|
115
|
+
width: sizes.tabIndicator,
|
|
114
116
|
},
|
|
115
117
|
// Dynamic transform/size from the measured active tab (StyleX dynamic style:
|
|
116
118
|
// simple identifier params only).
|
|
@@ -4,6 +4,8 @@ import {css, html} from 'react-strict-dom'
|
|
|
4
4
|
import {Tag} from './Tag'
|
|
5
5
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
6
6
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
7
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
8
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
7
9
|
|
|
8
10
|
const meta: Meta<typeof Tag> = {
|
|
9
11
|
title: 'Components/Tag',
|
|
@@ -53,8 +55,8 @@ const layoutStyles = css.create({
|
|
|
53
55
|
stack: {display: 'flex', flexDirection: 'column', gap: spacing.md},
|
|
54
56
|
// Narrow column that a long identifier tag would overflow without `wrap`.
|
|
55
57
|
narrowCol: {
|
|
56
|
-
width:
|
|
57
|
-
borderWidth:
|
|
58
|
+
width: sizes.labelMinW,
|
|
59
|
+
borderWidth: borders.hairline,
|
|
58
60
|
borderStyle: 'solid',
|
|
59
61
|
borderColor: colors.border,
|
|
60
62
|
padding: spacing.sm,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {
|
|
3
|
+
import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
5
6
|
|
|
6
7
|
export const styles = css.create({
|
|
7
8
|
base: {
|
|
@@ -11,15 +12,15 @@ export const styles = css.create({
|
|
|
11
12
|
fontFamily: typography.fontFamily,
|
|
12
13
|
fontWeight: typography.fontWeightNormal,
|
|
13
14
|
lineHeight: 1,
|
|
14
|
-
borderRadius:
|
|
15
|
+
borderRadius: radii.xs,
|
|
15
16
|
whiteSpace: 'nowrap',
|
|
16
17
|
minWidth: 0,
|
|
17
|
-
borderWidth:
|
|
18
|
+
borderWidth: borders.hairline,
|
|
18
19
|
borderStyle: 'solid',
|
|
19
20
|
borderColor: colors.border,
|
|
20
21
|
outlineWidth: {
|
|
21
22
|
default: 0,
|
|
22
|
-
':focus-visible':
|
|
23
|
+
':focus-visible': borders.focusRing,
|
|
23
24
|
},
|
|
24
25
|
outlineStyle: {
|
|
25
26
|
default: 'none',
|
|
@@ -31,7 +32,7 @@ export const styles = css.create({
|
|
|
31
32
|
},
|
|
32
33
|
outlineOffset: {
|
|
33
34
|
default: 0,
|
|
34
|
-
':focus-visible':
|
|
35
|
+
':focus-visible': borders.focusOffsetSm,
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
38
|
sizeMd: {
|
|
@@ -13,6 +13,7 @@ import {useControllableValue} from '../../hooks/useControllableValue'
|
|
|
13
13
|
import {useFieldContext} from '../Field/FieldContext'
|
|
14
14
|
import {TagGroupContext, type TagGroupContextValue} from './TagGroupContext'
|
|
15
15
|
import {styles} from './styles.css'
|
|
16
|
+
import {visuallyHidden} from '../../styles/visually-hidden.css'
|
|
16
17
|
|
|
17
18
|
// ---------------------------------------------------------------------------
|
|
18
19
|
// Local context accessor (non-throwing, returns null)
|
|
@@ -149,7 +150,7 @@ function Root({
|
|
|
149
150
|
{name && values.map((v) => <html.input key={v} type="hidden" name={name} value={v} />)}
|
|
150
151
|
|
|
151
152
|
{/* Live region for screen reader announcements */}
|
|
152
|
-
<html.div role="status" aria-live="polite" aria-atomic style={
|
|
153
|
+
<html.div role="status" aria-live="polite" aria-atomic style={visuallyHidden.base}>
|
|
153
154
|
{announcement}
|
|
154
155
|
</html.div>
|
|
155
156
|
</html.div>
|
|
@@ -3,6 +3,8 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
3
3
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
7
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
8
|
|
|
7
9
|
export const styles = css.create({
|
|
8
10
|
root: {
|
|
@@ -31,7 +33,7 @@ export const styles = css.create({
|
|
|
31
33
|
},
|
|
32
34
|
input: {
|
|
33
35
|
width: '100%',
|
|
34
|
-
borderWidth:
|
|
36
|
+
borderWidth: borders.hairline,
|
|
35
37
|
borderStyle: 'solid',
|
|
36
38
|
borderColor: {
|
|
37
39
|
default: colors.border,
|
|
@@ -47,13 +49,13 @@ export const styles = css.create({
|
|
|
47
49
|
paddingBottom: spacing.sm,
|
|
48
50
|
paddingLeft: spacing.sm,
|
|
49
51
|
paddingRight: spacing.sm,
|
|
50
|
-
minHeight:
|
|
52
|
+
minHeight: sizes.controlLg,
|
|
51
53
|
transitionProperty: 'border-color',
|
|
52
54
|
transitionDuration: duration.fast,
|
|
53
55
|
transitionTimingFunction: easing.standard,
|
|
54
56
|
outlineWidth: {
|
|
55
57
|
default: 0,
|
|
56
|
-
':focus':
|
|
58
|
+
':focus': borders.focusRing,
|
|
57
59
|
},
|
|
58
60
|
outlineStyle: {
|
|
59
61
|
default: 'none',
|
|
@@ -65,7 +67,7 @@ export const styles = css.create({
|
|
|
65
67
|
},
|
|
66
68
|
outlineOffset: {
|
|
67
69
|
default: 0,
|
|
68
|
-
':focus':
|
|
70
|
+
':focus': borders.focusOffsetSm,
|
|
69
71
|
},
|
|
70
72
|
boxSizing: 'border-box',
|
|
71
73
|
},
|
|
@@ -75,10 +77,4 @@ export const styles = css.create({
|
|
|
75
77
|
':focus': colors.error,
|
|
76
78
|
},
|
|
77
79
|
},
|
|
78
|
-
liveRegion: {
|
|
79
|
-
position: 'absolute',
|
|
80
|
-
width: 1,
|
|
81
|
-
height: 1,
|
|
82
|
-
overflow: 'hidden',
|
|
83
|
-
},
|
|
84
80
|
})
|
|
@@ -3,6 +3,7 @@ import {expect, fn} from 'storybook/test'
|
|
|
3
3
|
import {css, html} from 'react-strict-dom'
|
|
4
4
|
import {Textarea} from './Textarea'
|
|
5
5
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
6
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof Textarea> = {
|
|
8
9
|
title: 'Components/Textarea',
|
|
@@ -76,7 +77,7 @@ export const CustomRows: Story = {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
const stackStyles = css.create({
|
|
79
|
-
stack: {display: 'flex', flexDirection: 'column', gap: spacing.ms, maxWidth:
|
|
80
|
+
stack: {display: 'flex', flexDirection: 'column', gap: spacing.ms, maxWidth: sizes.panelSm},
|
|
80
81
|
})
|
|
81
82
|
|
|
82
83
|
export const AllVariants: Story = {
|
|
@@ -3,6 +3,7 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
3
3
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
7
|
|
|
7
8
|
export const styles = css.create({
|
|
8
9
|
base: {
|
|
@@ -16,7 +17,7 @@ export const styles = css.create({
|
|
|
16
17
|
lineHeight: typography.lineHeight,
|
|
17
18
|
color: colors.text,
|
|
18
19
|
backgroundColor: colors.bg,
|
|
19
|
-
borderWidth:
|
|
20
|
+
borderWidth: borders.hairline,
|
|
20
21
|
borderStyle: 'solid',
|
|
21
22
|
borderRadius: radii.sm,
|
|
22
23
|
resize: 'vertical' as const,
|
|
@@ -25,7 +26,7 @@ export const styles = css.create({
|
|
|
25
26
|
transitionTimingFunction: easing.standard,
|
|
26
27
|
outlineWidth: {
|
|
27
28
|
default: 0,
|
|
28
|
-
':focus-visible':
|
|
29
|
+
':focus-visible': borders.focusRing,
|
|
29
30
|
},
|
|
30
31
|
outlineStyle: {
|
|
31
32
|
default: 'none',
|
|
@@ -37,7 +38,7 @@ export const styles = css.create({
|
|
|
37
38
|
},
|
|
38
39
|
outlineOffset: {
|
|
39
40
|
default: 0,
|
|
40
|
-
':focus-visible':
|
|
41
|
+
':focus-visible': borders.focusOffsetSm,
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
44
|
default: {
|
|
@@ -7,6 +7,8 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
7
7
|
import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
8
8
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
9
9
|
import {shadows} from '@duro-app/tokens/tokens/shadows.css'
|
|
10
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
11
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
10
12
|
|
|
11
13
|
const meta: Meta<typeof ThemeProvider> = {
|
|
12
14
|
title: 'Theme/ThemeProvider',
|
|
@@ -27,7 +29,7 @@ const sampleStyles = css.create({
|
|
|
27
29
|
card: {
|
|
28
30
|
padding: spacing.md,
|
|
29
31
|
backgroundColor: colors.bgCard,
|
|
30
|
-
borderWidth:
|
|
32
|
+
borderWidth: borders.hairline,
|
|
31
33
|
borderStyle: 'solid',
|
|
32
34
|
borderColor: colors.border,
|
|
33
35
|
borderRadius: radii.md,
|
|
@@ -53,10 +55,10 @@ const sampleStyles = css.create({
|
|
|
53
55
|
flexWrap: 'wrap',
|
|
54
56
|
},
|
|
55
57
|
swatch: {
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
58
|
+
width: sizes.iconXxl,
|
|
59
|
+
height: sizes.iconXxl,
|
|
58
60
|
borderRadius: radii.sm,
|
|
59
|
-
borderWidth:
|
|
61
|
+
borderWidth: borders.hairline,
|
|
60
62
|
borderStyle: 'solid',
|
|
61
63
|
borderColor: colors.border,
|
|
62
64
|
},
|
|
@@ -131,7 +133,7 @@ const sideBySideStyles = css.create({
|
|
|
131
133
|
},
|
|
132
134
|
column: {
|
|
133
135
|
flex: 1,
|
|
134
|
-
minWidth:
|
|
136
|
+
minWidth: sizes.gridColMd,
|
|
135
137
|
},
|
|
136
138
|
label: {
|
|
137
139
|
fontSize: typography.fontSizeSm,
|
|
@@ -3,13 +3,14 @@ import {expect, userEvent, waitFor} from 'storybook/test'
|
|
|
3
3
|
import {css, html} from 'react-strict-dom'
|
|
4
4
|
import {ToastProvider, useToast} from './ToastProvider'
|
|
5
5
|
import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
6
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
7
|
|
|
7
8
|
const s = css.create({
|
|
8
9
|
row: {display: 'flex', flexDirection: 'row', gap: spacing.sm, flexWrap: 'wrap'},
|
|
9
10
|
btn: {
|
|
10
11
|
padding: spacing.sm,
|
|
11
12
|
borderRadius: radii.sm,
|
|
12
|
-
borderWidth:
|
|
13
|
+
borderWidth: borders.hairline,
|
|
13
14
|
borderStyle: 'solid',
|
|
14
15
|
cursor: 'pointer',
|
|
15
16
|
},
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {
|
|
3
|
+
import {microSpacing, radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {shadows} from '@duro-app/tokens/tokens/shadows.css'
|
|
6
|
-
import {easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
7
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
8
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
7
9
|
|
|
8
10
|
const enter = css.keyframes({
|
|
9
11
|
from: {opacity: 0, transform: 'translateY(10px)'},
|
|
@@ -31,17 +33,17 @@ export const styles = css.create({
|
|
|
31
33
|
pointerEvents: 'auto',
|
|
32
34
|
boxSizing: 'border-box',
|
|
33
35
|
width: '100%',
|
|
34
|
-
maxWidth:
|
|
36
|
+
maxWidth: sizes.toastMaxW,
|
|
35
37
|
display: 'flex',
|
|
36
38
|
flexDirection: 'row',
|
|
37
39
|
alignItems: 'flex-start',
|
|
38
40
|
gap: spacing.sm,
|
|
39
41
|
padding: spacing.md,
|
|
40
42
|
borderRadius: radii.sm,
|
|
41
|
-
borderWidth:
|
|
43
|
+
borderWidth: borders.hairline,
|
|
42
44
|
borderStyle: 'solid',
|
|
43
45
|
borderColor: colors.border,
|
|
44
|
-
borderLeftWidth:
|
|
46
|
+
borderLeftWidth: borders.accent,
|
|
45
47
|
backgroundColor: colors.bgCard,
|
|
46
48
|
boxShadow: shadows.lg,
|
|
47
49
|
color: colors.text,
|
|
@@ -51,7 +53,7 @@ export const styles = css.create({
|
|
|
51
53
|
default: enter,
|
|
52
54
|
'@media (prefers-reduced-motion: reduce)': 'none',
|
|
53
55
|
},
|
|
54
|
-
animationDuration:
|
|
56
|
+
animationDuration: duration.brisk,
|
|
55
57
|
animationTimingFunction: easing.easeOut,
|
|
56
58
|
},
|
|
57
59
|
success: {borderLeftColor: colors.successBorder},
|
|
@@ -63,7 +65,7 @@ export const styles = css.create({
|
|
|
63
65
|
display: 'flex',
|
|
64
66
|
alignItems: 'center',
|
|
65
67
|
justifyContent: 'center',
|
|
66
|
-
paddingTop:
|
|
68
|
+
paddingTop: microSpacing.px1,
|
|
67
69
|
},
|
|
68
70
|
iconSuccess: {color: colors.successText},
|
|
69
71
|
iconError: {color: colors.errorText},
|
|
@@ -74,14 +76,14 @@ export const styles = css.create({
|
|
|
74
76
|
minWidth: 0,
|
|
75
77
|
display: 'flex',
|
|
76
78
|
flexDirection: 'column',
|
|
77
|
-
gap:
|
|
79
|
+
gap: microSpacing.px2,
|
|
78
80
|
},
|
|
79
81
|
message: {
|
|
80
82
|
color: colors.text,
|
|
81
83
|
},
|
|
82
84
|
action: {
|
|
83
85
|
alignSelf: 'flex-start',
|
|
84
|
-
marginTop:
|
|
86
|
+
marginTop: microSpacing.px2,
|
|
85
87
|
padding: 0,
|
|
86
88
|
borderWidth: 0,
|
|
87
89
|
backgroundColor: 'transparent',
|
|
@@ -91,9 +93,9 @@ export const styles = css.create({
|
|
|
91
93
|
textDecorationLine: 'underline',
|
|
92
94
|
cursor: 'pointer',
|
|
93
95
|
outlineStyle: {default: 'none', ':focus-visible': 'solid'},
|
|
94
|
-
outlineWidth:
|
|
96
|
+
outlineWidth: borders.focusRing,
|
|
95
97
|
outlineColor: colors.accent,
|
|
96
|
-
outlineOffset:
|
|
98
|
+
outlineOffset: borders.focusOffset,
|
|
97
99
|
borderRadius: radii.sm,
|
|
98
100
|
},
|
|
99
101
|
closeBtn: {
|
|
@@ -101,7 +103,7 @@ export const styles = css.create({
|
|
|
101
103
|
display: 'flex',
|
|
102
104
|
alignItems: 'center',
|
|
103
105
|
justifyContent: 'center',
|
|
104
|
-
padding:
|
|
106
|
+
padding: microSpacing.px2,
|
|
105
107
|
marginTop: -1,
|
|
106
108
|
borderWidth: 0,
|
|
107
109
|
backgroundColor: 'transparent',
|
|
@@ -109,8 +111,8 @@ export const styles = css.create({
|
|
|
109
111
|
cursor: 'pointer',
|
|
110
112
|
borderRadius: radii.sm,
|
|
111
113
|
outlineStyle: {default: 'none', ':focus-visible': 'solid'},
|
|
112
|
-
outlineWidth:
|
|
114
|
+
outlineWidth: borders.focusRing,
|
|
113
115
|
outlineColor: colors.accent,
|
|
114
|
-
outlineOffset:
|
|
116
|
+
outlineOffset: borders.focusOffsetSm,
|
|
115
117
|
},
|
|
116
118
|
})
|
|
@@ -2,7 +2,7 @@ import type {ComponentMeta} from '../component-meta'
|
|
|
2
2
|
|
|
3
3
|
export const meta: ComponentMeta = {
|
|
4
4
|
description:
|
|
5
|
-
'Toggle button with pressed/unpressed state. Works standalone or within ToggleGroup for multi/single selection. Under a coarse pointer (touch) every Toggle is at least
|
|
5
|
+
'Toggle button with pressed/unpressed state. Works standalone or within ToggleGroup for multi/single selection. Under a coarse pointer (touch) every Toggle is at least sizes.touchTarget (44px) square; in a wrapping ToggleGroup each keeps its own border and a fixed row height.',
|
|
6
6
|
whenToUse: [
|
|
7
7
|
'Toolbar buttons that toggle on/off (bold, italic, grid view)',
|
|
8
8
|
'Within ToggleGroup for selecting from visible options',
|
|
@@ -3,13 +3,15 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
3
3
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
7
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
8
|
|
|
7
9
|
export const styles = css.create({
|
|
8
10
|
base: {
|
|
9
11
|
display: 'inline-flex',
|
|
10
12
|
alignItems: 'center',
|
|
11
13
|
justifyContent: 'center',
|
|
12
|
-
borderWidth:
|
|
14
|
+
borderWidth: borders.hairline,
|
|
13
15
|
borderStyle: 'solid',
|
|
14
16
|
cursor: 'pointer',
|
|
15
17
|
fontFamily: typography.fontFamily,
|
|
@@ -17,12 +19,12 @@ export const styles = css.create({
|
|
|
17
19
|
transitionProperty: 'background-color, border-color, color, opacity',
|
|
18
20
|
transitionDuration: duration.fast,
|
|
19
21
|
transitionTimingFunction: easing.standard,
|
|
20
|
-
outlineWidth: {default: 0, ':focus-visible':
|
|
22
|
+
outlineWidth: {default: 0, ':focus-visible': borders.focusRing},
|
|
21
23
|
outlineStyle: 'solid',
|
|
22
24
|
outlineColor: colors.accent,
|
|
23
|
-
outlineOffset:
|
|
24
|
-
minWidth: {default: null, '@media (pointer: coarse)':
|
|
25
|
-
minHeight: {default: null, '@media (pointer: coarse)':
|
|
25
|
+
outlineOffset: borders.focusOffset,
|
|
26
|
+
minWidth: {default: null, '@media (pointer: coarse)': sizes.touchTarget},
|
|
27
|
+
minHeight: {default: null, '@media (pointer: coarse)': sizes.touchTarget},
|
|
26
28
|
},
|
|
27
29
|
sizeDefault: {
|
|
28
30
|
padding: `${spacing.sm} ${spacing.md}`,
|
|
@@ -36,15 +38,15 @@ export const styles = css.create({
|
|
|
36
38
|
borderRadius: radii.sm,
|
|
37
39
|
gap: spacing.xs,
|
|
38
40
|
},
|
|
39
|
-
// wrapped toggles: a fixed block size per size,
|
|
40
|
-
//
|
|
41
|
+
// wrapped toggles: a fixed block size per size, the touch target under a
|
|
42
|
+
// coarse pointer. ToggleGroup's maxRows arithmetic reads the same tokens.
|
|
41
43
|
wrappedDefault: {
|
|
42
44
|
boxSizing: 'border-box',
|
|
43
|
-
height: {default:
|
|
45
|
+
height: {default: sizes.controlMd, '@media (pointer: coarse)': sizes.touchTarget},
|
|
44
46
|
},
|
|
45
47
|
wrappedSmall: {
|
|
46
48
|
boxSizing: 'border-box',
|
|
47
|
-
height: {default:
|
|
49
|
+
height: {default: sizes.controlSm, '@media (pointer: coarse)': sizes.touchTarget},
|
|
48
50
|
},
|
|
49
51
|
unpressed: {
|
|
50
52
|
backgroundColor: {
|
|
@@ -68,7 +70,7 @@ export const styles = css.create({
|
|
|
68
70
|
grouped: {
|
|
69
71
|
borderWidth: 0,
|
|
70
72
|
borderRadius: 0,
|
|
71
|
-
borderRightWidth:
|
|
73
|
+
borderRightWidth: borders.hairline,
|
|
72
74
|
borderRightStyle: 'solid',
|
|
73
75
|
// Override any borderColor set by pressed state — dividers always use border token
|
|
74
76
|
borderColor: colors.border,
|
|
@@ -6,7 +6,7 @@ export const meta: ComponentMeta = {
|
|
|
6
6
|
whenToUse: [
|
|
7
7
|
'Visible option set where user picks one or more (view mode, filter categories)',
|
|
8
8
|
'Segmented control pattern',
|
|
9
|
-
'A visible grid of icon choices: wrap + maxRows (rows scroll past maxRows, one tab stop with arrow keys, 44px touch targets)',
|
|
9
|
+
'A visible grid of icon choices: wrap + maxRows (rows scroll past maxRows, one tab stop with arrow keys, sizes.touchTarget (44px) touch targets)',
|
|
10
10
|
],
|
|
11
11
|
whenNotToUse: [
|
|
12
12
|
'Dropdown selection — use Select',
|
|
@@ -4,8 +4,9 @@ import {css, html} from 'react-strict-dom'
|
|
|
4
4
|
import {ToggleGroup} from './ToggleGroup'
|
|
5
5
|
import {Toggle} from '../Toggle/Toggle'
|
|
6
6
|
import {Icon, type IconName} from '../Icon'
|
|
7
|
-
import {
|
|
7
|
+
import {SIZES_PX} from '@duro-app/tokens/keys'
|
|
8
8
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
9
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
9
10
|
|
|
10
11
|
const meta: Meta<typeof ToggleGroup> = {
|
|
11
12
|
title: 'Components/ToggleGroup',
|
|
@@ -207,7 +208,7 @@ const ICON_NAMES: IconName[] = [
|
|
|
207
208
|
]
|
|
208
209
|
|
|
209
210
|
const iconStyles = css.create({
|
|
210
|
-
frame: {width:
|
|
211
|
+
frame: {width: sizes.panelSm},
|
|
211
212
|
})
|
|
212
213
|
|
|
213
214
|
function IconChoices({
|
|
@@ -268,10 +269,10 @@ export const FiveIcons: Story = {
|
|
|
268
269
|
render: () => <IconChoices names={ICON_NAMES.slice(0, 5)} pressed={ICON_NAMES[0]} />,
|
|
269
270
|
play: async ({canvas}) => {
|
|
270
271
|
const group = canvas.getByRole('toolbar')
|
|
271
|
-
await expect(group.getBoundingClientRect().height).toBe(
|
|
272
|
-
// exact: Toggle's styles
|
|
272
|
+
await expect(group.getBoundingClientRect().height).toBe(SIZES_PX.controlSm)
|
|
273
|
+
// exact: Toggle's styles read the same size tokens, and a drift must fail here
|
|
273
274
|
const toggle = canvas.getAllByRole('button')[0].getBoundingClientRect()
|
|
274
|
-
await expect(Math.abs(toggle.height -
|
|
275
|
+
await expect(Math.abs(toggle.height - SIZES_PX.controlSm)).toBeLessThanOrEqual(0.5)
|
|
275
276
|
},
|
|
276
277
|
}
|
|
277
278
|
|
|
@@ -311,6 +312,6 @@ export const DefaultSizeRows: Story = {
|
|
|
311
312
|
),
|
|
312
313
|
play: async ({canvas}) => {
|
|
313
314
|
const toggle = canvas.getAllByRole('button')[0].getBoundingClientRect()
|
|
314
|
-
await expect(Math.abs(toggle.height -
|
|
315
|
+
await expect(Math.abs(toggle.height - SIZES_PX.controlMd)).toBeLessThanOrEqual(0.5)
|
|
315
316
|
},
|
|
316
317
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
|
-
import {ROW_HEIGHT} from '../Toggle/rowHeight'
|
|
3
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
4
3
|
import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
5
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
5
6
|
|
|
6
7
|
export const styles = css.create({
|
|
7
8
|
root: {
|
|
8
9
|
display: 'inline-flex',
|
|
9
10
|
borderRadius: radii.sm,
|
|
10
|
-
borderWidth:
|
|
11
|
+
borderWidth: borders.hairline,
|
|
11
12
|
borderStyle: 'solid',
|
|
12
13
|
borderColor: colors.border,
|
|
13
14
|
overflow: 'hidden',
|
|
@@ -30,14 +31,14 @@ export const styles = css.create({
|
|
|
30
31
|
// sizes itself (max, not fixed). Row heights match the wrapped Toggles.
|
|
31
32
|
maxRowsSmall: (rows: number) => ({
|
|
32
33
|
maxHeight: {
|
|
33
|
-
default: `calc((${rows} + 0.5) * ${
|
|
34
|
-
'@media (pointer: coarse)': `calc((${rows} + 0.5) * ${
|
|
34
|
+
default: `calc((${rows} + 0.5) * ${sizes.controlSm} + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
|
|
35
|
+
'@media (pointer: coarse)': `calc((${rows} + 0.5) * ${sizes.touchTarget} + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
|
|
35
36
|
},
|
|
36
37
|
}),
|
|
37
38
|
maxRowsDefault: (rows: number) => ({
|
|
38
39
|
maxHeight: {
|
|
39
|
-
default: `calc((${rows} + 0.5) * ${
|
|
40
|
-
'@media (pointer: coarse)': `calc((${rows} + 0.5) * ${
|
|
40
|
+
default: `calc((${rows} + 0.5) * ${sizes.controlMd} + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
|
|
41
|
+
'@media (pointer: coarse)': `calc((${rows} + 0.5) * ${sizes.touchTarget} + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
|
|
41
42
|
},
|
|
42
43
|
}),
|
|
43
44
|
vertical: {
|
|
@@ -3,6 +3,7 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
3
3
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {shadows} from '@duro-app/tokens/tokens/shadows.css'
|
|
6
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
7
|
|
|
7
8
|
export const styles = css.create({
|
|
8
9
|
root: {
|
|
@@ -22,7 +23,7 @@ export const styles = css.create({
|
|
|
22
23
|
fontSize: typography.fontSizeXs,
|
|
23
24
|
lineHeight: typography.lineHeight,
|
|
24
25
|
borderRadius: radii.sm,
|
|
25
|
-
borderWidth:
|
|
26
|
+
borderWidth: borders.hairline,
|
|
26
27
|
borderStyle: 'solid',
|
|
27
28
|
borderColor: colors.border,
|
|
28
29
|
boxShadow: shadows.md,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {
|
|
3
|
+
import {microSpacing, radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
5
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
7
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
8
|
|
|
7
9
|
export const styles = css.create({
|
|
8
10
|
root: {
|
|
@@ -32,8 +34,8 @@ export const styles = css.create({
|
|
|
32
34
|
display: 'flex',
|
|
33
35
|
alignItems: 'center',
|
|
34
36
|
gap: spacing.xs,
|
|
35
|
-
paddingTop:
|
|
36
|
-
paddingBottom:
|
|
37
|
+
paddingTop: microSpacing.px5,
|
|
38
|
+
paddingBottom: microSpacing.px5,
|
|
37
39
|
paddingRight: spacing.sm,
|
|
38
40
|
fontFamily: typography.fontFamily,
|
|
39
41
|
fontSize: typography.fontSizeSm,
|
|
@@ -53,10 +55,10 @@ export const styles = css.create({
|
|
|
53
55
|
paddingLeft: `calc(${spacing.sm} + ${Math.max(0, level - 1)} * ${spacing.lg})`,
|
|
54
56
|
}),
|
|
55
57
|
rowFocused: {
|
|
56
|
-
outlineWidth:
|
|
58
|
+
outlineWidth: borders.focusRing,
|
|
57
59
|
outlineStyle: 'solid',
|
|
58
60
|
outlineColor: colors.accent,
|
|
59
|
-
outlineOffset: -
|
|
61
|
+
outlineOffset: `calc(-1 * ${borders.focusOffset})`,
|
|
60
62
|
},
|
|
61
63
|
rowSelected: {
|
|
62
64
|
color: colors.accent,
|
|
@@ -67,7 +69,7 @@ export const styles = css.create({
|
|
|
67
69
|
display: 'inline-flex',
|
|
68
70
|
alignItems: 'center',
|
|
69
71
|
justifyContent: 'center',
|
|
70
|
-
width:
|
|
72
|
+
width: sizes.glyphMd,
|
|
71
73
|
flexShrink: 0,
|
|
72
74
|
color: colors.textMuted,
|
|
73
75
|
transitionProperty: 'transform',
|