@duro-app/ui 2.0.1 → 3.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.
Files changed (85) hide show
  1. package/dist/components/ActionBar/ActionBar.stories.d.ts.map +1 -1
  2. package/dist/components/Alert/Alert.stories.d.ts.map +1 -1
  3. package/dist/components/Badge/Badge.stories.d.ts.map +1 -1
  4. package/dist/components/Button/Button.stories.d.ts.map +1 -1
  5. package/dist/components/Callout/Callout.stories.d.ts.map +1 -1
  6. package/dist/components/Card/Card.stories.d.ts.map +1 -1
  7. package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
  8. package/dist/components/Cluster/Cluster.stories.d.ts.map +1 -1
  9. package/dist/components/ColorMode/ColorMode.stories.d.ts.map +1 -1
  10. package/dist/components/Field/Field.stories.d.ts.map +1 -1
  11. package/dist/components/Grid/Grid.d.ts +19 -2
  12. package/dist/components/Grid/Grid.d.ts.map +1 -1
  13. package/dist/components/Grid/Grid.meta.d.ts.map +1 -1
  14. package/dist/components/Grid/Grid.stories.d.ts +16 -0
  15. package/dist/components/Grid/Grid.stories.d.ts.map +1 -1
  16. package/dist/components/Grid/columns.d.ts +27 -0
  17. package/dist/components/Grid/columns.d.ts.map +1 -0
  18. package/dist/components/Grid/styles.css.d.ts +77 -0
  19. package/dist/components/Grid/styles.css.d.ts.map +1 -1
  20. package/dist/components/Inline/Inline.stories.d.ts.map +1 -1
  21. package/dist/components/Input/Input.stories.d.ts.map +1 -1
  22. package/dist/components/InputGroup/InputGroup.stories.d.ts.map +1 -1
  23. package/dist/components/LinkButton/LinkButton.stories.d.ts.map +1 -1
  24. package/dist/components/List/List.stories.d.ts.map +1 -1
  25. package/dist/components/PageShell/PageShell.meta.d.ts.map +1 -1
  26. package/dist/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  27. package/dist/components/SideNav/SideNav.meta.d.ts.map +1 -1
  28. package/dist/components/Spinner/Spinner.stories.d.ts.map +1 -1
  29. package/dist/components/Stack/Stack.stories.d.ts.map +1 -1
  30. package/dist/components/StatusIcon/StatusIcon.stories.d.ts.map +1 -1
  31. package/dist/components/Switch/Switch.stories.d.ts.map +1 -1
  32. package/dist/components/Table/Table.stories.d.ts.map +1 -1
  33. package/dist/components/Tabs/Tabs.meta.d.ts.map +1 -1
  34. package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
  35. package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
  36. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  37. package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
  38. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
  39. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  40. package/dist/docs/Spacing.stories.d.ts.map +1 -1
  41. package/dist/docs/Typography.stories.d.ts.map +1 -1
  42. package/dist/docs/helpers.d.ts.map +1 -1
  43. package/dist/index.css +1 -1
  44. package/dist/index.js +524 -398
  45. package/dist/index.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/components/ActionBar/ActionBar.stories.tsx +7 -5
  48. package/src/components/Alert/Alert.stories.tsx +2 -1
  49. package/src/components/Badge/Badge.stories.tsx +3 -2
  50. package/src/components/Button/Button.stories.tsx +3 -2
  51. package/src/components/Callout/Callout.stories.tsx +2 -1
  52. package/src/components/Card/Card.stories.tsx +5 -3
  53. package/src/components/Checkbox/Checkbox.stories.tsx +2 -1
  54. package/src/components/Cluster/Cluster.stories.tsx +4 -3
  55. package/src/components/ColorMode/ColorMode.stories.tsx +2 -1
  56. package/src/components/Field/Field.stories.tsx +3 -2
  57. package/src/components/Grid/Grid.meta.ts +20 -2
  58. package/src/components/Grid/Grid.stories.tsx +106 -4
  59. package/src/components/Grid/Grid.tsx +134 -9
  60. package/src/components/Grid/columns.ts +58 -0
  61. package/src/components/Grid/styles.css.ts +85 -0
  62. package/src/components/Inline/Inline.stories.tsx +5 -4
  63. package/src/components/Input/Input.stories.tsx +2 -1
  64. package/src/components/InputGroup/InputGroup.stories.tsx +2 -1
  65. package/src/components/LinkButton/LinkButton.stories.tsx +3 -2
  66. package/src/components/List/List.stories.tsx +2 -1
  67. package/src/components/PageShell/PageShell.meta.ts +12 -1
  68. package/src/components/ScrollArea/ScrollArea.stories.tsx +12 -9
  69. package/src/components/SideNav/SideNav.meta.ts +5 -0
  70. package/src/components/Spinner/Spinner.stories.tsx +2 -1
  71. package/src/components/Stack/Stack.stories.tsx +5 -4
  72. package/src/components/StatusIcon/StatusIcon.stories.tsx +11 -4
  73. package/src/components/Switch/Switch.stories.tsx +2 -1
  74. package/src/components/Table/Table.stories.tsx +7 -2
  75. package/src/components/Tabs/Tabs.meta.ts +5 -0
  76. package/src/components/Tag/Tag.stories.tsx +11 -3
  77. package/src/components/Textarea/Textarea.stories.tsx +2 -1
  78. package/src/components/ThemeProvider/ThemeProvider.stories.tsx +9 -9
  79. package/src/components/Toast/Toast.stories.tsx +9 -2
  80. package/src/components/Toggle/Toggle.stories.tsx +2 -1
  81. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +2 -1
  82. package/src/components/Tooltip/Tooltip.stories.tsx +3 -2
  83. package/src/docs/Spacing.stories.tsx +12 -11
  84. package/src/docs/Typography.stories.tsx +4 -3
  85. package/src/docs/helpers.tsx +5 -4
@@ -1,5 +1,16 @@
1
1
  import {css} from 'react-strict-dom'
2
2
  import {spacing} from '@duro-app/tokens/tokens/spacing.css'
3
+ import {breakpoints} from '@duro-app/tokens/tokens/breakpoints.css'
4
+
5
+ // Where a split collapses to one column — measured on the split's OWN
6
+ // container, not the viewport. A split nested in another split (a list/detail
7
+ // board inside a nav/content shell) has far less room than the window: at a
8
+ // 768px viewport the shell leaves ~408px for its content column, and a
9
+ // viewport-keyed inner split would still open there and squeeze its detail
10
+ // pane to ~150px. Container queries collapse each split on what it actually
11
+ // has. defineConsts strings, inlined into the @container text at build time.
12
+ const SPLIT_WIDE_BP = breakpoints.md // 280px rail + real content
13
+ const SPLIT_BP = breakpoints.sm // 240px list + ≥ 384px detail
3
14
 
4
15
  export const styles = css.create({
5
16
  base: {
@@ -14,6 +25,34 @@ export const styles = css.create({
14
25
  autoFit: (minWidth: string) => ({
15
26
  gridTemplateColumns: `repeat(auto-fill, minmax(${minWidth}, 1fr))`,
16
27
  }),
28
+ // Hosts the @container query for a named layout. A container cannot query
29
+ // itself, so the grid sits inside this wrapper (the Table.rootContainer
30
+ // pattern). Only `layout` grids get it: counted and weighted grids keep
31
+ // their DOM exactly as before.
32
+ splitContainer: {
33
+ containerType: 'inline-size',
34
+ },
35
+ // Asymmetric list/detail splits: a bounded first column, the rest for the
36
+ // detail; one column when the container is narrower than the breakpoint.
37
+ // Static entries rather than a parameter because the pair (widths +
38
+ // collapse point) is the design decision — a screen picks a split, it does
39
+ // not tune one.
40
+ split: {
41
+ gridTemplateColumns: {
42
+ default: '1fr',
43
+ [`@container (min-width: ${SPLIT_BP})`]: 'minmax(240px, 1fr) minmax(0, 2fr)',
44
+ },
45
+ },
46
+ splitWide: {
47
+ gridTemplateColumns: {
48
+ default: '1fr',
49
+ [`@container (min-width: ${SPLIT_WIDE_BP})`]: 'minmax(280px, 1fr) minmax(0, 3fr)',
50
+ },
51
+ },
52
+ // Weighted columns: `[1, 2]` → `1fr 2fr` (see columns.ts).
53
+ template: (tracks: string) => ({
54
+ gridTemplateColumns: tracks,
55
+ }),
17
56
  gapXs: {gap: spacing.xs},
18
57
  gapSm: {gap: spacing.sm},
19
58
  gapMs: {gap: spacing.ms},
@@ -22,4 +61,50 @@ export const styles = css.create({
22
61
  gapXl: {gap: spacing.xl},
23
62
  gapXxl: {gap: spacing.xxl},
24
63
  gapXxxl: {gap: spacing.xxxl},
64
+
65
+ // --- native only (see NativeGrid in Grid.tsx) -----------------------------
66
+ // React Native honours `display: 'flex'` only, and RSD gives it web flex
67
+ // semantics, so the row direction is explicit.
68
+ nativeRow: {
69
+ display: 'flex',
70
+ flexDirection: 'row',
71
+ flexWrap: 'wrap',
72
+ alignItems: 'stretch',
73
+ // A definite width so percentage bases resolve in Yoga's measure pass;
74
+ // against an auto width the line breaks come out wrong and the container
75
+ // under-reports its height (verified on the iOS simulator).
76
+ width: '100%',
77
+ },
78
+ // border-box is explicit: react-strict-dom mirrors the web default
79
+ // (content-box) on native, which adds the gap padding on top of the basis
80
+ // and overflows the row so every cell wraps.
81
+ nativeCell: (basis: string) => ({
82
+ flexBasis: basis,
83
+ flexShrink: 0,
84
+ boxSizing: 'border-box',
85
+ }),
86
+ // Auto-fit approximation: start at the minimum width, grow to fill. flexGrow
87
+ // is fine here: this style is native-only, so RSD-web's forced flex-grow: 0
88
+ // never applies.
89
+ nativeMinCell: (minWidth: string) => ({
90
+ flexBasis: minWidth,
91
+ flexGrow: 1,
92
+ boxSizing: 'border-box',
93
+ }),
94
+ cellGapLeftXs: {paddingLeft: spacing.xs},
95
+ cellGapLeftSm: {paddingLeft: spacing.sm},
96
+ cellGapLeftMs: {paddingLeft: spacing.ms},
97
+ cellGapLeftMd: {paddingLeft: spacing.md},
98
+ cellGapLeftLg: {paddingLeft: spacing.lg},
99
+ cellGapLeftXl: {paddingLeft: spacing.xl},
100
+ cellGapLeftXxl: {paddingLeft: spacing.xxl},
101
+ cellGapLeftXxxl: {paddingLeft: spacing.xxxl},
102
+ cellGapTopXs: {paddingTop: spacing.xs},
103
+ cellGapTopSm: {paddingTop: spacing.sm},
104
+ cellGapTopMs: {paddingTop: spacing.ms},
105
+ cellGapTopMd: {paddingTop: spacing.md},
106
+ cellGapTopLg: {paddingTop: spacing.lg},
107
+ cellGapTopXl: {paddingTop: spacing.xl},
108
+ cellGapTopXxl: {paddingTop: spacing.xxl},
109
+ cellGapTopXxxl: {paddingTop: spacing.xxxl},
25
110
  })
@@ -2,8 +2,9 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {css, html} from 'react-strict-dom'
3
3
  import {Inline} from './Inline'
4
4
  import {colors} from '@duro-app/tokens/tokens/colors.css'
5
- import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
+ import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
6
6
  import {SPACING_KEYS} from '@duro-app/tokens/keys'
7
+ import {typography} from '@duro-app/tokens/tokens/typography.css'
7
8
 
8
9
  const meta: Meta<typeof Inline> = {
9
10
  title: 'Layout/Inline',
@@ -32,12 +33,12 @@ const localStyles = css.create({
32
33
  backgroundColor: colors.accent,
33
34
  color: colors.accentContrast,
34
35
  padding: spacing.sm,
35
- borderRadius: 4,
36
+ borderRadius: radii.xs,
36
37
  textAlign: 'center',
37
- fontSize: '0.875rem',
38
+ fontSize: typography.fontSizeSm,
38
39
  },
39
40
  iconLg: {
40
- fontSize: '1.25rem',
41
+ fontSize: typography.fontSizeXl,
41
42
  },
42
43
  })
43
44
 
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Input} from './Input'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof Input> = {
7
8
  title: 'Components/Input',
@@ -66,7 +67,7 @@ export const Disabled: Story = {
66
67
  }
67
68
 
68
69
  const stackStyles = css.create({
69
- stack: {display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 320},
70
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.ms, maxWidth: 320},
70
71
  })
71
72
 
72
73
  export const AllVariants: Story = {
@@ -3,6 +3,7 @@ import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {InputGroup} from './InputGroup'
5
5
  import {Input} from '../Input/Input'
6
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
6
7
 
7
8
  const meta: Meta = {
8
9
  title: 'Components/InputGroup',
@@ -94,7 +95,7 @@ export const StandaloneInput: Story = {
94
95
 
95
96
  const layoutStyles = css.create({
96
97
  container: {maxWidth: 400},
97
- stack: {display: 'flex', flexDirection: 'column', gap: 16, maxWidth: 400},
98
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.md, maxWidth: 400},
98
99
  })
99
100
 
100
101
  export const AllVariants: Story = {
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {LinkButton} from './LinkButton'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof LinkButton> = {
7
8
  title: 'Components/LinkButton',
@@ -61,8 +62,8 @@ export const ExternalLink: Story = {
61
62
  }
62
63
 
63
64
  const rowStyles = css.create({
64
- row: {display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap'},
65
- stack: {display: 'flex', flexDirection: 'column', gap: 16},
65
+ row: {display: 'flex', gap: spacing.ms, alignItems: 'center', flexWrap: 'wrap'},
66
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.md},
66
67
  })
67
68
 
68
69
  export const AllVariants: Story = {
@@ -7,6 +7,7 @@ import {Badge} from '../Badge/Badge'
7
7
  import {Button} from '../Button/Button'
8
8
  import {Checkbox} from '../Checkbox/Checkbox'
9
9
  import {colors} from '@duro-app/tokens/tokens/colors.css'
10
+ import {radii} from '@duro-app/tokens/tokens/spacing.css'
10
11
 
11
12
  const meta: Meta = {
12
13
  title: 'Components/List',
@@ -76,7 +77,7 @@ const narrowContainer = css.create({
76
77
  borderWidth: 1,
77
78
  borderStyle: 'solid',
78
79
  borderColor: colors.border,
79
- borderRadius: 8,
80
+ borderRadius: radii.sm,
80
81
  overflow: 'hidden',
81
82
  },
82
83
  })
@@ -9,7 +9,7 @@ export const meta: ComponentMeta = {
9
9
  ],
10
10
  whenNotToUse: [
11
11
  'Nested section layouts — use Stack or Card',
12
- 'Sidebar layouts — combine with SideNav manually',
12
+ 'Sidebar layouts — start from the page-with-sidenav recipe (PageShell + Grid layout="split-wide" + SideNav)',
13
13
  ],
14
14
  relatedTo: [
15
15
  {
@@ -18,6 +18,17 @@ export const meta: ComponentMeta = {
18
18
  relationship: 'Use Stack for content within PageShell',
19
19
  },
20
20
  {component: 'SideNav', kind: 'composition', relationship: 'Often placed alongside PageShell'},
21
+ {
22
+ component: 'page-with-sidenav',
23
+ kind: 'composition',
24
+ relationship:
25
+ 'PageShell with a SideNav rail is the page-with-sidenav recipe — copy it, do not lay it out by hand',
26
+ },
27
+ {
28
+ component: 'admin-detail-page',
29
+ kind: 'composition',
30
+ relationship: 'PageShell with a record heading and Tabs is the admin-detail-page recipe',
31
+ },
21
32
  ],
22
33
  example: `<PageShell maxWidth="lg" padding="md" header={<Heading level={1}>Dashboard</Heading>}>
23
34
  <Stack gap="lg">
@@ -2,6 +2,9 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {ScrollArea} from './ScrollArea'
5
+ import {colors} from '@duro-app/tokens/tokens/colors.css'
6
+ import {typography} from '@duro-app/tokens/tokens/typography.css'
7
+ import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
5
8
 
6
9
  const meta: Meta = {
7
10
  title: 'Components/ScrollArea',
@@ -15,19 +18,19 @@ const demoStyles = css.create({
15
18
  width: 300,
16
19
  borderWidth: 1,
17
20
  borderStyle: 'solid',
18
- borderColor: '#333333',
19
- borderRadius: 8,
21
+ borderColor: colors.border,
22
+ borderRadius: radii.sm,
20
23
  },
21
24
  item: {
22
- paddingTop: 12,
23
- paddingBottom: 12,
24
- paddingLeft: 16,
25
- paddingRight: 16,
25
+ paddingTop: spacing.ms,
26
+ paddingBottom: spacing.ms,
27
+ paddingLeft: spacing.md,
28
+ paddingRight: spacing.md,
26
29
  borderBottomWidth: 1,
27
30
  borderBottomStyle: 'solid',
28
- borderBottomColor: '#1a1a1a',
29
- fontSize: 14,
30
- color: '#e5e5e5',
31
+ borderBottomColor: colors.bgCard,
32
+ fontSize: typography.fontSizeSm,
33
+ color: colors.text,
31
34
  },
32
35
  })
33
36
 
@@ -26,6 +26,11 @@ export const meta: ComponentMeta = {
26
26
  relationship: 'Tabs switch content in-place; SideNav navigates pages',
27
27
  },
28
28
  {component: 'PageShell', kind: 'composition', relationship: 'Often placed alongside PageShell'},
29
+ {
30
+ component: 'page-with-sidenav',
31
+ kind: 'composition',
32
+ relationship: 'SideNav beside routed content is the page-with-sidenav recipe',
33
+ },
29
34
  ],
30
35
  example: `<SideNav.Root defaultValue="identities">
31
36
  {/* Default: always-open sections. Nothing is a click away from being seen. */}
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Spinner} from './Spinner'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof Spinner> = {
7
8
  title: 'Components/Spinner',
@@ -41,7 +42,7 @@ export const CustomLabel: Story = {
41
42
  }
42
43
 
43
44
  const rowStyles = css.create({
44
- row: {display: 'flex', gap: 24, alignItems: 'center'},
45
+ row: {display: 'flex', gap: spacing.lg, alignItems: 'center'},
45
46
  })
46
47
 
47
48
  export const AllSizes: Story = {
@@ -2,8 +2,9 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {css, html} from 'react-strict-dom'
3
3
  import {Stack} from './Stack'
4
4
  import {colors} from '@duro-app/tokens/tokens/colors.css'
5
- import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
+ import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
6
6
  import {SPACING_KEYS} from '@duro-app/tokens/keys'
7
+ import {typography} from '@duro-app/tokens/tokens/typography.css'
7
8
 
8
9
  const meta: Meta<typeof Stack> = {
9
10
  title: 'Layout/Stack',
@@ -28,12 +29,12 @@ const localStyles = css.create({
28
29
  backgroundColor: colors.accent,
29
30
  color: colors.accentContrast,
30
31
  padding: spacing.sm,
31
- borderRadius: 4,
32
+ borderRadius: radii.xs,
32
33
  textAlign: 'center',
33
- fontSize: '0.875rem',
34
+ fontSize: typography.fontSizeSm,
34
35
  },
35
36
  label: {
36
- fontSize: '0.75rem',
37
+ fontSize: typography.fontSizeXs,
37
38
  color: colors.textMuted,
38
39
  },
39
40
  })
@@ -2,6 +2,9 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {StatusIcon} from './StatusIcon'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
6
+ import {colors} from '@duro-app/tokens/tokens/colors.css'
7
+ import {typography} from '@duro-app/tokens/tokens/typography.css'
5
8
 
6
9
  const meta: Meta<typeof StatusIcon> = {
7
10
  title: 'Components/StatusIcon',
@@ -47,9 +50,13 @@ export const CustomSize: Story = {
47
50
  }
48
51
 
49
52
  const gridStyles = css.create({
50
- grid: {display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))', gap: 24},
51
- cell: {display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8},
52
- label: {fontSize: '0.875rem', color: '#888'},
53
+ grid: {
54
+ display: 'grid',
55
+ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
56
+ gap: spacing.lg,
57
+ },
58
+ cell: {display: 'flex', flexDirection: 'column', alignItems: 'center', gap: spacing.sm},
59
+ label: {fontSize: typography.fontSizeSm, color: colors.textMuted},
53
60
  })
54
61
 
55
62
  export const AllIcons: Story = {
@@ -66,7 +73,7 @@ export const AllIcons: Story = {
66
73
  }
67
74
 
68
75
  const rowStyles = css.create({
69
- row: {display: 'flex', gap: 24, alignItems: 'center'},
76
+ row: {display: 'flex', gap: spacing.lg, alignItems: 'center'},
70
77
  })
71
78
 
72
79
  export const AllVariants: Story = {
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Switch} from './Switch'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof Switch> = {
7
8
  title: 'Components/Switch',
@@ -67,7 +68,7 @@ export const WithoutLabel: Story = {
67
68
  }
68
69
 
69
70
  const stackStyles = css.create({
70
- stack: {display: 'flex', flexDirection: 'column', gap: 12},
71
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.ms},
71
72
  })
72
73
 
73
74
  export const AllVariants: Story = {
@@ -27,6 +27,7 @@ import {
27
27
  import {useDataTable} from './useDataTable'
28
28
  import {Combobox} from '../Combobox/Combobox'
29
29
  import {spacing} from '@duro-app/tokens/tokens/spacing.css'
30
+ import {typography} from '@duro-app/tokens/tokens/typography.css'
30
31
 
31
32
  const meta: Meta = {
32
33
  title: 'Components/Table',
@@ -326,8 +327,12 @@ export const WithCheckboxes: Story = {
326
327
  }
327
328
 
328
329
  const storyStyles = css.create({
329
- stack: {display: 'flex', flexDirection: 'column', gap: 24},
330
- label: {color: colors.textMuted, fontSize: '0.875rem', fontWeight: 600},
330
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.lg},
331
+ label: {
332
+ color: colors.textMuted,
333
+ fontSize: typography.fontSizeSm,
334
+ fontWeight: typography.fontWeightSemibold,
335
+ },
331
336
  })
332
337
 
333
338
  export const AllVariants: Story = {
@@ -21,6 +21,11 @@ export const meta: ComponentMeta = {
21
21
  kind: 'contrast',
22
22
  relationship: 'Tabs switch content in-place; SideNav navigates between pages',
23
23
  },
24
+ {
25
+ component: 'admin-detail-page',
26
+ kind: 'composition',
27
+ relationship: 'Tabs as the facets of one record is the admin-detail-page recipe',
28
+ },
24
29
  ],
25
30
  example: `<Tabs.Root defaultValue="general">
26
31
  <Tabs.List>
@@ -2,6 +2,8 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Tag} from './Tag'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
6
+ import {colors} from '@duro-app/tokens/tokens/colors.css'
5
7
 
6
8
  const meta: Meta<typeof Tag> = {
7
9
  title: 'Components/Tag',
@@ -47,10 +49,16 @@ export const Small: Story = {
47
49
  }
48
50
 
49
51
  const layoutStyles = css.create({
50
- row: {display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap'},
51
- stack: {display: 'flex', flexDirection: 'column', gap: 16},
52
+ row: {display: 'flex', alignItems: 'center', gap: spacing.sm, flexWrap: 'wrap'},
53
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.md},
52
54
  // Narrow column that a long identifier tag would overflow without `wrap`.
53
- narrowCol: {width: 120, borderWidth: 1, borderStyle: 'solid', borderColor: '#333', padding: 8},
55
+ narrowCol: {
56
+ width: 120,
57
+ borderWidth: 1,
58
+ borderStyle: 'solid',
59
+ borderColor: colors.border,
60
+ padding: spacing.sm,
61
+ },
54
62
  })
55
63
 
56
64
  const LONG_CAP = 'lldap.group.member.remove'
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Textarea} from './Textarea'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof Textarea> = {
7
8
  title: 'Components/Textarea',
@@ -59,7 +60,7 @@ export const CustomRows: Story = {
59
60
  }
60
61
 
61
62
  const stackStyles = css.create({
62
- stack: {display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 320},
63
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.ms, maxWidth: 320},
63
64
  })
64
65
 
65
66
  export const AllVariants: Story = {
@@ -4,7 +4,7 @@ import {expect} from 'storybook/test'
4
4
  import {css, html} from 'react-strict-dom'
5
5
  import {ThemeProvider, type ThemeName} from './ThemeProvider'
6
6
  import {colors} from '@duro-app/tokens/tokens/colors.css'
7
- import {radii} from '@duro-app/tokens/tokens/spacing.css'
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
10
 
@@ -18,26 +18,26 @@ type Story = StoryObj<typeof ThemeProvider>
18
18
 
19
19
  const sampleStyles = css.create({
20
20
  container: {
21
- padding: 24,
21
+ padding: spacing.lg,
22
22
  backgroundColor: colors.bg,
23
23
  color: colors.text,
24
24
  borderRadius: radii.md,
25
25
  fontFamily: typography.fontFamily,
26
26
  },
27
27
  card: {
28
- padding: 16,
28
+ padding: spacing.md,
29
29
  backgroundColor: colors.bgCard,
30
30
  borderWidth: 1,
31
31
  borderStyle: 'solid',
32
32
  borderColor: colors.border,
33
33
  borderRadius: radii.md,
34
34
  boxShadow: shadows.md,
35
- marginBottom: 12,
35
+ marginBottom: spacing.ms,
36
36
  },
37
37
  title: {
38
38
  fontSize: typography.fontSizeLg,
39
39
  fontWeight: typography.fontWeightSemibold,
40
- marginBottom: 8,
40
+ marginBottom: spacing.sm,
41
41
  },
42
42
  muted: {
43
43
  color: colors.textMuted,
@@ -49,7 +49,7 @@ const sampleStyles = css.create({
49
49
  },
50
50
  row: {
51
51
  display: 'flex',
52
- gap: 16,
52
+ gap: spacing.md,
53
53
  flexWrap: 'wrap',
54
54
  },
55
55
  swatch: {
@@ -126,7 +126,7 @@ export const HighContrast: Story = {
126
126
  const sideBySideStyles = css.create({
127
127
  wrapper: {
128
128
  display: 'flex',
129
- gap: 24,
129
+ gap: spacing.lg,
130
130
  flexWrap: 'wrap',
131
131
  },
132
132
  column: {
@@ -136,8 +136,8 @@ const sideBySideStyles = css.create({
136
136
  label: {
137
137
  fontSize: typography.fontSizeSm,
138
138
  fontWeight: typography.fontWeightSemibold,
139
- marginBottom: 8,
140
- color: '#888',
139
+ marginBottom: spacing.sm,
140
+ color: colors.textMuted,
141
141
  },
142
142
  })
143
143
 
@@ -2,10 +2,17 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, userEvent, waitFor} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {ToastProvider, useToast} from './ToastProvider'
5
+ import {radii, spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const s = css.create({
7
- row: {display: 'flex', flexDirection: 'row', gap: 8, flexWrap: 'wrap'},
8
- btn: {padding: 8, borderRadius: 6, borderWidth: 1, borderStyle: 'solid', cursor: 'pointer'},
8
+ row: {display: 'flex', flexDirection: 'row', gap: spacing.sm, flexWrap: 'wrap'},
9
+ btn: {
10
+ padding: spacing.sm,
11
+ borderRadius: radii.sm,
12
+ borderWidth: 1,
13
+ borderStyle: 'solid',
14
+ cursor: 'pointer',
15
+ },
9
16
  })
10
17
 
11
18
  function Triggers() {
@@ -2,6 +2,7 @@ import type {Meta, StoryObj} from '@storybook/react'
2
2
  import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Toggle} from './Toggle'
5
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
5
6
 
6
7
  const meta: Meta<typeof Toggle> = {
7
8
  title: 'Components/Toggle',
@@ -59,7 +60,7 @@ export const Small: Story = {
59
60
  }
60
61
 
61
62
  const stackStyles = css.create({
62
- stack: {display: 'flex', gap: 8},
63
+ stack: {display: 'flex', gap: spacing.sm},
63
64
  })
64
65
 
65
66
  export const AllVariants: Story = {
@@ -3,6 +3,7 @@ import {expect, fn} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {ToggleGroup} from './ToggleGroup'
5
5
  import {Toggle} from '../Toggle/Toggle'
6
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
6
7
 
7
8
  const meta: Meta<typeof ToggleGroup> = {
8
9
  title: 'Components/ToggleGroup',
@@ -125,7 +126,7 @@ export const Vertical: Story = {
125
126
  }
126
127
 
127
128
  const stackStyles = css.create({
128
- stack: {display: 'flex', flexDirection: 'column', gap: 16},
129
+ stack: {display: 'flex', flexDirection: 'column', gap: spacing.md},
129
130
  })
130
131
 
131
132
  export const AllVariants: Story = {
@@ -3,6 +3,7 @@ import {expect} from 'storybook/test'
3
3
  import {css, html} from 'react-strict-dom'
4
4
  import {Tooltip} from './Tooltip'
5
5
  import {Badge} from '../Badge/Badge'
6
+ import {spacing} from '@duro-app/tokens/tokens/spacing.css'
6
7
 
7
8
  const meta: Meta = {
8
9
  title: 'Components/Tooltip',
@@ -31,8 +32,8 @@ const centerStyles = css.create({
31
32
  display: 'flex',
32
33
  alignItems: 'center',
33
34
  justifyContent: 'center',
34
- padding: 80,
35
- gap: 24,
35
+ padding: spacing.xxxl,
36
+ gap: spacing.lg,
36
37
  },
37
38
  })
38
39