@sixthshift/design-system 0.2.1 → 0.3.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 (288) hide show
  1. package/README.md +135 -28
  2. package/dist/components/Badge/Badge.d.ts +5 -2
  3. package/dist/components/Badge/Badge.d.ts.map +1 -1
  4. package/dist/components/Badge/Badge.js +5 -3
  5. package/dist/components/Badge/Badge.js.map +1 -1
  6. package/dist/components/BarChart/BarChart.d.ts +8 -2
  7. package/dist/components/BarChart/BarChart.d.ts.map +1 -1
  8. package/dist/components/BarChart/BarChart.js +5 -3
  9. package/dist/components/BarChart/BarChart.js.map +1 -1
  10. package/dist/components/Calendar/Calendar.d.ts +17 -1
  11. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  12. package/dist/components/Calendar/Calendar.js +80 -225
  13. package/dist/components/Calendar/Calendar.js.map +1 -1
  14. package/dist/components/Calendar/CalendarView.d.ts +15 -0
  15. package/dist/components/Calendar/CalendarView.d.ts.map +1 -0
  16. package/dist/components/Calendar/CalendarView.js +255 -0
  17. package/dist/components/Calendar/CalendarView.js.map +1 -0
  18. package/dist/components/Calendar/calendar.types.d.ts +78 -27
  19. package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
  20. package/dist/components/Calendar/calendar.types.js +10 -3
  21. package/dist/components/Calendar/calendar.types.js.map +1 -1
  22. package/dist/components/Calendar/index.d.ts +16 -2
  23. package/dist/components/Calendar/index.d.ts.map +1 -1
  24. package/dist/components/Calendar/index.js +15 -1
  25. package/dist/components/Calendar/index.js.map +1 -1
  26. package/dist/components/ColorDot/ColorDot.d.ts +9 -3
  27. package/dist/components/ColorDot/ColorDot.d.ts.map +1 -1
  28. package/dist/components/ColorDot/ColorDot.js +5 -3
  29. package/dist/components/ColorDot/ColorDot.js.map +1 -1
  30. package/dist/components/DatePicker/DatePicker.d.ts +2 -2
  31. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  32. package/dist/components/DatePicker/DatePicker.js +65 -10
  33. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  34. package/dist/components/DatePicker/datepicker.types.d.ts +34 -36
  35. package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
  36. package/dist/components/DatePicker/datepicker.types.js +5 -3
  37. package/dist/components/DatePicker/datepicker.types.js.map +1 -1
  38. package/dist/components/DatePicker/index.d.ts +10 -1
  39. package/dist/components/DatePicker/index.d.ts.map +1 -1
  40. package/dist/components/DatePicker/index.js +8 -0
  41. package/dist/components/DatePicker/index.js.map +1 -1
  42. package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -2
  43. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  44. package/dist/components/DateRangePicker/DateRangePicker.js +17 -21
  45. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  46. package/dist/components/DateRangePicker/daterangepicker.types.d.ts +20 -20
  47. package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
  48. package/dist/components/DateRangePicker/daterangepicker.types.js +6 -0
  49. package/dist/components/DateRangePicker/daterangepicker.types.js.map +1 -1
  50. package/dist/components/DateRangePicker/index.d.ts +8 -1
  51. package/dist/components/DateRangePicker/index.d.ts.map +1 -1
  52. package/dist/components/DateRangePicker/index.js +6 -0
  53. package/dist/components/DateRangePicker/index.js.map +1 -1
  54. package/dist/components/DateTimePicker/DateTimePicker.d.ts +3 -3
  55. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  56. package/dist/components/DateTimePicker/DateTimePicker.js +30 -12
  57. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  58. package/dist/components/DateTimePicker/datetimepicker.types.d.ts +20 -17
  59. package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
  60. package/dist/components/DateTimePicker/datetimepicker.types.js +10 -0
  61. package/dist/components/DateTimePicker/datetimepicker.types.js.map +1 -1
  62. package/dist/components/DateTimePicker/index.d.ts +8 -1
  63. package/dist/components/DateTimePicker/index.d.ts.map +1 -1
  64. package/dist/components/DateTimePicker/index.js +6 -0
  65. package/dist/components/DateTimePicker/index.js.map +1 -1
  66. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +3 -3
  67. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  68. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +41 -20
  69. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  70. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +22 -18
  71. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
  72. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js +8 -0
  73. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js.map +1 -1
  74. package/dist/components/DateTimeRangePicker/index.d.ts +8 -0
  75. package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
  76. package/dist/components/DateTimeRangePicker/index.js +7 -0
  77. package/dist/components/DateTimeRangePicker/index.js.map +1 -1
  78. package/dist/components/EmptyState/EmptyState.d.ts +16 -5
  79. package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
  80. package/dist/components/EmptyState/EmptyState.js +5 -3
  81. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  82. package/dist/components/Field/Field.d.ts +3 -3
  83. package/dist/components/Field/Field.d.ts.map +1 -1
  84. package/dist/components/Field/Field.js +6 -4
  85. package/dist/components/Field/Field.js.map +1 -1
  86. package/dist/components/LineChart/LineChart.d.ts +18 -2
  87. package/dist/components/LineChart/LineChart.d.ts.map +1 -1
  88. package/dist/components/LineChart/LineChart.js +5 -3
  89. package/dist/components/LineChart/LineChart.js.map +1 -1
  90. package/dist/components/Markdown/Markdown.d.ts +2 -4
  91. package/dist/components/Markdown/Markdown.d.ts.map +1 -1
  92. package/dist/components/Markdown/Markdown.js +3 -2
  93. package/dist/components/Markdown/Markdown.js.map +1 -1
  94. package/dist/components/Message/Message.d.ts.map +1 -1
  95. package/dist/components/Message/Message.js +16 -1
  96. package/dist/components/Message/Message.js.map +1 -1
  97. package/dist/components/MetricList/MetricList.d.ts +3 -3
  98. package/dist/components/MetricList/MetricList.d.ts.map +1 -1
  99. package/dist/components/MetricList/MetricList.js +5 -3
  100. package/dist/components/MetricList/MetricList.js.map +1 -1
  101. package/dist/components/Modal/Modal.d.ts +24 -5
  102. package/dist/components/Modal/Modal.d.ts.map +1 -1
  103. package/dist/components/Modal/Modal.js +16 -6
  104. package/dist/components/Modal/Modal.js.map +1 -1
  105. package/dist/components/Modal/components/ModalContext.d.ts +14 -0
  106. package/dist/components/Modal/components/ModalContext.d.ts.map +1 -1
  107. package/dist/components/Modal/components/ModalContext.js.map +1 -1
  108. package/dist/components/Modal/components/ModalHeader.d.ts.map +1 -1
  109. package/dist/components/Modal/components/ModalHeader.js +13 -2
  110. package/dist/components/Modal/components/ModalHeader.js.map +1 -1
  111. package/dist/components/NavBottom/NavBottom.d.ts +2 -1
  112. package/dist/components/NavBottom/NavBottom.d.ts.map +1 -1
  113. package/dist/components/NavBottom/NavBottom.js +6 -4
  114. package/dist/components/NavBottom/NavBottom.js.map +1 -1
  115. package/dist/components/NavSide/NavItem.js +1 -1
  116. package/dist/components/NavSide/NavItem.js.map +1 -1
  117. package/dist/components/NavSide/NavSide.d.ts +2 -1
  118. package/dist/components/NavSide/NavSide.d.ts.map +1 -1
  119. package/dist/components/NavSide/NavSide.js +5 -3
  120. package/dist/components/NavSide/NavSide.js.map +1 -1
  121. package/dist/components/Popover/Popover.d.ts.map +1 -1
  122. package/dist/components/Popover/Popover.js +7 -0
  123. package/dist/components/Popover/Popover.js.map +1 -1
  124. package/dist/components/Popover/components/PopoverBody.d.ts.map +1 -1
  125. package/dist/components/Popover/components/PopoverBody.js +5 -2
  126. package/dist/components/Popover/components/PopoverBody.js.map +1 -1
  127. package/dist/components/Popover/components/PopoverContext.d.ts +1 -0
  128. package/dist/components/Popover/components/PopoverContext.d.ts.map +1 -1
  129. package/dist/components/Popover/components/PopoverContext.js.map +1 -1
  130. package/dist/components/Popover/components/PopoverTrigger.d.ts.map +1 -1
  131. package/dist/components/Popover/components/PopoverTrigger.js +2 -2
  132. package/dist/components/Popover/components/PopoverTrigger.js.map +1 -1
  133. package/dist/components/ProgressBar/ProgressBar.d.ts +2 -1
  134. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  135. package/dist/components/ProgressBar/ProgressBar.js +5 -3
  136. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  137. package/dist/components/Select/Select.d.ts +11 -2
  138. package/dist/components/Select/Select.d.ts.map +1 -1
  139. package/dist/components/Select/Select.js +64 -18
  140. package/dist/components/Select/Select.js.map +1 -1
  141. package/dist/components/Select/SelectDropdown.d.ts +14 -2
  142. package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
  143. package/dist/components/Select/SelectDropdown.js +19 -4
  144. package/dist/components/Select/SelectDropdown.js.map +1 -1
  145. package/dist/components/Select/SelectTrigger.d.ts +10 -3
  146. package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
  147. package/dist/components/Select/SelectTrigger.js +12 -3
  148. package/dist/components/Select/SelectTrigger.js.map +1 -1
  149. package/dist/components/Select/useSelectKeyboard.d.ts +15 -1
  150. package/dist/components/Select/useSelectKeyboard.d.ts.map +1 -1
  151. package/dist/components/Select/useSelectKeyboard.js +73 -65
  152. package/dist/components/Select/useSelectKeyboard.js.map +1 -1
  153. package/dist/components/Sheet/Sheet.d.ts +19 -5
  154. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  155. package/dist/components/Sheet/Sheet.js +18 -6
  156. package/dist/components/Sheet/Sheet.js.map +1 -1
  157. package/dist/components/Sheet/components/SheetContext.d.ts +10 -0
  158. package/dist/components/Sheet/components/SheetContext.d.ts.map +1 -1
  159. package/dist/components/Sheet/components/SheetContext.js.map +1 -1
  160. package/dist/components/Sheet/components/SheetHeader.d.ts.map +1 -1
  161. package/dist/components/Sheet/components/SheetHeader.js +11 -2
  162. package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
  163. package/dist/components/Skeleton/Skeleton.d.ts +2 -1
  164. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
  165. package/dist/components/Skeleton/Skeleton.js +5 -3
  166. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  167. package/dist/components/Sparkline/Sparkline.d.ts +10 -2
  168. package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
  169. package/dist/components/Sparkline/Sparkline.js +5 -3
  170. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  171. package/dist/components/StatsCard/StatsCard.d.ts +4 -4
  172. package/dist/components/StatsCard/StatsCard.d.ts.map +1 -1
  173. package/dist/components/StatsCard/StatsCard.js +5 -3
  174. package/dist/components/StatsCard/StatsCard.js.map +1 -1
  175. package/dist/components/Tabs/Tabs.d.ts +2 -2
  176. package/dist/components/Tabs/components/TabsList.d.ts +1 -1
  177. package/dist/components/Tabs/components/TabsList.d.ts.map +1 -1
  178. package/dist/components/Tabs/components/TabsList.js +5 -4
  179. package/dist/components/Tabs/components/TabsList.js.map +1 -1
  180. package/dist/components/Tabs/components/TabsPanels.d.ts +1 -1
  181. package/dist/components/Tabs/components/TabsPanels.d.ts.map +1 -1
  182. package/dist/components/Tabs/components/TabsPanels.js +5 -3
  183. package/dist/components/Tabs/components/TabsPanels.js.map +1 -1
  184. package/dist/components/TagChip/TagChip.d.ts +2 -1
  185. package/dist/components/TagChip/TagChip.d.ts.map +1 -1
  186. package/dist/components/TagChip/TagChip.js +5 -3
  187. package/dist/components/TagChip/TagChip.js.map +1 -1
  188. package/dist/components/TagInput/TagInput.d.ts +1 -1
  189. package/dist/components/TagInput/TagInput.d.ts.map +1 -1
  190. package/dist/components/TagInput/TagInput.js +5 -4
  191. package/dist/components/TagInput/TagInput.js.map +1 -1
  192. package/dist/components/TimePicker/TimePicker.d.ts +2 -2
  193. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  194. package/dist/components/TimePicker/TimePicker.js +27 -11
  195. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  196. package/dist/components/TimePicker/timepicker.types.d.ts +14 -13
  197. package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
  198. package/dist/components/TimePicker/timepicker.types.js +4 -3
  199. package/dist/components/TimePicker/timepicker.types.js.map +1 -1
  200. package/dist/date-time/index.d.ts +2 -0
  201. package/dist/date-time/index.d.ts.map +1 -1
  202. package/dist/date-time/index.js +9 -0
  203. package/dist/date-time/index.js.map +1 -1
  204. package/dist/date-time/iso.d.ts +261 -0
  205. package/dist/date-time/iso.d.ts.map +1 -0
  206. package/dist/date-time/iso.js +358 -0
  207. package/dist/date-time/iso.js.map +1 -0
  208. package/dist/date-time/now.d.ts +7 -6
  209. package/dist/date-time/now.d.ts.map +1 -1
  210. package/dist/date-time/now.js +3 -3
  211. package/dist/date-time/now.js.map +1 -1
  212. package/dist/theme/index.d.ts +4 -3
  213. package/dist/theme/index.d.ts.map +1 -1
  214. package/dist/theme/index.js +3 -2
  215. package/dist/theme/index.js.map +1 -1
  216. package/dist/theme/schema.d.ts +70 -32
  217. package/dist/theme/schema.d.ts.map +1 -1
  218. package/dist/theme/schema.js +36 -18
  219. package/dist/theme/schema.js.map +1 -1
  220. package/package.json +9 -15
  221. package/src/components/Badge/Badge.tsx +5 -4
  222. package/src/components/BarChart/BarChart.tsx +25 -30
  223. package/src/components/Calendar/Calendar.tsx +91 -401
  224. package/src/components/Calendar/CalendarView.tsx +445 -0
  225. package/src/components/Calendar/calendar.types.ts +94 -29
  226. package/src/components/Calendar/index.ts +16 -17
  227. package/src/components/ColorDot/ColorDot.tsx +6 -4
  228. package/src/components/DatePicker/DatePicker.tsx +92 -16
  229. package/src/components/DatePicker/datepicker.types.ts +38 -39
  230. package/src/components/DatePicker/index.ts +11 -10
  231. package/src/components/DateRangePicker/DateRangePicker.tsx +17 -21
  232. package/src/components/DateRangePicker/daterangepicker.types.ts +22 -22
  233. package/src/components/DateRangePicker/index.ts +9 -1
  234. package/src/components/DateTimePicker/DateTimePicker.tsx +46 -18
  235. package/src/components/DateTimePicker/datetimepicker.types.ts +22 -18
  236. package/src/components/DateTimePicker/index.ts +9 -1
  237. package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +62 -28
  238. package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +24 -19
  239. package/src/components/DateTimeRangePicker/index.ts +9 -0
  240. package/src/components/EmptyState/EmptyState.tsx +8 -7
  241. package/src/components/Field/Field.tsx +7 -6
  242. package/src/components/LineChart/LineChart.tsx +147 -141
  243. package/src/components/Markdown/Markdown.tsx +4 -3
  244. package/src/components/Message/Message.tsx +17 -1
  245. package/src/components/MetricList/MetricList.tsx +10 -5
  246. package/src/components/Modal/Modal.tsx +119 -87
  247. package/src/components/Modal/components/ModalContext.tsx +14 -0
  248. package/src/components/Modal/components/ModalHeader.tsx +14 -2
  249. package/src/components/NavBottom/NavBottom.tsx +6 -4
  250. package/src/components/NavSide/NavItem.tsx +1 -1
  251. package/src/components/NavSide/NavSide.tsx +5 -3
  252. package/src/components/Popover/Popover.tsx +7 -0
  253. package/src/components/Popover/components/PopoverBody.tsx +6 -1
  254. package/src/components/Popover/components/PopoverContext.tsx +1 -0
  255. package/src/components/Popover/components/PopoverTrigger.tsx +2 -1
  256. package/src/components/ProgressBar/ProgressBar.tsx +32 -28
  257. package/src/components/Select/Select.tsx +76 -19
  258. package/src/components/Select/SelectDropdown.tsx +32 -3
  259. package/src/components/Select/SelectTrigger.tsx +26 -3
  260. package/src/components/Select/useSelectKeyboard.ts +20 -10
  261. package/src/components/Sheet/Sheet.tsx +108 -83
  262. package/src/components/Sheet/components/SheetContext.tsx +10 -0
  263. package/src/components/Sheet/components/SheetHeader.tsx +17 -2
  264. package/src/components/Skeleton/Skeleton.tsx +5 -3
  265. package/src/components/Sparkline/Sparkline.tsx +29 -36
  266. package/src/components/StatsCard/StatsCard.tsx +7 -6
  267. package/src/components/Tabs/components/TabsList.tsx +5 -3
  268. package/src/components/Tabs/components/TabsPanels.tsx +5 -3
  269. package/src/components/TagChip/TagChip.tsx +10 -3
  270. package/src/components/TagInput/TagInput.tsx +5 -3
  271. package/src/components/TimePicker/TimePicker.tsx +31 -13
  272. package/src/components/TimePicker/timepicker.types.ts +14 -13
  273. package/src/date-time/index.ts +61 -0
  274. package/src/date-time/iso.ts +511 -0
  275. package/src/date-time/now.ts +10 -9
  276. package/src/theme/index.ts +11 -3
  277. package/src/theme/schema.ts +82 -54
  278. package/src/theme/tokens.css +807 -0
  279. package/dist/styles.css +0 -2
  280. package/dist/theme.generated.css +0 -438
  281. package/src/styles/base.css +0 -41
  282. package/src/theme/palette.json +0 -100
  283. package/src/theme/palette.schema.json +0 -40
  284. package/src/theme/theme.json +0 -349
  285. package/src/theme/theme.schema.json +0 -876
  286. package/src/theme/typography.json +0 -7
  287. package/src/theme/typography.schema.json +0 -36
  288. package/tailwind.config.ts +0 -261
@@ -4,22 +4,23 @@
4
4
  * Functions that answer "what time/date is it right now?"
5
5
  */
6
6
  import { Temporal } from "@js-temporal/polyfill";
7
+ import type { ISODate, ISODateTime, ISOInstant } from "./iso.js";
7
8
  /**
8
9
  * Get the current instant (point in time)
9
10
  */
10
11
  export declare function now(): Temporal.Instant;
11
12
  /**
12
- * Get the current instant as an ISO 8601 string
13
+ * Get the current instant as a canonical ISO 8601 string (UTC, `...Z`)
13
14
  */
14
- export declare function nowISO(): string;
15
+ export declare function nowISO(): ISOInstant;
15
16
  /**
16
17
  * Get today's date in the system timezone
17
18
  */
18
19
  export declare function today(): Temporal.PlainDate;
19
20
  /**
20
- * Get today's date as an ISO 8601 string
21
+ * Get today's date as a canonical ISO 8601 string (`YYYY-MM-DD`)
21
22
  */
22
- export declare function todayISO(): string;
23
+ export declare function todayISO(): ISODate;
23
24
  /**
24
25
  * Get the current time in the system timezone
25
26
  */
@@ -29,9 +30,9 @@ export declare function currentTime(): Temporal.PlainTime;
29
30
  */
30
31
  export declare function nowDateTime(): Temporal.PlainDateTime;
31
32
  /**
32
- * Get the current date/time as an ISO 8601 string (without timezone info)
33
+ * Get the current date/time as a canonical ISO 8601 string (no timezone)
33
34
  */
34
- export declare function nowDateTimeISO(): string;
35
+ export declare function nowDateTimeISO(): ISODateTime;
35
36
  /**
36
37
  * Get the current zoned date/time in the system timezone
37
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"now.d.ts","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,GAAG,IAAI,QAAQ,CAAC,OAAO,CAEtC;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,QAAQ,CAAC,SAAS,CAE1C;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,SAAS,CAEhD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,aAAa,CAEpD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAEjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAEtE"}
1
+ {"version":3,"file":"now.d.ts","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9D;;GAEG;AACH,wBAAgB,GAAG,IAAI,QAAQ,CAAC,OAAO,CAEtC;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,UAAU,CAEnC;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,QAAQ,CAAC,SAAS,CAE1C;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,SAAS,CAEhD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,aAAa,CAEpD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAEjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAEtE"}
@@ -11,7 +11,7 @@ export function now() {
11
11
  return Temporal.Now.instant();
12
12
  }
13
13
  /**
14
- * Get the current instant as an ISO 8601 string
14
+ * Get the current instant as a canonical ISO 8601 string (UTC, `...Z`)
15
15
  */
16
16
  export function nowISO() {
17
17
  return Temporal.Now.instant().toString();
@@ -23,7 +23,7 @@ export function today() {
23
23
  return Temporal.Now.plainDateISO();
24
24
  }
25
25
  /**
26
- * Get today's date as an ISO 8601 string
26
+ * Get today's date as a canonical ISO 8601 string (`YYYY-MM-DD`)
27
27
  */
28
28
  export function todayISO() {
29
29
  return Temporal.Now.plainDateISO().toString();
@@ -41,7 +41,7 @@ export function nowDateTime() {
41
41
  return Temporal.Now.plainDateTimeISO();
42
42
  }
43
43
  /**
44
- * Get the current date/time as an ISO 8601 string (without timezone info)
44
+ * Get the current date/time as a canonical ISO 8601 string (no timezone)
45
45
  */
46
46
  export function nowDateTimeISO() {
47
47
  return Temporal.Now.plainDateTimeISO().toString();
@@ -1 +1 @@
1
- {"version":3,"file":"now.js","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;GAEG;AACH,MA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AChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAgB,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK;IACnB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAa,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAiB,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Theme Exports
3
3
  *
4
- * Re-exports schema types and utilities for use in other packages.
4
+ * The token naming vocabulary and its types. Token *values* live in
5
+ * src/theme/tokens.css and are read from the stylesheet, not from here.
5
6
  */
6
- export type { BgKey, BgToken, BorderKey, BorderToken, ColorMode, ColorModeSchema, ColorToken, Context, CSSVarName, Feedback, FgKey, FgToken, HexValue, Hierarchy, HSLValue, Semantic, ThemeSchema, TokenKey, } from "./schema.js";
7
- export { contexts, cssVar, feedback, getAllTokenNames, getTokenNames, hierarchy, hsl, semantics, } from "./schema.js";
7
+ export type { BgKey, BgToken, BorderKey, BorderToken, ColorMode, ColorModeSchema, ColorToken, Context, CSSVarName, Feedback, FgKey, FgToken, HexValue, Hierarchy, HSLValue, Intent, Semantic, StandaloneToken, State, ThemeSchema, TokenKey, TokenName, Weight, } from "./schema.js";
8
+ export { contexts, cssVar, feedback, hierarchy, hsl, intents, semantics, standaloneTokens, states, weights, } from "./schema.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,GACT,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,GAAG,EACH,SAAS,GACV,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,eAAe,EACf,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,GACP,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,OAAO,GACR,MAAM,UAAU,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Theme Exports
3
3
  *
4
- * Re-exports schema types and utilities for use in other packages.
4
+ * The token naming vocabulary and its types. Token *values* live in
5
+ * src/theme/tokens.css and are read from the stylesheet, not from here.
5
6
  */
6
- export { contexts, cssVar, feedback, getAllTokenNames, getTokenNames, hierarchy, hsl, semantics, } from "./schema.js";
7
+ export { contexts, cssVar, feedback, hierarchy, hsl, intents, semantics, standaloneTokens, states, weights, } from "./schema.js";
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,GAAG,EACH,SAAS,GACV,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4BH,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,OAAO,GACR,MAAM,UAAU,CAAC"}
@@ -1,13 +1,34 @@
1
1
  /**
2
2
  * Theme Schema
3
3
  *
4
- * Type definitions for the PA design system token structure.
5
- * These types enforce the naming convention: {context}-{semantic}
4
+ * The naming convention for design tokens, as types and as data:
5
+ *
6
+ * {context}-[on-]{intent}[-{weight}][-{state}]
7
+ *
8
+ * src/theme/tokens.css is the only place tokens are defined, and nothing derives
9
+ * TypeScript from it. These types describe the *shape* a token name can take
10
+ * rather than enumerating the names that happen to exist today, which is why the
11
+ * vocabulary below is the thing to edit when the system grows a new axis.
12
+ *
13
+ * The trade that makes explicit: the union is complete but permissive. Every real
14
+ * token is assignable, and a few combinations it accepts are not defined. Keeping
15
+ * this vocabulary and tokens.css describing the same system is a manual job — a
16
+ * token whose name falls outside the grid below is unnameable in TypeScript even
17
+ * though its utility compiles.
18
+ *
19
+ * To read a value, read the CSS: `var(--bg-brand)` in a stylesheet, or
20
+ * `getComputedStyle(document.documentElement).getPropertyValue("--bg-brand")`
21
+ * at runtime.
6
22
  */
7
- /** HSL color value without wrapper, e.g., "239 84% 67%" */
8
- export type HSLValue = string;
9
23
  /** Hex color value, e.g., "#6366f1" */
10
24
  export type HexValue = string;
25
+ /**
26
+ * HSL color value without wrapper, e.g., "239 84% 67%"
27
+ *
28
+ * @deprecated Tokens hold hex values and palette references, never bare HSL
29
+ * triples. Kept only so the export surface stays stable.
30
+ */
31
+ export type HSLValue = string;
11
32
  /** Color mode */
12
33
  export type ColorMode = "light" | "dark";
13
34
  /** Contexts - what CSS property this affects */
@@ -22,44 +43,61 @@ export type Feedback = (typeof feedback)[number];
22
43
  /** All semantics */
23
44
  export declare const semantics: readonly ["strong", "normal", "subtle", "success", "warning", "danger"];
24
45
  export type Semantic = (typeof semantics)[number];
25
- /** Background tokens: bg-{semantic} */
26
- export type BgToken = `bg-${Semantic}`;
27
- /** Foreground tokens: fg-{semantic} | fg-on-{semantic} */
28
- export type FgToken = `fg-${Semantic}` | `fg-on-${Semantic}`;
29
- /** Border tokens: border-{semantic} */
30
- export type BorderToken = `border-${Semantic}`;
46
+ /** Every intent a token can carry, including the ones outside the grid above */
47
+ export declare const intents: readonly ["strong", "normal", "subtle", "success", "warning", "danger", "brand", "overlay"];
48
+ export type Intent = (typeof intents)[number];
49
+ /** Weight modifiers, applied to brand and feedback intents */
50
+ export declare const weights: readonly ["subtle", "strong"];
51
+ export type Weight = (typeof weights)[number];
52
+ /** Interaction states */
53
+ export declare const states: readonly ["hovered", "pressed", "disabled"];
54
+ export type State = (typeof states)[number];
55
+ /** Tokens that are a category of one, outside the grid */
56
+ export declare const standaloneTokens: readonly ["focus-ring"];
57
+ export type StandaloneToken = (typeof standaloneTokens)[number];
58
+ /** Intents that take a weight modifier — the hierarchy trio *is* the weight. */
59
+ type Weightable = Exclude<Intent, Hierarchy>;
60
+ /** `brand` | `brand-subtle` | `danger-strong` | ... */
61
+ type WeightedIntent = Intent | `${Weightable}-${Weight}`;
62
+ /** Any of the above, optionally in an interaction state */
63
+ type Stateful<T extends string> = T | `${T}-${State}`;
64
+ /** Background tokens */
65
+ export type BgToken = Stateful<`bg-${WeightedIntent}`>;
66
+ /** Foreground tokens, including the `fg-on-*` pairs */
67
+ export type FgToken = Stateful<`fg-${WeightedIntent}`> | Stateful<`fg-on-${WeightedIntent}`>;
68
+ /** Border tokens */
69
+ export type BorderToken = Stateful<`border-${WeightedIntent}`>;
70
+ /** Every token name the convention allows */
71
+ export type TokenName = BgToken | FgToken | BorderToken | StandaloneToken;
31
72
  /** All color tokens */
32
- export type ColorToken = BgToken | FgToken | BorderToken;
73
+ export type ColorToken = TokenName;
33
74
  /** CSS variable name format */
34
75
  export type CSSVarName = `--${ColorToken}`;
35
- /** Background token keys */
36
- export type BgKey = `bg-${Semantic}`;
37
- /** Foreground token keys */
38
- export type FgKey = `fg-${Semantic}` | `fg-on-${Semantic}`;
39
- /** Border token keys */
40
- export type BorderKey = `border-${Semantic}`;
41
- /** All token keys */
42
- export type TokenKey = BgKey | FgKey | BorderKey;
43
- /** Color mode schema (light or dark) - flat structure */
44
- export type ColorModeSchema = {
45
- [K in TokenKey]: HexValue;
46
- };
47
- /** Complete theme schema */
76
+ /** @deprecated Use {@link BgToken}. */
77
+ export type BgKey = BgToken;
78
+ /** @deprecated Use {@link FgToken}. */
79
+ export type FgKey = FgToken;
80
+ /** @deprecated Use {@link BorderToken}. */
81
+ export type BorderKey = BorderToken;
82
+ /** @deprecated Use {@link TokenName}. */
83
+ export type TokenKey = TokenName;
84
+ /** A set of token values for one mode */
85
+ export type ColorModeSchema = Partial<Record<TokenName, HexValue>>;
86
+ /** A complete theme */
48
87
  export type ThemeSchema = {
49
- $schema?: string;
50
88
  name: string;
51
89
  version: string;
52
90
  light: ColorModeSchema;
53
91
  dark: ColorModeSchema;
54
92
  };
55
- /** Get all token names for a context */
56
- export declare function getTokenNames(context: "bg"): BgToken[];
57
- export declare function getTokenNames(context: "fg"): FgToken[];
58
- export declare function getTokenNames(context: "border"): BorderToken[];
59
- /** Get all token names */
60
- export declare function getAllTokenNames(): ColorToken[];
61
93
  /** Type-safe CSS var reference */
62
94
  export declare function cssVar(token: ColorToken): string;
63
- /** Type-safe HSL wrapper for Tailwind */
95
+ /**
96
+ * Type-safe HSL wrapper for Tailwind
97
+ *
98
+ * @deprecated Token values are hex and palette references, so wrapping one in
99
+ * `hsl()` yields invalid CSS. Use {@link cssVar}.
100
+ */
64
101
  export declare function hsl(token: ColorToken): string;
102
+ export {};
65
103
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/theme/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,iBAAiB;AACjB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAMzC,gDAAgD;AAChD,eAAO,MAAM,QAAQ,iCAAkC,CAAC;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,0CAA0C;AAC1C,eAAO,MAAM,SAAS,yCAA0C,CAAC;AACjE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,mCAAmC;AACnC,eAAO,MAAM,QAAQ,2CAA4C,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO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,CAAC;AAE1E,uBAAuB;AACvB,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC;AAEnC,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,KAAK,UAAU,EAAE,CAAC;AAE3C,uCAAuC;AACvC,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC;AAC5B,uCAAuC;AACvC,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC;AAC5B,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,yCAAyC;AACzC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC;AAMjC,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnE,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAMF,kCAAkC;AAClC,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7C"}
@@ -1,11 +1,27 @@
1
1
  /**
2
2
  * Theme Schema
3
3
  *
4
- * Type definitions for the PA design system token structure.
5
- * These types enforce the naming convention: {context}-{semantic}
4
+ * The naming convention for design tokens, as types and as data:
5
+ *
6
+ * {context}-[on-]{intent}[-{weight}][-{state}]
7
+ *
8
+ * src/theme/tokens.css is the only place tokens are defined, and nothing derives
9
+ * TypeScript from it. These types describe the *shape* a token name can take
10
+ * rather than enumerating the names that happen to exist today, which is why the
11
+ * vocabulary below is the thing to edit when the system grows a new axis.
12
+ *
13
+ * The trade that makes explicit: the union is complete but permissive. Every real
14
+ * token is assignable, and a few combinations it accepts are not defined. Keeping
15
+ * this vocabulary and tokens.css describing the same system is a manual job — a
16
+ * token whose name falls outside the grid below is unnameable in TypeScript even
17
+ * though its utility compiles.
18
+ *
19
+ * To read a value, read the CSS: `var(--bg-brand)` in a stylesheet, or
20
+ * `getComputedStyle(document.documentElement).getPropertyValue("--bg-brand")`
21
+ * at runtime.
6
22
  */
7
23
  // =============================================================================
8
- // TOKEN STRUCTURE
24
+ // VOCABULARY
9
25
  // =============================================================================
10
26
  /** Contexts - what CSS property this affects */
11
27
  export const contexts = ["bg", "fg", "border"];
@@ -15,25 +31,27 @@ export const hierarchy = ["strong", "normal", "subtle"];
15
31
  export const feedback = ["success", "warning", "danger"];
16
32
  /** All semantics */
17
33
  export const semantics = [...hierarchy, ...feedback];
18
- export function getTokenNames(context) {
19
- switch (context) {
20
- case "bg":
21
- return semantics.map((s) => `bg-${s}`);
22
- case "fg":
23
- return [...semantics.map((s) => `fg-${s}`), ...semantics.map((s) => `fg-on-${s}`)];
24
- case "border":
25
- return semantics.map((s) => `border-${s}`);
26
- }
27
- }
28
- /** Get all token names */
29
- export function getAllTokenNames() {
30
- return [...getTokenNames("bg"), ...getTokenNames("fg"), ...getTokenNames("border")];
31
- }
34
+ /** Every intent a token can carry, including the ones outside the grid above */
35
+ export const intents = [...semantics, "brand", "overlay"];
36
+ /** Weight modifiers, applied to brand and feedback intents */
37
+ export const weights = ["subtle", "strong"];
38
+ /** Interaction states */
39
+ export const states = ["hovered", "pressed", "disabled"];
40
+ /** Tokens that are a category of one, outside the grid */
41
+ export const standaloneTokens = ["focus-ring"];
42
+ // =============================================================================
43
+ // UTILITIES
44
+ // =============================================================================
32
45
  /** Type-safe CSS var reference */
33
46
  export function cssVar(token) {
34
47
  return `var(--${token})`;
35
48
  }
36
- /** Type-safe HSL wrapper for Tailwind */
49
+ /**
50
+ * Type-safe HSL wrapper for Tailwind
51
+ *
52
+ * @deprecated Token values are hex and palette references, so wrapping one in
53
+ * `hsl()` yields invalid CSS. Use {@link cssVar}.
54
+ */
37
55
  export function hsl(token)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D,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,kCAAkC;AAClC,MAAM,UAAU,MAAM,CAAC,KAAiB;IACtC,OAAO,SAAS,KAAK,GAAG,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAiB;IACnC,OAAO,aAAa,KAAK,IAAI,CAAC;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixthshift/design-system",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Personal design system - tokens, theme, and component library",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -29,7 +29,6 @@
29
29
  "files": [
30
30
  "src",
31
31
  "dist",
32
- "tailwind.config.ts",
33
32
  "!src/**/*.test.ts",
34
33
  "!src/**/*.test.tsx",
35
34
  "!src/**/__tests__",
@@ -39,13 +38,11 @@
39
38
  "!src/testing"
40
39
  ],
41
40
  "exports": {
42
- "./styles.css": "./dist/styles.css",
43
- "./theme.css": "./dist/theme.generated.css",
41
+ "./theme.css": "./src/theme/tokens.css",
44
42
  "./theme": {
45
43
  "types": "./dist/theme/index.d.ts",
46
44
  "import": "./dist/theme/index.js"
47
45
  },
48
- "./tailwind.config": "./tailwind.config.ts",
49
46
  "./utils": {
50
47
  "types": "./dist/lib/utils.d.ts",
51
48
  "import": "./dist/lib/utils.js"
@@ -365,21 +362,17 @@
365
362
  },
366
363
  "scripts": {
367
364
  "prepare": "bun run build",
368
- "build": "bun run clean:dist && bun run build:js && bun run build:theme && bun run build:css && bun run scripts/check-exports.ts",
365
+ "build": "bun run clean:dist && bun run build:js && bun run scripts/check-exports.ts",
369
366
  "build:js": "tsc -p tsconfig.build.json && bun run scripts/fix-extensions.ts",
370
- "build:theme": "bun run scripts/generate-theme.ts -i src/theme/theme.json -p src/theme/palette.json -t src/theme/typography.json -o dist/theme.generated.css",
371
- "build:css": "tailwindcss -i src/styles/base.css -o dist/styles.css --minify",
372
- "dev": "bun run dev:css & bun run dev:theme",
373
- "dev:css": "tailwindcss -i src/styles/base.css -o dist/styles.css --watch",
374
- "dev:theme": "bun run scripts/watch-theme.ts",
375
- "storybook": "storybook dev -p 6006 --no-open",
376
- "build-storybook": "storybook build",
367
+ "dev": "storybook dev -p 6006 --no-open",
368
+ "build:storybook": "storybook build",
377
369
  "test": "vitest run --project unit --project date-time --reporter=dot",
378
370
  "test:verbose": "vitest run --project unit --project date-time",
379
371
  "test:watch": "vitest --project unit --project date-time",
380
372
  "test:visual": "vitest run --project visual",
381
373
  "test:visual:update": "vitest run --project visual --update",
382
- "test:stories": "vitest run --project storybook",
374
+ "test:stories": "vitest run --project storybook --project storybook-dark",
375
+ "test:stories:dark": "vitest run --project storybook-dark",
383
376
  "test:ui": "bunx vitest --ui",
384
377
  "type-check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
385
378
  "lint": "biome lint .",
@@ -441,7 +434,8 @@
441
434
  "monaco-editor": "^0.55.1",
442
435
  "react": "^18.2.0 || ^19.0.0",
443
436
  "react-dom": "^18.2.0 || ^19.0.0",
444
- "react-markdown": "^10.1.0"
437
+ "react-markdown": "^10.1.0",
438
+ "tailwindcss": "^4.0.0"
445
439
  },
446
440
  "peerDependenciesMeta": {
447
441
  "@fontsource-variable/inter": {
@@ -1,6 +1,6 @@
1
1
  import { cn } from "@sixthshift/design-system/utils";
2
2
  import { cva, type VariantProps } from "class-variance-authority";
3
- import type * as React from "react";
3
+ import * as React from "react";
4
4
 
5
5
  const badgeVariants = cva(
6
6
  "inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-border-brand focus:ring-offset-2",
@@ -52,8 +52,9 @@ const badgeVariants = cva(
52
52
 
53
53
  export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;
54
54
 
55
- export const Badge = ({ className, variant, intent, ...props }: BadgeProps) => {
56
- return <span className={cn(badgeVariants({ variant, intent }), className)} {...props} />;
57
- };
55
+ export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, intent, ...props }, ref) => {
56
+ return <span ref={ref} className={cn(badgeVariants({ variant, intent }), className)} {...props} />;
57
+ });
58
+ Badge.displayName = "Badge";
58
59
 
59
60
  export { badgeVariants };
@@ -1,5 +1,5 @@
1
1
  import { cn } from "@sixthshift/design-system/utils";
2
- import type * as React from "react";
2
+ import * as React from "react";
3
3
 
4
4
  export type BarChartItem = {
5
5
  label: string;
@@ -17,35 +17,30 @@ export type BarChartProps = React.HTMLAttributes<HTMLDivElement> & {
17
17
 
18
18
  const DEFAULT_COLORS = ["var(--fg-brand)", "var(--fg-success)", "var(--fg-warning)", "var(--fg-danger)", "var(--fg-subtle)"];
19
19
 
20
- export const BarChart = ({
21
- data,
22
- showValues = true,
23
- maxValue: maxValueProp,
24
- formatValue = (v) => String(v),
25
- barHeight = 24,
26
- className,
27
- ...rest
28
- }: BarChartProps) => {
29
- const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
20
+ export const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(
21
+ ({ data, showValues = true, maxValue: maxValueProp, formatValue = (v) => String(v), barHeight = 24, className, ...rest }, ref) => {
22
+ const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
30
23
 
31
- return (
32
- <div {...rest} className={cn("flex flex-col gap-2", className)}>
33
- {data.map((item, i) => {
34
- // Clamp both ends: a negative value would otherwise emit an invalid
35
- // `width: -n%`, whose rendering is undefined.
36
- const percent = Math.min(Math.max((item.value / maxValue) * 100, 0), 100);
37
- const color = item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
24
+ return (
25
+ <div ref={ref} {...rest} className={cn("flex flex-col gap-2", className)}>
26
+ {data.map((item, i) => {
27
+ // Clamp both ends: a negative value would otherwise emit an invalid
28
+ // `width: -n%`, whose rendering is undefined.
29
+ const percent = Math.min(Math.max((item.value / maxValue) * 100, 0), 100);
30
+ const color = item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
38
31
 
39
- return (
40
- <div key={item.label} className="flex items-center gap-3">
41
- <span className="w-20 shrink-0 truncate text-right text-fg-subtle text-sm">{item.label}</span>
42
- <div className="flex-1 overflow-hidden rounded-sm bg-bg-subtle" style={{ height: barHeight }}>
43
- <div className="h-full rounded-sm transition-all duration-300" style={{ width: `${percent}%`, backgroundColor: color }} />
32
+ return (
33
+ <div key={item.label} className="flex items-center gap-3">
34
+ <span className="w-20 shrink-0 truncate text-right text-fg-subtle text-sm">{item.label}</span>
35
+ <div className="flex-1 overflow-hidden rounded-sm bg-bg-subtle" style={{ height: barHeight }}>
36
+ <div className="h-full rounded-sm transition-all duration-300" style={{ width: `${percent}%`, backgroundColor: color }} />
37
+ </div>
38
+ {showValues && <span className="w-12 shrink-0 text-right font-medium text-fg-normal text-sm">{formatValue(item.value)}</span>}
44
39
  </div>
45
- {showValues && <span className="w-12 shrink-0 text-right font-medium text-fg-normal text-sm">{formatValue(item.value)}</span>}
46
- </div>
47
- );
48
- })}
49
- </div>
50
- );
51
- };
40
+ );
41
+ })}
42
+ </div>
43
+ );
44
+ }
45
+ );
46
+ BarChart.displayName = "BarChart";