agentic-ds-kit 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 (345) hide show
  1. package/AGENTS.md +10 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +38 -0
  5. package/contracts/accordion.json +38 -0
  6. package/contracts/alert.json +57 -0
  7. package/contracts/alertdialog.json +89 -0
  8. package/contracts/appheader.json +140 -0
  9. package/contracts/appnav.json +72 -0
  10. package/contracts/avatar.json +63 -0
  11. package/contracts/avatargroup.json +83 -0
  12. package/contracts/badge.json +92 -0
  13. package/contracts/barchart.json +55 -0
  14. package/contracts/breadcrumb.json +76 -0
  15. package/contracts/button.json +120 -0
  16. package/contracts/buttongroup.json +48 -0
  17. package/contracts/calendar.json +93 -0
  18. package/contracts/card.json +123 -0
  19. package/contracts/carousel.json +98 -0
  20. package/contracts/cell.json +203 -0
  21. package/contracts/chat.json +131 -0
  22. package/contracts/checkbox.json +101 -0
  23. package/contracts/collapsible.json +66 -0
  24. package/contracts/command.json +84 -0
  25. package/contracts/datatable.json +126 -0
  26. package/contracts/datepicker.json +102 -0
  27. package/contracts/drawer.json +93 -0
  28. package/contracts/dropdownmenu.json +190 -0
  29. package/contracts/empty.json +79 -0
  30. package/contracts/field.json +49 -0
  31. package/contracts/fieldset.json +29 -0
  32. package/contracts/headercell.json +107 -0
  33. package/contracts/index.json +478 -0
  34. package/contracts/input.json +119 -0
  35. package/contracts/inputotp.json +119 -0
  36. package/contracts/insightcard.json +130 -0
  37. package/contracts/linechart.json +51 -0
  38. package/contracts/loadinganimation.json +33 -0
  39. package/contracts/modal.json +100 -0
  40. package/contracts/modalcard.json +88 -0
  41. package/contracts/navigationmenu.json +65 -0
  42. package/contracts/numbertransition.json +33 -0
  43. package/contracts/pageheader.json +101 -0
  44. package/contracts/pagination.json +85 -0
  45. package/contracts/patterns/activity.json +30 -0
  46. package/contracts/patterns/assistant-workspace.json +16 -0
  47. package/contracts/patterns/dashboard.json +12 -0
  48. package/contracts/patterns/empty-first-run.json +15 -0
  49. package/contracts/patterns/inbox.json +32 -0
  50. package/contracts/patterns/invite-members.json +14 -0
  51. package/contracts/patterns/list-detail.json +13 -0
  52. package/contracts/patterns/settings-form.json +13 -0
  53. package/contracts/piechart.json +68 -0
  54. package/contracts/progress.json +124 -0
  55. package/contracts/progresssteps.json +91 -0
  56. package/contracts/radiogroup.json +132 -0
  57. package/contracts/scoreboard.json +46 -0
  58. package/contracts/scorecard.json +124 -0
  59. package/contracts/section.json +97 -0
  60. package/contracts/select.json +130 -0
  61. package/contracts/shimmertext.json +33 -0
  62. package/contracts/sidenav.json +133 -0
  63. package/contracts/slider.json +81 -0
  64. package/contracts/spinner.json +52 -0
  65. package/contracts/switch.json +94 -0
  66. package/contracts/table.json +92 -0
  67. package/contracts/tabs.json +90 -0
  68. package/contracts/textarea.json +54 -0
  69. package/contracts/thinkinganimation.json +32 -0
  70. package/contracts/timeline.json +49 -0
  71. package/contracts/toast.json +104 -0
  72. package/contracts/tooltip.json +66 -0
  73. package/lib/tokens.css +637 -0
  74. package/package.json +60 -0
  75. package/skills/prototype-from-kit/SKILL.md +29 -0
  76. package/src/index.ts +71 -0
  77. package/tokens/tokens.json +725 -0
  78. package/ui/Accordion/Accordion.module.css +68 -0
  79. package/ui/Accordion/Accordion.tsx +51 -0
  80. package/ui/Accordion/Accordion.types.ts +10 -0
  81. package/ui/Accordion/index.ts +2 -0
  82. package/ui/Alert/Alert.module.css +62 -0
  83. package/ui/Alert/Alert.tsx +27 -0
  84. package/ui/Alert/Alert.types.ts +7 -0
  85. package/ui/Alert/index.ts +2 -0
  86. package/ui/AlertDialog/AlertDialog.module.css +71 -0
  87. package/ui/AlertDialog/AlertDialog.tsx +109 -0
  88. package/ui/AlertDialog/AlertDialog.types.ts +14 -0
  89. package/ui/AlertDialog/index.ts +6 -0
  90. package/ui/AppHeader/AppHeader.module.css +120 -0
  91. package/ui/AppHeader/AppHeader.tsx +70 -0
  92. package/ui/AppHeader/AppHeader.types.ts +28 -0
  93. package/ui/AppHeader/index.ts +2 -0
  94. package/ui/AppNav/AppNav.module.css +168 -0
  95. package/ui/AppNav/AppNav.tsx +137 -0
  96. package/ui/AppNav/AppNav.types.ts +24 -0
  97. package/ui/AppNav/index.ts +2 -0
  98. package/ui/Avatar/Avatar.module.css +52 -0
  99. package/ui/Avatar/Avatar.tsx +62 -0
  100. package/ui/Avatar/Avatar.types.ts +8 -0
  101. package/ui/Avatar/index.ts +2 -0
  102. package/ui/AvatarGroup/AvatarGroup.module.css +49 -0
  103. package/ui/AvatarGroup/AvatarGroup.tsx +29 -0
  104. package/ui/AvatarGroup/AvatarGroup.types.ts +16 -0
  105. package/ui/AvatarGroup/index.ts +2 -0
  106. package/ui/Badge/Badge.module.css +92 -0
  107. package/ui/Badge/Badge.tsx +43 -0
  108. package/ui/Badge/Badge.types.ts +11 -0
  109. package/ui/Badge/index.ts +2 -0
  110. package/ui/BarChart/BarChart.module.css +56 -0
  111. package/ui/BarChart/BarChart.tsx +380 -0
  112. package/ui/BarChart/BarChart.types.ts +18 -0
  113. package/ui/BarChart/index.ts +2 -0
  114. package/ui/Breadcrumb/Breadcrumb.module.css +64 -0
  115. package/ui/Breadcrumb/Breadcrumb.tsx +89 -0
  116. package/ui/Breadcrumb/Breadcrumb.types.ts +14 -0
  117. package/ui/Breadcrumb/index.ts +2 -0
  118. package/ui/Button/Button.module.css +101 -0
  119. package/ui/Button/Button.tsx +49 -0
  120. package/ui/Button/Button.types.ts +18 -0
  121. package/ui/Button/index.ts +2 -0
  122. package/ui/Button/lucideName.tsx +188 -0
  123. package/ui/ButtonGroup/ButtonGroup.module.css +31 -0
  124. package/ui/ButtonGroup/ButtonGroup.tsx +12 -0
  125. package/ui/ButtonGroup/ButtonGroup.types.ts +6 -0
  126. package/ui/ButtonGroup/index.ts +2 -0
  127. package/ui/Calendar/Calendar.module.css +146 -0
  128. package/ui/Calendar/Calendar.tsx +296 -0
  129. package/ui/Calendar/Calendar.types.ts +11 -0
  130. package/ui/Calendar/index.ts +2 -0
  131. package/ui/Card/Card.module.css +95 -0
  132. package/ui/Card/Card.tsx +69 -0
  133. package/ui/Card/Card.types.ts +23 -0
  134. package/ui/Card/index.ts +2 -0
  135. package/ui/Carousel/Carousel.module.css +114 -0
  136. package/ui/Carousel/Carousel.tsx +152 -0
  137. package/ui/Carousel/Carousel.types.ts +17 -0
  138. package/ui/Carousel/index.ts +7 -0
  139. package/ui/Cell/Cell.module.css +133 -0
  140. package/ui/Cell/Cell.tsx +300 -0
  141. package/ui/Cell/Cell.types.ts +69 -0
  142. package/ui/Cell/index.ts +11 -0
  143. package/ui/Chat/Chat.module.css +149 -0
  144. package/ui/Chat/Chat.tsx +175 -0
  145. package/ui/Chat/Chat.types.ts +39 -0
  146. package/ui/Chat/index.ts +2 -0
  147. package/ui/Checkbox/Checkbox.module.css +135 -0
  148. package/ui/Checkbox/Checkbox.tsx +70 -0
  149. package/ui/Checkbox/Checkbox.types.ts +15 -0
  150. package/ui/Checkbox/index.ts +2 -0
  151. package/ui/Collapsible/Collapsible.module.css +68 -0
  152. package/ui/Collapsible/Collapsible.tsx +59 -0
  153. package/ui/Collapsible/Collapsible.types.ts +9 -0
  154. package/ui/Collapsible/index.ts +2 -0
  155. package/ui/Command/Command.module.css +138 -0
  156. package/ui/Command/Command.tsx +152 -0
  157. package/ui/Command/Command.types.ts +20 -0
  158. package/ui/Command/index.ts +2 -0
  159. package/ui/DataTable/DataTable.module.css +211 -0
  160. package/ui/DataTable/DataTable.tsx +429 -0
  161. package/ui/DataTable/DataTable.types.ts +35 -0
  162. package/ui/DataTable/index.ts +8 -0
  163. package/ui/DatePicker/DatePicker.module.css +44 -0
  164. package/ui/DatePicker/DatePicker.tsx +123 -0
  165. package/ui/DatePicker/DatePicker.types.ts +15 -0
  166. package/ui/DatePicker/index.ts +2 -0
  167. package/ui/Drawer/Drawer.module.css +204 -0
  168. package/ui/Drawer/Drawer.tsx +112 -0
  169. package/ui/Drawer/Drawer.types.ts +14 -0
  170. package/ui/Drawer/index.ts +2 -0
  171. package/ui/DropdownMenu/DropdownMenu.module.css +319 -0
  172. package/ui/DropdownMenu/DropdownMenu.tsx +580 -0
  173. package/ui/DropdownMenu/DropdownMenu.types.ts +48 -0
  174. package/ui/DropdownMenu/index.ts +8 -0
  175. package/ui/Empty/Empty.module.css +68 -0
  176. package/ui/Empty/Empty.tsx +35 -0
  177. package/ui/Empty/Empty.types.ts +10 -0
  178. package/ui/Empty/index.ts +2 -0
  179. package/ui/Field/Field.module.css +66 -0
  180. package/ui/Field/Field.tsx +46 -0
  181. package/ui/Field/Field.types.ts +12 -0
  182. package/ui/Field/index.ts +2 -0
  183. package/ui/FieldSet/FieldSet.module.css +30 -0
  184. package/ui/FieldSet/FieldSet.tsx +14 -0
  185. package/ui/FieldSet/FieldSet.types.ts +7 -0
  186. package/ui/FieldSet/index.ts +2 -0
  187. package/ui/HeaderCell/HeaderCell.module.css +85 -0
  188. package/ui/HeaderCell/HeaderCell.tsx +71 -0
  189. package/ui/HeaderCell/HeaderCell.types.ts +18 -0
  190. package/ui/HeaderCell/index.ts +2 -0
  191. package/ui/Input/Input.module.css +59 -0
  192. package/ui/Input/Input.tsx +65 -0
  193. package/ui/Input/Input.types.ts +22 -0
  194. package/ui/Input/index.ts +2 -0
  195. package/ui/InputOTP/InputOTP.module.css +139 -0
  196. package/ui/InputOTP/InputOTP.tsx +136 -0
  197. package/ui/InputOTP/InputOTP.types.ts +19 -0
  198. package/ui/InputOTP/index.ts +2 -0
  199. package/ui/InsightCard/InsightCard.module.css +166 -0
  200. package/ui/InsightCard/InsightCard.tsx +90 -0
  201. package/ui/InsightCard/InsightCard.types.ts +20 -0
  202. package/ui/InsightCard/index.ts +7 -0
  203. package/ui/LineChart/LineChart.module.css +93 -0
  204. package/ui/LineChart/LineChart.tsx +424 -0
  205. package/ui/LineChart/LineChart.types.ts +19 -0
  206. package/ui/LineChart/index.ts +2 -0
  207. package/ui/LoadingAnimation/LoadingAnimation.module.css +66 -0
  208. package/ui/LoadingAnimation/LoadingAnimation.tsx +41 -0
  209. package/ui/LoadingAnimation/LoadingAnimation.types.ts +9 -0
  210. package/ui/LoadingAnimation/index.ts +6 -0
  211. package/ui/Modal/Modal.module.css +48 -0
  212. package/ui/Modal/Modal.tsx +114 -0
  213. package/ui/Modal/Modal.types.ts +15 -0
  214. package/ui/Modal/index.ts +2 -0
  215. package/ui/ModalCard/ModalCard.module.css +137 -0
  216. package/ui/ModalCard/ModalCard.tsx +58 -0
  217. package/ui/ModalCard/ModalCard.types.ts +15 -0
  218. package/ui/ModalCard/index.ts +2 -0
  219. package/ui/NavigationMenu/NavigationMenu.module.css +31 -0
  220. package/ui/NavigationMenu/NavigationMenu.tsx +57 -0
  221. package/ui/NavigationMenu/NavigationMenu.types.ts +22 -0
  222. package/ui/NavigationMenu/index.ts +7 -0
  223. package/ui/NumberTransition/NumberTransition.module.css +110 -0
  224. package/ui/NumberTransition/NumberTransition.tsx +78 -0
  225. package/ui/NumberTransition/NumberTransition.types.ts +9 -0
  226. package/ui/NumberTransition/index.ts +2 -0
  227. package/ui/PageHeader/PageHeader.module.css +57 -0
  228. package/ui/PageHeader/PageHeader.tsx +39 -0
  229. package/ui/PageHeader/PageHeader.types.ts +12 -0
  230. package/ui/PageHeader/index.ts +2 -0
  231. package/ui/Pagination/Pagination.module.css +19 -0
  232. package/ui/Pagination/Pagination.tsx +147 -0
  233. package/ui/Pagination/Pagination.types.ts +12 -0
  234. package/ui/Pagination/index.ts +2 -0
  235. package/ui/PieChart/PieChart.module.css +116 -0
  236. package/ui/PieChart/PieChart.tsx +293 -0
  237. package/ui/PieChart/PieChart.types.ts +22 -0
  238. package/ui/PieChart/index.ts +2 -0
  239. package/ui/Progress/Progress.module.css +226 -0
  240. package/ui/Progress/Progress.tsx +167 -0
  241. package/ui/Progress/Progress.types.ts +15 -0
  242. package/ui/Progress/index.ts +8 -0
  243. package/ui/ProgressSteps/ProgressSteps.module.css +210 -0
  244. package/ui/ProgressSteps/ProgressSteps.tsx +105 -0
  245. package/ui/ProgressSteps/ProgressSteps.types.ts +19 -0
  246. package/ui/ProgressSteps/index.ts +8 -0
  247. package/ui/RadioGroup/RadioGroup.module.css +284 -0
  248. package/ui/RadioGroup/RadioGroup.tsx +116 -0
  249. package/ui/RadioGroup/RadioGroup.types.ts +30 -0
  250. package/ui/RadioGroup/index.ts +8 -0
  251. package/ui/Scoreboard/Scoreboard.module.css +53 -0
  252. package/ui/Scoreboard/Scoreboard.tsx +41 -0
  253. package/ui/Scoreboard/Scoreboard.types.ts +7 -0
  254. package/ui/Scoreboard/index.ts +2 -0
  255. package/ui/Scorecard/Scorecard.module.css +150 -0
  256. package/ui/Scorecard/Scorecard.tsx +92 -0
  257. package/ui/Scorecard/Scorecard.types.ts +18 -0
  258. package/ui/Scorecard/index.ts +2 -0
  259. package/ui/Section/Section.module.css +104 -0
  260. package/ui/Section/Section.tsx +75 -0
  261. package/ui/Section/Section.types.ts +15 -0
  262. package/ui/Section/index.ts +2 -0
  263. package/ui/Select/Select.module.css +7 -0
  264. package/ui/Select/Select.tsx +113 -0
  265. package/ui/Select/Select.types.ts +26 -0
  266. package/ui/Select/index.ts +2 -0
  267. package/ui/ShimmerText/ShimmerText.module.css +46 -0
  268. package/ui/ShimmerText/ShimmerText.tsx +48 -0
  269. package/ui/ShimmerText/ShimmerText.types.ts +12 -0
  270. package/ui/ShimmerText/index.ts +2 -0
  271. package/ui/SideNav/SideNav.module.css +347 -0
  272. package/ui/SideNav/SideNav.tsx +222 -0
  273. package/ui/SideNav/SideNav.types.ts +42 -0
  274. package/ui/SideNav/index.ts +8 -0
  275. package/ui/Slider/Slider.module.css +105 -0
  276. package/ui/Slider/Slider.tsx +187 -0
  277. package/ui/Slider/Slider.types.ts +11 -0
  278. package/ui/Slider/index.ts +2 -0
  279. package/ui/Spinner/Spinner.module.css +58 -0
  280. package/ui/Spinner/Spinner.tsx +19 -0
  281. package/ui/Spinner/Spinner.types.ts +6 -0
  282. package/ui/Spinner/index.ts +2 -0
  283. package/ui/Switch/Switch.module.css +189 -0
  284. package/ui/Switch/Switch.tsx +65 -0
  285. package/ui/Switch/Switch.types.ts +12 -0
  286. package/ui/Switch/index.ts +2 -0
  287. package/ui/Table/Table.module.css +132 -0
  288. package/ui/Table/Table.tsx +108 -0
  289. package/ui/Table/Table.types.ts +26 -0
  290. package/ui/Table/index.ts +8 -0
  291. package/ui/Tabs/Tabs.module.css +162 -0
  292. package/ui/Tabs/Tabs.tsx +150 -0
  293. package/ui/Tabs/Tabs.types.ts +21 -0
  294. package/ui/Tabs/index.ts +2 -0
  295. package/ui/Textarea/Textarea.module.css +74 -0
  296. package/ui/Textarea/Textarea.tsx +38 -0
  297. package/ui/Textarea/Textarea.types.ts +14 -0
  298. package/ui/Textarea/index.ts +2 -0
  299. package/ui/ThinkingAnimation/ThinkingAnimation.module.css +75 -0
  300. package/ui/ThinkingAnimation/ThinkingAnimation.tsx +31 -0
  301. package/ui/ThinkingAnimation/ThinkingAnimation.types.ts +8 -0
  302. package/ui/ThinkingAnimation/index.ts +2 -0
  303. package/ui/Timeline/Timeline.module.css +99 -0
  304. package/ui/Timeline/Timeline.tsx +47 -0
  305. package/ui/Timeline/Timeline.types.ts +16 -0
  306. package/ui/Timeline/index.ts +2 -0
  307. package/ui/Toast/Toast.module.css +133 -0
  308. package/ui/Toast/Toast.tsx +89 -0
  309. package/ui/Toast/Toast.types.ts +17 -0
  310. package/ui/Toast/index.ts +2 -0
  311. package/ui/Tooltip/Tooltip.module.css +111 -0
  312. package/ui/Tooltip/Tooltip.tsx +101 -0
  313. package/ui/Tooltip/index.ts +2 -0
  314. package/ui/patterns/ActivityPattern/ActivityFeed.tsx +77 -0
  315. package/ui/patterns/ActivityPattern/ActivityPattern.tsx +120 -0
  316. package/ui/patterns/ActivityPattern/ActivityTasks.tsx +86 -0
  317. package/ui/patterns/ActivityPattern/TaskDrawer.module.css +39 -0
  318. package/ui/patterns/ActivityPattern/TaskDrawer.tsx +186 -0
  319. package/ui/patterns/ActivityPattern/index.ts +2 -0
  320. package/ui/patterns/AssistantWorkspacePattern/AssistantWorkspacePattern.module.css +16 -0
  321. package/ui/patterns/AssistantWorkspacePattern/AssistantWorkspacePattern.tsx +159 -0
  322. package/ui/patterns/AssistantWorkspacePattern/index.ts +2 -0
  323. package/ui/patterns/DashboardPattern/DashboardPattern.tsx +102 -0
  324. package/ui/patterns/DashboardPattern/index.ts +1 -0
  325. package/ui/patterns/DashboardPattern/patterns.module.css +6 -0
  326. package/ui/patterns/EmptyFirstRunPattern/EmptyFirstRunPattern.tsx +125 -0
  327. package/ui/patterns/EmptyFirstRunPattern/index.ts +2 -0
  328. package/ui/patterns/InboxPattern/InboxPattern.module.css +40 -0
  329. package/ui/patterns/InboxPattern/InboxPattern.tsx +192 -0
  330. package/ui/patterns/InboxPattern/InboxReplyDrawer.tsx +97 -0
  331. package/ui/patterns/InboxPattern/inbox-data.ts +101 -0
  332. package/ui/patterns/InboxPattern/index.ts +2 -0
  333. package/ui/patterns/InviteMembersPattern/InviteMembersPattern.tsx +148 -0
  334. package/ui/patterns/InviteMembersPattern/index.ts +2 -0
  335. package/ui/patterns/ListDetailPattern/ListDetailPattern.module.css +34 -0
  336. package/ui/patterns/ListDetailPattern/ListDetailPattern.tsx +145 -0
  337. package/ui/patterns/ListDetailPattern/index.ts +2 -0
  338. package/ui/patterns/SettingsFormPattern/SettingsFormPattern.module.css +12 -0
  339. package/ui/patterns/SettingsFormPattern/SettingsFormPattern.tsx +89 -0
  340. package/ui/patterns/SettingsFormPattern/index.ts +3 -0
  341. package/ui/shared/ChartFrame.module.css +295 -0
  342. package/ui/shared/ChartFrame.tsx +87 -0
  343. package/ui/shared/chartMath.ts +228 -0
  344. package/ui/shared/controls.module.css +48 -0
  345. package/ui/shared/useChartSize.ts +22 -0
@@ -0,0 +1,105 @@
1
+ import { Check, X } from "lucide-react";
2
+ import type { ProgressStepsItem, ProgressStepsProps, ProgressStepsStatus } from "./ProgressSteps.types";
3
+ import styles from "./ProgressSteps.module.css";
4
+
5
+ export type {
6
+ ProgressStepsItem,
7
+ ProgressStepsOrientation,
8
+ ProgressStepsProps,
9
+ ProgressStepsSize,
10
+ ProgressStepsStatus,
11
+ } from "./ProgressSteps.types";
12
+
13
+ const ICON_SIZE = { sm: 12, md: 14 } as const;
14
+ const STATUSES: readonly ProgressStepsStatus[] = ["complete", "current", "upcoming", "error"];
15
+
16
+ function clampCurrent(value: number): number {
17
+ if (!Number.isFinite(value)) return 0;
18
+ return Math.max(0, Math.round(value));
19
+ }
20
+
21
+ function isStatus(value: ProgressStepsStatus | undefined): value is ProgressStepsStatus {
22
+ return Boolean(value && STATUSES.includes(value));
23
+ }
24
+
25
+ function resolveStatus(step: ProgressStepsItem, index: number, current: number): ProgressStepsStatus {
26
+ if (isStatus(step.status)) return step.status;
27
+ if (index < current) return "complete";
28
+ if (index === current) return "current";
29
+ return "upcoming";
30
+ }
31
+
32
+ function statusPhrase(status: ProgressStepsStatus): string {
33
+ if (status === "complete") return "Completed";
34
+ if (status === "current") return "Current";
35
+ if (status === "error") return "Error";
36
+ return "Upcoming";
37
+ }
38
+
39
+ export function ProgressSteps({
40
+ steps,
41
+ current = 0,
42
+ orientation = "horizontal",
43
+ size = "md",
44
+ ariaLabel = "Progress",
45
+ className = "",
46
+ }: ProgressStepsProps) {
47
+ if (!steps.length) return null;
48
+
49
+ const currentIndex = clampCurrent(current);
50
+ const iconPx = ICON_SIZE[size];
51
+ const statuses = steps.map((step, index) => resolveStatus(step, index, currentIndex));
52
+
53
+ return (
54
+ <nav aria-label={ariaLabel} className={`${styles.root} ${styles[orientation]} ${styles[size]} ${className}`.trim()}>
55
+ <ol className={styles.list}>
56
+ {steps.map((step, index) => {
57
+ const status = statuses[index];
58
+ const prevComplete = index > 0 && statuses[index - 1] === "complete";
59
+ const thisComplete = status === "complete";
60
+ const lineStartClass = `${styles.line} ${styles.lineStart} ${prevComplete ? styles.lineComplete : ""}`.trim();
61
+ const lineEndClass = `${styles.line} ${styles.lineEnd} ${thisComplete ? styles.lineComplete : ""}`.trim();
62
+ const marker = (
63
+ <span className={styles.marker}>
64
+ {status === "complete" ? (
65
+ <Check size={iconPx} strokeWidth={2.5} color="currentColor" aria-hidden />
66
+ ) : status === "error" ? (
67
+ <X size={iconPx} strokeWidth={2.5} color="currentColor" aria-hidden />
68
+ ) : (
69
+ <span className={styles.number}>{index + 1}</span>
70
+ )}
71
+ </span>
72
+ );
73
+
74
+ return (
75
+ <li
76
+ key={step.id}
77
+ className={`${styles.step} ${styles[status]}`}
78
+ aria-current={status === "current" ? "step" : undefined}
79
+ >
80
+ <span className={styles.srOnly}>
81
+ {`${statusPhrase(status)}, step ${index + 1} of ${steps.length}`}
82
+ </span>
83
+ {orientation === "horizontal" ? (
84
+ <div className={styles.markerRow} aria-hidden="true">
85
+ <span className={lineStartClass} />
86
+ {marker}
87
+ <span className={lineEndClass} />
88
+ </div>
89
+ ) : (
90
+ <span className={styles.rail} aria-hidden="true">
91
+ {marker}
92
+ {index < steps.length - 1 ? <span className={lineEndClass} /> : null}
93
+ </span>
94
+ )}
95
+ <div className={styles.copy}>
96
+ <span className={styles.label}>{step.label}</span>
97
+ {step.description ? <span className={styles.description}>{step.description}</span> : null}
98
+ </div>
99
+ </li>
100
+ );
101
+ })}
102
+ </ol>
103
+ </nav>
104
+ );
105
+ }
@@ -0,0 +1,19 @@
1
+ export type ProgressStepsOrientation = "horizontal" | "vertical";
2
+ export type ProgressStepsSize = "sm" | "md";
3
+ export type ProgressStepsStatus = "complete" | "current" | "upcoming" | "error";
4
+
5
+ export interface ProgressStepsItem {
6
+ id: string;
7
+ label: string;
8
+ description?: string;
9
+ status?: ProgressStepsStatus;
10
+ }
11
+
12
+ export interface ProgressStepsProps {
13
+ steps: ProgressStepsItem[];
14
+ current?: number;
15
+ orientation?: ProgressStepsOrientation;
16
+ size?: ProgressStepsSize;
17
+ ariaLabel?: string;
18
+ className?: string;
19
+ }
@@ -0,0 +1,8 @@
1
+ export { ProgressSteps } from "./ProgressSteps";
2
+ export type {
3
+ ProgressStepsItem,
4
+ ProgressStepsOrientation,
5
+ ProgressStepsProps,
6
+ ProgressStepsSize,
7
+ ProgressStepsStatus,
8
+ } from "./ProgressSteps.types";
@@ -0,0 +1,284 @@
1
+ .group {
2
+ display: grid;
3
+ gap: var(--space-stack-md);
4
+ margin: 0;
5
+ padding: 0;
6
+ border: 0;
7
+ min-inline-size: 0;
8
+ }
9
+
10
+ .legend {
11
+ float: left;
12
+ width: 100%;
13
+ padding: 0;
14
+ margin: 0 0 var(--space-stack-sm);
15
+ color: var(--text-primary);
16
+ font-family: var(--font-sans);
17
+ font-size: var(--type-size-label);
18
+ font-weight: var(--type-weight-label);
19
+ line-height: var(--type-line-body);
20
+ }
21
+
22
+ .options {
23
+ display: grid;
24
+ gap: var(--space-stack-md);
25
+ clear: both;
26
+ }
27
+
28
+ .horizontal {
29
+ display: flex;
30
+ flex-wrap: wrap;
31
+ gap: var(--space-inline-lg);
32
+ }
33
+
34
+ .message {
35
+ clear: both;
36
+ margin: 0;
37
+ color: var(--text-muted);
38
+ font-family: var(--font-sans);
39
+ font-size: var(--type-size-caption);
40
+ font-weight: var(--type-weight-caption);
41
+ line-height: var(--type-line-body);
42
+ }
43
+
44
+ .messageError {
45
+ color: var(--text-danger);
46
+ }
47
+
48
+ .radio {
49
+ --radio-size: 1.15rem;
50
+ --radio-dot: 0.6rem;
51
+ display: inline-flex;
52
+ align-items: center;
53
+ gap: var(--space-inline-sm);
54
+ cursor: pointer;
55
+ }
56
+
57
+ .input {
58
+ position: absolute;
59
+ width: 1px;
60
+ height: 1px;
61
+ padding: 0;
62
+ margin: -1px;
63
+ overflow: hidden;
64
+ clip: rect(0, 0, 0, 0);
65
+ white-space: nowrap;
66
+ border: 0;
67
+ }
68
+
69
+ .control {
70
+ position: relative;
71
+ flex-shrink: 0;
72
+ box-sizing: border-box;
73
+ width: var(--radio-size);
74
+ height: var(--radio-size);
75
+ border: var(--border-control) solid var(--border-strong);
76
+ border-radius: var(--radius-pill);
77
+ background: var(--surface-page);
78
+ transition:
79
+ border-color var(--motion-interaction-duration) var(--motion-interaction-easing),
80
+ background-color var(--motion-interaction-duration) var(--motion-interaction-easing);
81
+ }
82
+
83
+ .dot {
84
+ position: absolute;
85
+ top: 50%;
86
+ left: 50%;
87
+ width: var(--radio-dot);
88
+ height: var(--radio-dot);
89
+ border-radius: var(--radius-pill);
90
+ background: var(--action-primary);
91
+ transform: translate(-50%, -50%) scale(0);
92
+ opacity: 0;
93
+ transition:
94
+ transform var(--motion-expand-duration) var(--motion-ease-spring),
95
+ opacity var(--motion-expand-duration) var(--motion-ease-spring);
96
+ }
97
+
98
+ .radio[data-checked] .control {
99
+ border-color: var(--action-primary);
100
+ background: var(--surface-page);
101
+ }
102
+
103
+ .radio[data-checked] .dot {
104
+ transform: translate(-50%, -50%) scale(1);
105
+ opacity: 1;
106
+ }
107
+
108
+ .groupError .radio:not([data-checked]) .control {
109
+ border-color: var(--status-danger);
110
+ }
111
+
112
+ .groupError .radio[data-checked] .control {
113
+ border-color: var(--action-danger);
114
+ background: var(--surface-page);
115
+ }
116
+
117
+ .groupError .radio[data-checked] .dot {
118
+ background: var(--action-danger);
119
+ }
120
+
121
+ .groupError .radio[data-checked]:hover:not([data-disabled]) .control {
122
+ border-color: var(--action-danger-hover);
123
+ }
124
+
125
+ .groupError .radio[data-checked]:hover:not([data-disabled]) .dot {
126
+ background: var(--action-danger-hover);
127
+ }
128
+
129
+ .label {
130
+ color: var(--text-primary);
131
+ font-family: var(--font-sans);
132
+ font-size: var(--type-size-label);
133
+ font-weight: var(--type-weight-label);
134
+ line-height: var(--type-line-body);
135
+ }
136
+
137
+ .radio:hover:not([data-disabled]) .control {
138
+ border-color: var(--border-strong);
139
+ }
140
+
141
+ .radio[data-checked]:hover:not([data-disabled]) .control {
142
+ border-color: var(--action-primary-hover);
143
+ background: var(--surface-page);
144
+ }
145
+
146
+ .radio[data-checked]:hover:not([data-disabled]) .dot {
147
+ background: var(--action-primary-hover);
148
+ }
149
+
150
+ .radio:has(.input:focus-visible) .control {
151
+ outline: var(--border-focus-width) solid var(--focus-ring);
152
+ outline-offset: var(--space-inset-2xs);
153
+ }
154
+
155
+ .radio[data-disabled] {
156
+ cursor: not-allowed;
157
+ }
158
+
159
+ .radio[data-disabled] .control {
160
+ opacity: var(--opacity-disabled);
161
+ }
162
+
163
+ .radio[data-disabled] .label {
164
+ color: var(--text-disabled);
165
+ }
166
+
167
+ .group:disabled .radio {
168
+ cursor: not-allowed;
169
+ }
170
+
171
+ .sm,
172
+ .sm .options {
173
+ gap: var(--space-stack-sm);
174
+ }
175
+
176
+ .sm .radio {
177
+ --radio-size: 0.95rem;
178
+ --radio-dot: 0.48rem;
179
+ gap: var(--space-inline-xs);
180
+ }
181
+
182
+ .sm .label,
183
+ .sm .legend {
184
+ font-size: var(--type-size-caption);
185
+ }
186
+
187
+ .sm .legend {
188
+ margin-bottom: var(--space-stack-xs);
189
+ }
190
+
191
+ .lg {
192
+ gap: var(--space-stack-lg);
193
+ }
194
+
195
+ .lg .legend {
196
+ margin-bottom: var(--space-stack-md);
197
+ }
198
+
199
+ .lg .options {
200
+ gap: var(--space-stack-lg);
201
+ }
202
+
203
+ .lg .radio {
204
+ --radio-size: 1.35rem;
205
+ --radio-dot: 0.72rem;
206
+ gap: var(--space-inline-md);
207
+ }
208
+
209
+ .lg .label {
210
+ font-size: var(--type-size-body-sm);
211
+ }
212
+
213
+ @media (prefers-reduced-motion: reduce) {
214
+ .control,
215
+ .dot,
216
+ .message {
217
+ transition: none;
218
+ animation: none;
219
+ }
220
+ }
221
+
222
+ .legendHidden {
223
+ position: absolute;
224
+ width: 1px;
225
+ height: 1px;
226
+ padding: 0;
227
+ margin: -1px;
228
+ overflow: hidden;
229
+ clip: rect(0, 0, 0, 0);
230
+ white-space: nowrap;
231
+ border: 0;
232
+ }
233
+
234
+ .card {
235
+ gap: var(--space-stack-sm);
236
+ }
237
+
238
+ .card .options {
239
+ display: grid;
240
+ gap: var(--space-3);
241
+ }
242
+
243
+ .card .radio {
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ gap: var(--space-4);
248
+ width: 100%;
249
+ margin: 0;
250
+ padding: var(--space-4);
251
+ border: var(--border-highlight) solid var(--border-faint);
252
+ border-radius: var(--radius-surface-md);
253
+ background: var(--surface-card);
254
+ box-sizing: border-box;
255
+ }
256
+
257
+ .card .copy {
258
+ display: grid;
259
+ gap: var(--space-1);
260
+ min-width: 0;
261
+ flex: 1;
262
+ }
263
+
264
+ .card .titleRow {
265
+ display: flex;
266
+ align-items: center;
267
+ flex-wrap: wrap;
268
+ gap: var(--space-2);
269
+ min-width: 0;
270
+ }
271
+
272
+ .card .label {
273
+ font-size: var(--type-size-body);
274
+ font-weight: var(--type-weight-heading);
275
+ }
276
+
277
+ .card .description {
278
+ color: var(--text-muted);
279
+ font-family: var(--font-sans);
280
+ font-size: var(--type-size-body-sm);
281
+ font-weight: var(--type-weight-caption);
282
+ line-height: var(--type-line-body);
283
+ }
284
+
@@ -0,0 +1,116 @@
1
+ "use client";
2
+
3
+ import { useId, useState } from "react";
4
+ import { Badge } from "../Badge";
5
+ import type { RadioGroupProps } from "./RadioGroup.types";
6
+ import styles from "./RadioGroup.module.css";
7
+
8
+ export type {
9
+ RadioGroupProps,
10
+ RadioGroupOption,
11
+ RadioGroupOrientation,
12
+ RadioGroupSize,
13
+ RadioGroupLayout,
14
+ } from "./RadioGroup.types";
15
+
16
+ export function RadioGroup({
17
+ name,
18
+ legend,
19
+ hideLegend = false,
20
+ size = "md",
21
+ orientation = "vertical",
22
+ layout = "list",
23
+ options,
24
+ defaultValue,
25
+ value: valueProp,
26
+ onChange,
27
+ disabled = false,
28
+ error,
29
+ hint,
30
+ }: RadioGroupProps) {
31
+ const uid = useId();
32
+ const isControlled = valueProp !== undefined;
33
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
34
+ const value = isControlled ? valueProp : uncontrolled;
35
+ const message = error || hint;
36
+ const messageId = message ? `${uid}-message` : undefined;
37
+
38
+ function emit(next: string) {
39
+ if (disabled) return;
40
+ if (!isControlled) setUncontrolled(next);
41
+ onChange?.(next);
42
+ }
43
+
44
+ return (
45
+ <fieldset
46
+ className={`${styles.group} ${styles[size]} ${layout === "card" ? styles.card : ""}${error ? ` ${styles.groupError}` : ""}`}
47
+ disabled={disabled}
48
+ aria-invalid={error ? true : undefined}
49
+ aria-describedby={messageId}
50
+ >
51
+ <legend className={hideLegend ? styles.legendHidden : styles.legend}>{legend}</legend>
52
+ <div
53
+ className={`${styles.options} ${orientation === "horizontal" && layout !== "card" ? styles.horizontal : ""}`}
54
+ >
55
+ {options.map((option) => {
56
+ const optionId = `${uid}-${option.value || "empty"}`;
57
+ const optionDisabled = Boolean(disabled || option.disabled);
58
+ const checked = value === option.value;
59
+ return (
60
+ <label
61
+ key={option.value}
62
+ className={styles.radio}
63
+ htmlFor={optionId}
64
+ data-checked={checked || undefined}
65
+ data-disabled={optionDisabled || undefined}
66
+ >
67
+ <input
68
+ id={optionId}
69
+ className={styles.input}
70
+ type="radio"
71
+ name={name}
72
+ value={option.value}
73
+ checked={checked}
74
+ disabled={optionDisabled}
75
+ aria-invalid={error ? true : undefined}
76
+ onChange={() => emit(option.value)}
77
+ />
78
+ {layout === "card" ? (
79
+ <span className={styles.copy}>
80
+ <span className={styles.titleRow}>
81
+ <span className={styles.label}>{option.label}</span>
82
+ {option.badge ? (
83
+ <Badge size="sm" tone={option.badgeTone ?? "neutral"}>
84
+ {option.badge}
85
+ </Badge>
86
+ ) : null}
87
+ </span>
88
+ {option.description ? (
89
+ <span className={styles.description}>{option.description}</span>
90
+ ) : null}
91
+ </span>
92
+ ) : (
93
+ <>
94
+ <span className={styles.control} aria-hidden>
95
+ <span className={styles.dot} />
96
+ </span>
97
+ <span className={styles.label}>{option.label}</span>
98
+ </>
99
+ )}
100
+ {layout === "card" ? (
101
+ <span className={styles.control} aria-hidden>
102
+ <span className={styles.dot} />
103
+ </span>
104
+ ) : null}
105
+ </label>
106
+ );
107
+ })}
108
+ </div>
109
+ {message ? (
110
+ <p id={messageId} className={`${styles.message}${error ? ` ${styles.messageError}` : ""}`}>
111
+ {message}
112
+ </p>
113
+ ) : null}
114
+ </fieldset>
115
+ );
116
+ }
@@ -0,0 +1,30 @@
1
+ import type { BadgeTone } from "../Badge/Badge.types";
2
+
3
+ export type RadioGroupSize = "sm" | "md" | "lg";
4
+ export type RadioGroupOrientation = "vertical" | "horizontal";
5
+ export type RadioGroupLayout = "list" | "card";
6
+
7
+ export interface RadioGroupOption {
8
+ value: string;
9
+ label: string;
10
+ description?: string;
11
+ badge?: string;
12
+ badgeTone?: BadgeTone;
13
+ disabled?: boolean;
14
+ }
15
+
16
+ export interface RadioGroupProps {
17
+ name: string;
18
+ legend: string;
19
+ hideLegend?: boolean;
20
+ size?: RadioGroupSize;
21
+ orientation?: RadioGroupOrientation;
22
+ layout?: RadioGroupLayout;
23
+ options: RadioGroupOption[];
24
+ defaultValue?: string;
25
+ value?: string;
26
+ onChange?: (value: string) => void;
27
+ disabled?: boolean;
28
+ error?: string;
29
+ hint?: string;
30
+ }
@@ -0,0 +1,8 @@
1
+ export { RadioGroup } from "./RadioGroup";
2
+ export type {
3
+ RadioGroupProps,
4
+ RadioGroupOption,
5
+ RadioGroupOrientation,
6
+ RadioGroupSize,
7
+ RadioGroupLayout,
8
+ } from "./RadioGroup.types";
@@ -0,0 +1,53 @@
1
+ .scoreboard {
2
+ width: 100%;
3
+ min-width: 0;
4
+ container-type: inline-size;
5
+ container-name: scoreboard;
6
+ }
7
+
8
+ .grid {
9
+ display: grid;
10
+ gap: var(--space-4);
11
+ width: 100%;
12
+ min-width: 0;
13
+ align-items: stretch;
14
+ }
15
+
16
+ .count1 {
17
+ grid-template-columns: minmax(0, 1fr);
18
+ }
19
+
20
+ .count2,
21
+ .count4 {
22
+ grid-template-columns: repeat(2, minmax(0, 1fr));
23
+ }
24
+
25
+ .count3 {
26
+ grid-template-columns: repeat(3, minmax(0, 1fr));
27
+ }
28
+
29
+ @container scoreboard (max-width: calc(2 * var(--layout-metrics-min) + var(--space-4))) {
30
+ .count2,
31
+ .count4 {
32
+ grid-template-columns: minmax(0, 1fr);
33
+ }
34
+ }
35
+
36
+ @container scoreboard (max-width: calc(3 * var(--layout-metrics-min) + 2 * var(--space-4))) {
37
+ .count3 {
38
+ grid-template-columns: minmax(0, 1fr);
39
+ }
40
+ }
41
+
42
+ @container scoreboard (min-width: calc(4 * var(--layout-metrics-min) + 3 * var(--space-4))) {
43
+ .count4 {
44
+ grid-template-columns: repeat(4, minmax(0, 1fr));
45
+ }
46
+ }
47
+
48
+ .overflow {
49
+ width: 100%;
50
+ min-width: 0;
51
+ padding-inline: var(--space-12);
52
+ box-sizing: border-box;
53
+ }
@@ -0,0 +1,41 @@
1
+ import { Carousel } from "../Carousel";
2
+ import { Scorecard } from "../Scorecard";
3
+ import type { ScoreboardProps } from "./Scoreboard.types";
4
+ import styles from "./Scoreboard.module.css";
5
+
6
+ export type { ScoreboardProps } from "./Scoreboard.types";
7
+
8
+ const STRIP_MAX = 4;
9
+
10
+ export function Scoreboard({
11
+ items,
12
+ "aria-label": ariaLabel = "Key metrics",
13
+ className = "",
14
+ }: ScoreboardProps) {
15
+ const cards = items.map((item) => (
16
+ <Scorecard key={item.label} {...item} fill />
17
+ ));
18
+
19
+ if (items.length > STRIP_MAX) {
20
+ return (
21
+ <div className={`${styles.overflow} ${className}`.trim()}>
22
+ <Carousel items={cards} slidesPerView={4} ariaLabel={ariaLabel} />
23
+ </div>
24
+ );
25
+ }
26
+
27
+ const countClass =
28
+ items.length <= 1
29
+ ? styles.count1
30
+ : items.length === 2
31
+ ? styles.count2
32
+ : items.length === 3
33
+ ? styles.count3
34
+ : styles.count4;
35
+
36
+ return (
37
+ <section className={styles.scoreboard} aria-label={ariaLabel}>
38
+ <div className={`${styles.grid} ${countClass} ${className}`.trim()}>{cards}</div>
39
+ </section>
40
+ );
41
+ }
@@ -0,0 +1,7 @@
1
+ import type { ScorecardProps } from "../Scorecard/Scorecard.types";
2
+
3
+ export interface ScoreboardProps {
4
+ items: ScorecardProps[];
5
+ "aria-label"?: string;
6
+ className?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ export { Scoreboard } from "./Scoreboard";
2
+ export type { ScoreboardProps } from "./Scoreboard.types";