@ponti-studios/ui 2.0.1 → 3.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 (319) hide show
  1. package/README.md +36 -3
  2. package/dist/auth/index.d.ts +3 -0
  3. package/dist/auth/index.js +3 -0
  4. package/dist/components/data-display/accordion.d.ts +10 -0
  5. package/dist/components/data-display/accordion.js +53 -0
  6. package/{src/components/data-display/index.ts → dist/components/data-display/index.d.ts} +1 -10
  7. package/dist/components/data-display/index.js +8 -0
  8. package/dist/components/data-display/metric-card.d.ts +9 -0
  9. package/dist/components/data-display/metric-card.js +25 -0
  10. package/dist/components/data-display/sort-controls.d.ts +13 -0
  11. package/dist/components/data-display/sort-controls.js +57 -0
  12. package/dist/components/data-display/sort-row.d.ts +10 -0
  13. package/dist/components/data-display/sort-row.js +52 -0
  14. package/dist/components/data-display/table.d.ts +10 -0
  15. package/dist/components/data-display/table.js +57 -0
  16. package/dist/components/feedback/alert.d.ts +9 -0
  17. package/dist/components/feedback/alert.js +38 -0
  18. package/dist/components/feedback/empty-state.d.ts +18 -0
  19. package/dist/components/feedback/empty-state.js +36 -0
  20. package/{src/components/feedback/index.ts → dist/components/feedback/index.d.ts} +2 -0
  21. package/dist/components/feedback/index.js +7 -0
  22. package/dist/components/feedback/progress.d.ts +6 -0
  23. package/dist/components/feedback/progress.js +25 -0
  24. package/dist/components/feedback/skeleton.d.ts +2 -0
  25. package/dist/components/feedback/skeleton.js +11 -0
  26. package/dist/components/feedback/spinner.d.ts +14 -0
  27. package/dist/components/feedback/spinner.js +27 -0
  28. package/dist/components/feedback/update-guard.d.ts +13 -0
  29. package/dist/components/feedback/update-guard.js +38 -0
  30. package/dist/components/filters/active-filters-bar.d.ts +14 -0
  31. package/dist/components/filters/active-filters-bar.js +44 -0
  32. package/dist/components/filters/filter-chip.d.ts +11 -0
  33. package/dist/components/filters/filter-chip.js +33 -0
  34. package/dist/components/filters/filter-select.d.ts +17 -0
  35. package/dist/components/filters/filter-select.js +46 -0
  36. package/dist/components/filters/index.js +4 -0
  37. package/dist/components/forms/checkbox.d.ts +4 -0
  38. package/dist/components/forms/checkbox.js +24 -0
  39. package/dist/components/forms/date-month-select.d.ts +11 -0
  40. package/dist/components/forms/date-month-select.js +47 -0
  41. package/dist/components/forms/date-picker.d.ts +60 -0
  42. package/dist/components/forms/date-picker.js +193 -0
  43. package/dist/components/forms/date-utils.d.ts +14 -0
  44. package/dist/components/forms/date-utils.js +18 -0
  45. package/dist/components/forms/drop-zone.d.ts +42 -0
  46. package/dist/components/forms/drop-zone.js +184 -0
  47. package/{src/components/forms/index.ts → dist/components/forms/index.d.ts} +3 -9
  48. package/dist/components/forms/index.js +17 -0
  49. package/dist/components/forms/input.d.ts +3 -0
  50. package/dist/components/forms/input.js +15 -0
  51. package/dist/components/forms/label.d.ts +3 -0
  52. package/dist/components/forms/label.js +14 -0
  53. package/dist/components/forms/passkey-management.d.ts +14 -0
  54. package/dist/components/forms/passkey-management.js +132 -0
  55. package/dist/components/forms/radio-group.d.ts +6 -0
  56. package/dist/components/forms/radio-group.js +28 -0
  57. package/dist/components/forms/select.d.ts +18 -0
  58. package/dist/components/forms/select.js +103 -0
  59. package/dist/components/forms/slider.d.ts +9 -0
  60. package/dist/components/forms/slider.js +25 -0
  61. package/dist/components/forms/stepper.d.ts +15 -0
  62. package/dist/components/forms/stepper.js +41 -0
  63. package/dist/components/forms/switch.d.ts +6 -0
  64. package/dist/components/forms/switch.js +21 -0
  65. package/dist/components/forms/text-field.d.ts +15 -0
  66. package/dist/components/forms/text-field.js +46 -0
  67. package/dist/components/forms/text-field.types.d.ts +8 -0
  68. package/dist/components/forms/textarea.d.ts +3 -0
  69. package/dist/components/forms/textarea.js +14 -0
  70. package/dist/components/layout/index.js +5 -0
  71. package/dist/components/layout/particle-background.d.ts +19 -0
  72. package/dist/components/layout/particle-background.js +171 -0
  73. package/dist/components/layout/scroll-area.d.ts +9 -0
  74. package/dist/components/layout/scroll-area.js +35 -0
  75. package/dist/components/layout/section-intro.d.ts +12 -0
  76. package/dist/components/layout/section-intro.js +28 -0
  77. package/dist/components/layout/surface-panel.d.ts +7 -0
  78. package/dist/components/layout/surface-panel.js +11 -0
  79. package/dist/components/navigation/app-navigation.d.ts +67 -0
  80. package/dist/components/navigation/app-navigation.js +106 -0
  81. package/{src/components/navigation/index.ts → dist/components/navigation/index.d.ts} +1 -7
  82. package/dist/components/navigation/index.js +4 -0
  83. package/dist/components/navigation/pagination-controls.d.ts +7 -0
  84. package/dist/components/navigation/pagination-controls.js +50 -0
  85. package/dist/components/navigation/tabs.d.ts +7 -0
  86. package/dist/components/navigation/tabs.js +35 -0
  87. package/dist/components/overlays/bottom-sheet.d.ts +20 -0
  88. package/dist/components/overlays/bottom-sheet.js +101 -0
  89. package/dist/components/overlays/command.d.ts +29 -0
  90. package/dist/components/overlays/command.js +123 -0
  91. package/dist/components/overlays/dialog.d.ts +30 -0
  92. package/dist/components/overlays/dialog.js +105 -0
  93. package/dist/components/overlays/dropdown-menu.d.ts +29 -0
  94. package/dist/components/overlays/dropdown-menu.js +128 -0
  95. package/dist/components/overlays/index.d.ts +7 -0
  96. package/dist/components/overlays/index.js +8 -0
  97. package/dist/components/overlays/popover.d.ts +14 -0
  98. package/dist/components/overlays/popover.js +56 -0
  99. package/dist/components/overlays/sheet.d.ts +27 -0
  100. package/dist/components/overlays/sheet.js +81 -0
  101. package/dist/components/overlays/tooltip.d.ts +10 -0
  102. package/dist/components/overlays/tooltip.js +23 -0
  103. package/dist/components/primitives/avatar.d.ts +14 -0
  104. package/dist/components/primitives/avatar.js +72 -0
  105. package/dist/components/primitives/badge.d.ts +7 -0
  106. package/dist/components/primitives/badge.js +27 -0
  107. package/dist/components/primitives/button.d.ts +13 -0
  108. package/dist/components/primitives/button.js +113 -0
  109. package/{src/components/primitives/button.types.ts → dist/components/primitives/button.types.d.ts} +4 -6
  110. package/dist/components/primitives/card.d.ts +9 -0
  111. package/dist/components/primitives/card.js +56 -0
  112. package/{src/components/primitives/index.ts → dist/components/primitives/index.d.ts} +1 -9
  113. package/dist/components/primitives/index.js +7 -0
  114. package/dist/components/primitives/segmented-control.d.ts +20 -0
  115. package/dist/components/primitives/segmented-control.js +27 -0
  116. package/dist/components/primitives/separator.d.ts +4 -0
  117. package/dist/components/primitives/separator.js +16 -0
  118. package/dist/constants/chart-colors.d.ts +33 -0
  119. package/dist/constants/chart-colors.js +31 -0
  120. package/dist/hooks/index.js +9 -0
  121. package/{src/hooks/sort.types.ts → dist/hooks/sort.types.d.ts} +2 -4
  122. package/dist/hooks/use-api-client.d.ts +30 -0
  123. package/dist/hooks/use-api-client.js +106 -0
  124. package/dist/hooks/use-debounced-value.d.ts +1 -0
  125. package/dist/hooks/use-debounced-value.js +12 -0
  126. package/dist/hooks/use-derived-filter-state.d.ts +20 -0
  127. package/dist/hooks/use-derived-filter-state.js +39 -0
  128. package/dist/hooks/use-filter-state.d.ts +12 -0
  129. package/dist/hooks/use-filter-state.js +37 -0
  130. package/dist/hooks/use-media-query.d.ts +6 -0
  131. package/dist/hooks/use-media-query.js +27 -0
  132. package/dist/hooks/use-mobile.d.ts +1 -0
  133. package/dist/hooks/use-mobile.js +14 -0
  134. package/dist/hooks/use-sort.d.ts +11 -0
  135. package/dist/hooks/use-sort.js +14 -0
  136. package/{src/index.ts → dist/index.d.ts} +4 -32
  137. package/dist/index.js +15 -0
  138. package/dist/integrations/service-worker.d.ts +2 -0
  139. package/dist/integrations/service-worker.js +2 -0
  140. package/dist/lib/auth.d.ts +2 -0
  141. package/dist/lib/auth.js +7 -0
  142. package/dist/lib/clipboard.d.ts +1 -0
  143. package/dist/lib/clipboard.js +10 -0
  144. package/dist/lib/index.js +4 -0
  145. package/{src/lib/slot.tsx → dist/lib/slot.d.ts} +2 -15
  146. package/dist/lib/slot.js +14 -0
  147. package/dist/lib/utils.d.ts +2 -0
  148. package/dist/lib/utils.js +8 -0
  149. package/dist/native/components.d.ts +41 -0
  150. package/dist/native/components.js +135 -0
  151. package/dist/native/index.js +3 -0
  152. package/dist/native/theme.d.ts +19 -0
  153. package/dist/native/theme.js +58 -0
  154. package/dist/styles/tokens/css-vars.d.ts +7 -0
  155. package/dist/styles/tokens/css-vars.js +5 -0
  156. package/dist/styles/tokens/generated/dark.colors.generated.d.ts +40 -0
  157. package/dist/styles/tokens/generated/dark.colors.generated.js +39 -0
  158. package/dist/styles/tokens/generated/foundations.generated.d.ts +323 -0
  159. package/dist/styles/tokens/generated/foundations.generated.js +453 -0
  160. package/dist/styles/tokens/generated/light.colors.generated.d.ts +40 -0
  161. package/dist/styles/tokens/generated/light.colors.generated.js +39 -0
  162. package/dist/styles/tokens/index.d.ts +317 -0
  163. package/dist/styles/tokens/index.js +14 -0
  164. package/dist/styles.css +1 -1
  165. package/dist/translations/en.d.ts +34 -0
  166. package/dist/translations/index.d.ts +39 -0
  167. package/dist/translations/ui-provider.d.ts +9 -0
  168. package/dist/translations/ui-provider.js +16 -0
  169. package/dist/types/upload.d.ts +36 -0
  170. package/package.json +50 -33
  171. package/src/components/data-display/accordion.stories.tsx +0 -57
  172. package/src/components/data-display/accordion.tsx +0 -86
  173. package/src/components/data-display/metric-card.stories.tsx +0 -48
  174. package/src/components/data-display/metric-card.tsx +0 -20
  175. package/src/components/data-display/sort-controls.stories.tsx +0 -45
  176. package/src/components/data-display/sort-controls.tsx +0 -96
  177. package/src/components/data-display/sort-row.tsx +0 -88
  178. package/src/components/data-display/table.stories.tsx +0 -75
  179. package/src/components/data-display/table.tsx +0 -80
  180. package/src/components/feedback/alert.stories.tsx +0 -51
  181. package/src/components/feedback/alert.tsx +0 -64
  182. package/src/components/feedback/empty-state.tsx +0 -76
  183. package/src/components/feedback/progress.stories.tsx +0 -54
  184. package/src/components/feedback/progress.tsx +0 -41
  185. package/src/components/feedback/skeleton.stories.tsx +0 -36
  186. package/src/components/feedback/skeleton.tsx +0 -7
  187. package/src/components/feedback/spinner.stories.tsx +0 -52
  188. package/src/components/feedback/spinner.tsx +0 -47
  189. package/src/components/feedback/update-guard.stories.tsx +0 -28
  190. package/src/components/feedback/update-guard.tsx +0 -57
  191. package/src/components/filters/active-filters-bar.stories.tsx +0 -114
  192. package/src/components/filters/active-filters-bar.tsx +0 -61
  193. package/src/components/filters/filter-chip.tsx +0 -57
  194. package/src/components/filters/filter-select.stories.tsx +0 -71
  195. package/src/components/filters/filter-select.tsx +0 -68
  196. package/src/components/forms/checkbox.stories.tsx +0 -35
  197. package/src/components/forms/checkbox.tsx +0 -38
  198. package/src/components/forms/date-month-select.stories.tsx +0 -26
  199. package/src/components/forms/date-month-select.tsx +0 -79
  200. package/src/components/forms/date-picker.stories.tsx +0 -188
  201. package/src/components/forms/date-picker.tsx +0 -303
  202. package/src/components/forms/date-utils.ts +0 -37
  203. package/src/components/forms/drop-zone.stories.tsx +0 -140
  204. package/src/components/forms/drop-zone.tsx +0 -298
  205. package/src/components/forms/input.stories.tsx +0 -47
  206. package/src/components/forms/input.tsx +0 -24
  207. package/src/components/forms/label.stories.tsx +0 -16
  208. package/src/components/forms/label.tsx +0 -25
  209. package/src/components/forms/passkey-management.stories.tsx +0 -85
  210. package/src/components/forms/passkey-management.tsx +0 -168
  211. package/src/components/forms/radio-group.stories.tsx +0 -46
  212. package/src/components/forms/radio-group.tsx +0 -44
  213. package/src/components/forms/select.stories.tsx +0 -207
  214. package/src/components/forms/select.tsx +0 -182
  215. package/src/components/forms/slider.stories.tsx +0 -70
  216. package/src/components/forms/slider.tsx +0 -50
  217. package/src/components/forms/stepper.stories.tsx +0 -111
  218. package/src/components/forms/stepper.tsx +0 -66
  219. package/src/components/forms/switch.stories.tsx +0 -144
  220. package/src/components/forms/switch.tsx +0 -39
  221. package/src/components/forms/text-field.stories.tsx +0 -87
  222. package/src/components/forms/text-field.tsx +0 -75
  223. package/src/components/forms/text-field.types.ts +0 -9
  224. package/src/components/forms/textarea.stories.tsx +0 -150
  225. package/src/components/forms/textarea.tsx +0 -22
  226. package/src/components/layout/particle-background.stories.tsx +0 -38
  227. package/src/components/layout/particle-background.tsx +0 -378
  228. package/src/components/layout/scroll-area.stories.tsx +0 -91
  229. package/src/components/layout/scroll-area.tsx +0 -79
  230. package/src/components/layout/section-intro.stories.tsx +0 -29
  231. package/src/components/layout/section-intro.tsx +0 -31
  232. package/src/components/layout/surface-panel.stories.tsx +0 -32
  233. package/src/components/layout/surface-panel.tsx +0 -23
  234. package/src/components/navigation/app-navigation.stories.tsx +0 -217
  235. package/src/components/navigation/app-navigation.tsx +0 -234
  236. package/src/components/navigation/pagination-controls.stories.tsx +0 -41
  237. package/src/components/navigation/pagination-controls.tsx +0 -46
  238. package/src/components/navigation/tabs.stories.tsx +0 -48
  239. package/src/components/navigation/tabs.tsx +0 -52
  240. package/src/components/overlays/bottom-sheet.stories.tsx +0 -52
  241. package/src/components/overlays/bottom-sheet.tsx +0 -179
  242. package/src/components/overlays/command.stories.tsx +0 -65
  243. package/src/components/overlays/command.tsx +0 -227
  244. package/src/components/overlays/dialog.stories.tsx +0 -148
  245. package/src/components/overlays/dialog.tsx +0 -203
  246. package/src/components/overlays/dropdown-menu.stories.tsx +0 -74
  247. package/src/components/overlays/dropdown-menu.tsx +0 -236
  248. package/src/components/overlays/index.ts +0 -56
  249. package/src/components/overlays/popover.stories.tsx +0 -51
  250. package/src/components/overlays/popover.tsx +0 -78
  251. package/src/components/overlays/sheet.stories.tsx +0 -68
  252. package/src/components/overlays/sheet.tsx +0 -155
  253. package/src/components/overlays/tooltip.stories.tsx +0 -29
  254. package/src/components/overlays/tooltip.tsx +0 -41
  255. package/src/components/primitives/avatar-placeholder.svg +0 -13
  256. package/src/components/primitives/avatar.stories.tsx +0 -72
  257. package/src/components/primitives/avatar.tsx +0 -136
  258. package/src/components/primitives/badge.stories.tsx +0 -43
  259. package/src/components/primitives/badge.tsx +0 -43
  260. package/src/components/primitives/button.stories.tsx +0 -113
  261. package/src/components/primitives/button.tsx +0 -131
  262. package/src/components/primitives/card.stories.tsx +0 -59
  263. package/src/components/primitives/card.tsx +0 -66
  264. package/src/components/primitives/segmented-control.stories.tsx +0 -54
  265. package/src/components/primitives/segmented-control.tsx +0 -73
  266. package/src/components/primitives/separator.stories.tsx +0 -34
  267. package/src/components/primitives/separator.tsx +0 -27
  268. package/src/constants/chart-colors.ts +0 -39
  269. package/src/env.d.ts +0 -9
  270. package/src/hooks/use-api-client.ts +0 -122
  271. package/src/hooks/use-debounced-value.ts +0 -12
  272. package/src/hooks/use-derived-filter-state.ts +0 -70
  273. package/src/hooks/use-filter-state.ts +0 -66
  274. package/src/hooks/use-media-query.ts +0 -69
  275. package/src/hooks/use-mobile.tsx +0 -19
  276. package/src/hooks/use-sort.ts +0 -20
  277. package/src/lib/auth.ts +0 -5
  278. package/src/lib/clipboard.ts +0 -8
  279. package/src/lib/utils.ts +0 -6
  280. package/src/native/components.tsx +0 -198
  281. package/src/native/theme.tsx +0 -69
  282. package/src/storybook/controls.ts +0 -117
  283. package/src/storybook/options.ts +0 -52
  284. package/src/styles/build.ts +0 -1
  285. package/src/styles/index.css +0 -423
  286. package/src/styles/nokia.css +0 -36
  287. package/src/styles/package.css +0 -3
  288. package/src/styles/tokens/chart-colors.stories.tsx +0 -189
  289. package/src/styles/tokens/color-systems.stories.tsx +0 -190
  290. package/src/styles/tokens/css-vars.ts +0 -15
  291. package/src/styles/tokens/generated/dark-class.css +0 -39
  292. package/src/styles/tokens/generated/dark.colors.generated.ts +0 -39
  293. package/src/styles/tokens/generated/dark.css +0 -39
  294. package/src/styles/tokens/generated/foundations.css +0 -149
  295. package/src/styles/tokens/generated/foundations.generated.ts +0 -454
  296. package/src/styles/tokens/generated/light.colors.generated.ts +0 -39
  297. package/src/styles/tokens/generated/light.css +0 -39
  298. package/src/styles/tokens/index.ts +0 -70
  299. package/src/styles/tokens/layout.stories.tsx +0 -50
  300. package/src/styles/tokens/scripts/check-foundations.mjs +0 -126
  301. package/src/styles/tokens/scripts/check-source.mjs +0 -53
  302. package/src/styles/tokens/source/dark.tokens.json +0 -138
  303. package/src/styles/tokens/source/foundations.tokens.json +0 -344
  304. package/src/styles/tokens/source/light.tokens.json +0 -138
  305. package/src/styles/tokens/style-dictionary.dark-class.json +0 -16
  306. package/src/styles/tokens/style-dictionary.dark-storybook.json +0 -16
  307. package/src/styles/tokens/style-dictionary.dark.json +0 -21
  308. package/src/styles/tokens/style-dictionary.foundations.json +0 -21
  309. package/src/styles/tokens/style-dictionary.light-storybook.json +0 -16
  310. package/src/styles/tokens/style-dictionary.light.json +0 -21
  311. package/src/styles/tokens/typography.stories.tsx +0 -157
  312. package/src/translations/en.ts +0 -34
  313. package/src/translations/index.ts +0 -32
  314. package/src/types/upload.ts +0 -42
  315. /package/{src/components/filters/index.ts → dist/components/filters/index.d.ts} +0 -0
  316. /package/{src/components/layout/index.ts → dist/components/layout/index.d.ts} +0 -0
  317. /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
  318. /package/{src/lib/index.ts → dist/lib/index.d.ts} +0 -0
  319. /package/{src/native/index.ts → dist/native/index.d.ts} +0 -0
@@ -1,189 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
-
3
- import { CHART_CSS_VARS } from "../../constants/chart-colors";
4
-
5
- const meta: Meta = { title: "Foundations/Charts", parameters: { layout: "fullscreen" } };
6
- export default meta;
7
- type Story = StoryObj<typeof meta>;
8
-
9
- const SERIES = [
10
- { key: "chart1", label: "chart-1" },
11
- { key: "chart2", label: "chart-2" },
12
- { key: "chart3", label: "chart-3" },
13
- { key: "chart4", label: "chart-4" },
14
- { key: "chart5", label: "chart-5" },
15
- ] as const;
16
-
17
- const STATUS = [
18
- { key: "positive", label: "chart-positive", example: "▲ Up 12%" },
19
- { key: "negative", label: "chart-negative", example: "▼ Down 4%" },
20
- { key: "neutral", label: "chart-neutral", example: "— Flat" },
21
- ] as const;
22
-
23
- // A handful of arbitrary multi-series datasets, purely to show how the
24
- // ordinal chart-1..5 palette reads next to itself in a real chart shape.
25
- const BAR_DATA = [
26
- [42, 68, 30, 55, 90],
27
- [70, 25, 60, 40, 35],
28
- [30, 55, 80, 20, 65],
29
- ];
30
-
31
- const LINE_POINTS: Record<string, Array<[number, number]>> = {
32
- chart1: [
33
- [0, 60],
34
- [20, 40],
35
- [40, 50],
36
- [60, 20],
37
- [80, 30],
38
- [100, 10],
39
- ],
40
- chart2: [
41
- [0, 80],
42
- [20, 70],
43
- [40, 75],
44
- [60, 55],
45
- [80, 60],
46
- [100, 45],
47
- ],
48
- chart3: [
49
- [0, 30],
50
- [20, 45],
51
- [40, 25],
52
- [60, 50],
53
- [80, 35],
54
- [100, 55],
55
- ],
56
- chart4: [
57
- [0, 90],
58
- [20, 85],
59
- [40, 65],
60
- [60, 70],
61
- [80, 50],
62
- [100, 60],
63
- ],
64
- chart5: [
65
- [0, 15],
66
- [20, 30],
67
- [40, 20],
68
- [60, 40],
69
- [80, 25],
70
- [100, 20],
71
- ],
72
- };
73
-
74
- export const CategoricalPalette: Story = {
75
- render: () => (
76
- <main className="bg-background text-foreground grid min-h-screen gap-10 p-6 md:p-10">
77
- <header className="grid gap-2">
78
- <p className="text-muted-foreground text-sm">Foundations / charts</p>
79
- <h1 className="text-4xl font-semibold tracking-tight">Chart colors</h1>
80
- <p className="text-muted-foreground max-w-2xl text-base">
81
- <code className="font-mono">chart-1</code> through{" "}
82
- <code className="font-mono">chart-5</code> are an ordinal palette for arbitrary
83
- categorical series (e.g. one line per country) — there's no fixed meaning to a given slot,
84
- so they're assigned by index, not by what the data represents. That's different from{" "}
85
- <code className="font-mono">chart-positive</code>/
86
- <code className="font-mono">chart-negative</code>/
87
- <code className="font-mono">chart-neutral</code> below, which carry real meaning
88
- (up/down/flat) and should stay semantic in any chart that shows a directional delta.
89
- </p>
90
- </header>
91
-
92
- <section className="grid gap-4">
93
- <h2 className="text-2xl font-semibold">Series swatches</h2>
94
- <div className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">
95
- {SERIES.map(({ key, label }) => (
96
- <div
97
- key={key}
98
- className="border-border grid min-h-20 content-end rounded-md border p-3"
99
- style={{ backgroundColor: CHART_CSS_VARS[key] }}
100
- >
101
- <span className="bg-background text-foreground w-fit rounded px-1 font-mono text-xs">
102
- {label}
103
- </span>
104
- </div>
105
- ))}
106
- </div>
107
- </section>
108
-
109
- <section className="border-border bg-card grid gap-5 rounded-xl border p-6">
110
- <h2 className="text-2xl font-semibold">Grouped bar chart (mock)</h2>
111
- <p className="text-muted-foreground max-w-2xl text-sm">
112
- Three unrelated categories, five series each — a stress test for how distinguishable the
113
- palette stays side by side.
114
- </p>
115
- <div className="flex items-end gap-8" style={{ height: 220 }}>
116
- {BAR_DATA.map((group, groupIndex) => (
117
- // biome-ignore lint/suspicious/noArrayIndexKey: static mock dataset
118
- <div key={groupIndex} className="flex h-full items-end gap-1.5">
119
- {group.map((value, seriesIndex) => (
120
- <div
121
- key={SERIES[seriesIndex].key}
122
- className="w-6 rounded-t-sm"
123
- style={{
124
- height: `${value}%`,
125
- backgroundColor: CHART_CSS_VARS[SERIES[seriesIndex].key],
126
- }}
127
- title={SERIES[seriesIndex].label}
128
- />
129
- ))}
130
- </div>
131
- ))}
132
- </div>
133
- <div className="flex flex-wrap gap-4">
134
- {SERIES.map(({ key, label }) => (
135
- <div key={key} className="flex items-center gap-2">
136
- <span
137
- className="size-2.5 rounded-full"
138
- style={{ backgroundColor: CHART_CSS_VARS[key] }}
139
- aria-hidden="true"
140
- />
141
- <span className="text-muted-foreground font-mono text-xs">{label}</span>
142
- </div>
143
- ))}
144
- </div>
145
- </section>
146
-
147
- <section className="border-border bg-card grid gap-5 rounded-xl border p-6">
148
- <h2 className="text-2xl font-semibold">Multi-line chart (mock)</h2>
149
- <svg viewBox="0 0 100 100" preserveAspectRatio="none" className="h-56 w-full">
150
- <title>Multi-series line chart using the chart-1..5 palette</title>
151
- {Object.entries(LINE_POINTS).map(([key, points]) => (
152
- <polyline
153
- key={key}
154
- fill="none"
155
- strokeWidth={1.5}
156
- vectorEffect="non-scaling-stroke"
157
- stroke={CHART_CSS_VARS[key as keyof typeof CHART_CSS_VARS]}
158
- points={points.map(([x, y]) => `${x},${y}`).join(" ")}
159
- />
160
- ))}
161
- </svg>
162
- </section>
163
-
164
- <section className="grid gap-4">
165
- <h2 className="text-2xl font-semibold">Semantic status colors</h2>
166
- <p className="text-muted-foreground max-w-2xl text-sm">
167
- Use these — not a numbered slot — whenever a value has an inherent direction.
168
- </p>
169
- <div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
170
- {STATUS.map(({ key, label, example }) => (
171
- <div key={key} className="border-border grid gap-2 rounded-md border p-3">
172
- <div className="flex items-center gap-2">
173
- <span
174
- className="size-2.5 rounded-full"
175
- style={{ backgroundColor: CHART_CSS_VARS[key] }}
176
- aria-hidden="true"
177
- />
178
- <span className="text-muted-foreground font-mono text-xs">{label}</span>
179
- </div>
180
- <span className="text-lg font-semibold" style={{ color: CHART_CSS_VARS[key] }}>
181
- {example}
182
- </span>
183
- </div>
184
- ))}
185
- </div>
186
- </section>
187
- </main>
188
- ),
189
- };
@@ -1,190 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
-
3
- import { Button } from "../../components/primitives/button";
4
- import { colors } from "./css-vars";
5
- import type { ColorToken } from "./index";
6
-
7
- const meta: Meta = { title: "Foundations/Colors", parameters: { layout: "fullscreen" } };
8
- export default meta;
9
- type Story = StoryObj<typeof meta>;
10
-
11
- type Role = {
12
- token: ColorToken;
13
- purpose: string;
14
- foreground?: ColorToken;
15
- };
16
-
17
- const surfaces: Role[] = [
18
- { token: "background", purpose: "The page and app shell surface." },
19
- { token: "card", purpose: "Content containers and grouped information." },
20
- { token: "popover", purpose: "Dropdowns, dialogs, and floating panels." },
21
- { token: "muted", purpose: "Quiet, disabled, and loading surfaces." },
22
- { token: "secondary", purpose: "Secondary actions and selectable chips." },
23
- {
24
- token: "accent",
25
- purpose: "Tinted emphasis and hover surfaces.",
26
- foreground: "accent-foreground",
27
- },
28
- ];
29
-
30
- const text: Role[] = [
31
- { token: "text-primary", purpose: "Primary reading text." },
32
- { token: "text-secondary", purpose: "Supporting labels and descriptions." },
33
- { token: "tertiary", purpose: "Metadata, timestamps, and placeholders." },
34
- { token: "text-accent", purpose: "Standalone links and accent affordances." },
35
- { token: "text-success", purpose: "Standalone positive status text and icons." },
36
- { token: "text-warning", purpose: "Standalone cautionary status text and icons." },
37
- { token: "text-destructive", purpose: "Standalone error and destructive text." },
38
- ];
39
-
40
- const actions: Role[] = [
41
- {
42
- token: "primary",
43
- purpose: "The strongest action on a screen.",
44
- foreground: "primary-foreground",
45
- },
46
- {
47
- token: "destructive",
48
- purpose: "Irreversible or dangerous actions.",
49
- foreground: "destructive-foreground",
50
- },
51
- {
52
- token: "success",
53
- purpose: "Positive indicators and confirmed states.",
54
- foreground: "success-foreground",
55
- },
56
- {
57
- token: "warning",
58
- purpose: "Caution indicators and attention states.",
59
- foreground: "warning-foreground",
60
- },
61
- ];
62
-
63
- const system: Role[] = [
64
- { token: "border-default", purpose: "Default borders, inputs, and dividers." },
65
- { token: "focus-ring", purpose: "Keyboard focus indication." },
66
- { token: "overlay-scrim", purpose: "Backdrop behind modal surfaces." },
67
- ];
68
-
69
- const charts: Role[] = [
70
- { token: "chart-1", purpose: "Categorical data series one." },
71
- { token: "chart-2", purpose: "Categorical data series two." },
72
- { token: "chart-3", purpose: "Categorical data series three." },
73
- { token: "chart-4", purpose: "Categorical data series four." },
74
- { token: "chart-5", purpose: "Categorical data series five." },
75
- { token: "chart-positive", purpose: "Positive trend in a visualization." },
76
- { token: "chart-negative", purpose: "Negative trend in a visualization." },
77
- { token: "chart-neutral", purpose: "Neutral or baseline trend." },
78
- ];
79
-
80
- function RoleCard({ token, purpose, foreground }: Role) {
81
- const isText = token.startsWith("text-") || token === "tertiary";
82
- const isSurface = surfaces.some((role) => role.token === token);
83
- const swatchOnly = !isText && !isSurface && !foreground;
84
- const background = isText ? "background" : token;
85
- const contentColor = isText ? token : (foreground ?? "text-primary");
86
-
87
- return (
88
- <article className="border-border overflow-hidden rounded-md border bg-card">
89
- <div
90
- className="flex min-h-24 items-end p-3"
91
- style={{
92
- backgroundColor: colors[swatchOnly ? "card" : background],
93
- color: colors[swatchOnly ? "text-primary" : contentColor],
94
- }}
95
- >
96
- {swatchOnly ? (
97
- <span
98
- aria-hidden="true"
99
- className="h-full min-h-16 w-full rounded-sm"
100
- style={{ backgroundColor: colors[token] }}
101
- />
102
- ) : (
103
- <span className="font-mono text-xs">{token}</span>
104
- )}
105
- </div>
106
- <div className="grid gap-1 p-3">
107
- <code className="text-sm font-medium">--{token}</code>
108
- <p className="text-muted-foreground text-sm">{purpose}</p>
109
- {foreground && (
110
- <p className="text-muted-foreground text-xs">Paired content: --{foreground}</p>
111
- )}
112
- </div>
113
- </article>
114
- );
115
- }
116
-
117
- function RoleSection({
118
- title,
119
- description,
120
- roles,
121
- }: {
122
- title: string;
123
- description: string;
124
- roles: Role[];
125
- }) {
126
- return (
127
- <section className="grid gap-3">
128
- <div className="grid gap-1">
129
- <h2 className="text-lg font-semibold">{title}</h2>
130
- <p className="text-muted-foreground text-sm">{description}</p>
131
- </div>
132
- <div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
133
- {roles.map((role) => (
134
- <RoleCard key={role.token} {...role} />
135
- ))}
136
- </div>
137
- </section>
138
- );
139
- }
140
-
141
- export const SystemAppearance: Story = {
142
- render: () => (
143
- <main className="bg-background text-foreground grid min-h-screen gap-10 p-6 md:p-10">
144
- <header className="grid max-w-3xl gap-2">
145
- <p className="text-accent-text text-xs font-medium uppercase tracking-widest">
146
- Foundations
147
- </p>
148
- <h1 className="text-2xl font-semibold">Color roles</h1>
149
- <p className="text-muted-foreground text-sm">
150
- Every color has a job. These roles resolve from the operating system’s light or dark
151
- appearance and are the only colors components should consume.
152
- </p>
153
- <div className="flex flex-wrap gap-2 pt-2">
154
- <Button>Primary action</Button>
155
- <Button variant="secondary">Secondary action</Button>
156
- <Button variant="outline">Outline action</Button>
157
- <Button variant="destructive">Delete item</Button>
158
- </div>
159
- </header>
160
-
161
- <div className="grid gap-10">
162
- <RoleSection
163
- title="Surfaces"
164
- description="Backgrounds establish hierarchy. Use the lightest appropriate surface and let spacing do the rest."
165
- roles={surfaces}
166
- />
167
- <RoleSection
168
- title="Text"
169
- description="Text roles describe hierarchy or state. Use a text role when content sits directly on a surface."
170
- roles={text}
171
- />
172
- <RoleSection
173
- title="Actions and status"
174
- description="Fill roles communicate action or state and always pair with their matching foreground."
175
- roles={actions}
176
- />
177
- <RoleSection
178
- title="System"
179
- description="Structural colors support boundaries, focus, and modal layering without competing with content."
180
- roles={system}
181
- />
182
- <RoleSection
183
- title="Charts"
184
- description="Chart roles are for data visualization only. They do not communicate interaction or severity in product UI."
185
- roles={charts}
186
- />
187
- </div>
188
- </main>
189
- ),
190
- };
@@ -1,15 +0,0 @@
1
- import { colorTokenNames, type ColorToken } from "./index";
2
-
3
- /**
4
- * Color tokens as CSS `var()` references, for consumers whose runtime resolves
5
- * the CSS cascade (i.e. web). Kept out of `./tokens` because React Native has
6
- * no cascade — a `var(--token)` string there fails silently, rendering as an
7
- * unparseable color rather than throwing.
8
- */
9
- export const colors = colorTokenNames.reduce(
10
- (accumulator, token) => {
11
- accumulator[token] = `var(--${token})`;
12
- return accumulator;
13
- },
14
- {} as Record<ColorToken, `var(--${string})`>,
15
- );
@@ -1,39 +0,0 @@
1
- /**
2
- * Do not edit directly, this file was auto-generated.
3
- */
4
-
5
- :root.dark {
6
- --background: #0a0a0a;
7
- --card: #111111;
8
- --secondary: #1a1a1a;
9
- --popover: #111111;
10
- --muted: #141414;
11
- --text-primary: #fafafa;
12
- --text-secondary: #a3a3a3;
13
- --tertiary: #a3a3a3;
14
- --primary: #ededed;
15
- --accent: #1e293b;
16
- --destructive: #dc2626;
17
- --success: #22c55e;
18
- --warning: #f59e0b;
19
- --text-success: #4ade80;
20
- --text-warning: #fcd34d;
21
- --success-foreground: #0a0a0a;
22
- --warning-foreground: #0a0a0a;
23
- --primary-foreground: #0a0a0a;
24
- --accent-foreground: #93c5fd;
25
- --destructive-foreground: #ffffff;
26
- --text-destructive: #fca5a5;
27
- --text-accent: #60a5fa;
28
- --border-default: #262626;
29
- --focus-ring: #3b82f6;
30
- --chart-1: #3b82f6;
31
- --chart-2: #ededed;
32
- --chart-3: #737373;
33
- --chart-4: #93c5fd;
34
- --chart-5: #3f3f46;
35
- --chart-positive: #22c55e;
36
- --chart-negative: #ef4444;
37
- --chart-neutral: #a3a3a3;
38
- --overlay-scrim: #000000;
39
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Do not edit directly, this file was auto-generated.
3
- */
4
-
5
- export default {
6
- background: "#0a0a0a",
7
- card: "#111111",
8
- secondary: "#1a1a1a",
9
- popover: "#111111",
10
- muted: "#141414",
11
- "text-primary": "#fafafa",
12
- "text-secondary": "#a3a3a3",
13
- tertiary: "#a3a3a3",
14
- primary: "#ededed",
15
- accent: "#1e293b",
16
- destructive: "#dc2626",
17
- success: "#22c55e",
18
- warning: "#f59e0b",
19
- "text-success": "#4ade80",
20
- "text-warning": "#fcd34d",
21
- "success-foreground": "#0a0a0a",
22
- "warning-foreground": "#0a0a0a",
23
- "primary-foreground": "#0a0a0a",
24
- "accent-foreground": "#93c5fd",
25
- "destructive-foreground": "#ffffff",
26
- "text-destructive": "#fca5a5",
27
- "text-accent": "#60a5fa",
28
- "border-default": "#262626",
29
- "focus-ring": "#3b82f6",
30
- "chart-1": "#3b82f6",
31
- "chart-2": "#ededed",
32
- "chart-3": "#737373",
33
- "chart-4": "#93c5fd",
34
- "chart-5": "#3f3f46",
35
- "chart-positive": "#22c55e",
36
- "chart-negative": "#ef4444",
37
- "chart-neutral": "#a3a3a3",
38
- "overlay-scrim": "#000000",
39
- };
@@ -1,39 +0,0 @@
1
- /**
2
- * Do not edit directly, this file was auto-generated.
3
- */
4
-
5
- :root {
6
- --background: #0a0a0a;
7
- --card: #111111;
8
- --secondary: #1a1a1a;
9
- --popover: #111111;
10
- --muted: #141414;
11
- --text-primary: #fafafa;
12
- --text-secondary: #a3a3a3;
13
- --tertiary: #a3a3a3;
14
- --primary: #ededed;
15
- --accent: #1e293b;
16
- --destructive: #dc2626;
17
- --success: #22c55e;
18
- --warning: #f59e0b;
19
- --text-success: #4ade80;
20
- --text-warning: #fcd34d;
21
- --success-foreground: #0a0a0a;
22
- --warning-foreground: #0a0a0a;
23
- --primary-foreground: #0a0a0a;
24
- --accent-foreground: #93c5fd;
25
- --destructive-foreground: #ffffff;
26
- --text-destructive: #fca5a5;
27
- --text-accent: #60a5fa;
28
- --border-default: #262626;
29
- --focus-ring: #3b82f6;
30
- --chart-1: #3b82f6;
31
- --chart-2: #ededed;
32
- --chart-3: #737373;
33
- --chart-4: #93c5fd;
34
- --chart-5: #3f3f46;
35
- --chart-positive: #22c55e;
36
- --chart-negative: #ef4444;
37
- --chart-neutral: #a3a3a3;
38
- --overlay-scrim: #000000;
39
- }
@@ -1,149 +0,0 @@
1
- /**
2
- * Do not edit directly, this file was auto-generated.
3
- */
4
-
5
- :root {
6
- --spacing: 0.25rem;
7
- --spacing-scale-0: 0rem;
8
- --spacing-scale-1: 0.25rem;
9
- --spacing-scale-2: 0.5rem;
10
- --spacing-scale-3: 0.75rem;
11
- --spacing-scale-4: 1rem;
12
- --spacing-scale-5: 1.25rem;
13
- --spacing-scale-6: 1.5rem;
14
- --spacing-scale-7: 1.75rem;
15
- --spacing-scale-8: 2rem;
16
- --spacing-scale-9: 2.25rem;
17
- --spacing-scale-10: 2.5rem;
18
- --spacing-scale-11: 2.75rem;
19
- --spacing-scale-12: 3rem;
20
- --spacing-scale-14: 3.5rem;
21
- --spacing-scale-16: 4rem;
22
- --spacing-scale-20: 5rem;
23
- --spacing-scale-24: 6rem;
24
- --spacing-scale-28: 7rem;
25
- --spacing-scale-32: 8rem;
26
- --spacing-scale-36: 9rem;
27
- --spacing-scale-40: 10rem;
28
- --spacing-scale-44: 11rem;
29
- --spacing-scale-48: 12rem;
30
- --spacing-scale-52: 13rem;
31
- --spacing-scale-56: 14rem;
32
- --spacing-scale-60: 15rem;
33
- --spacing-scale-64: 16rem;
34
- --spacing-scale-72: 18rem;
35
- --spacing-scale-80: 20rem;
36
- --spacing-scale-96: 24rem;
37
- --spacing-scale-px: 1px;
38
- --spacing-scale-0-5: 0.125rem;
39
- --spacing-scale-1-5: 0.375rem;
40
- --spacing-scale-2-5: 0.625rem;
41
- --spacing-scale-3-5: 0.875rem;
42
- --font-sans: Geist, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
43
- --font-serif: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
44
- --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
45
- --text-xs: 0.75rem;
46
- --text-sm: 0.875rem;
47
- --text-base: 1rem;
48
- --text-lg: 1.125rem;
49
- --text-xl: 1.25rem;
50
- --text-2xl: 1.5rem;
51
- --text-3xl: 1.875rem;
52
- --text-4xl: 2.25rem;
53
- --text-5xl: 3rem;
54
- --text-6xl: 3.75rem;
55
- --text-7xl: 4.5rem;
56
- --text-8xl: 6rem;
57
- --text-9xl: 8rem;
58
- --text-line-height-xs: 1.3333333333;
59
- --text-line-height-sm: 1.4285714286;
60
- --text-line-height-base: 1.5;
61
- --text-line-height-lg: 1.5555555556;
62
- --text-line-height-xl: 1.4;
63
- --text-line-height-2xl: 1.3333333333;
64
- --text-line-height-3xl: 1.2;
65
- --text-line-height-4xl: 1.1111111111;
66
- --text-line-height-5xl: 1;
67
- --text-line-height-6xl: 1;
68
- --text-line-height-7xl: 1;
69
- --text-line-height-8xl: 1;
70
- --text-line-height-9xl: 1;
71
- --font-weight-thin: 100;
72
- --font-weight-extralight: 200;
73
- --font-weight-light: 300;
74
- --font-weight-normal: 400;
75
- --font-weight-medium: 500;
76
- --font-weight-semibold: 600;
77
- --font-weight-bold: 700;
78
- --font-weight-extrabold: 800;
79
- --font-weight-black: 900;
80
- --tracking-tighter: -0.05em;
81
- --tracking-tight: -0.025em;
82
- --tracking-normal: 0em;
83
- --tracking-wide: 0.025em;
84
- --tracking-wider: 0.05em;
85
- --tracking-widest: 0.1em;
86
- --leading-tight: 1.25;
87
- --leading-snug: 1.375;
88
- --leading-normal: 1.5;
89
- --leading-relaxed: 1.625;
90
- --leading-loose: 2;
91
- --radius-xs: 0.125rem;
92
- --radius-sm: 0.25rem;
93
- --radius-md: 0.375rem;
94
- --radius-lg: 0.5rem;
95
- --radius-xl: 0.75rem;
96
- --radius-2xl: 1rem;
97
- --radius-3xl: 1.5rem;
98
- --radius-4xl: 2rem;
99
- --radius-full: 9999px;
100
- --shadow-2xs: 0px 1px 0px 0px rgb(0 0 0 / 0.05);
101
- --shadow-xs: 0px 1px 2px 0px rgb(0 0 0 / 0.05);
102
- --shadow-sm: 0px 1px 3px 0px rgb(0 0 0 / 0.1), 0px 1px 2px -1px rgb(0 0 0 / 0.1);
103
- --shadow-md: 0px 4px 6px -1px rgb(0 0 0 / 0.1), 0px 2px 4px -2px rgb(0 0 0 / 0.1);
104
- --shadow-lg: 0px 10px 15px -3px rgb(0 0 0 / 0.1), 0px 4px 6px -4px rgb(0 0 0 / 0.1);
105
- --shadow-xl: 0px 20px 25px -5px rgb(0 0 0 / 0.1), 0px 8px 10px -6px rgb(0 0 0 / 0.1);
106
- --shadow-2xl: 0px 25px 50px -12px rgb(0 0 0 / 0.25);
107
- --shadow-none: 0px 0px 0px 0px transparent;
108
- --breakpoint-sm: 40rem;
109
- --breakpoint-md: 48rem;
110
- --breakpoint-lg: 64rem;
111
- --breakpoint-xl: 80rem;
112
- --breakpoint-2xl: 96rem;
113
- --container-3xs: 16rem;
114
- --container-2xs: 18rem;
115
- --container-xs: 20rem;
116
- --container-sm: 24rem;
117
- --container-md: 28rem;
118
- --container-lg: 32rem;
119
- --container-xl: 36rem;
120
- --container-2xl: 42rem;
121
- --container-3xl: 48rem;
122
- --container-4xl: 56rem;
123
- --container-5xl: 64rem;
124
- --container-6xl: 72rem;
125
- --container-7xl: 80rem;
126
- --z-index-0: 0;
127
- --z-index-10: 10;
128
- --z-index-20: 20;
129
- --z-index-30: 30;
130
- --z-index-40: 40;
131
- --z-index-50: 50;
132
- --z-index-auto: auto;
133
- --ease-in: cubic-bezier(0.4, 0, 1, 1);
134
- --ease-out: cubic-bezier(0, 0, 0.2, 1);
135
- --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
136
- --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
137
- --duration-75: 75ms;
138
- --duration-100: 100ms;
139
- --duration-150: 150ms;
140
- --duration-200: 200ms;
141
- --duration-300: 300ms;
142
- --duration-500: 500ms;
143
- --duration-700: 700ms;
144
- --duration-1000: 1000ms;
145
- --animate-spin: spin 1s linear infinite;
146
- --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
147
- --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
148
- --animate-bounce: bounce 1s infinite;
149
- }