@ds-mo/ui 0.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 (213) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/dist/index.css +1 -0
  4. package/dist/index.d.ts +969 -0
  5. package/dist/index.js +2623 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/r/accordion.json +79 -0
  8. package/dist/r/badge.json +69 -0
  9. package/dist/r/banner.json +90 -0
  10. package/dist/r/breadcrumb.json +70 -0
  11. package/dist/r/button-group.json +65 -0
  12. package/dist/r/button.json +137 -0
  13. package/dist/r/card.json +82 -0
  14. package/dist/r/checkbox.json +91 -0
  15. package/dist/r/divider.json +57 -0
  16. package/dist/r/empty-state.json +69 -0
  17. package/dist/r/error-boundary.json +66 -0
  18. package/dist/r/fade.json +65 -0
  19. package/dist/r/field.json +71 -0
  20. package/dist/r/header.json +67 -0
  21. package/dist/r/input.json +77 -0
  22. package/dist/r/loader.json +54 -0
  23. package/dist/r/menu.json +130 -0
  24. package/dist/r/modal.json +93 -0
  25. package/dist/r/pagination.json +80 -0
  26. package/dist/r/radio.json +85 -0
  27. package/dist/r/registry.json +1600 -0
  28. package/dist/r/scrollbar.json +68 -0
  29. package/dist/r/select.json +93 -0
  30. package/dist/r/sidebar.json +105 -0
  31. package/dist/r/skeleton.json +72 -0
  32. package/dist/r/slider.json +87 -0
  33. package/dist/r/surface.json +97 -0
  34. package/dist/r/tab-group.json +72 -0
  35. package/dist/r/tab.json +71 -0
  36. package/dist/r/table.json +110 -0
  37. package/dist/r/tag.json +110 -0
  38. package/dist/r/text.json +94 -0
  39. package/dist/r/toast.json +77 -0
  40. package/dist/r/toggle-button-group.json +65 -0
  41. package/dist/r/toggle-button.json +94 -0
  42. package/dist/r/toggle.json +65 -0
  43. package/dist/r/tooltip.json +86 -0
  44. package/package.json +80 -0
  45. package/src/components/Accordion/Accordion.module.css +66 -0
  46. package/src/components/Accordion/Accordion.stories.tsx +95 -0
  47. package/src/components/Accordion/Accordion.tsx +122 -0
  48. package/src/components/Accordion/index.ts +2 -0
  49. package/src/components/Badge/Badge.module.css +6 -0
  50. package/src/components/Badge/Badge.stories.tsx +99 -0
  51. package/src/components/Badge/Badge.tsx +23 -0
  52. package/src/components/Badge/index.ts +2 -0
  53. package/src/components/Banner/Banner.module.css +67 -0
  54. package/src/components/Banner/Banner.stories.tsx +81 -0
  55. package/src/components/Banner/Banner.tsx +109 -0
  56. package/src/components/Banner/index.ts +2 -0
  57. package/src/components/Breadcrumb/Breadcrumb.module.css +46 -0
  58. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +72 -0
  59. package/src/components/Breadcrumb/Breadcrumb.tsx +68 -0
  60. package/src/components/Breadcrumb/index.ts +2 -0
  61. package/src/components/Button/Button.module.css +343 -0
  62. package/src/components/Button/Button.stories.tsx +575 -0
  63. package/src/components/Button/Button.tsx +201 -0
  64. package/src/components/Button/index.ts +10 -0
  65. package/src/components/ButtonGroup/ButtonGroup.module.css +157 -0
  66. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +384 -0
  67. package/src/components/ButtonGroup/ButtonGroup.tsx +122 -0
  68. package/src/components/ButtonGroup/index.ts +2 -0
  69. package/src/components/Card/Card.module.css +36 -0
  70. package/src/components/Card/Card.stories.tsx +78 -0
  71. package/src/components/Card/Card.tsx +53 -0
  72. package/src/components/Card/index.ts +2 -0
  73. package/src/components/Checkbox/Checkbox.module.css +47 -0
  74. package/src/components/Checkbox/Checkbox.stories.tsx +129 -0
  75. package/src/components/Checkbox/Checkbox.tsx +68 -0
  76. package/src/components/Checkbox/index.ts +2 -0
  77. package/src/components/Divider/Divider.module.css +19 -0
  78. package/src/components/Divider/Divider.stories.tsx +55 -0
  79. package/src/components/Divider/Divider.tsx +28 -0
  80. package/src/components/Divider/index.ts +2 -0
  81. package/src/components/EmptyState/EmptyState.module.css +8 -0
  82. package/src/components/EmptyState/EmptyState.stories.tsx +53 -0
  83. package/src/components/EmptyState/EmptyState.tsx +31 -0
  84. package/src/components/EmptyState/index.ts +2 -0
  85. package/src/components/ErrorBoundary/ErrorBoundary.module.css +18 -0
  86. package/src/components/ErrorBoundary/ErrorBoundary.stories.tsx +38 -0
  87. package/src/components/ErrorBoundary/ErrorBoundary.tsx +50 -0
  88. package/src/components/ErrorBoundary/index.ts +2 -0
  89. package/src/components/Fade/Fade.module.css +31 -0
  90. package/src/components/Fade/Fade.stories.tsx +35 -0
  91. package/src/components/Fade/Fade.tsx +33 -0
  92. package/src/components/Fade/index.ts +2 -0
  93. package/src/components/Field/Field.module.css +5 -0
  94. package/src/components/Field/Field.stories.tsx +111 -0
  95. package/src/components/Field/Field.tsx +22 -0
  96. package/src/components/Field/index.ts +2 -0
  97. package/src/components/Header/Header.module.css +33 -0
  98. package/src/components/Header/Header.stories.tsx +52 -0
  99. package/src/components/Header/Header.tsx +42 -0
  100. package/src/components/Header/index.ts +2 -0
  101. package/src/components/Input/Input.module.css +71 -0
  102. package/src/components/Input/Input.stories.tsx +135 -0
  103. package/src/components/Input/Input.tsx +76 -0
  104. package/src/components/Input/index.ts +2 -0
  105. package/src/components/LabelWrap/LabelWrap.module.css +34 -0
  106. package/src/components/LabelWrap/LabelWrap.tsx +32 -0
  107. package/src/components/LabelWrap/index.ts +1 -0
  108. package/src/components/Loader/Loader.module.css +9 -0
  109. package/src/components/Loader/Loader.stories.tsx +44 -0
  110. package/src/components/Loader/Loader.tsx +43 -0
  111. package/src/components/Loader/index.ts +2 -0
  112. package/src/components/Menu/DestructiveMenuItem.module.css +57 -0
  113. package/src/components/Menu/DestructiveMenuItem.tsx +64 -0
  114. package/src/components/Menu/Menu.module.css +49 -0
  115. package/src/components/Menu/Menu.stories.tsx +129 -0
  116. package/src/components/Menu/Menu.tsx +269 -0
  117. package/src/components/Menu/MenuItem.module.css +84 -0
  118. package/src/components/Menu/MenuItem.tsx +101 -0
  119. package/src/components/Menu/index.ts +6 -0
  120. package/src/components/Modal/Modal.module.css +67 -0
  121. package/src/components/Modal/Modal.stories.tsx +71 -0
  122. package/src/components/Modal/Modal.tsx +122 -0
  123. package/src/components/Modal/index.ts +2 -0
  124. package/src/components/Pagination/Pagination.module.css +64 -0
  125. package/src/components/Pagination/Pagination.stories.tsx +51 -0
  126. package/src/components/Pagination/Pagination.tsx +103 -0
  127. package/src/components/Pagination/index.ts +2 -0
  128. package/src/components/Radio/Radio.module.css +61 -0
  129. package/src/components/Radio/Radio.stories.tsx +101 -0
  130. package/src/components/Radio/Radio.tsx +108 -0
  131. package/src/components/Radio/index.ts +2 -0
  132. package/src/components/Scrollbar/Scrollbar.module.css +81 -0
  133. package/src/components/Scrollbar/Scrollbar.stories.tsx +46 -0
  134. package/src/components/Scrollbar/Scrollbar.tsx +187 -0
  135. package/src/components/Scrollbar/index.ts +2 -0
  136. package/src/components/Select/Select.module.css +31 -0
  137. package/src/components/Select/Select.stories.tsx +59 -0
  138. package/src/components/Select/Select.tsx +92 -0
  139. package/src/components/Select/index.ts +2 -0
  140. package/src/components/Sidebar/Sidebar.module.css +161 -0
  141. package/src/components/Sidebar/Sidebar.stories.tsx +125 -0
  142. package/src/components/Sidebar/Sidebar.tsx +129 -0
  143. package/src/components/Sidebar/SidebarItem.tsx +57 -0
  144. package/src/components/Sidebar/SidebarSection.tsx +42 -0
  145. package/src/components/Sidebar/index.ts +6 -0
  146. package/src/components/Skeleton/Skeleton.module.css +53 -0
  147. package/src/components/Skeleton/Skeleton.stories.tsx +89 -0
  148. package/src/components/Skeleton/Skeleton.tsx +66 -0
  149. package/src/components/Skeleton/index.ts +2 -0
  150. package/src/components/Slider/Slider.module.css +62 -0
  151. package/src/components/Slider/Slider.stories.tsx +120 -0
  152. package/src/components/Slider/Slider.tsx +74 -0
  153. package/src/components/Slider/index.ts +2 -0
  154. package/src/components/Surface/Surface.module.css +222 -0
  155. package/src/components/Surface/Surface.stories.tsx +213 -0
  156. package/src/components/Surface/Surface.tsx +219 -0
  157. package/src/components/Surface/index.ts +12 -0
  158. package/src/components/Tab/Tab.module.css +66 -0
  159. package/src/components/Tab/Tab.stories.tsx +103 -0
  160. package/src/components/Tab/Tab.tsx +41 -0
  161. package/src/components/Tab/index.ts +2 -0
  162. package/src/components/TabGroup/TabGroup.module.css +26 -0
  163. package/src/components/TabGroup/TabGroup.stories.tsx +60 -0
  164. package/src/components/TabGroup/TabGroup.tsx +83 -0
  165. package/src/components/TabGroup/index.ts +2 -0
  166. package/src/components/Table/Table.module.css +130 -0
  167. package/src/components/Table/Table.stories.tsx +111 -0
  168. package/src/components/Table/Table.tsx +226 -0
  169. package/src/components/Table/index.ts +11 -0
  170. package/src/components/Tag/Tag.module.css +270 -0
  171. package/src/components/Tag/Tag.stories.tsx +399 -0
  172. package/src/components/Tag/Tag.tsx +162 -0
  173. package/src/components/Tag/index.ts +2 -0
  174. package/src/components/Text/Text.module.css +166 -0
  175. package/src/components/Text/Text.stories.tsx +212 -0
  176. package/src/components/Text/Text.tsx +181 -0
  177. package/src/components/Text/index.ts +13 -0
  178. package/src/components/Toast/Toast.module.css +91 -0
  179. package/src/components/Toast/Toast.stories.tsx +66 -0
  180. package/src/components/Toast/Toast.tsx +182 -0
  181. package/src/components/Toast/index.ts +8 -0
  182. package/src/components/Toggle/Toggle.module.css +87 -0
  183. package/src/components/Toggle/Toggle.stories.tsx +85 -0
  184. package/src/components/Toggle/Toggle.tsx +52 -0
  185. package/src/components/Toggle/index.ts +2 -0
  186. package/src/components/ToggleButton/ToggleButton.module.css +172 -0
  187. package/src/components/ToggleButton/ToggleButton.stories.tsx +299 -0
  188. package/src/components/ToggleButton/ToggleButton.tsx +118 -0
  189. package/src/components/ToggleButton/index.ts +2 -0
  190. package/src/components/ToggleButtonGroup/ToggleButtonGroup.module.css +163 -0
  191. package/src/components/ToggleButtonGroup/ToggleButtonGroup.stories.tsx +341 -0
  192. package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +111 -0
  193. package/src/components/ToggleButtonGroup/index.ts +2 -0
  194. package/src/components/Tooltip/Tooltip.module.css +45 -0
  195. package/src/components/Tooltip/Tooltip.stories.tsx +46 -0
  196. package/src/components/Tooltip/Tooltip.tsx +224 -0
  197. package/src/components/Tooltip/index.ts +2 -0
  198. package/src/css-modules.d.ts +4 -0
  199. package/src/docs/ColorUsage.mdx +195 -0
  200. package/src/docs/ElevationUsage.mdx +95 -0
  201. package/src/docs/Introduction.mdx +97 -0
  202. package/src/docs/OpticalSizing.mdx +178 -0
  203. package/src/docs/TypographyUsage.mdx +121 -0
  204. package/src/index.ts +154 -0
  205. package/src/stories/Colors.stories.tsx +528 -0
  206. package/src/stories/Dimensions.stories.tsx +200 -0
  207. package/src/stories/Effects.stories.tsx +231 -0
  208. package/src/stories/Icons.stories.tsx +159 -0
  209. package/src/stories/Typography.stories.tsx +157 -0
  210. package/src/types/icons.ts +15 -0
  211. package/src/types/index.ts +1 -0
  212. package/src/utils/cn.ts +6 -0
  213. package/src/utils/css-tokens.ts +22 -0
@@ -0,0 +1,528 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import React from 'react';
3
+
4
+ const meta: Meta = {
5
+ title: 'Design System/Colors',
6
+ parameters: { layout: 'fullscreen' },
7
+ };
8
+
9
+ export default meta;
10
+
11
+ // ── Helpers ──────────────────────────────────────────────────────────────────
12
+
13
+ const S: Record<string, React.CSSProperties> = {
14
+ page: { fontFamily: 'var(--typography-font-family, system-ui)', padding: 24, display: 'flex', flexDirection: 'column', gap: 40 },
15
+ section: { display: 'flex', flexDirection: 'column', gap: 12 },
16
+ heading: { fontSize: 18, fontWeight: 600, color: 'var(--color-foreground-primary)', margin: 0, letterSpacing: -0.3 },
17
+ subheading: { fontSize: 13, fontWeight: 500, color: 'var(--color-foreground-secondary)', margin: 0 },
18
+ grid: { display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(140px, 1fr))', gap: 8 },
19
+ swatch: { display: 'flex', flexDirection: 'column', gap: 4 },
20
+ color: { width: '100%', height: 48, borderRadius: 6, border: '1px solid var(--color-border-tertiary)' },
21
+ label: { fontSize: 10, lineHeight: 1.3, color: 'var(--color-foreground-secondary)', wordBreak: 'break-all' as const },
22
+ };
23
+
24
+ const INTENTS = ['brand', 'neutral', 'positive', 'negative', 'warning', 'caution', 'ai', 'guide', 'walkthrough'] as const;
25
+ const CONTRASTS = ['faint', 'medium', 'bold', 'strong'] as const;
26
+
27
+ function Swatch({ token, label, style }: { token: string; label?: string; style?: React.CSSProperties }) {
28
+ return (
29
+ <div style={S.swatch}>
30
+ <div style={{ ...S.color, backgroundColor: `var(--${token})`, ...style }} title={`--${token}`} />
31
+ <span style={S.label}>{label || token.replace('color-', '')}</span>
32
+ </div>
33
+ );
34
+ }
35
+
36
+ function Section({ title, subtitle, children }: { title: string; subtitle?: string; children: React.ReactNode }) {
37
+ return (
38
+ <div style={S.section}>
39
+ <div>
40
+ <h2 style={S.heading}>{title}</h2>
41
+ {subtitle && <p style={{ ...S.subheading, marginTop: 2 }}>{subtitle}</p>}
42
+ </div>
43
+ {children}
44
+ </div>
45
+ );
46
+ }
47
+
48
+ // ── Stories ───────────────────────────────────────────────────────────────────
49
+
50
+ function BackgroundColors() {
51
+ return (
52
+ <div style={S.page}>
53
+ <Section title="Background — Surface" subtitle="Primary, secondary, shade, translucent">
54
+ <div style={S.grid}>
55
+ <Swatch token="color-background-primary" />
56
+ <Swatch token="color-background-secondary" />
57
+ <Swatch token="color-background-shade" />
58
+ <Swatch token="color-background-translucent" style={{ backdropFilter: 'blur(16px)' }} />
59
+ <Swatch token="color-background-transparent" style={{ background: 'repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 0 0 / 12px 12px' }} />
60
+ </div>
61
+ </Section>
62
+
63
+ {CONTRASTS.map(contrast => (
64
+ <Section key={contrast} title={`Background — ${contrast.charAt(0).toUpperCase() + contrast.slice(1)}`}>
65
+ <div style={S.grid}>
66
+ {INTENTS.map(intent => (
67
+ <Swatch key={intent} token={`color-background-${contrast}-${intent}`} label={intent} />
68
+ ))}
69
+ </div>
70
+ </Section>
71
+ ))}
72
+ </div>
73
+ );
74
+ }
75
+
76
+ function ForegroundColors() {
77
+ return (
78
+ <div style={S.page}>
79
+ <Section title="Foreground — Base" subtitle="Neutral hierarchy">
80
+ <div style={S.grid}>
81
+ {['primary', 'secondary', 'tertiary', 'quaternary'].map(level => (
82
+ <div key={level} style={S.swatch}>
83
+ <div style={{ ...S.color, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'var(--color-background-primary)' }}>
84
+ <span style={{ color: `var(--color-foreground-${level})`, fontWeight: 600, fontSize: 14 }}>Aa</span>
85
+ </div>
86
+ <span style={S.label}>foreground-{level}</span>
87
+ </div>
88
+ ))}
89
+ </div>
90
+ </Section>
91
+
92
+ {CONTRASTS.map(contrast => (
93
+ <Section key={contrast} title={`Foreground — ${contrast.charAt(0).toUpperCase() + contrast.slice(1)}`}>
94
+ <div style={S.grid}>
95
+ {INTENTS.map(intent => (
96
+ <div key={intent} style={S.swatch}>
97
+ <div style={{ ...S.color, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor:
98
+ contrast === 'faint' ? 'var(--color-background-primary)'
99
+ : contrast === 'medium' ? `var(--color-background-strong-${intent})`
100
+ : contrast === 'bold' ? `var(--color-background-faint-${intent})`
101
+ : contrast === 'strong' ? `var(--color-background-medium-${intent})`
102
+ : `var(--color-background-${contrast}-${intent})`
103
+ }}>
104
+ <span style={{ color: `var(--color-foreground-${contrast}-${intent})`, fontWeight: 600, fontSize: 16 }}>Aa</span>
105
+ </div>
106
+ <span style={S.label}>{intent}</span>
107
+ </div>
108
+ ))}
109
+ </div>
110
+ </Section>
111
+ ))}
112
+
113
+ <Section title="Foreground — On Background" subtitle="Tokens for text on colored surfaces">
114
+ {['on-bold-background', 'on-strong-background', 'on-medium-background', 'on-translucent-background'].map(ctx => (
115
+ <div key={ctx} style={{ marginBottom: 16 }}>
116
+ <p style={{ ...S.subheading, marginBottom: 8 }}>{ctx}</p>
117
+ <div style={S.grid}>
118
+ {['primary', 'secondary', 'tertiary', 'quaternary'].map(level => {
119
+ const bg = ctx === 'on-bold-background' ? 'var(--color-background-bold-brand)'
120
+ : ctx === 'on-strong-background' ? 'var(--color-background-strong-brand)'
121
+ : ctx === 'on-medium-background' ? 'var(--color-background-medium-brand)'
122
+ : 'var(--color-background-translucent)';
123
+ return (
124
+ <div key={level} style={S.swatch}>
125
+ <div style={{ ...S.color, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: bg }}>
126
+ <span style={{ color: `var(--color-foreground-${ctx}-${level})`, fontWeight: 600, fontSize: 16 }}>Aa</span>
127
+ </div>
128
+ <span style={S.label}>{level}</span>
129
+ </div>
130
+ );
131
+ })}
132
+ </div>
133
+ </div>
134
+ ))}
135
+ </Section>
136
+ </div>
137
+ );
138
+ }
139
+
140
+ function BorderColors() {
141
+ return (
142
+ <div style={S.page}>
143
+ <Section title="Border — Base" subtitle="Neutral hierarchy">
144
+ <div style={S.grid}>
145
+ {['primary', 'secondary', 'tertiary'].map(level => (
146
+ <div key={level} style={S.swatch}>
147
+ <div style={{ ...S.color, backgroundColor: 'var(--color-background-primary)', border: `3px solid var(--color-border-${level})` }} />
148
+ <span style={S.label}>border-{level}</span>
149
+ </div>
150
+ ))}
151
+ </div>
152
+ </Section>
153
+
154
+ <Section title="Border — Intent">
155
+ <div style={S.grid}>
156
+ {INTENTS.map(intent => (
157
+ <div key={intent} style={S.swatch}>
158
+ <div style={{ ...S.color, backgroundColor: 'var(--color-background-primary)', border: `3px solid var(--color-border-${intent})` }} />
159
+ <span style={S.label}>{intent}</span>
160
+ </div>
161
+ ))}
162
+ </div>
163
+ </Section>
164
+
165
+ <Section title="Border — On Background" subtitle="Context-aware border hierarchy">
166
+ {['on-bold-background', 'on-strong-background', 'on-medium-background', 'on-translucent-background'].map(ctx => {
167
+ const bg = ctx === 'on-bold-background' ? 'var(--color-background-bold-neutral)'
168
+ : ctx === 'on-strong-background' ? 'var(--color-background-strong-neutral)'
169
+ : ctx === 'on-medium-background' ? 'var(--color-background-medium-neutral)'
170
+ : 'var(--color-background-translucent)';
171
+ return (
172
+ <div key={ctx} style={{ marginBottom: 16 }}>
173
+ <p style={{ ...S.subheading, marginBottom: 8 }}>{ctx}</p>
174
+ <div style={S.grid}>
175
+ {['primary', 'secondary', 'tertiary'].map(level => (
176
+ <div key={level} style={S.swatch}>
177
+ <div style={{ ...S.color, backgroundColor: bg, border: `3px solid var(--color-border-${ctx}-${level})` }} />
178
+ <span style={S.label}>{level}</span>
179
+ </div>
180
+ ))}
181
+ </div>
182
+ </div>
183
+ );
184
+ })}
185
+ </Section>
186
+
187
+ <Section title="Divider" subtitle="--color-divider-*">
188
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
189
+ <div>
190
+ <p style={{ ...S.subheading, marginBottom: 8 }}>Default</p>
191
+ <div style={{ backgroundColor: 'var(--color-background-primary)', borderRadius: 8, padding: 16 }}>
192
+ <div style={{ height: 1, backgroundColor: 'var(--color-divider-divider)' }} />
193
+ <span style={{ ...S.label, marginTop: 4, display: 'block' }}>color-divider-divider</span>
194
+ </div>
195
+ </div>
196
+ {['on-bold-background', 'on-strong-background', 'on-medium-background', 'on-translucent-background'].map(ctx => {
197
+ const bg = ctx === 'on-bold-background' ? 'var(--color-background-bold-neutral)'
198
+ : ctx === 'on-strong-background' ? 'var(--color-background-strong-neutral)'
199
+ : ctx === 'on-medium-background' ? 'var(--color-background-medium-neutral)'
200
+ : 'var(--color-background-translucent)';
201
+ return (
202
+ <div key={ctx}>
203
+ <p style={{ ...S.subheading, marginBottom: 8 }}>{ctx}</p>
204
+ <div style={{ backgroundColor: bg, borderRadius: 8, padding: 16 }}>
205
+ <div style={{ height: 1, backgroundColor: `var(--color-divider-${ctx})` }} />
206
+ <span style={{ ...S.label, marginTop: 4, display: 'block', color: ctx.includes('bold') || ctx.includes('strong') ? 'var(--color-foreground-on-strong-background-secondary)' : 'var(--color-foreground-secondary)' }}>
207
+ color-divider-{ctx}
208
+ </span>
209
+ </div>
210
+ </div>
211
+ );
212
+ })}
213
+ </div>
214
+ </Section>
215
+ </div>
216
+ );
217
+ }
218
+
219
+ function InteractionColors() {
220
+ return (
221
+ <div style={S.page}>
222
+ <Section title="Interaction — Default" subtitle="Hover, pressed, focus on standard surfaces">
223
+ <div style={S.grid}>
224
+ {['hover', 'pressed', 'focus'].map(state => (
225
+ <Swatch key={state} token={`color-interaction-${state}`} label={state} />
226
+ ))}
227
+ </div>
228
+ </Section>
229
+
230
+ {['on-bold-background', 'on-strong-background', 'on-medium-background', 'on-translucent-background'].map(ctx => {
231
+ const bg = ctx === 'on-bold-background' ? 'var(--color-background-bold-brand)'
232
+ : ctx === 'on-strong-background' ? 'var(--color-background-strong-brand)'
233
+ : ctx === 'on-medium-background' ? 'var(--color-background-medium-brand)'
234
+ : 'var(--color-background-translucent)';
235
+ return (
236
+ <Section key={ctx} title={`Interaction — ${ctx}`}>
237
+ <div style={S.grid}>
238
+ {['hover', 'pressed', 'focus'].map(state => (
239
+ <div key={state} style={S.swatch}>
240
+ <div style={{ ...S.color, position: 'relative', backgroundColor: bg, overflow: 'hidden' }}>
241
+ <div style={{ position: 'absolute', inset: 0, backgroundColor: `var(--color-interaction-${ctx}-${state})` }} />
242
+ </div>
243
+ <span style={S.label}>{state}</span>
244
+ </div>
245
+ ))}
246
+ </div>
247
+ </Section>
248
+ );
249
+ })}
250
+ </div>
251
+ );
252
+ }
253
+
254
+ function AlwaysDarkColors() {
255
+ return (
256
+ <div style={S.page}>
257
+ <Section title="Always Dark" subtitle="Tokens that stay dark regardless of theme">
258
+ <div style={{ backgroundColor: 'var(--color-always-dark-background)', borderRadius: 12, padding: 24, display: 'flex', flexDirection: 'column', gap: 24 }}>
259
+ <div>
260
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Background</p>
261
+ <div style={S.grid}>
262
+ <div style={S.swatch}>
263
+ <div style={{ ...S.color, backgroundColor: 'var(--color-always-dark-background)', border: '1px solid var(--color-always-dark-border-tertiary)' }} />
264
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>always-dark-background</span>
265
+ </div>
266
+ </div>
267
+ </div>
268
+
269
+ <div>
270
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Foreground — Hierarchy</p>
271
+ <div style={S.grid}>
272
+ {['primary', 'secondary', 'tertiary', 'quaternary', 'quinary'].map(level => (
273
+ <div key={level} style={S.swatch}>
274
+ <div style={{ ...S.color, display: 'flex', alignItems: 'center', justifyContent: 'center', border: 'none' }}>
275
+ <span style={{ color: `var(--color-always-dark-foreground-${level})`, fontWeight: 600, fontSize: 16 }}>Aa</span>
276
+ </div>
277
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>{level}</span>
278
+ </div>
279
+ ))}
280
+ </div>
281
+ </div>
282
+
283
+ <div>
284
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Foreground — Intent</p>
285
+ <div style={S.grid}>
286
+ {INTENTS.map(intent => (
287
+ <div key={intent} style={S.swatch}>
288
+ <div style={{ ...S.color, display: 'flex', alignItems: 'center', justifyContent: 'center', border: 'none' }}>
289
+ <span style={{ color: `var(--color-always-dark-foreground-${intent})`, fontWeight: 600, fontSize: 16 }}>Aa</span>
290
+ </div>
291
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>{intent}</span>
292
+ </div>
293
+ ))}
294
+ </div>
295
+ </div>
296
+
297
+ <div>
298
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Border — Hierarchy</p>
299
+ <div style={S.grid}>
300
+ {['primary', 'secondary', 'tertiary'].map(level => (
301
+ <div key={level} style={S.swatch}>
302
+ <div style={{ ...S.color, border: `3px solid var(--color-always-dark-border-${level})` }} />
303
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>{level}</span>
304
+ </div>
305
+ ))}
306
+ </div>
307
+ </div>
308
+
309
+ <div>
310
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Border — Intent</p>
311
+ <div style={S.grid}>
312
+ {INTENTS.map(intent => (
313
+ <div key={intent} style={S.swatch}>
314
+ <div style={{ ...S.color, border: `3px solid var(--color-always-dark-border-${intent})` }} />
315
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>{intent}</span>
316
+ </div>
317
+ ))}
318
+ </div>
319
+ </div>
320
+
321
+ <div>
322
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Divider</p>
323
+ <div style={{ height: 1, backgroundColor: 'var(--color-always-dark-divider)', margin: '4px 0' }} />
324
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>always-dark-divider</span>
325
+ </div>
326
+
327
+ <div>
328
+ <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--color-always-dark-foreground-secondary)', margin: '0 0 8px' }}>Interaction</p>
329
+ <div style={S.grid}>
330
+ {['hover', 'pressed', 'focus'].map(state => (
331
+ <div key={state} style={S.swatch}>
332
+ <div style={{ ...S.color, position: 'relative', overflow: 'hidden', border: 'none' }}>
333
+ <div style={{ position: 'absolute', inset: 0, backgroundColor: `var(--color-always-dark-interaction-${state})` }} />
334
+ </div>
335
+ <span style={{ ...S.label, color: 'var(--color-always-dark-foreground-tertiary)' }}>{state}</span>
336
+ </div>
337
+ ))}
338
+ </div>
339
+ </div>
340
+ </div>
341
+ </Section>
342
+ </div>
343
+ );
344
+ }
345
+
346
+ function DataVizColors() {
347
+ return (
348
+ <div style={S.page}>
349
+ <Section title="Data — Category (12)" subtitle="Categorical palette for charts and graphs">
350
+ <div style={{ ...S.grid, gridTemplateColumns: 'repeat(auto-fill, minmax(80px, 1fr))' }}>
351
+ {Array.from({ length: 12 }, (_, i) => i + 1).map(n => (
352
+ <Swatch key={n} token={`color-data-category-${n}`} label={`${n}`} />
353
+ ))}
354
+ </div>
355
+ </Section>
356
+
357
+ <Section title="Data — Sequential Blue" subtitle="2, 3, and 4-step blue sequences">
358
+ {[2, 3, 4].map(steps => (
359
+ <div key={steps} style={{ marginBottom: 12 }}>
360
+ <p style={{ ...S.subheading, marginBottom: 6 }}>{steps}-step</p>
361
+ <div style={{ display: 'flex', gap: 8 }}>
362
+ {Array.from({ length: steps }, (_, i) => i + 1).map(n => (
363
+ <div key={n} style={{ flex: 1 }}>
364
+ <Swatch token={`color-data-sequence-blue-${steps}-${n}`} label={`${n}`} />
365
+ </div>
366
+ ))}
367
+ </div>
368
+ </div>
369
+ ))}
370
+ </Section>
371
+
372
+ <Section title="Data — Diverging Blue-Orange" subtitle="5, 7, and 9-step diverging palettes">
373
+ {[5, 7, 9].map(steps => (
374
+ <div key={steps} style={{ marginBottom: 12 }}>
375
+ <p style={{ ...S.subheading, marginBottom: 6 }}>{steps}-step</p>
376
+ <div style={{ display: 'flex', gap: 4 }}>
377
+ {Array.from({ length: steps }, (_, i) => i + 1).map(n => (
378
+ <div key={n} style={{ flex: 1 }}>
379
+ <Swatch token={`color-data-diverging-blue-orange-${steps}-${n}`} label={`${n}`} />
380
+ </div>
381
+ ))}
382
+ </div>
383
+ </div>
384
+ ))}
385
+ </Section>
386
+
387
+ <Section title="Data — Win/Loss">
388
+ <div style={{ display: 'flex', gap: 8, maxWidth: 400 }}>
389
+ <div style={{ flex: 1 }}><Swatch token="color-data-win-loss-win" label="win" /></div>
390
+ <div style={{ flex: 1 }}><Swatch token="color-data-win-loss-win-alt" label="win-alt" /></div>
391
+ <div style={{ flex: 1 }}><Swatch token="color-data-win-loss-loss" label="loss" /></div>
392
+ </div>
393
+ </Section>
394
+
395
+ <Section title="Data — Misc">
396
+ <div style={{ display: 'flex', gap: 8, maxWidth: 400 }}>
397
+ {[1, 2, 3, 4].map(n => (
398
+ <div key={n} style={{ flex: 1 }}><Swatch token={`color-data-misc-${n}`} label={`${n}`} /></div>
399
+ ))}
400
+ </div>
401
+ </Section>
402
+ </div>
403
+ );
404
+ }
405
+
406
+ function ReferenceColors() {
407
+ const alphaSteps = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100];
408
+
409
+ const greys = [
410
+ 'grey-l18', 'grey-l20', 'grey-l27-dark-faint', 'grey-l30-light-strong',
411
+ 'grey-l50-dark-medium', 'grey-l51-light-bold', 'grey-l65-dark-bold',
412
+ 'grey-l75-light-medium', 'grey-l91-dark-strong', 'grey-l93-light-faint', 'grey-l98',
413
+ ];
414
+
415
+ const hues = [
416
+ { name: 'Blue (250)', tokens: {
417
+ light: ['light-blue-250-l92-c04-faint', 'light-blue-250-l70-c18-medium', 'light-blue-250-l50-c18-bold', 'light-blue-250-l33-c09-strong'],
418
+ dark: ['dark-blue-250-l27-c05-faint', 'dark-blue-250-l50-c17-medium', 'dark-blue-250-l65-c20-bold', 'dark-blue-250-l91-c05-strong'],
419
+ }},
420
+ { name: 'Red (30)', tokens: {
421
+ light: ['light-red-30-l93-c04-faint', 'light-red-30-l70-c20-medium', 'light-red-30-l53-c20-bold', 'light-red-30-l30-c11-strong'],
422
+ dark: ['dark-red-30-l28-c05-faint', 'dark-red-30-l51-c17-medium', 'dark-red-30-l70-c20-bold', 'dark-red-30-l91-c06-strong'],
423
+ }},
424
+ { name: 'Green (145)', tokens: {
425
+ light: ['light-green-145-l94-c05-faint', 'light-green-145-l75-c22-medium', 'light-green-145-l50-c19-bold', 'light-green-145-l35-c13-strong'],
426
+ dark: ['dark-green-145-l27-c05-faint', 'dark-green-145-l50-c17-medium', 'dark-green-145-l70-c19-bold', 'dark-green-145-l93-c06-strong'],
427
+ }},
428
+ { name: 'Orange (60)', tokens: {
429
+ light: ['light-orange-60-l93-c05-faint', 'light-orange-60-l75-c20-medium', 'light-orange-60-l52-c13-bold', 'light-orange-60-l35-c09-strong'],
430
+ dark: ['dark-orange-60-l28-c05-faint', 'dark-orange-60-l51-c13-medium', 'dark-orange-60-l75-c20-bold', 'dark-orange-60-l92-c06-strong'],
431
+ }},
432
+ { name: 'Yellow (85)', tokens: {
433
+ light: ['light-yellow-85-l93-c08-faint', 'light-yellow-85-l85-c20-medium', 'light-yellow-85-l51-c12-bold', 'light-yellow-85-l40-c09-strong'],
434
+ dark: ['dark-yellow-85-l28-c05-faint', 'dark-yellow-85-l51-c12-medium', 'dark-yellow-85-l80-c18-bold', 'dark-yellow-85-l93-c05-strong'],
435
+ }},
436
+ { name: 'Purple (290)', tokens: {
437
+ light: ['light-purple-290-l92-c04-faint', 'light-purple-290-l75-c15-medium', 'light-purple-290-l52-c20-bold', 'light-purple-290-l35-c13-strong'],
438
+ dark: ['dark-purple-290-l28-c05-faint', 'dark-purple-290-l52-c17-medium', 'dark-purple-290-l67-c20-bold', 'dark-purple-290-l92-c05-strong'],
439
+ }},
440
+ { name: 'Teal (180)', tokens: {
441
+ light: ['light-teal-180-l94-c05-faint', 'light-teal-180-l75-c17-medium', 'light-teal-180-l50-c12-bold', 'light-teal-180-l35-c09-strong'],
442
+ dark: ['dark-teal-180-l27-c05-faint', 'dark-teal-180-l50-c12-medium', 'dark-teal-180-l70-c15-bold', 'dark-teal-180-l93-c08-strong'],
443
+ }},
444
+ { name: 'Cyan (215)', tokens: {
445
+ light: ['light-cyan-215-l94-c04-faint', 'light-cyan-215-l75-c17-medium', 'light-cyan-215-l51-c11-bold', 'light-cyan-215-l30-c07-strong'],
446
+ dark: ['dark-cyan-215-l27-c05-faint', 'dark-cyan-215-l50-c11-medium', 'dark-cyan-215-l70-c15-bold', 'dark-cyan-215-l92-c07-strong'],
447
+ }},
448
+ { name: 'Magenta (325)', tokens: {
449
+ light: ['light-magenta-325-l94-c05-faint', 'light-magenta-325-l70-c23-medium', 'light-magenta-325-l54-c20-bold', 'light-magenta-325-l30-c13-strong'],
450
+ dark: ['dark-magenta-325-l28-c05-faint', 'dark-magenta-325-l51-c17-medium', 'dark-magenta-325-l67-c20-bold', 'dark-magenta-325-l90-c08-strong'],
451
+ }},
452
+ { name: 'Pink (0)', tokens: {
453
+ light: ['light-pink-0-l93-c05-faint', 'light-pink-0-l70-c22-medium', 'light-pink-0-l53-c20-bold', 'light-pink-0-l29-c10-strong'],
454
+ dark: ['dark-pink-0-l28-c05-faint', 'dark-pink-0-l52-c17-medium', 'dark-pink-0-l68-c20-bold', 'dark-pink-0-l92-c05-strong'],
455
+ }},
456
+ { name: 'Olive (115)', tokens: {
457
+ light: ['light-olive-115-l93-c05-faint', 'light-olive-115-l85-c22-medium', 'light-olive-115-l51-c13-bold', 'light-olive-115-l35-c09-strong'],
458
+ dark: ['dark-olive-115-l27-c05-faint', 'dark-olive-115-l51-c13-medium', 'dark-olive-115-l75-c19-bold', 'dark-olive-115-l93-c05-strong'],
459
+ }},
460
+ ];
461
+
462
+ return (
463
+ <div style={S.page}>
464
+ <Section title="Reference — Black" subtitle="--color-reference-black-{opacity}">
465
+ <div style={{ display: 'flex', gap: 2 }}>
466
+ {alphaSteps.map(step => (
467
+ <div key={step} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
468
+ <div style={{ width: '100%', height: 40, backgroundColor: `var(--color-reference-black-${step})`, borderRadius: 4, border: '1px solid var(--color-border-tertiary)' }} />
469
+ <span style={{ fontSize: 9, color: 'var(--color-foreground-tertiary)' }}>{step}</span>
470
+ </div>
471
+ ))}
472
+ </div>
473
+ </Section>
474
+
475
+ <Section title="Reference — White" subtitle="--color-reference-white-{opacity}">
476
+ <div style={{ display: 'flex', gap: 2, backgroundColor: 'var(--color-reference-black-100)', borderRadius: 8, padding: 8 }}>
477
+ {alphaSteps.map(step => (
478
+ <div key={step} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
479
+ <div style={{ width: '100%', height: 40, backgroundColor: `var(--color-reference-white-${step})`, borderRadius: 4 }} />
480
+ <span style={{ fontSize: 9, color: 'var(--color-reference-white-55)' }}>{step}</span>
481
+ </div>
482
+ ))}
483
+ </div>
484
+ </Section>
485
+
486
+ <Section title="Reference — Grey" subtitle="--color-reference-grey-*">
487
+ <div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
488
+ {greys.map(g => (
489
+ <div key={g} style={{ flex: '1 0 70px', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
490
+ <div style={{ width: '100%', height: 40, backgroundColor: `var(--color-reference-${g})`, borderRadius: 4, border: '1px solid var(--color-border-tertiary)' }} />
491
+ <span style={{ fontSize: 8, color: 'var(--color-foreground-tertiary)', textAlign: 'center', wordBreak: 'break-all' as const }}>{g}</span>
492
+ </div>
493
+ ))}
494
+ </div>
495
+ </Section>
496
+
497
+ {hues.map(hue => (
498
+ <Section key={hue.name} title={`Reference — ${hue.name}`} subtitle="Light (faint → strong) | Dark (faint → strong)">
499
+ <div style={{ display: 'flex', gap: 4 }}>
500
+ {hue.tokens.light.map(token => (
501
+ <div key={token} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
502
+ <div style={{ width: '100%', height: 40, backgroundColor: `var(--color-reference-${token})`, borderRadius: 4, border: '1px solid var(--color-border-tertiary)' }}
503
+ title={`--color-reference-${token}`} />
504
+ <span style={{ fontSize: 8, color: 'var(--color-foreground-tertiary)', textAlign: 'center', wordBreak: 'break-all' as const }}>{token}</span>
505
+ </div>
506
+ ))}
507
+ <div style={{ width: 1, backgroundColor: 'var(--color-border-tertiary)', margin: '0 4px', flexShrink: 0 }} />
508
+ {hue.tokens.dark.map(token => (
509
+ <div key={token} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
510
+ <div style={{ width: '100%', height: 40, backgroundColor: `var(--color-reference-${token})`, borderRadius: 4, border: '1px solid var(--color-border-tertiary)' }}
511
+ title={`--color-reference-${token}`} />
512
+ <span style={{ fontSize: 8, color: 'var(--color-foreground-tertiary)', textAlign: 'center', wordBreak: 'break-all' as const }}>{token}</span>
513
+ </div>
514
+ ))}
515
+ </div>
516
+ </Section>
517
+ ))}
518
+ </div>
519
+ );
520
+ }
521
+
522
+ export const References: StoryObj = { name: 'References', render: () => <ReferenceColors /> };
523
+ export const Backgrounds: StoryObj = { name: 'Backgrounds', render: () => <BackgroundColors /> };
524
+ export const Foregrounds: StoryObj = { name: 'Foregrounds', render: () => <ForegroundColors /> };
525
+ export const Borders: StoryObj = { name: 'Borders & Dividers', render: () => <BorderColors /> };
526
+ export const Interactions: StoryObj = { name: 'Interactions', render: () => <InteractionColors /> };
527
+ export const AlwaysDark: StoryObj = { name: 'Always Dark', render: () => <AlwaysDarkColors /> };
528
+ export const DataViz: StoryObj = { name: 'Data Visualization', render: () => <DataVizColors /> };