@duro-app/ui 4.5.0 → 5.0.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.
Files changed (235) hide show
  1. package/dist/{Table-CUp12BKZ.js → Table-BKN_d-mp.js} +512 -419
  2. package/dist/Table-BKN_d-mp.js.map +1 -0
  3. package/dist/components/ActionBar/ActionBar.stories.d.ts.map +1 -1
  4. package/dist/components/ActionBar/styles.css.d.ts +7 -7
  5. package/dist/components/ActionBar/styles.css.d.ts.map +1 -1
  6. package/dist/components/Alert/styles.css.d.ts +2 -2
  7. package/dist/components/Alert/styles.css.d.ts.map +1 -1
  8. package/dist/components/Badge/styles.css.d.ts +2 -2
  9. package/dist/components/Button/styles.css.d.ts +5 -5
  10. package/dist/components/Button/styles.css.d.ts.map +1 -1
  11. package/dist/components/Callout/styles.css.d.ts +1 -1
  12. package/dist/components/Callout/styles.css.d.ts.map +1 -1
  13. package/dist/components/Card/styles.css.d.ts +3 -3
  14. package/dist/components/Card/styles.css.d.ts.map +1 -1
  15. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  16. package/dist/components/Checkbox/styles.css.d.ts +7 -11
  17. package/dist/components/Checkbox/styles.css.d.ts.map +1 -1
  18. package/dist/components/Cluster/Cluster.stories.d.ts.map +1 -1
  19. package/dist/components/ColorInput/styles.css.d.ts +6 -6
  20. package/dist/components/ColorInput/styles.css.d.ts.map +1 -1
  21. package/dist/components/ColorMode/styles.css.d.ts +3 -3
  22. package/dist/components/ColorMode/styles.css.d.ts.map +1 -1
  23. package/dist/components/Combobox/styles.css.d.ts +3 -3
  24. package/dist/components/Combobox/styles.css.d.ts.map +1 -1
  25. package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -1
  26. package/dist/components/DetailPanel/DetailPanel.stories.d.ts.map +1 -1
  27. package/dist/components/DetailPanel/styles.css.d.ts +19 -10
  28. package/dist/components/DetailPanel/styles.css.d.ts.map +1 -1
  29. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  30. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  31. package/dist/components/Dialog/styles.css.d.ts +18 -9
  32. package/dist/components/Dialog/styles.css.d.ts.map +1 -1
  33. package/dist/components/DragDrop/DragDrop.d.ts.map +1 -1
  34. package/dist/components/DragDrop/DragDrop.stories.d.ts.map +1 -1
  35. package/dist/components/DragDrop/styles.css.d.ts +0 -6
  36. package/dist/components/DragDrop/styles.css.d.ts.map +1 -1
  37. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  38. package/dist/components/Drawer/styles.css.d.ts +19 -10
  39. package/dist/components/Drawer/styles.css.d.ts.map +1 -1
  40. package/dist/components/Field/Field.stories.d.ts.map +1 -1
  41. package/dist/components/Field/styles.css.d.ts +1 -1
  42. package/dist/components/Field/styles.css.d.ts.map +1 -1
  43. package/dist/components/Form/Form.stories.d.ts.map +1 -1
  44. package/dist/components/Grid/Grid.d.ts +6 -4
  45. package/dist/components/Grid/Grid.d.ts.map +1 -1
  46. package/dist/components/Grid/Grid.stories.d.ts.map +1 -1
  47. package/dist/components/Grid/styles.css.d.ts +3 -3
  48. package/dist/components/Input/Input.stories.d.ts.map +1 -1
  49. package/dist/components/Input/styles.css.d.ts +3 -3
  50. package/dist/components/Input/styles.css.d.ts.map +1 -1
  51. package/dist/components/InputGroup/InputGroup.d.ts +4 -2
  52. package/dist/components/InputGroup/InputGroup.d.ts.map +1 -1
  53. package/dist/components/InputGroup/InputGroup.stories.d.ts.map +1 -1
  54. package/dist/components/InputGroup/styles.css.d.ts +3 -3
  55. package/dist/components/InputGroup/styles.css.d.ts.map +1 -1
  56. package/dist/components/LinkButton/styles.css.d.ts +1 -1
  57. package/dist/components/LinkButton/styles.css.d.ts.map +1 -1
  58. package/dist/components/List/List.stories.d.ts.map +1 -1
  59. package/dist/components/List/styles.css.d.ts +3 -3
  60. package/dist/components/List/styles.css.d.ts.map +1 -1
  61. package/dist/components/Menu/styles.css.d.ts +4 -4
  62. package/dist/components/Menu/styles.css.d.ts.map +1 -1
  63. package/dist/components/PageShell/styles.css.d.ts +3 -3
  64. package/dist/components/PageShell/styles.css.d.ts.map +1 -1
  65. package/dist/components/Panel/styles.css.d.ts +3 -3
  66. package/dist/components/Panel/styles.css.d.ts.map +1 -1
  67. package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
  68. package/dist/components/Popover/styles.css.d.ts +2 -2
  69. package/dist/components/Popover/styles.css.d.ts.map +1 -1
  70. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  71. package/dist/components/RadioGroup/styles.css.d.ts +5 -9
  72. package/dist/components/RadioGroup/styles.css.d.ts.map +1 -1
  73. package/dist/components/ScrollArea/ScrollArea.d.ts +2 -1
  74. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  75. package/dist/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  76. package/dist/components/ScrollArea/styles.css.d.ts +8 -8
  77. package/dist/components/ScrollArea/styles.css.d.ts.map +1 -1
  78. package/dist/components/Select/styles.css.d.ts +4 -4
  79. package/dist/components/Select/styles.css.d.ts.map +1 -1
  80. package/dist/components/SideNav/styles.css.d.ts +7 -7
  81. package/dist/components/SideNav/styles.css.d.ts.map +1 -1
  82. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  83. package/dist/components/Spinner/styles.css.d.ts +10 -14
  84. package/dist/components/Spinner/styles.css.d.ts.map +1 -1
  85. package/dist/components/Switch/Switch.d.ts.map +1 -1
  86. package/dist/components/Switch/styles.css.d.ts +10 -14
  87. package/dist/components/Switch/styles.css.d.ts.map +1 -1
  88. package/dist/components/Table/ColumnFilter.d.ts.map +1 -1
  89. package/dist/components/Table/FromTanstack.d.ts +2 -1
  90. package/dist/components/Table/FromTanstack.d.ts.map +1 -1
  91. package/dist/components/Table/Pagination.d.ts.map +1 -1
  92. package/dist/components/Table/SortIndicator.d.ts.map +1 -1
  93. package/dist/components/Table/Table.d.ts +11 -9
  94. package/dist/components/Table/Table.d.ts.map +1 -1
  95. package/dist/components/Table/Table.stories.d.ts.map +1 -1
  96. package/dist/components/Table/styles.css.d.ts +6 -6
  97. package/dist/components/Table/styles.css.d.ts.map +1 -1
  98. package/dist/components/Tabs/styles.css.d.ts +8 -8
  99. package/dist/components/Tabs/styles.css.d.ts.map +1 -1
  100. package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
  101. package/dist/components/Tag/styles.css.d.ts +4 -4
  102. package/dist/components/Tag/styles.css.d.ts.map +1 -1
  103. package/dist/components/TagGroup/TagGroup.d.ts.map +1 -1
  104. package/dist/components/TagGroup/styles.css.d.ts +4 -10
  105. package/dist/components/TagGroup/styles.css.d.ts.map +1 -1
  106. package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
  107. package/dist/components/Textarea/styles.css.d.ts +3 -3
  108. package/dist/components/Textarea/styles.css.d.ts.map +1 -1
  109. package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -1
  110. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  111. package/dist/components/Toast/styles.css.d.ts +12 -12
  112. package/dist/components/Toast/styles.css.d.ts.map +1 -1
  113. package/dist/components/Toggle/styles.css.d.ts +8 -8
  114. package/dist/components/Toggle/styles.css.d.ts.map +1 -1
  115. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
  116. package/dist/components/ToggleGroup/styles.css.d.ts +1 -1
  117. package/dist/components/ToggleGroup/styles.css.d.ts.map +1 -1
  118. package/dist/components/Tooltip/styles.css.d.ts +1 -1
  119. package/dist/components/Tooltip/styles.css.d.ts.map +1 -1
  120. package/dist/components/Tree/styles.css.d.ts +4 -4
  121. package/dist/components/Tree/styles.css.d.ts.map +1 -1
  122. package/dist/components/VirtualTable/VirtualTable.d.ts +2 -1
  123. package/dist/components/VirtualTable/VirtualTable.d.ts.map +1 -1
  124. package/dist/components/VirtualTable/VirtualTable.stories.d.ts.map +1 -1
  125. package/dist/components/VirtualTable/styles.css.d.ts +7 -7
  126. package/dist/components/VirtualTable/styles.css.d.ts.map +1 -1
  127. package/dist/docs/Spacing.stories.d.ts.map +1 -1
  128. package/dist/docs/Typography.stories.d.ts.map +1 -1
  129. package/dist/docs/helpers.d.ts.map +1 -1
  130. package/dist/index.css +1 -1
  131. package/dist/index.js +2790 -2785
  132. package/dist/index.js.map +1 -1
  133. package/dist/shared/length.d.ts +24 -0
  134. package/dist/shared/length.d.ts.map +1 -0
  135. package/dist/shared/length.typecheck.d.ts +28 -0
  136. package/dist/shared/length.typecheck.d.ts.map +1 -0
  137. package/dist/styles/visually-hidden.css.d.ts +10 -0
  138. package/dist/styles/visually-hidden.css.d.ts.map +1 -0
  139. package/dist/table.js +166 -166
  140. package/dist/table.js.map +1 -1
  141. package/package.json +2 -2
  142. package/src/components/ActionBar/ActionBar.stories.tsx +4 -2
  143. package/src/components/ActionBar/styles.css.ts +11 -9
  144. package/src/components/Alert/styles.css.ts +4 -3
  145. package/src/components/Badge/styles.css.ts +3 -3
  146. package/src/components/Button/styles.css.ts +8 -7
  147. package/src/components/Callout/styles.css.ts +2 -1
  148. package/src/components/Card/styles.css.ts +4 -3
  149. package/src/components/Checkbox/Checkbox.tsx +2 -1
  150. package/src/components/Checkbox/styles.css.ts +10 -11
  151. package/src/components/Cluster/Cluster.stories.tsx +2 -1
  152. package/src/components/ColorInput/styles.css.ts +9 -7
  153. package/src/components/ColorMode/styles.css.ts +4 -3
  154. package/src/components/Combobox/styles.css.ts +5 -3
  155. package/src/components/DetailPanel/DetailPanel.stories.tsx +5 -3
  156. package/src/components/DetailPanel/DetailPanel.tsx +3 -0
  157. package/src/components/DetailPanel/styles.css.ts +17 -11
  158. package/src/components/Dialog/Dialog.stories.tsx +2 -1
  159. package/src/components/Dialog/Dialog.tsx +3 -0
  160. package/src/components/Dialog/styles.css.ts +14 -9
  161. package/src/components/DragDrop/DragDrop.stories.tsx +2 -1
  162. package/src/components/DragDrop/DragDrop.tsx +2 -1
  163. package/src/components/DragDrop/styles.css.ts +0 -7
  164. package/src/components/Drawer/Drawer.tsx +3 -0
  165. package/src/components/Drawer/DrawerScroll.stories.tsx +5 -5
  166. package/src/components/Drawer/styles.css.ts +15 -10
  167. package/src/components/Field/Field.stories.tsx +3 -2
  168. package/src/components/Field/styles.css.ts +2 -1
  169. package/src/components/Form/Form.stories.tsx +4 -3
  170. package/src/components/Grid/Grid.meta.ts +2 -2
  171. package/src/components/Grid/Grid.stories.tsx +3 -2
  172. package/src/components/Grid/Grid.tsx +8 -6
  173. package/src/components/Grid/styles.css.ts +2 -2
  174. package/src/components/Input/Input.stories.tsx +2 -1
  175. package/src/components/Input/styles.css.ts +4 -3
  176. package/src/components/InputGroup/InputGroup.stories.tsx +3 -2
  177. package/src/components/InputGroup/InputGroup.tsx +5 -3
  178. package/src/components/InputGroup/styles.css.ts +4 -3
  179. package/src/components/LinkButton/styles.css.ts +2 -1
  180. package/src/components/List/List.stories.tsx +4 -2
  181. package/src/components/List/styles.css.ts +6 -4
  182. package/src/components/Menu/styles.css.ts +6 -4
  183. package/src/components/PageShell/styles.css.ts +4 -3
  184. package/src/components/Panel/styles.css.ts +4 -3
  185. package/src/components/Popover/Popover.stories.tsx +6 -4
  186. package/src/components/Popover/styles.css.ts +3 -2
  187. package/src/components/RadioGroup/RadioGroup.tsx +2 -1
  188. package/src/components/RadioGroup/styles.css.ts +8 -9
  189. package/src/components/ScrollArea/ScrollArea.meta.ts +1 -1
  190. package/src/components/ScrollArea/ScrollArea.stories.tsx +7 -5
  191. package/src/components/ScrollArea/ScrollArea.tsx +7 -2
  192. package/src/components/ScrollArea/styles.css.ts +10 -9
  193. package/src/components/Select/styles.css.ts +6 -4
  194. package/src/components/SideNav/styles.css.ts +10 -8
  195. package/src/components/Spinner/Spinner.tsx +2 -1
  196. package/src/components/Spinner/styles.css.ts +14 -14
  197. package/src/components/Switch/Switch.tsx +2 -1
  198. package/src/components/Switch/styles.css.ts +15 -15
  199. package/src/components/Table/ColumnFilter.tsx +5 -4
  200. package/src/components/Table/FromTanstack.tsx +2 -1
  201. package/src/components/Table/Pagination.tsx +6 -4
  202. package/src/components/Table/SortIndicator.tsx +4 -2
  203. package/src/components/Table/Table.stories.tsx +8 -8
  204. package/src/components/Table/Table.tsx +19 -15
  205. package/src/components/Table/styles.css.ts +9 -7
  206. package/src/components/Tabs/styles.css.ts +11 -9
  207. package/src/components/Tag/Tag.stories.tsx +4 -2
  208. package/src/components/Tag/styles.css.ts +6 -5
  209. package/src/components/TagGroup/TagGroup.tsx +2 -1
  210. package/src/components/TagGroup/styles.css.ts +6 -10
  211. package/src/components/Textarea/Textarea.stories.tsx +2 -1
  212. package/src/components/Textarea/styles.css.ts +4 -3
  213. package/src/components/ThemeProvider/ThemeProvider.stories.tsx +7 -5
  214. package/src/components/Toast/Toast.stories.tsx +2 -1
  215. package/src/components/Toast/styles.css.ts +16 -14
  216. package/src/components/Toggle/Toggle.meta.ts +1 -1
  217. package/src/components/Toggle/styles.css.ts +12 -10
  218. package/src/components/ToggleGroup/ToggleGroup.meta.ts +1 -1
  219. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +7 -6
  220. package/src/components/ToggleGroup/styles.css.ts +7 -6
  221. package/src/components/Tooltip/styles.css.ts +2 -1
  222. package/src/components/Tree/styles.css.ts +8 -6
  223. package/src/components/VirtualTable/VirtualTable.stories.tsx +4 -3
  224. package/src/components/VirtualTable/VirtualTable.tsx +5 -3
  225. package/src/components/VirtualTable/styles.css.ts +9 -8
  226. package/src/docs/Spacing.stories.tsx +11 -10
  227. package/src/docs/Typography.stories.tsx +8 -6
  228. package/src/docs/helpers.tsx +3 -2
  229. package/src/shared/length.ts +51 -0
  230. package/src/shared/length.typecheck.tsx +47 -0
  231. package/src/styles/visually-hidden.css.ts +16 -0
  232. package/dist/Table-CUp12BKZ.js.map +0 -1
  233. package/dist/components/Toggle/rowHeight.d.ts +0 -17
  234. package/dist/components/Toggle/rowHeight.d.ts.map +0 -1
  235. package/src/components/Toggle/rowHeight.ts +0 -12
@@ -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 {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
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: 4,
15
+ borderRadius: radii.xs,
15
16
  whiteSpace: 'nowrap',
16
17
  minWidth: 0,
17
- borderWidth: 1,
18
+ borderWidth: borders.hairline,
18
19
  borderStyle: 'solid',
19
20
  borderColor: colors.border,
20
21
  outlineWidth: {
21
22
  default: 0,
22
- ':focus-visible': 2,
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': 1,
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={styles.liveRegion}>
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: 1,
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: 40,
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': 2,
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': 1,
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: 320},
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: 1,
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': 2,
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': 1,
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: 1,
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: 48,
57
- height: 48,
58
+ width: sizes.iconXxl,
59
+ height: sizes.iconXxl,
58
60
  borderRadius: radii.sm,
59
- borderWidth: 1,
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: 280,
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: 1,
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 {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
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: 440,
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: 1,
43
+ borderWidth: borders.hairline,
42
44
  borderStyle: 'solid',
43
45
  borderColor: colors.border,
44
- borderLeftWidth: 3,
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: '160ms',
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: 1,
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: 2,
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: 2,
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: 2,
96
+ outlineWidth: borders.focusRing,
95
97
  outlineColor: colors.accent,
96
- outlineOffset: 2,
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: 2,
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: 2,
114
+ outlineWidth: borders.focusRing,
113
115
  outlineColor: colors.accent,
114
- outlineOffset: 1,
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 44×44px; in a wrapping ToggleGroup each keeps its own border and a fixed row height.',
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: 1,
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': 2},
22
+ outlineWidth: {default: 0, ':focus-visible': borders.focusRing},
21
23
  outlineStyle: 'solid',
22
24
  outlineColor: colors.accent,
23
- outlineOffset: 2,
24
- minWidth: {default: null, '@media (pointer: coarse)': 44},
25
- minHeight: {default: null, '@media (pointer: coarse)': 44},
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, 44px under a coarse pointer.
40
- // Must equal ROW_HEIGHT in ./rowHeight (StyleX cannot import it here).
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: 39, '@media (pointer: coarse)': 44},
45
+ height: {default: sizes.controlMd, '@media (pointer: coarse)': sizes.touchTarget},
44
46
  },
45
47
  wrappedSmall: {
46
48
  boxSizing: 'border-box',
47
- height: {default: 28, '@media (pointer: coarse)': 44},
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: 1,
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 {ROW_HEIGHT} from '../Toggle/rowHeight'
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: 320},
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(ROW_HEIGHT.small)
272
- // exact: Toggle's styles repeat ROW_HEIGHT, and a drift must fail here
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 - ROW_HEIGHT.small)).toBeLessThanOrEqual(0.5)
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 - ROW_HEIGHT.default)).toBeLessThanOrEqual(0.5)
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: 1,
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) * ${ROW_HEIGHT.small}px + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
34
- '@media (pointer: coarse)': `calc((${rows} + 0.5) * ${ROW_HEIGHT.coarse}px + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
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) * ${ROW_HEIGHT.default}px + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
40
- '@media (pointer: coarse)': `calc((${rows} + 0.5) * ${ROW_HEIGHT.coarse}px + ${rows} * ${spacing.xs} + 2 * ${spacing.xs})`,
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: 1,
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 {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
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: '5px',
36
- paddingBottom: '5px',
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: 2,
58
+ outlineWidth: borders.focusRing,
57
59
  outlineStyle: 'solid',
58
60
  outlineColor: colors.accent,
59
- outlineOffset: -2,
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: spacing.md,
72
+ width: sizes.glyphMd,
71
73
  flexShrink: 0,
72
74
  color: colors.textMuted,
73
75
  transitionProperty: 'transform',
@@ -3,10 +3,11 @@ import {expect, fn, waitFor} from 'storybook/test'
3
3
  import {createColumnHelper} from '@tanstack/react-table'
4
4
  import {css, html} from 'react-strict-dom'
5
5
  import {VirtualTable} from './VirtualTable'
6
+ import {sizes} from '@duro-app/tokens/tokens/sizes.css'
6
7
 
7
8
  const storyStyles = css.create({
8
9
  // Phone-width wrapper: below VirtualTable's 640px stackBelow default.
9
- narrow: {width: 400},
10
+ narrow: {width: sizes.dialogSm},
10
11
  })
11
12
 
12
13
  interface Item {
@@ -49,7 +50,7 @@ export const SmallList: Story = {
49
50
  export const Virtualized: Story = {
50
51
  args: {
51
52
  data: makeData(500),
52
- maxHeight: 300,
53
+ maxHeight: 'listMaxH',
53
54
  rangeLabel: ({from, to, total}) => `${from}-${to} of ${total}`,
54
55
  onVisiblePageChange: fn(),
55
56
  },
@@ -69,7 +70,7 @@ export const Virtualized: Story = {
69
70
  export const ScrollReportsPage: Story = {
70
71
  args: {
71
72
  data: makeData(500),
72
- maxHeight: 300,
73
+ maxHeight: 'listMaxH',
73
74
  pageSize: 50,
74
75
  rangeLabel: ({page, pages}) => `page ${page}/${pages}`,
75
76
  onVisiblePageChange: fn(),
@@ -13,6 +13,8 @@ import {
13
13
  import {useVirtualizer} from '@tanstack/react-virtual'
14
14
  import {breakpointsPx, type Breakpoint} from '@duro-app/tokens/tokens/breakpoints.css'
15
15
  import {styles} from './styles.css'
16
+ import {SIZES_PX} from '@duro-app/tokens/keys'
17
+ import {resolveLength, type Length} from '../../shared/length'
16
18
 
17
19
  // Measure + commit before paint on the client; no-op-safe on the server.
18
20
  const useIsoLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect
@@ -56,7 +58,7 @@ interface VirtualTableProps<TData> {
56
58
  /** Estimated row height for the virtualizer. Default 44. */
57
59
  estimateRowHeight?: number
58
60
  /** Max height of the scroll viewport once virtualized. Default '70vh'. */
59
- maxHeight?: number | string
61
+ maxHeight?: Length
60
62
  /** Render every row (no windowing) at or below this count. Default 150. */
61
63
  virtualizeThreshold?: number
62
64
  /**
@@ -94,7 +96,7 @@ export function VirtualTable<TData>({
94
96
  onVisiblePageChange,
95
97
  rangeLabel,
96
98
  pageSize = 50,
97
- estimateRowHeight = 44,
99
+ estimateRowHeight = SIZES_PX.touchTarget,
98
100
  maxHeight = '70vh',
99
101
  virtualizeThreshold = 150,
100
102
  stackBelow = 'sm',
@@ -288,7 +290,7 @@ export function VirtualTable<TData>({
288
290
  role="table"
289
291
  style={[
290
292
  stacked ? styles.stackScroll : styles.scroll,
291
- virtualize && styles.scrollMax(maxHeight),
293
+ virtualize && styles.scrollMax(resolveLength(maxHeight)),
292
294
  ]}
293
295
  >
294
296
  {stacked ? null : (