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,132 @@
1
+ .wrapper {
2
+ position: relative;
3
+ width: 100%;
4
+ min-width: 0;
5
+ overflow-x: auto;
6
+ }
7
+
8
+ .table {
9
+ width: 100%;
10
+ caption-side: bottom;
11
+ border-collapse: collapse;
12
+ font-family: var(--font-sans);
13
+ font-size: var(--type-size-body-sm);
14
+ line-height: var(--type-line-body);
15
+ color: var(--text-primary);
16
+ text-align: start;
17
+ }
18
+
19
+ .caption {
20
+ caption-side: bottom;
21
+ margin-top: var(--space-4);
22
+ font-family: var(--font-sans);
23
+ font-size: var(--type-size-body-sm);
24
+ font-weight: var(--type-weight-body);
25
+ line-height: var(--type-line-body);
26
+ color: var(--text-muted);
27
+ text-align: start;
28
+ }
29
+
30
+ .tr {
31
+ border-bottom: var(--border-divider) solid var(--border-faint);
32
+ transition: background-color var(--motion-interaction-duration) var(--motion-interaction-easing);
33
+ }
34
+
35
+ .thead .tr {
36
+ border-bottom: var(--border-divider) solid var(--border-faint);
37
+ }
38
+
39
+ .tbody .tr:last-child {
40
+ border-bottom: none;
41
+ }
42
+
43
+ .tbody .tr:hover .td {
44
+ background-color: color-mix(in srgb, var(--surface-muted) 50%, var(--surface-card));
45
+ }
46
+
47
+ .tfoot {
48
+ border-top: var(--border-divider) solid var(--border-faint);
49
+ background-color: color-mix(in srgb, var(--surface-muted) 50%, transparent);
50
+ font-weight: var(--type-weight-label);
51
+ }
52
+
53
+ .tfoot .td {
54
+ color: var(--text-primary);
55
+ font-weight: var(--type-weight-label);
56
+ background-color: color-mix(in srgb, var(--surface-muted) 50%, var(--surface-card));
57
+ }
58
+
59
+ .tfoot .tr {
60
+ border-bottom: none;
61
+ }
62
+
63
+ .tfoot .tr:last-child {
64
+ border-bottom: none;
65
+ }
66
+
67
+ .th,
68
+ .td {
69
+ vertical-align: middle;
70
+ text-align: start;
71
+ white-space: nowrap;
72
+ }
73
+
74
+ .th {
75
+ height: 2.5rem;
76
+ padding-inline: var(--space-2);
77
+ padding-block: 0;
78
+ font-weight: var(--type-weight-label);
79
+ color: var(--text-primary);
80
+ background-color: var(--surface-card);
81
+ }
82
+
83
+ .td {
84
+ padding: var(--space-2);
85
+ color: var(--text-secondary);
86
+ background-color: var(--surface-card);
87
+ transition: background-color var(--motion-interaction-duration) var(--motion-interaction-easing);
88
+ }
89
+
90
+ .emphasis {
91
+ font-weight: var(--type-weight-label);
92
+ color: var(--text-primary);
93
+ }
94
+
95
+ .numeric {
96
+ width: 1%;
97
+ text-align: end;
98
+ font-variant-numeric: tabular-nums;
99
+ }
100
+
101
+ .empty {
102
+ min-height: 6rem;
103
+ height: 6rem;
104
+ text-align: center;
105
+ white-space: normal;
106
+ color: var(--text-muted);
107
+ }
108
+
109
+ .sm .th {
110
+ height: 2rem;
111
+ padding-inline: var(--space-1);
112
+ }
113
+
114
+ .sm .td {
115
+ padding: var(--space-1);
116
+ }
117
+
118
+ .lg .th {
119
+ height: 3rem;
120
+ padding-inline: var(--space-3);
121
+ }
122
+
123
+ .lg .td {
124
+ padding: var(--space-3);
125
+ }
126
+
127
+ @media (prefers-reduced-motion: reduce) {
128
+ .tr,
129
+ .td {
130
+ transition: none;
131
+ }
132
+ }
@@ -0,0 +1,108 @@
1
+ import type { ReactNode } from "react";
2
+ import type { TableColumn, TableProps } from "./Table.types";
3
+ import styles from "./Table.module.css";
4
+
5
+ export type {
6
+ TableProps,
7
+ TableColumn,
8
+ TableSize,
9
+ TableAlign,
10
+ TableFooter,
11
+ } from "./Table.types";
12
+
13
+ const DEFAULT_EMPTY = "No results.";
14
+
15
+ function isNumeric(column: TableColumn): boolean {
16
+ return column.numeric === true || column.align === "end";
17
+ }
18
+
19
+ function isEmphasis(column: TableColumn, index: number): boolean {
20
+ return column.emphasis === true || index === 0;
21
+ }
22
+
23
+ function classNames(...parts: Array<string | false | undefined>): string {
24
+ return parts.filter(Boolean).join(" ");
25
+ }
26
+
27
+ function cellValue(value: string | number | ReactNode | undefined): ReactNode {
28
+ if (value === undefined || value === null) return "";
29
+ return value;
30
+ }
31
+
32
+ export function Table({
33
+ columns,
34
+ rows,
35
+ caption,
36
+ size = "md",
37
+ emptyLabel = DEFAULT_EMPTY,
38
+ footer,
39
+ }: TableProps) {
40
+ const empty = rows.length === 0;
41
+ const colCount = Math.max(columns.length, 1);
42
+ const footerLabelSpan = columns.length > 1 ? columns.length - 1 : 1;
43
+
44
+ return (
45
+ <div className={classNames(styles.wrapper, styles[size])}>
46
+ <table className={styles.table}>
47
+ {caption ? <caption className={styles.caption}>{caption}</caption> : null}
48
+ <thead className={styles.thead}>
49
+ <tr className={styles.tr}>
50
+ {columns.map((column) => (
51
+ <th
52
+ key={column.key}
53
+ scope="col"
54
+ className={classNames(styles.th, isNumeric(column) && styles.numeric)}
55
+ >
56
+ {column.header}
57
+ </th>
58
+ ))}
59
+ </tr>
60
+ </thead>
61
+ <tbody className={styles.tbody}>
62
+ {empty ? (
63
+ <tr className={styles.tr}>
64
+ <td className={classNames(styles.td, styles.empty)} colSpan={colCount}>
65
+ {emptyLabel}
66
+ </td>
67
+ </tr>
68
+ ) : (
69
+ rows.map((row, index) => (
70
+ <tr key={index} className={styles.tr}>
71
+ {columns.map((column, columnIndex) => (
72
+ <td
73
+ key={column.key}
74
+ className={classNames(
75
+ styles.td,
76
+ isNumeric(column) && styles.numeric,
77
+ isEmphasis(column, columnIndex) && styles.emphasis,
78
+ )}
79
+ >
80
+ {cellValue(row[column.key])}
81
+ </td>
82
+ ))}
83
+ </tr>
84
+ ))
85
+ )}
86
+ </tbody>
87
+ {footer ? (
88
+ <tfoot className={styles.tfoot}>
89
+ <tr className={styles.tr}>
90
+ {columns.length > 1 ? (
91
+ <>
92
+ <td className={styles.td} colSpan={footerLabelSpan}>
93
+ {footer.label}
94
+ </td>
95
+ <td className={classNames(styles.td, styles.numeric)}>{footer.value}</td>
96
+ </>
97
+ ) : (
98
+ <td className={classNames(styles.td, styles.numeric)}>
99
+ {footer.label} {footer.value}
100
+ </td>
101
+ )}
102
+ </tr>
103
+ </tfoot>
104
+ ) : null}
105
+ </table>
106
+ </div>
107
+ );
108
+ }
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ export type TableSize = "sm" | "md" | "lg";
4
+ export type TableAlign = "start" | "end";
5
+
6
+ export interface TableColumn {
7
+ key: string;
8
+ header: string;
9
+ align?: TableAlign;
10
+ numeric?: boolean;
11
+ emphasis?: boolean;
12
+ }
13
+
14
+ export interface TableFooter {
15
+ label: string;
16
+ value: string | number;
17
+ }
18
+
19
+ export interface TableProps {
20
+ columns: TableColumn[];
21
+ rows: Record<string, string | number | ReactNode>[];
22
+ caption?: string;
23
+ size?: TableSize;
24
+ emptyLabel?: string;
25
+ footer?: TableFooter;
26
+ }
@@ -0,0 +1,8 @@
1
+ export { Table } from "./Table";
2
+ export type {
3
+ TableProps,
4
+ TableColumn,
5
+ TableSize,
6
+ TableAlign,
7
+ TableFooter,
8
+ } from "./Table.types";
@@ -0,0 +1,162 @@
1
+ .tabs {
2
+ display: grid;
3
+ gap: var(--space-stack-md);
4
+ width: 100%;
5
+ }
6
+
7
+ .listOnly {
8
+ gap: 0;
9
+ width: fit-content;
10
+ max-width: 100%;
11
+ }
12
+
13
+ .list {
14
+ position: relative;
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ align-items: center;
18
+ width: fit-content;
19
+ max-width: 100%;
20
+ }
21
+
22
+ .indicator {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ z-index: 0;
27
+ pointer-events: none;
28
+ opacity: 0;
29
+ transform-origin: left center;
30
+ }
31
+
32
+ .indicator[data-ready] {
33
+ opacity: 1;
34
+ }
35
+
36
+ .trigger {
37
+ position: relative;
38
+ z-index: 1;
39
+ appearance: none;
40
+ margin: 0;
41
+ border: 0;
42
+ background: transparent;
43
+ color: var(--text-muted);
44
+ font-family: var(--font-sans);
45
+ font-size: var(--type-size-label);
46
+ font-weight: var(--type-weight-label);
47
+ line-height: var(--type-line-body);
48
+ cursor: pointer;
49
+ }
50
+
51
+ .trigger:hover:not(:disabled) {
52
+ color: var(--text-primary);
53
+ }
54
+
55
+ .trigger[data-state="active"] {
56
+ color: var(--text-primary);
57
+ }
58
+
59
+ .trigger:focus-visible {
60
+ outline: var(--border-focus-width) solid var(--focus-ring);
61
+ outline-offset: var(--space-inset-2xs);
62
+ }
63
+
64
+ .trigger:disabled {
65
+ color: var(--text-disabled);
66
+ cursor: not-allowed;
67
+ opacity: var(--opacity-disabled);
68
+ }
69
+
70
+ .content {
71
+ min-width: 0;
72
+ color: var(--text-secondary);
73
+ font-family: var(--font-sans);
74
+ font-size: var(--type-size-body-sm);
75
+ font-weight: var(--type-weight-body);
76
+ line-height: var(--type-line-body);
77
+ outline: none;
78
+ }
79
+
80
+ .segmented .list {
81
+ gap: var(--space-inline-2xs);
82
+ padding: var(--space-inset-2xs);
83
+ border-radius: var(--radius-control-md);
84
+ background: var(--surface-muted);
85
+ box-shadow: inset 0 0 0 var(--border-100) var(--border-faint);
86
+ }
87
+
88
+ .segmented .indicator {
89
+ border-radius: var(--radius-control-sm);
90
+ background: var(--surface-card);
91
+ box-shadow: var(--shadow-raised-sm);
92
+ }
93
+
94
+ .segmented .trigger {
95
+ border-radius: var(--radius-control-sm);
96
+ padding: var(--space-inset-sm) var(--space-inset-md);
97
+ }
98
+
99
+ .line .list {
100
+ gap: var(--space-inline-md);
101
+ width: 100%;
102
+ border-bottom: var(--border-divider) solid var(--border-faint);
103
+ }
104
+
105
+ .line .indicator {
106
+ top: auto;
107
+ bottom: 0;
108
+ height: var(--border-control-strong) !important;
109
+ border-radius: var(--radius-pill);
110
+ background: var(--text-primary);
111
+ }
112
+
113
+ .line .trigger {
114
+ padding: var(--space-inset-sm) var(--space-inset-2xs);
115
+ margin-bottom: calc(-1 * var(--border-divider));
116
+ }
117
+
118
+ .sm {
119
+ gap: var(--space-stack-sm);
120
+ }
121
+
122
+ .sm.segmented .trigger {
123
+ padding: var(--space-inset-xs) var(--space-inset-sm);
124
+ font-size: var(--type-size-caption);
125
+ font-weight: var(--type-weight-caption);
126
+ }
127
+
128
+ .sm.line .trigger {
129
+ padding: var(--space-inset-xs) var(--space-inset-2xs);
130
+ font-size: var(--type-size-caption);
131
+ font-weight: var(--type-weight-caption);
132
+ }
133
+
134
+ .lg {
135
+ gap: var(--space-stack-lg);
136
+ }
137
+
138
+ .lg.segmented .list {
139
+ padding: var(--space-inset-xs);
140
+ border-radius: var(--radius-control-lg);
141
+ gap: var(--space-inline-xs);
142
+ }
143
+
144
+ .lg.segmented .trigger {
145
+ padding: var(--space-inset-sm) var(--space-inset-lg);
146
+ border-radius: var(--radius-control-md);
147
+ font-size: var(--type-size-body-sm);
148
+ }
149
+
150
+ .lg.segmented .indicator {
151
+ border-radius: var(--radius-control-md);
152
+ }
153
+
154
+ .lg.line .trigger {
155
+ padding: var(--space-inset-md) var(--space-inset-xs);
156
+ font-size: var(--type-size-body-sm);
157
+ }
158
+
159
+ .lg .content {
160
+ font-size: var(--type-size-body);
161
+ }
162
+
@@ -0,0 +1,150 @@
1
+ "use client";
2
+
3
+ import { useId, useLayoutEffect, useRef, useState, type KeyboardEvent } from "react";
4
+ import type { TabsProps } from "./Tabs.types";
5
+ import styles from "./Tabs.module.css";
6
+
7
+ export type { TabsProps, TabItem, TabsSize, TabsVariant } from "./Tabs.types";
8
+
9
+ function firstEnabledId(items: TabsProps["items"], preferred?: string) {
10
+ if (preferred && items.some((item) => item.id === preferred && !item.disabled)) {
11
+ return preferred;
12
+ }
13
+ return items.find((item) => !item.disabled)?.id;
14
+ }
15
+
16
+ export function Tabs({
17
+ items,
18
+ value,
19
+ defaultValue,
20
+ onChange,
21
+ size = "md",
22
+ variant = "segmented",
23
+ ariaLabel = "Tabs",
24
+ }: TabsProps) {
25
+ const baseId = useId();
26
+ const isControlled = value !== undefined;
27
+ const [internal, setInternal] = useState(() => firstEnabledId(items, defaultValue) ?? items[0]?.id);
28
+ const selected = (isControlled ? value : internal) ?? items[0]?.id;
29
+ const selectedItem = items.find((item) => item.id === selected) ?? items.find((item) => !item.disabled) ?? items[0];
30
+
31
+ const listRef = useRef<HTMLDivElement>(null);
32
+ const tabRefs = useRef(new Map<string, HTMLButtonElement>());
33
+ const [indicator, setIndicator] = useState({ left: 0, top: 0, width: 0, height: 0, ready: false });
34
+
35
+ function select(id: string) {
36
+ const item = items.find((entry) => entry.id === id);
37
+ if (!item || item.disabled) return;
38
+ if (!isControlled) setInternal(id);
39
+ onChange?.(id);
40
+ }
41
+
42
+ useLayoutEffect(() => {
43
+ function update() {
44
+ const list = listRef.current;
45
+ const active = selected ? tabRefs.current.get(selected) : undefined;
46
+ if (!list || !active) {
47
+ setIndicator((current) => ({ ...current, ready: false }));
48
+ return;
49
+ }
50
+ setIndicator({
51
+ left: active.offsetLeft,
52
+ top: active.offsetTop,
53
+ width: active.offsetWidth,
54
+ height: active.offsetHeight,
55
+ ready: true,
56
+ });
57
+ }
58
+
59
+ update();
60
+ const observer = new ResizeObserver(update);
61
+ if (listRef.current) observer.observe(listRef.current);
62
+ tabRefs.current.forEach((node) => observer.observe(node));
63
+ window.addEventListener("resize", update);
64
+ return () => {
65
+ observer.disconnect();
66
+ window.removeEventListener("resize", update);
67
+ };
68
+ }, [selected, size, variant, items]);
69
+
70
+ function onListKeyDown(event: KeyboardEvent<HTMLDivElement>) {
71
+ const enabled = items.filter((item) => !item.disabled);
72
+ if (enabled.length === 0) return;
73
+ const index = enabled.findIndex((item) => item.id === selected);
74
+ const current = index < 0 ? 0 : index;
75
+ let next = current;
76
+ if (event.key === "ArrowRight" || event.key === "ArrowDown") next = (current + 1) % enabled.length;
77
+ else if (event.key === "ArrowLeft" || event.key === "ArrowUp") next = (current - 1 + enabled.length) % enabled.length;
78
+ else if (event.key === "Home") next = 0;
79
+ else if (event.key === "End") next = enabled.length - 1;
80
+ else return;
81
+ event.preventDefault();
82
+ select(enabled[next].id);
83
+ tabRefs.current.get(enabled[next].id)?.focus();
84
+ }
85
+
86
+ if (!selectedItem) return null;
87
+ const showPanel = selectedItem.content != null && selectedItem.content !== false;
88
+
89
+ return (
90
+ <div
91
+ className={`${styles.tabs} ${styles[size]} ${styles[variant]}${showPanel ? "" : ` ${styles.listOnly}`}`}
92
+ >
93
+ <div
94
+ ref={listRef}
95
+ role="tablist"
96
+ aria-label={ariaLabel}
97
+ className={styles.list}
98
+ onKeyDown={onListKeyDown}
99
+ >
100
+ <span
101
+ className={styles.indicator}
102
+ data-ready={indicator.ready ? "" : undefined}
103
+ aria-hidden
104
+ style={{
105
+ transform: `translate(${indicator.left}px, ${indicator.top}px)`,
106
+ width: indicator.width,
107
+ height: indicator.height,
108
+ }}
109
+ />
110
+ {items.map((item) => {
111
+ const isSelected = item.id === selected;
112
+ const triggerId = `${baseId}-trigger-${item.id}`;
113
+ const panelId = `${baseId}-panel-${item.id}`;
114
+ return (
115
+ <button
116
+ key={item.id}
117
+ id={triggerId}
118
+ ref={(node) => {
119
+ if (node) tabRefs.current.set(item.id, node);
120
+ else tabRefs.current.delete(item.id);
121
+ }}
122
+ type="button"
123
+ role="tab"
124
+ className={styles.trigger}
125
+ aria-selected={isSelected}
126
+ aria-controls={panelId}
127
+ tabIndex={isSelected ? 0 : -1}
128
+ disabled={item.disabled}
129
+ data-state={isSelected ? "active" : "inactive"}
130
+ onClick={() => select(item.id)}
131
+ >
132
+ {item.label}
133
+ </button>
134
+ );
135
+ })}
136
+ </div>
137
+ {showPanel ? (
138
+ <div
139
+ id={`${baseId}-panel-${selectedItem.id}`}
140
+ role="tabpanel"
141
+ className={styles.content}
142
+ aria-labelledby={`${baseId}-trigger-${selectedItem.id}`}
143
+ tabIndex={0}
144
+ >
145
+ {selectedItem.content}
146
+ </div>
147
+ ) : null}
148
+ </div>
149
+ );
150
+ }
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ export type TabsSize = "sm" | "md" | "lg";
4
+ export type TabsVariant = "segmented" | "line";
5
+
6
+ export interface TabItem {
7
+ id: string;
8
+ label: string;
9
+ content?: ReactNode;
10
+ disabled?: boolean;
11
+ }
12
+
13
+ export interface TabsProps {
14
+ items: TabItem[];
15
+ value?: string;
16
+ defaultValue?: string;
17
+ onChange?: (id: string) => void;
18
+ size?: TabsSize;
19
+ variant?: TabsVariant;
20
+ ariaLabel?: string;
21
+ }
@@ -0,0 +1,2 @@
1
+ export { Tabs } from "./Tabs";
2
+ export type { TabsProps, TabItem, TabsSize, TabsVariant } from "./Tabs.types";
@@ -0,0 +1,74 @@
1
+ .textarea {
2
+ display: block;
3
+ box-sizing: border-box;
4
+ width: 100%;
5
+ margin: 0;
6
+ resize: vertical;
7
+ font-family: var(--font-sans);
8
+ font-weight: var(--type-weight-body);
9
+ line-height: var(--type-line-body);
10
+ color: var(--text-primary);
11
+ background-color: var(--surface-card);
12
+ border: var(--border-control) solid var(--border-faint);
13
+ outline: none;
14
+ }
15
+
16
+ .textarea::placeholder {
17
+ color: var(--text-muted);
18
+ }
19
+
20
+ .sm {
21
+ min-height: 5rem;
22
+ padding: var(--space-inset-sm);
23
+ border-radius: var(--radius-control-md);
24
+ font-size: var(--type-size-caption);
25
+ }
26
+
27
+ .md {
28
+ min-height: 6.5rem;
29
+ padding: var(--space-inset-sm) var(--space-inset-md);
30
+ border-radius: var(--radius-control-md);
31
+ font-size: var(--type-size-body-sm);
32
+ }
33
+
34
+ .lg {
35
+ min-height: 8rem;
36
+ padding: var(--space-inset-md) var(--space-inset-lg);
37
+ border-radius: var(--radius-control-lg);
38
+ font-size: var(--type-size-body);
39
+ }
40
+
41
+ .textarea:hover:not(:disabled):not(:focus),
42
+ .textarea[data-demo="hover"]:not(:disabled):not(:focus) {
43
+ border-color: var(--border-strong);
44
+ }
45
+
46
+ .textarea:focus-visible,
47
+ .textarea[data-demo="focus"] {
48
+ border-color: var(--border-focus);
49
+ outline: var(--border-focus-width) solid var(--focus-ring);
50
+ outline-offset: var(--space-inset-2xs);
51
+ }
52
+
53
+ .error {
54
+ border-color: var(--status-danger);
55
+ }
56
+
57
+ .error:hover:not(:disabled):not(:focus),
58
+ .error[data-demo="hover"]:not(:disabled):not(:focus) {
59
+ border-color: var(--status-danger);
60
+ }
61
+
62
+ .error:focus-visible,
63
+ .error[data-demo="focus"] {
64
+ border-color: var(--status-danger);
65
+ outline-color: var(--status-danger);
66
+ }
67
+
68
+ .textarea:disabled {
69
+ resize: none;
70
+ cursor: not-allowed;
71
+ color: var(--text-disabled);
72
+ background-color: var(--surface-disabled);
73
+ border-color: var(--border-disabled);
74
+ }