@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
|
@@ -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: {
|
|
@@ -19,9 +21,9 @@ export const styles = css.create({
|
|
|
19
21
|
cursor: 'not-allowed',
|
|
20
22
|
},
|
|
21
23
|
box: {
|
|
22
|
-
width:
|
|
23
|
-
height:
|
|
24
|
-
borderWidth:
|
|
24
|
+
width: sizes.indicator,
|
|
25
|
+
height: sizes.indicator,
|
|
26
|
+
borderWidth: borders.hairline,
|
|
25
27
|
borderStyle: 'solid',
|
|
26
28
|
borderRadius: radii.xs,
|
|
27
29
|
display: 'inline-flex',
|
|
@@ -47,12 +49,12 @@ export const styles = css.create({
|
|
|
47
49
|
// rotated 45° into a tick. Pure CSS (RSD translates the transform string to
|
|
48
50
|
// an RN transform), so no SVG / react-native-svg weight reaches web.
|
|
49
51
|
checkmark: {
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
52
|
-
borderRightWidth:
|
|
52
|
+
width: sizes.checkMarkW,
|
|
53
|
+
height: sizes.checkMarkH,
|
|
54
|
+
borderRightWidth: borders.strong,
|
|
53
55
|
borderRightStyle: 'solid',
|
|
54
56
|
borderRightColor: colors.accentContrast,
|
|
55
|
-
borderBottomWidth:
|
|
57
|
+
borderBottomWidth: borders.strong,
|
|
56
58
|
borderBottomStyle: 'solid',
|
|
57
59
|
borderBottomColor: colors.accentContrast,
|
|
58
60
|
transform: 'rotate(45deg)',
|
|
@@ -77,12 +79,9 @@ export const styles = css.create({
|
|
|
77
79
|
backgroundColor: 'transparent',
|
|
78
80
|
padding: 0,
|
|
79
81
|
},
|
|
82
|
+
// Layered on visuallyHidden.base: a native input is also made transparent.
|
|
80
83
|
input: {
|
|
81
|
-
position: 'absolute',
|
|
82
|
-
width: 1,
|
|
83
|
-
height: 1,
|
|
84
84
|
opacity: 0,
|
|
85
|
-
overflow: 'hidden',
|
|
86
85
|
},
|
|
87
86
|
// RSD-native only honors display:'flex' (not 'inline-flex'). Layered on
|
|
88
87
|
// native via `isNative` (on both .root and .box); web keeps inline-flex.
|
|
@@ -5,6 +5,7 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
5
5
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
6
6
|
import {SPACING_KEYS} from '@duro-app/tokens/keys'
|
|
7
7
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
8
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
8
9
|
|
|
9
10
|
const meta: Meta<typeof Cluster> = {
|
|
10
11
|
title: 'Layout/Cluster',
|
|
@@ -41,7 +42,7 @@ const localStyles = css.create({
|
|
|
41
42
|
whiteSpace: 'nowrap',
|
|
42
43
|
},
|
|
43
44
|
narrow: {
|
|
44
|
-
maxWidth:
|
|
45
|
+
maxWidth: sizes.gridColMd,
|
|
45
46
|
},
|
|
46
47
|
})
|
|
47
48
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
3
|
+
import {microSpacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
5
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
4
6
|
|
|
5
7
|
export const styles = css.create({
|
|
6
8
|
base: {
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
9
|
-
padding:
|
|
9
|
+
width: sizes.swatchW,
|
|
10
|
+
height: sizes.swatchH,
|
|
11
|
+
padding: microSpacing.px2,
|
|
10
12
|
backgroundColor: colors.bg,
|
|
11
|
-
borderWidth:
|
|
13
|
+
borderWidth: borders.hairline,
|
|
12
14
|
borderStyle: 'solid',
|
|
13
15
|
borderColor: {
|
|
14
16
|
default: colors.border,
|
|
@@ -18,7 +20,7 @@ export const styles = css.create({
|
|
|
18
20
|
cursor: 'pointer',
|
|
19
21
|
outlineWidth: {
|
|
20
22
|
default: 0,
|
|
21
|
-
':focus-visible':
|
|
23
|
+
':focus-visible': borders.focusRing,
|
|
22
24
|
},
|
|
23
25
|
outlineStyle: {
|
|
24
26
|
default: 'none',
|
|
@@ -28,7 +30,7 @@ export const styles = css.create({
|
|
|
28
30
|
default: 'transparent',
|
|
29
31
|
':focus-visible': colors.accent,
|
|
30
32
|
},
|
|
31
|
-
outlineOffset:
|
|
33
|
+
outlineOffset: borders.focusOffsetSm,
|
|
32
34
|
},
|
|
33
35
|
invalid: {
|
|
34
36
|
borderColor: colors.error,
|
|
@@ -2,6 +2,7 @@ import {css} from 'react-strict-dom'
|
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
3
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
5
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
5
6
|
|
|
6
7
|
export const styles = css.create({
|
|
7
8
|
button: {
|
|
@@ -9,7 +10,7 @@ export const styles = css.create({
|
|
|
9
10
|
alignItems: 'center',
|
|
10
11
|
justifyContent: 'center',
|
|
11
12
|
padding: spacing.sm,
|
|
12
|
-
borderWidth:
|
|
13
|
+
borderWidth: borders.hairline,
|
|
13
14
|
borderStyle: 'solid',
|
|
14
15
|
borderColor: {
|
|
15
16
|
default: colors.border,
|
|
@@ -25,9 +26,9 @@ export const styles = css.create({
|
|
|
25
26
|
transitionProperty: 'background-color, border-color, color',
|
|
26
27
|
transitionDuration: duration.fast,
|
|
27
28
|
transitionTimingFunction: easing.standard,
|
|
28
|
-
outlineWidth: {default: 0, ':focus-visible':
|
|
29
|
+
outlineWidth: {default: 0, ':focus-visible': borders.focusRing},
|
|
29
30
|
outlineStyle: 'solid',
|
|
30
31
|
outlineColor: colors.accent,
|
|
31
|
-
outlineOffset:
|
|
32
|
+
outlineOffset: borders.focusOffset,
|
|
32
33
|
},
|
|
33
34
|
})
|
|
@@ -4,6 +4,8 @@ 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
6
|
import {duration} 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
|
export const styles = css.create({
|
|
9
11
|
root: {
|
|
@@ -17,7 +19,7 @@ export const styles = css.create({
|
|
|
17
19
|
paddingLeft: spacing.md,
|
|
18
20
|
paddingRight: spacing.xs,
|
|
19
21
|
backgroundColor: colors.bgCard,
|
|
20
|
-
borderWidth:
|
|
22
|
+
borderWidth: borders.hairline,
|
|
21
23
|
borderStyle: 'solid',
|
|
22
24
|
borderColor: {
|
|
23
25
|
default: colors.border,
|
|
@@ -71,14 +73,14 @@ export const styles = css.create({
|
|
|
71
73
|
// ancestor with `overflow: hidden` or `transform` (e.g. inside a Dialog).
|
|
72
74
|
position: 'fixed',
|
|
73
75
|
backgroundColor: colors.bgCard,
|
|
74
|
-
borderWidth:
|
|
76
|
+
borderWidth: borders.hairline,
|
|
75
77
|
borderStyle: 'solid',
|
|
76
78
|
borderColor: colors.border,
|
|
77
79
|
borderRadius: radii.sm,
|
|
78
80
|
boxShadow: shadows.md,
|
|
79
81
|
paddingTop: spacing.xs,
|
|
80
82
|
paddingBottom: spacing.xs,
|
|
81
|
-
maxHeight:
|
|
83
|
+
maxHeight: sizes.listMaxHSm,
|
|
82
84
|
overflowY: 'auto',
|
|
83
85
|
zIndex: 1050,
|
|
84
86
|
// Re-enable pointer events: the portal mount is pointer-events: none so
|
|
@@ -11,6 +11,8 @@ import {Inline} from '../Inline/Inline'
|
|
|
11
11
|
import {Badge} from '../Badge/Badge'
|
|
12
12
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
13
13
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
14
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
15
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
14
16
|
|
|
15
17
|
const meta: Meta = {
|
|
16
18
|
title: 'Components/DetailPanel',
|
|
@@ -22,8 +24,8 @@ type Story = StoryObj
|
|
|
22
24
|
const layoutStyles = css.create({
|
|
23
25
|
container: {
|
|
24
26
|
display: 'flex',
|
|
25
|
-
height:
|
|
26
|
-
borderWidth:
|
|
27
|
+
height: sizes.dialogSm,
|
|
28
|
+
borderWidth: borders.hairline,
|
|
27
29
|
borderStyle: 'solid',
|
|
28
30
|
borderColor: colors.border,
|
|
29
31
|
},
|
|
@@ -117,7 +119,7 @@ const tableStyles = css.create({
|
|
|
117
119
|
paddingBottom: spacing.sm,
|
|
118
120
|
paddingLeft: spacing.md,
|
|
119
121
|
paddingRight: spacing.md,
|
|
120
|
-
borderBottomWidth:
|
|
122
|
+
borderBottomWidth: borders.hairline,
|
|
121
123
|
borderBottomStyle: 'solid',
|
|
122
124
|
borderBottomColor: colors.border,
|
|
123
125
|
},
|
|
@@ -17,7 +17,10 @@ import {styles} from './styles.css'
|
|
|
17
17
|
|
|
18
18
|
const closeDurationMap = {
|
|
19
19
|
instant: styles.closeDurationInstant,
|
|
20
|
+
minimal: styles.closeDurationMinimal,
|
|
21
|
+
quick: styles.closeDurationQuick,
|
|
20
22
|
fast: styles.closeDurationFast,
|
|
23
|
+
brisk: styles.closeDurationBrisk,
|
|
21
24
|
base: styles.closeDurationBase,
|
|
22
25
|
slow: styles.closeDurationSlow,
|
|
23
26
|
} as const satisfies Record<DurationToken, unknown>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {css} from 'react-strict-dom'
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
-
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
3
|
+
import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {shadows} from '@duro-app/tokens/tokens/shadows.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 {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
8
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
6
9
|
|
|
7
10
|
// The "Apple ease" curves and the 280ms open live in the shared motion tokens
|
|
8
11
|
// (easing.easeOut/easeIn, duration.slow). The close is duration.base, and the
|
|
@@ -62,7 +65,7 @@ export const styles = css.create({
|
|
|
62
65
|
display: 'flex',
|
|
63
66
|
flexDirection: 'column',
|
|
64
67
|
backgroundColor: colors.bgCard,
|
|
65
|
-
borderLeftWidth:
|
|
68
|
+
borderLeftWidth: borders.hairline,
|
|
66
69
|
borderLeftStyle: 'solid',
|
|
67
70
|
borderLeftColor: colors.border,
|
|
68
71
|
boxShadow: shadows.sm,
|
|
@@ -70,8 +73,8 @@ export const styles = css.create({
|
|
|
70
73
|
},
|
|
71
74
|
|
|
72
75
|
// Content must maintain its target width even while wrapper is narrower
|
|
73
|
-
contentSm: {width:
|
|
74
|
-
contentMd: {width:
|
|
76
|
+
contentSm: {width: sizes.panelSm},
|
|
77
|
+
contentMd: {width: sizes.panelMd},
|
|
75
78
|
|
|
76
79
|
// --- Content slide + fade animations ---
|
|
77
80
|
slideIn: {
|
|
@@ -109,7 +112,10 @@ export const styles = css.create({
|
|
|
109
112
|
// The closeAnimationDuration prop token drives both these and the unmount
|
|
110
113
|
// timeout, so the exit animation can never race the unmount.
|
|
111
114
|
closeDurationInstant: {animationDuration: duration.instant},
|
|
115
|
+
closeDurationMinimal: {animationDuration: duration.minimal},
|
|
116
|
+
closeDurationQuick: {animationDuration: duration.quick},
|
|
112
117
|
closeDurationFast: {animationDuration: duration.fast},
|
|
118
|
+
closeDurationBrisk: {animationDuration: duration.brisk},
|
|
113
119
|
closeDurationBase: {animationDuration: duration.base},
|
|
114
120
|
closeDurationSlow: {animationDuration: duration.slow},
|
|
115
121
|
|
|
@@ -123,15 +129,15 @@ export const styles = css.create({
|
|
|
123
129
|
paddingRight: spacing.lg,
|
|
124
130
|
paddingBottom: spacing.lg,
|
|
125
131
|
gap: spacing.md,
|
|
126
|
-
borderBottomWidth:
|
|
132
|
+
borderBottomWidth: borders.hairline,
|
|
127
133
|
borderBottomStyle: 'solid',
|
|
128
134
|
borderBottomColor: colors.border,
|
|
129
135
|
},
|
|
130
136
|
|
|
131
137
|
// --- Title ---
|
|
132
138
|
title: {
|
|
133
|
-
fontSize:
|
|
134
|
-
fontWeight:
|
|
139
|
+
fontSize: typography.fontSizeLg,
|
|
140
|
+
fontWeight: typography.fontWeightSemibold,
|
|
135
141
|
lineHeight: 1.4,
|
|
136
142
|
color: colors.text,
|
|
137
143
|
margin: 0,
|
|
@@ -166,7 +172,7 @@ export const styles = css.create({
|
|
|
166
172
|
paddingBottom: spacing.md,
|
|
167
173
|
paddingLeft: spacing.lg,
|
|
168
174
|
paddingRight: spacing.lg,
|
|
169
|
-
borderTopWidth:
|
|
175
|
+
borderTopWidth: borders.hairline,
|
|
170
176
|
borderTopStyle: 'solid',
|
|
171
177
|
borderTopColor: colors.border,
|
|
172
178
|
},
|
|
@@ -176,9 +182,9 @@ export const styles = css.create({
|
|
|
176
182
|
display: 'flex',
|
|
177
183
|
alignItems: 'center',
|
|
178
184
|
justifyContent: 'center',
|
|
179
|
-
width:
|
|
180
|
-
height:
|
|
181
|
-
borderRadius:
|
|
185
|
+
width: sizes.iconButton,
|
|
186
|
+
height: sizes.iconButton,
|
|
187
|
+
borderRadius: radii.sm,
|
|
182
188
|
borderWidth: 0,
|
|
183
189
|
backgroundColor: {
|
|
184
190
|
default: 'transparent',
|
|
@@ -12,6 +12,7 @@ import {Field} from '../Field/Field'
|
|
|
12
12
|
import {Select} from '../Select/Select'
|
|
13
13
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
14
14
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
15
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
15
16
|
|
|
16
17
|
const meta: Meta = {
|
|
17
18
|
title: 'Components/Dialog',
|
|
@@ -334,7 +335,7 @@ const barStyles = css.create({
|
|
|
334
335
|
bar: {
|
|
335
336
|
transform: 'translateZ(0)',
|
|
336
337
|
padding: spacing.sm,
|
|
337
|
-
borderWidth:
|
|
338
|
+
borderWidth: borders.hairline,
|
|
338
339
|
borderStyle: 'solid',
|
|
339
340
|
borderColor: colors.border,
|
|
340
341
|
},
|
|
@@ -21,7 +21,10 @@ export type DialogSize = 'sm' | 'md' | 'lg'
|
|
|
21
21
|
|
|
22
22
|
const closeDurationMap = {
|
|
23
23
|
instant: styles.closeDurationInstant,
|
|
24
|
+
minimal: styles.closeDurationMinimal,
|
|
25
|
+
quick: styles.closeDurationQuick,
|
|
24
26
|
fast: styles.closeDurationFast,
|
|
27
|
+
brisk: styles.closeDurationBrisk,
|
|
25
28
|
base: styles.closeDurationBase,
|
|
26
29
|
slow: styles.closeDurationSlow,
|
|
27
30
|
} as const satisfies Record<DurationToken, unknown>
|
|
@@ -4,13 +4,15 @@ 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
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
|
export const styles = css.create({
|
|
9
11
|
// --- Backdrop ---
|
|
10
12
|
backdrop: {
|
|
11
13
|
position: 'fixed',
|
|
12
14
|
inset: 0,
|
|
13
|
-
backgroundColor:
|
|
15
|
+
backgroundColor: colors.scrim,
|
|
14
16
|
zIndex: 1000,
|
|
15
17
|
// Portaled into the ThemeProvider mount, which is pointer-events: none:
|
|
16
18
|
// the backdrop must take clicks back (outside click dismisses).
|
|
@@ -62,7 +64,7 @@ export const styles = css.create({
|
|
|
62
64
|
flexDirection: 'column',
|
|
63
65
|
overflow: 'hidden',
|
|
64
66
|
pointerEvents: 'auto',
|
|
65
|
-
borderWidth:
|
|
67
|
+
borderWidth: borders.hairline,
|
|
66
68
|
borderStyle: 'solid',
|
|
67
69
|
borderColor: colors.border,
|
|
68
70
|
},
|
|
@@ -103,14 +105,17 @@ export const styles = css.create({
|
|
|
103
105
|
// The closeAnimationDuration prop token drives both these and the unmount
|
|
104
106
|
// timeout, so the exit animation can never race the unmount.
|
|
105
107
|
closeDurationInstant: {animationDuration: duration.instant},
|
|
108
|
+
closeDurationMinimal: {animationDuration: duration.minimal},
|
|
109
|
+
closeDurationQuick: {animationDuration: duration.quick},
|
|
106
110
|
closeDurationFast: {animationDuration: duration.fast},
|
|
111
|
+
closeDurationBrisk: {animationDuration: duration.brisk},
|
|
107
112
|
closeDurationBase: {animationDuration: duration.base},
|
|
108
113
|
closeDurationSlow: {animationDuration: duration.slow},
|
|
109
114
|
|
|
110
115
|
// --- Sizes ---
|
|
111
|
-
sm: {maxWidth:
|
|
112
|
-
md: {maxWidth:
|
|
113
|
-
lg: {maxWidth:
|
|
116
|
+
sm: {maxWidth: sizes.dialogSm},
|
|
117
|
+
md: {maxWidth: sizes.dialogMd},
|
|
118
|
+
lg: {maxWidth: sizes.dialogLg},
|
|
114
119
|
|
|
115
120
|
// --- Header ---
|
|
116
121
|
header: {
|
|
@@ -163,7 +168,7 @@ export const styles = css.create({
|
|
|
163
168
|
paddingLeft: spacing.lg,
|
|
164
169
|
paddingRight: spacing.lg,
|
|
165
170
|
paddingBottom: spacing.lg,
|
|
166
|
-
borderTopWidth:
|
|
171
|
+
borderTopWidth: borders.hairline,
|
|
167
172
|
borderTopStyle: 'solid',
|
|
168
173
|
borderTopColor: colors.border,
|
|
169
174
|
},
|
|
@@ -173,8 +178,8 @@ export const styles = css.create({
|
|
|
173
178
|
display: 'flex',
|
|
174
179
|
alignItems: 'center',
|
|
175
180
|
justifyContent: 'center',
|
|
176
|
-
width:
|
|
177
|
-
height:
|
|
181
|
+
width: sizes.iconButton,
|
|
182
|
+
height: sizes.iconButton,
|
|
178
183
|
borderRadius: radii.sm,
|
|
179
184
|
borderWidth: 0,
|
|
180
185
|
backgroundColor: {
|
|
@@ -196,6 +201,6 @@ export const styles = css.create({
|
|
|
196
201
|
|
|
197
202
|
// --- Reduced motion ---
|
|
198
203
|
reducedMotion: {
|
|
199
|
-
animationDuration:
|
|
204
|
+
animationDuration: duration.minimal,
|
|
200
205
|
},
|
|
201
206
|
})
|
|
@@ -11,6 +11,7 @@ import {Tag} from '../Tag/Tag'
|
|
|
11
11
|
import {Text} from '../Text/Text'
|
|
12
12
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
13
13
|
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
14
|
+
import {borders} from '@duro-app/tokens/tokens/borders.css'
|
|
14
15
|
|
|
15
16
|
const meta: Meta<typeof DragDrop.Root> = {
|
|
16
17
|
title: 'Interaction/DragDrop',
|
|
@@ -24,7 +25,7 @@ const localStyles = css.create({
|
|
|
24
25
|
zone: {
|
|
25
26
|
padding: spacing.md,
|
|
26
27
|
minHeight: spacing.xxl,
|
|
27
|
-
borderWidth:
|
|
28
|
+
borderWidth: borders.hairline,
|
|
28
29
|
borderStyle: 'dashed',
|
|
29
30
|
borderColor: colors.border,
|
|
30
31
|
borderRadius: radii.sm,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import {html} from 'react-strict-dom'
|
|
12
12
|
import {styles} from './styles.css'
|
|
13
13
|
import {isNative} from '../../platform'
|
|
14
|
+
import {visuallyHidden} from '../../styles/visually-hidden.css'
|
|
14
15
|
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
16
17
|
// DragDrop — move items between zones with one pointer, on mouse, pen and
|
|
@@ -358,7 +359,7 @@ function Root<T = unknown>({onDrop, announce, children}: DragDropRootProps<T>) {
|
|
|
358
359
|
{drag.preview}
|
|
359
360
|
</html.div>
|
|
360
361
|
)}
|
|
361
|
-
<html.div role="status" aria-live="polite" aria-atomic style={
|
|
362
|
+
<html.div role="status" aria-live="polite" aria-atomic style={visuallyHidden.base}>
|
|
362
363
|
{announcement}
|
|
363
364
|
</html.div>
|
|
364
365
|
</RootContext.Provider>
|
|
@@ -52,11 +52,4 @@ export const styles = css.create({
|
|
|
52
52
|
height,
|
|
53
53
|
transform: `translate3d(${x}px, ${y}px, 0)`,
|
|
54
54
|
}),
|
|
55
|
-
// Same visually-hidden recipe as TagGroup's live region.
|
|
56
|
-
liveRegion: {
|
|
57
|
-
position: 'absolute',
|
|
58
|
-
width: 1,
|
|
59
|
-
height: 1,
|
|
60
|
-
overflow: 'hidden',
|
|
61
|
-
},
|
|
62
55
|
})
|
|
@@ -23,7 +23,10 @@ export type DrawerSize = 'sm' | 'md' | 'lg'
|
|
|
23
23
|
|
|
24
24
|
const closeDurationMap = {
|
|
25
25
|
instant: styles.closeDurationInstant,
|
|
26
|
+
minimal: styles.closeDurationMinimal,
|
|
27
|
+
quick: styles.closeDurationQuick,
|
|
26
28
|
fast: styles.closeDurationFast,
|
|
29
|
+
brisk: styles.closeDurationBrisk,
|
|
27
30
|
base: styles.closeDurationBase,
|
|
28
31
|
slow: styles.closeDurationSlow,
|
|
29
32
|
} as const satisfies Record<DurationToken, unknown>
|
|
@@ -5,7 +5,7 @@ import {Drawer} from './Drawer'
|
|
|
5
5
|
import {ToggleGroup} from '../ToggleGroup/ToggleGroup'
|
|
6
6
|
import {Toggle} from '../Toggle/Toggle'
|
|
7
7
|
import {Icon, type IconName} from '../Icon'
|
|
8
|
-
import {
|
|
8
|
+
import {SIZES_PX} from '@duro-app/tokens/keys'
|
|
9
9
|
|
|
10
10
|
const meta: Meta = {
|
|
11
11
|
title: 'Components/Drawer/Scroll',
|
|
@@ -282,11 +282,11 @@ export const CoarsePointerRows: Story = {
|
|
|
282
282
|
await cdpSend('Emulation.setTouchEmulationEnabled', {enabled: true, maxTouchPoints: 1})
|
|
283
283
|
await waitFor(() => expect(matchMedia('(pointer: coarse)').matches).toBe(true))
|
|
284
284
|
const viewport = getViewport()
|
|
285
|
-
const expected = 3.5 *
|
|
285
|
+
const expected = 3.5 * SIZES_PX.touchTarget + 3 * 4 + 2 * 4
|
|
286
286
|
await waitFor(() => expect(Math.abs(viewport.clientHeight - expected)).toBeLessThanOrEqual(2))
|
|
287
287
|
const toggle = viewport.querySelector('button')!.getBoundingClientRect()
|
|
288
|
-
// exact: Toggle's styles
|
|
289
|
-
await expect(Math.abs(toggle.height -
|
|
290
|
-
await expect(toggle.width).toBeGreaterThanOrEqual(
|
|
288
|
+
// exact: Toggle's styles read the same size tokens, and a drift must fail here
|
|
289
|
+
await expect(Math.abs(toggle.height - SIZES_PX.touchTarget)).toBeLessThanOrEqual(0.5)
|
|
290
|
+
await expect(toggle.width).toBeGreaterThanOrEqual(SIZES_PX.touchTarget)
|
|
291
291
|
},
|
|
292
292
|
}
|
|
@@ -4,13 +4,15 @@ 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
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
|
export const styles = css.create({
|
|
9
11
|
// --- Backdrop ---
|
|
10
12
|
backdrop: {
|
|
11
13
|
position: 'fixed',
|
|
12
14
|
inset: 0,
|
|
13
|
-
backgroundColor:
|
|
15
|
+
backgroundColor: colors.scrim,
|
|
14
16
|
zIndex: 1000,
|
|
15
17
|
// Portaled into the ThemeProvider mount, which is pointer-events: none:
|
|
16
18
|
// the backdrop must take clicks back (outside click dismisses).
|
|
@@ -77,13 +79,13 @@ export const styles = css.create({
|
|
|
77
79
|
panelHorizontal: {
|
|
78
80
|
width: '100%',
|
|
79
81
|
height: '100%',
|
|
80
|
-
borderLeftWidth:
|
|
82
|
+
borderLeftWidth: borders.hairline,
|
|
81
83
|
borderLeftStyle: 'solid',
|
|
82
84
|
borderLeftColor: colors.border,
|
|
83
85
|
},
|
|
84
86
|
panelVertical: {
|
|
85
87
|
width: '100%',
|
|
86
|
-
borderTopWidth:
|
|
88
|
+
borderTopWidth: borders.hairline,
|
|
87
89
|
borderTopStyle: 'solid',
|
|
88
90
|
borderTopColor: colors.border,
|
|
89
91
|
borderTopLeftRadius: radii.lg,
|
|
@@ -92,15 +94,15 @@ export const styles = css.create({
|
|
|
92
94
|
},
|
|
93
95
|
panelLeftBorder: {
|
|
94
96
|
borderLeftWidth: 0,
|
|
95
|
-
borderRightWidth:
|
|
97
|
+
borderRightWidth: borders.hairline,
|
|
96
98
|
borderRightStyle: 'solid',
|
|
97
99
|
borderRightColor: colors.border,
|
|
98
100
|
},
|
|
99
101
|
|
|
100
102
|
// --- Panel widths (horizontal anchors) ---
|
|
101
|
-
sm: {maxWidth:
|
|
102
|
-
md: {maxWidth:
|
|
103
|
-
lg: {maxWidth:
|
|
103
|
+
sm: {maxWidth: sizes.panelSm},
|
|
104
|
+
md: {maxWidth: sizes.panelMd},
|
|
105
|
+
lg: {maxWidth: sizes.panelLg},
|
|
104
106
|
|
|
105
107
|
// --- Slide animations: Right ---
|
|
106
108
|
slideInRight: {
|
|
@@ -166,7 +168,10 @@ export const styles = css.create({
|
|
|
166
168
|
// The closeAnimationDuration prop token drives both these and the unmount
|
|
167
169
|
// timeout, so the exit animation can never race the unmount.
|
|
168
170
|
closeDurationInstant: {animationDuration: duration.instant},
|
|
171
|
+
closeDurationMinimal: {animationDuration: duration.minimal},
|
|
172
|
+
closeDurationQuick: {animationDuration: duration.quick},
|
|
169
173
|
closeDurationFast: {animationDuration: duration.fast},
|
|
174
|
+
closeDurationBrisk: {animationDuration: duration.brisk},
|
|
170
175
|
closeDurationBase: {animationDuration: duration.base},
|
|
171
176
|
closeDurationSlow: {animationDuration: duration.slow},
|
|
172
177
|
|
|
@@ -221,7 +226,7 @@ export const styles = css.create({
|
|
|
221
226
|
paddingLeft: spacing.lg,
|
|
222
227
|
paddingRight: spacing.lg,
|
|
223
228
|
paddingBottom: spacing.lg,
|
|
224
|
-
borderTopWidth:
|
|
229
|
+
borderTopWidth: borders.hairline,
|
|
225
230
|
borderTopStyle: 'solid',
|
|
226
231
|
borderTopColor: colors.border,
|
|
227
232
|
},
|
|
@@ -231,8 +236,8 @@ export const styles = css.create({
|
|
|
231
236
|
display: 'flex',
|
|
232
237
|
alignItems: 'center',
|
|
233
238
|
justifyContent: 'center',
|
|
234
|
-
width:
|
|
235
|
-
height:
|
|
239
|
+
width: sizes.iconButton,
|
|
240
|
+
height: sizes.iconButton,
|
|
236
241
|
borderRadius: radii.sm,
|
|
237
242
|
borderWidth: 0,
|
|
238
243
|
backgroundColor: {
|
|
@@ -11,6 +11,7 @@ import {Checkbox} from '../Checkbox/Checkbox'
|
|
|
11
11
|
import {Stack} from '../Stack/Stack'
|
|
12
12
|
import {Fieldset} from '../Fieldset/Fieldset'
|
|
13
13
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
14
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
14
15
|
|
|
15
16
|
const meta: Meta = {
|
|
16
17
|
title: 'Components/Field',
|
|
@@ -70,8 +71,8 @@ export const WithError: Story = {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const stackStyles = css.create({
|
|
73
|
-
stack: {display: 'flex', flexDirection: 'column', gap: spacing.md, maxWidth:
|
|
74
|
-
stackWide: {display: 'flex', flexDirection: 'column', gap: spacing.md, maxWidth:
|
|
74
|
+
stack: {display: 'flex', flexDirection: 'column', gap: spacing.md, maxWidth: sizes.dialogSm},
|
|
75
|
+
stackWide: {display: 'flex', flexDirection: 'column', gap: spacing.md, maxWidth: sizes.pageSm},
|
|
75
76
|
})
|
|
76
77
|
|
|
77
78
|
export const FormExample: Story = {
|
|
@@ -2,6 +2,7 @@ import {css} from 'react-strict-dom'
|
|
|
2
2
|
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
3
|
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
4
|
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
5
6
|
|
|
6
7
|
export const styles = css.create({
|
|
7
8
|
root: {
|
|
@@ -21,7 +22,7 @@ export const styles = css.create({
|
|
|
21
22
|
color: colors.text,
|
|
22
23
|
},
|
|
23
24
|
labelSide: {
|
|
24
|
-
minWidth:
|
|
25
|
+
minWidth: sizes.labelMinW,
|
|
25
26
|
paddingTop: spacing.sm,
|
|
26
27
|
flexShrink: 0,
|
|
27
28
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {useState} from 'react'
|
|
2
2
|
import type {Meta, StoryObj} from '@storybook/react'
|
|
3
|
-
import {expect, fn, userEvent
|
|
3
|
+
import {expect, fn, userEvent} from 'storybook/test'
|
|
4
4
|
import {css, html} from 'react-strict-dom'
|
|
5
5
|
import {Schema} from 'effect'
|
|
6
6
|
import {Form} from './Form'
|
|
@@ -9,6 +9,7 @@ import {Input} from '../Input/Input'
|
|
|
9
9
|
import {Textarea} from '../Textarea/Textarea'
|
|
10
10
|
import {Fieldset} from '../Fieldset/Fieldset'
|
|
11
11
|
import {Button} from '../Button/Button'
|
|
12
|
+
import {sizes} from '@duro-app/tokens/tokens/sizes.css'
|
|
12
13
|
|
|
13
14
|
const meta: Meta = {
|
|
14
15
|
title: 'Components/Form',
|
|
@@ -48,8 +49,8 @@ const ProfileSchema = Schema.Struct({
|
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
const wrapStyles = css.create({
|
|
51
|
-
wrap: {maxWidth:
|
|
52
|
-
wrapWide: {maxWidth:
|
|
52
|
+
wrap: {maxWidth: sizes.dialogSm},
|
|
53
|
+
wrapWide: {maxWidth: sizes.pageSm},
|
|
53
54
|
})
|
|
54
55
|
|
|
55
56
|
// --- Stories ---
|
|
@@ -24,14 +24,14 @@ export const meta: ComponentMeta = {
|
|
|
24
24
|
relationship: 'Grid layout="split" with a List and a Panel is the split-pane recipe',
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
|
-
example: `// Split: list ≥ 240px beside a detail pane, one column below md
|
|
27
|
+
example: `// Split: list ≥ sizes.gridColSm (240px) beside a detail pane, one column below md
|
|
28
28
|
<Grid layout="split" gap="lg">
|
|
29
29
|
<List.Root>…</List.Root>
|
|
30
30
|
<Panel.Root>…</Panel.Root>
|
|
31
31
|
</Grid>
|
|
32
32
|
|
|
33
33
|
// Responsive: columns auto-fit based on min width
|
|
34
|
-
<Grid minColumnWidth="
|
|
34
|
+
<Grid minColumnWidth="gridColMd" gap="md">
|
|
35
35
|
<Card>A</Card>
|
|
36
36
|
<Card>B</Card>
|
|
37
37
|
<Card>C</Card>
|