@15gifts/back-office-kit 0.1.0-alpha.0 → 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 (304) hide show
  1. package/README.md +9 -6
  2. package/dist/browser/back-office-kit.js +6649 -5932
  3. package/dist/components/Alert/Alert.css.d.ts +1 -0
  4. package/dist/components/Alert/Alert.d.ts +12 -2
  5. package/dist/components/Alert/Alert.js +33 -29
  6. package/dist/components/Alert/Alert.js.map +1 -1
  7. package/dist/components/Alert/Alert.styles.js +2 -2
  8. package/dist/components/Alert/Alert.styles.js.map +1 -1
  9. package/dist/components/AppShell/AppShell.css.d.ts +2 -0
  10. package/dist/components/AppShell/AppShell.d.ts +3 -1
  11. package/dist/components/AppShell/AppShell.js +42 -26
  12. package/dist/components/AppShell/AppShell.js.map +1 -1
  13. package/dist/components/AppShell/AppShell.styles.js +3 -2
  14. package/dist/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/dist/components/Avatar/Avatar.d.ts +1 -0
  16. package/dist/components/Avatar/Avatar.js.map +1 -1
  17. package/dist/components/Badge/Badge.css.d.ts +5 -0
  18. package/dist/components/Badge/Badge.d.ts +4 -1
  19. package/dist/components/Badge/Badge.js +6 -5
  20. package/dist/components/Badge/Badge.js.map +1 -1
  21. package/dist/components/Badge/Badge.styles.js +16 -15
  22. package/dist/components/Badge/Badge.styles.js.map +1 -1
  23. package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +2 -0
  24. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  25. package/dist/components/Breadcrumbs/Breadcrumbs.js +27 -27
  26. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  27. package/dist/components/Breadcrumbs/Breadcrumbs.styles.js +2 -2
  28. package/dist/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
  29. package/dist/components/Button/Button.css.d.ts +1 -1
  30. package/dist/components/Button/Button.d.ts +5 -4
  31. package/dist/components/Button/Button.js +21 -21
  32. package/dist/components/Button/Button.js.map +1 -1
  33. package/dist/components/Button/Button.styles.js.map +1 -1
  34. package/dist/components/Card/Card.css.d.ts +2 -0
  35. package/dist/components/Card/Card.d.ts +7 -1
  36. package/dist/components/Card/Card.js +33 -22
  37. package/dist/components/Card/Card.js.map +1 -1
  38. package/dist/components/Card/Card.styles.js +2 -2
  39. package/dist/components/Card/Card.styles.js.map +1 -1
  40. package/dist/components/ChatTranscript/ChatTranscript.d.ts +2 -2
  41. package/dist/components/ChatTranscript/ChatTranscript.js +74 -71
  42. package/dist/components/ChatTranscript/ChatTranscript.js.map +1 -1
  43. package/dist/components/Checkbox/Checkbox.d.ts +2 -1
  44. package/dist/components/Checkbox/Checkbox.js +30 -34
  45. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  46. package/dist/components/Checkbox/Checkbox.styles.js.map +1 -1
  47. package/dist/components/CheckboxGroup/CheckboxGroup.css.d.ts +2 -0
  48. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +28 -0
  49. package/dist/components/CheckboxGroup/CheckboxGroup.js +66 -0
  50. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
  51. package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +10 -0
  52. package/dist/components/CheckboxGroup/CheckboxGroup.styles.js.map +1 -0
  53. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  54. package/dist/components/Chip/Chip.css.d.ts +2 -0
  55. package/dist/components/Chip/Chip.d.ts +15 -3
  56. package/dist/components/Chip/Chip.js +35 -16
  57. package/dist/components/Chip/Chip.js.map +1 -1
  58. package/dist/components/Chip/Chip.styles.js +2 -2
  59. package/dist/components/Chip/Chip.styles.js.map +1 -1
  60. package/dist/components/Chip/index.d.ts +1 -1
  61. package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
  62. package/dist/components/ColorPicker/ColorPicker.js +46 -47
  63. package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
  64. package/dist/components/ColorPicker/ColorPicker.styles.js.map +1 -1
  65. package/dist/components/Combobox/Combobox.d.ts +28 -4
  66. package/dist/components/Combobox/Combobox.js +130 -109
  67. package/dist/components/Combobox/Combobox.js.map +1 -1
  68. package/dist/components/CopyButton/CopyButton.d.ts +11 -0
  69. package/dist/components/CopyButton/CopyButton.js +40 -0
  70. package/dist/components/CopyButton/CopyButton.js.map +1 -0
  71. package/dist/components/CopyButton/index.d.ts +2 -0
  72. package/dist/components/DateRangePicker/DateRangePicker.d.ts +10 -3
  73. package/dist/components/DateRangePicker/DateRangePicker.js +107 -110
  74. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  75. package/dist/components/DateRangePicker/DateRangePicker.styles.js +2 -2
  76. package/dist/components/DateRangePicker/DateRangePicker.styles.js.map +1 -1
  77. package/dist/components/DateTimeInput/DateTimeInput.d.ts +1 -1
  78. package/dist/components/DateTimeInput/DateTimeInput.js +20 -28
  79. package/dist/components/DateTimeInput/DateTimeInput.js.map +1 -1
  80. package/dist/components/DateTimeInput/DateTimeInput.styles.js +1 -0
  81. package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
  82. package/dist/components/DescriptionList/DescriptionList.js +2 -1
  83. package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
  84. package/dist/components/DetailsSummary/DetailsSummary.css.d.ts +1 -0
  85. package/dist/components/DetailsSummary/DetailsSummary.d.ts +5 -1
  86. package/dist/components/DetailsSummary/DetailsSummary.js +15 -15
  87. package/dist/components/DetailsSummary/DetailsSummary.js.map +1 -1
  88. package/dist/components/DetailsSummary/DetailsSummary.styles.js +10 -2
  89. package/dist/components/DetailsSummary/DetailsSummary.styles.js.map +1 -1
  90. package/dist/components/DetailsSummary/index.d.ts +1 -1
  91. package/dist/components/Drawer/Drawer.css.d.ts +3 -0
  92. package/dist/components/Drawer/Drawer.d.ts +24 -3
  93. package/dist/components/Drawer/Drawer.js +55 -46
  94. package/dist/components/Drawer/Drawer.js.map +1 -1
  95. package/dist/components/Drawer/Drawer.styles.js +7 -2
  96. package/dist/components/Drawer/Drawer.styles.js.map +1 -1
  97. package/dist/components/EmptyState/EmptyState.css.d.ts +16 -0
  98. package/dist/components/EmptyState/EmptyState.d.ts +15 -0
  99. package/dist/components/EmptyState/EmptyState.js +37 -0
  100. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  101. package/dist/components/EmptyState/EmptyState.styles.js +15 -0
  102. package/dist/components/EmptyState/EmptyState.styles.js.map +1 -0
  103. package/dist/components/EmptyState/index.d.ts +2 -0
  104. package/dist/components/EnvironmentChip/EnvironmentChip.css.d.ts +5 -0
  105. package/dist/components/EnvironmentChip/EnvironmentChip.d.ts +13 -5
  106. package/dist/components/EnvironmentChip/EnvironmentChip.js +14 -3
  107. package/dist/components/EnvironmentChip/EnvironmentChip.js.map +1 -1
  108. package/dist/components/EnvironmentChip/EnvironmentChip.styles.js +3 -2
  109. package/dist/components/EnvironmentChip/EnvironmentChip.styles.js.map +1 -1
  110. package/dist/components/EnvironmentChip/index.d.ts +2 -2
  111. package/dist/components/Field/Field.css.d.ts +0 -1
  112. package/dist/components/Field/Field.d.ts +11 -28
  113. package/dist/components/Field/Field.js +25 -36
  114. package/dist/components/Field/Field.js.map +1 -1
  115. package/dist/components/Field/Field.styles.js +2 -2
  116. package/dist/components/Field/Field.styles.js.map +1 -1
  117. package/dist/components/Field/index.d.ts +1 -1
  118. package/dist/components/Fieldset/Fieldset.d.ts +1 -0
  119. package/dist/components/Fieldset/Fieldset.js.map +1 -1
  120. package/dist/components/Fieldset/Fieldset.styles.js.map +1 -1
  121. package/dist/components/Grid/Grid.css.d.ts +22 -0
  122. package/dist/components/Grid/Grid.d.ts +21 -0
  123. package/dist/components/Grid/Grid.js +23 -0
  124. package/dist/components/Grid/Grid.js.map +1 -0
  125. package/dist/components/Grid/Grid.styles.js +28 -0
  126. package/dist/components/Grid/Grid.styles.js.map +1 -0
  127. package/dist/components/Grid/index.d.ts +2 -0
  128. package/dist/components/List/List.d.ts +1 -0
  129. package/dist/components/List/List.js.map +1 -1
  130. package/dist/components/Loader/Loader.d.ts +1 -1
  131. package/dist/components/Loader/Loader.js +6 -2
  132. package/dist/components/Loader/Loader.js.map +1 -1
  133. package/dist/components/Menu/Menu.d.ts +25 -1
  134. package/dist/components/Menu/Menu.js +1 -1
  135. package/dist/components/Menu/Menu.js.map +1 -1
  136. package/dist/components/Menu/Menu.styles.js.map +1 -1
  137. package/dist/components/MetricBar/MetricBar.css.d.ts +5 -0
  138. package/dist/components/MetricBar/MetricBar.d.ts +9 -1
  139. package/dist/components/MetricBar/MetricBar.js +38 -22
  140. package/dist/components/MetricBar/MetricBar.js.map +1 -1
  141. package/dist/components/MetricBar/MetricBar.styles.js +15 -10
  142. package/dist/components/MetricBar/MetricBar.styles.js.map +1 -1
  143. package/dist/components/Modal/Modal.d.ts +6 -0
  144. package/dist/components/Modal/Modal.js +25 -28
  145. package/dist/components/Modal/Modal.js.map +1 -1
  146. package/dist/components/Modal/Modal.styles.js +2 -1
  147. package/dist/components/Modal/Modal.styles.js.map +1 -1
  148. package/dist/components/NavRail/NavRail.css.d.ts +2 -0
  149. package/dist/components/NavRail/NavRail.d.ts +22 -7
  150. package/dist/components/NavRail/NavRail.js +79 -58
  151. package/dist/components/NavRail/NavRail.js.map +1 -1
  152. package/dist/components/NavRail/NavRail.styles.js +3 -2
  153. package/dist/components/NavRail/NavRail.styles.js.map +1 -1
  154. package/dist/components/NavRail/index.d.ts +1 -1
  155. package/dist/components/NumberInput/NumberInput.d.ts +9 -1
  156. package/dist/components/NumberInput/NumberInput.js +37 -31
  157. package/dist/components/NumberInput/NumberInput.js.map +1 -1
  158. package/dist/components/PageHeader/PageHeader.css.d.ts +1 -1
  159. package/dist/components/PageHeader/PageHeader.d.ts +3 -1
  160. package/dist/components/PageHeader/PageHeader.js +21 -23
  161. package/dist/components/PageHeader/PageHeader.js.map +1 -1
  162. package/dist/components/PageHeader/PageHeader.styles.js +1 -1
  163. package/dist/components/PageHeader/PageHeader.styles.js.map +1 -1
  164. package/dist/components/Pagination/Pagination.d.ts +5 -0
  165. package/dist/components/Pagination/Pagination.js.map +1 -1
  166. package/dist/components/Popover/Popover.d.ts +9 -1
  167. package/dist/components/Popover/Popover.js +7 -6
  168. package/dist/components/Popover/Popover.js.map +1 -1
  169. package/dist/components/Popover/Popover.styles.js.map +1 -1
  170. package/dist/components/PortalContainer/PortalContainer.d.ts +1 -0
  171. package/dist/components/PortalContainer/PortalContainer.js.map +1 -1
  172. package/dist/components/ProgressBar/ProgressBar.css.d.ts +3 -0
  173. package/dist/components/ProgressBar/ProgressBar.d.ts +5 -1
  174. package/dist/components/ProgressBar/ProgressBar.js +21 -7
  175. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  176. package/dist/components/ProgressBar/ProgressBar.styles.js +6 -6
  177. package/dist/components/ProgressBar/ProgressBar.styles.js.map +1 -1
  178. package/dist/components/RadioCards/RadioCards.d.ts +8 -2
  179. package/dist/components/RadioCards/RadioCards.js +40 -44
  180. package/dist/components/RadioCards/RadioCards.js.map +1 -1
  181. package/dist/components/SaveBar/SaveBar.d.ts +6 -1
  182. package/dist/components/SaveBar/SaveBar.js +1 -2
  183. package/dist/components/SaveBar/SaveBar.js.map +1 -1
  184. package/dist/components/SaveBar/SaveBar.styles.js.map +1 -1
  185. package/dist/components/Select/Select.css.d.ts +2 -0
  186. package/dist/components/Select/Select.d.ts +32 -5
  187. package/dist/components/Select/Select.js +91 -62
  188. package/dist/components/Select/Select.js.map +1 -1
  189. package/dist/components/Select/Select.styles.js +3 -2
  190. package/dist/components/Select/Select.styles.js.map +1 -1
  191. package/dist/components/Skeleton/Skeleton.d.ts +2 -0
  192. package/dist/components/Skeleton/Skeleton.js +20 -19
  193. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  194. package/dist/components/Stack/Stack.css.d.ts +4 -1
  195. package/dist/components/Stack/Stack.d.ts +7 -3
  196. package/dist/components/Stack/Stack.js.map +1 -1
  197. package/dist/components/Stack/Stack.styles.js +16 -23
  198. package/dist/components/Stack/Stack.styles.js.map +1 -1
  199. package/dist/components/StatCard/StatCard.d.ts +3 -0
  200. package/dist/components/StatCard/StatCard.js.map +1 -1
  201. package/dist/components/StatCard/StatCard.styles.js.map +1 -1
  202. package/dist/components/StatsGrid/StatsGrid.d.ts +3 -6
  203. package/dist/components/StatsGrid/StatsGrid.js +3 -7
  204. package/dist/components/StatsGrid/StatsGrid.js.map +1 -1
  205. package/dist/components/StatusBadge/StatusBadge.d.ts +3 -2
  206. package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
  207. package/dist/components/Switch/Switch.d.ts +2 -1
  208. package/dist/components/Switch/Switch.js +27 -31
  209. package/dist/components/Switch/Switch.js.map +1 -1
  210. package/dist/components/Switcher/Switcher.css.d.ts +0 -1
  211. package/dist/components/Switcher/Switcher.d.ts +13 -1
  212. package/dist/components/Switcher/Switcher.js +35 -35
  213. package/dist/components/Switcher/Switcher.js.map +1 -1
  214. package/dist/components/Switcher/Switcher.styles.js +2 -2
  215. package/dist/components/Switcher/Switcher.styles.js.map +1 -1
  216. package/dist/components/Table/Table.css.d.ts +16 -1
  217. package/dist/components/Table/Table.d.ts +110 -13
  218. package/dist/components/Table/Table.js +214 -102
  219. package/dist/components/Table/Table.js.map +1 -1
  220. package/dist/components/Table/Table.styles.js +7 -6
  221. package/dist/components/Table/Table.styles.js.map +1 -1
  222. package/dist/components/Table/index.d.ts +1 -1
  223. package/dist/components/Tabs/Tabs.d.ts +23 -8
  224. package/dist/components/Tabs/Tabs.js +1 -1
  225. package/dist/components/Tabs/Tabs.js.map +1 -1
  226. package/dist/components/Tabs/Tabs.styles.js.map +1 -1
  227. package/dist/components/Tabs/index.d.ts +1 -1
  228. package/dist/components/Tag/Tag.css.d.ts +33 -0
  229. package/dist/components/Tag/Tag.d.ts +5 -2
  230. package/dist/components/Tag/Tag.js +23 -6
  231. package/dist/components/Tag/Tag.js.map +1 -1
  232. package/dist/components/Tag/Tag.styles.js +12 -1
  233. package/dist/components/Tag/Tag.styles.js.map +1 -1
  234. package/dist/components/Tag/index.d.ts +1 -1
  235. package/dist/components/TextInput/TextInput.d.ts +13 -2
  236. package/dist/components/TextInput/TextInput.js +45 -48
  237. package/dist/components/TextInput/TextInput.js.map +1 -1
  238. package/dist/components/Textarea/Textarea.css.d.ts +2 -0
  239. package/dist/components/Textarea/Textarea.d.ts +5 -2
  240. package/dist/components/Textarea/Textarea.js +37 -37
  241. package/dist/components/Textarea/Textarea.js.map +1 -1
  242. package/dist/components/Textarea/Textarea.styles.js +3 -2
  243. package/dist/components/Textarea/Textarea.styles.js.map +1 -1
  244. package/dist/components/ThemeMenu/ThemeMenu.d.ts +13 -0
  245. package/dist/components/ThemeMenu/ThemeMenu.js +52 -0
  246. package/dist/components/ThemeMenu/ThemeMenu.js.map +1 -0
  247. package/dist/components/ThemeMenu/index.d.ts +2 -0
  248. package/dist/components/ThemePicker/ThemePicker.d.ts +9 -1
  249. package/dist/components/ThemePicker/ThemePicker.js +3 -1
  250. package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
  251. package/dist/components/TimeInput/TimeInput.d.ts +10 -0
  252. package/dist/components/TimeInput/TimeInput.js +29 -0
  253. package/dist/components/TimeInput/TimeInput.js.map +1 -0
  254. package/dist/components/TimeInput/index.d.ts +2 -0
  255. package/dist/components/ToggleGroup/ToggleGroup.d.ts +30 -10
  256. package/dist/components/ToggleGroup/ToggleGroup.js +60 -59
  257. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  258. package/dist/components/ToggleGroup/ToggleGroup.styles.js.map +1 -1
  259. package/dist/components/ToggleGroup/index.d.ts +1 -1
  260. package/dist/components/Tooltip/Tooltip.css.d.ts +0 -1
  261. package/dist/components/Tooltip/Tooltip.d.ts +9 -5
  262. package/dist/components/Tooltip/Tooltip.js +9 -9
  263. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  264. package/dist/components/Tooltip/Tooltip.styles.js +2 -2
  265. package/dist/components/Tooltip/Tooltip.styles.js.map +1 -1
  266. package/dist/components/TopBar/TopBar.styles.js.map +1 -1
  267. package/dist/components/UserMenu/UserMenu.d.ts +4 -3
  268. package/dist/components/UserMenu/UserMenu.js.map +1 -1
  269. package/dist/examples/Crm.css.d.ts +3 -0
  270. package/dist/examples/ExampleShell.d.ts +28 -0
  271. package/dist/examples/Expenses.css.d.ts +2 -0
  272. package/dist/examples/HiringTracker.css.d.ts +13 -0
  273. package/dist/examples/SalesPipeline.css.d.ts +11 -0
  274. package/dist/foundations/Foundations.css.d.ts +1 -1
  275. package/dist/index.d.ts +6 -0
  276. package/dist/index.js +51 -45
  277. package/dist/styles/input.css.d.ts +8 -0
  278. package/dist/styles/input.styles.js +3 -2
  279. package/dist/styles/input.styles.js.map +1 -1
  280. package/dist/styles/shared.css.d.ts +5 -0
  281. package/dist/styles/shared.styles.js.map +1 -1
  282. package/dist/styles.css +1 -1
  283. package/dist/theme/fontSize.d.ts +4 -4
  284. package/dist/theme/fontSize.js +8 -23
  285. package/dist/theme/fontSize.js.map +1 -1
  286. package/dist/theme/htmlSetting.d.ts +14 -0
  287. package/dist/theme/htmlSetting.js +33 -0
  288. package/dist/theme/htmlSetting.js.map +1 -0
  289. package/dist/theme/theme.d.ts +4 -4
  290. package/dist/theme/theme.js +18 -33
  291. package/dist/theme/theme.js.map +1 -1
  292. package/dist/tokens/index.d.ts +0 -2
  293. package/dist/tokens.js +1 -2
  294. package/package.json +8 -3
  295. package/skills/back-office-kit/SKILL.md +27 -14
  296. package/skills/back-office-kit/references/artifact-template.html +1 -0
  297. package/skills/back-office-kit/references/components.md +482 -251
  298. package/skills/back-office-kit/references/install.md +27 -4
  299. package/skills/back-office-kit/references/migrate.md +58 -2
  300. package/skills/back-office-kit/references/patterns.md +129 -33
  301. package/skills/back-office-kit/references/testing.md +26 -22
  302. package/dist/tokens/sprinkles.css.d.ts +0 -38
  303. package/dist/tokens/sprinkles.styles.js +0 -349
  304. package/dist/tokens/sprinkles.styles.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","names":["styles.link","styles.list","item","styles.item","styles.current","Crumb","useRender","item","clsx","link","Breadcrumbs","ariaLabel","props","list","items","isCurrent","item$1","index","ChevronRight","current"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport type { ComponentProps, HTMLAttributes, ReactElement, ReactNode } from 'react'\n\nimport * as styles from './Breadcrumbs.css'\nimport type { DataAttributes } from '../Field/Field'\n\nexport interface BreadcrumbItem {\n label: ReactNode\n href?: string\n /** Router link element, e.g. `<Link to=\"/customers\" />`. */\n render?: ReactElement\n /**\n * Marks the item as the current page: a plain `<span aria-current=\"page\">`, never a link.\n * Defaults to `true` for the last item. Set `false` to keep the last item interactive, e.g. a\n * link, or a switcher button passed as `label`.\n */\n current?: boolean\n /** Props for the crumb's link or text element, e.g. `{ 'data-testid': 'crumb-customer' }`. */\n itemProps?: HTMLAttributes<HTMLElement> & DataAttributes\n}\n\nexport interface BreadcrumbsProps extends Omit<ComponentProps<'nav'>, 'children'> {\n /** Trail from root to the current page. The last item is the current page unless it sets `current: false`. */\n items: BreadcrumbItem[]\n}\n\nfunction Crumb({ item }: { item: BreadcrumbItem }) {\n return useRender({\n defaultTagName: 'a',\n render: item.render,\n props: {\n ...item.itemProps,\n href: item.render ? undefined : item.href,\n className: clsx(styles.link, item.itemProps?.className),\n children: item.label,\n },\n })\n}\n\n/** Where the current page sits in the app. */\nexport function Breadcrumbs({\n items,\n className,\n 'aria-label': ariaLabel = 'Breadcrumb',\n ...props\n}: BreadcrumbsProps) {\n return (\n <nav aria-label={ariaLabel} className={className} {...props}>\n <ol className={styles.list}>\n {items.map((item, index) => {\n const isCurrent = item.current ?? index === items.length - 1\n return (\n <li key={index} className={styles.item}>\n {index > 0 && (\n <span className={styles.separator} aria-hidden>\n <ChevronRight size=\"1em\" />\n </span>\n )}\n {isCurrent ? (\n <span\n {...item.itemProps}\n className={clsx(styles.current, item.itemProps?.className)}\n aria-current=\"page\"\n >\n {item.label}\n </span>\n ) : !item.href && !item.render ? (\n <span\n {...item.itemProps}\n className={clsx(styles.current, item.itemProps?.className)}\n >\n {item.label}\n </span>\n ) : (\n <Crumb item={item} />\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"mappings":";;;;;;AA4BA,SAASK,EAAM,EAAE,WAAkC;CACjD,OAAOC,EAAU;EACf,gBAAgB;EAChB,QAAQC,EAAK;EACb,OAAO;GACL,GAAGA,EAAK;GACR,MAAMA,EAAK,SAAS,KAAA,IAAYA,EAAK;GACrC,WAAWC,EAAKR,GAAaO,EAAK,WAAW,SAAS;GACtD,UAAUA,EAAK;EACjB;CACF,CAAC;AACH;AAGA,SAAgBG,EAAY,EAC1B,UACA,cACA,cAAcC,IAAY,cAC1B,GAAGC,KACgB;CACnB,OACE,kBAAC,OAAD;EAAK,cAAYD;EAAsB;EAAW,GAAIC;EACpD,UAAA,kBAAC,MAAD;GAAI,WAAWX;GACZ,UAAAa,EAAM,KAAK,GAAM,MAAU;IAC1B,IAAMC,IAAYb,EAAK,WAAWe,MAAUH,EAAM,SAAS;IAC3D,OACE,kBAAC,MAAD;KAAgB,WAAWX;KAA3B,UAAA,CACGc,IAAQ,KACP,kBAAC,QAAD;MAAM,WAAW;MAAkB,eAAA;MACjC,UAAA,kBAACC,GAAD,EAAc,MAAK,MAAO,CAAA;KACtB,CAAA,GAEPH,IACC,kBAAC,QAAD;MACE,GAAIb,EAAK;MACT,WAAWM,EAAKJ,GAAgBF,EAAK,WAAW,SAAS;MACzD,gBAAa;MAEZ,UAAAA,EAAK;KACF,CAAA,IACJ,CAACA,EAAK,QAAQ,CAACA,EAAK,SACtB,kBAAC,QAAD;MACE,GAAIA,EAAK;MACT,WAAWM,EAAKJ,GAAgBF,EAAK,WAAW,SAAS;MAExD,UAAAA,EAAK;KACF,CAAA,IAEN,kBAACG,GAAD,EAAa,MAAAW,EAAO,CAAA,CAEpB;IAxBK,GAAAC,CAwBL;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET"}
1
+ {"version":3,"file":"Breadcrumbs.js","names":["styles.link","styles.nav","styles.list","item","styles.item","styles.current","styles.text","Crumb","useRender","item","clsx","link","Breadcrumbs","ariaLabel","props","nav","className","list","items","isCurrent","item$1","index","ChevronRight","current","text"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport type { ComponentProps, HTMLAttributes, ReactElement, ReactNode } from 'react'\n\nimport * as styles from './Breadcrumbs.css'\nimport type { DataAttributes } from '../Field/Field'\n\nexport interface BreadcrumbItem {\n /** Crumb text, or a control such as a `Switcher` (then set `current: false`). */\n label: ReactNode\n /** Link target. Use `render` instead for a router link. Without either, the crumb is plain text. */\n href?: string\n /** Router link element, e.g. `<Link to=\"/customers\" />`. */\n render?: ReactElement\n /**\n * Marks the item as the current page: a plain `<span aria-current=\"page\">`, never a link.\n * Defaults to `true` for the last item. Set `false` to keep the last item interactive, e.g. a\n * link, or a switcher button passed as `label`.\n */\n current?: boolean\n /** Props for the crumb's link or text element, e.g. `{ 'data-testid': 'crumb-customer' }`. */\n itemProps?: HTMLAttributes<HTMLElement> & DataAttributes\n}\n\nexport interface BreadcrumbsProps extends Omit<ComponentProps<'nav'>, 'children'> {\n /** Trail from root to the current page. The last item is the current page unless it sets `current: false`. */\n items: BreadcrumbItem[]\n}\n\nfunction Crumb({ item }: { item: BreadcrumbItem }) {\n return useRender({\n defaultTagName: 'a',\n render: item.render,\n props: {\n ...item.itemProps,\n href: item.render ? undefined : item.href,\n className: clsx(styles.link, item.itemProps?.className),\n children: item.label,\n },\n })\n}\n\n/** Where the current page sits in the app. */\nexport function Breadcrumbs({\n items,\n className,\n 'aria-label': ariaLabel = 'Breadcrumb',\n ...props\n}: BreadcrumbsProps) {\n return (\n <nav aria-label={ariaLabel} className={clsx(styles.nav, className)} {...props}>\n <ol className={styles.list}>\n {items.map((item, index) => {\n const isCurrent = item.current ?? index === items.length - 1\n return (\n <li key={index} className={styles.item}>\n {index > 0 && (\n <span className={styles.separator} aria-hidden>\n <ChevronRight size=\"1em\" />\n </span>\n )}\n {isCurrent ? (\n <span\n {...item.itemProps}\n className={clsx(styles.current, item.itemProps?.className)}\n aria-current=\"page\"\n >\n {item.label}\n </span>\n ) : !item.href && !item.render ? (\n <span {...item.itemProps} className={clsx(styles.text, item.itemProps?.className)}>\n {item.label}\n </span>\n ) : (\n <Crumb item={item} />\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"mappings":";;;;;;AA8BA,SAASO,EAAM,EAAE,WAAkC;CACjD,OAAOC,EAAU;EACf,gBAAgB;EAChB,QAAQC,EAAK;EACb,OAAO;GACL,GAAGA,EAAK;GACR,MAAMA,EAAK,SAAS,KAAA,IAAYA,EAAK;GACrC,WAAWC,EAAKV,GAAaS,EAAK,WAAW,SAAS;GACtD,UAAUA,EAAK;EACjB;CACF,CAAC;AACH;AAGA,SAAgBG,EAAY,EAC1B,UACA,cACA,cAAcC,IAAY,cAC1B,GAAGC,KACgB;CACnB,OACE,kBAAC,OAAD;EAAK,cAAYD;EAAW,WAAWH,EAAKT,GAAYe,CAAS;EAAG,GAAIF;EACtE,UAAA,kBAAC,MAAD;GAAI,WAAWZ;GACZ,UAAAgB,EAAM,KAAK,GAAM,MAAU;IAC1B,IAAMC,IAAYhB,EAAK,WAAWkB,MAAUH,EAAM,SAAS;IAC3D,OACE,kBAAC,MAAD;KAAgB,WAAWd;KAA3B,UAAA,CACGiB,IAAQ,KACP,kBAAC,QAAD;MAAM,WAAW;MAAkB,eAAA;MACjC,UAAA,kBAACC,GAAD,EAAc,MAAK,MAAO,CAAA;KACtB,CAAA,GAEPH,IACC,kBAAC,QAAD;MACE,GAAIhB,EAAK;MACT,WAAWO,EAAKL,GAAgBF,EAAK,WAAW,SAAS;MACzD,gBAAa;MAEZ,UAAAA,EAAK;KACF,CAAA,IACJ,CAACA,EAAK,QAAQ,CAACA,EAAK,SACtB,kBAAC,QAAD;MAAM,GAAIA,EAAK;MAAW,WAAWO,EAAKJ,GAAaH,EAAK,WAAW,SAAS;MAC7E,UAAAA,EAAK;KACF,CAAA,IAEN,kBAACI,GAAD,EAAa,MAAAa,EAAO,CAAA,CAEpB;IArBK,GAAAC,CAqBL;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET"}
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  // src/components/Breadcrumbs/Breadcrumbs.css.ts
4
- var e = "_1ef1m2r0", t = "_1ef1m2r1", n = "_1ef1m2r2 tyvs8e0", r = "_1ef1m2r3", i = "_1ef1m2r4";
5
- export { r as current, t as item, n as link, e as list, i as separator };
4
+ var e = "_1ef1m2r0", t = "_1ef1m2r1", n = "_1ef1m2r2", r = "_1ef1m2r3 tyvs8e0", i = "_1ef1m2r4", a = "_1ef1m2r5", o = "_1ef1m2r6";
5
+ export { i as current, n as item, r as link, t as list, e as nav, o as separator, a as text };
6
6
 
7
7
  //# sourceMappingURL=Breadcrumbs.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.styles.js","names":["list","item","link","current","separator"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const list = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n gap: space['1'],\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n})\nexport const item = style({\n display: 'inline-flex',\n alignItems: 'center',\n gap: space['1'],\n minWidth: 0,\n})\nexport const link = style([\n focusRing,\n {\n color: vars.color.inkMuted,\n textDecoration: 'none',\n borderRadius: radius.sm,\n paddingInline: space['1'],\n selectors: { '&:hover': { color: vars.color.ink, textDecoration: 'underline' } },\n },\n])\nexport const current = style({\n color: vars.color.ink,\n fontWeight: fontWeight.medium,\n paddingInline: space['1'],\n})\nexport const separator = style({ color: vars.color.inkSubtle, display: 'inline-flex' })\n"],"mappings":""}
1
+ {"version":3,"file":"Breadcrumbs.styles.js","names":["nav","list","item","link","current","text","separator"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const nav = style({ minWidth: 0 })\n// One line: in a narrow bar, link crumbs shrink with an ellipsis instead of wrapping.\nexport const list = style({\n display: 'flex',\n flexWrap: 'nowrap',\n alignItems: 'center',\n gap: space['1'],\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n})\nexport const item = style({\n display: 'inline-flex',\n alignItems: 'center',\n gap: space['1'],\n minWidth: 0,\n})\nexport const link = style([\n focusRing,\n {\n display: 'inline-block',\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n // A 24px target (WCAG 2.5.8) without changing the text size.\n lineHeight: space['6'],\n color: vars.color.inkMuted,\n textDecoration: 'none',\n borderRadius: radius.sm,\n paddingInline: space['1'],\n selectors: { '&:hover': { color: vars.color.ink, textDecoration: 'underline' } },\n },\n])\nexport const current = style({\n whiteSpace: 'nowrap',\n color: vars.color.ink,\n fontWeight: fontWeight.medium,\n paddingInline: space['1'],\n})\n// A crumb that's neither a link nor the current page, e.g. a switcher.\nexport const text = style({ color: vars.color.inkMuted, paddingInline: space['1'] })\nexport const separator = style({\n flexShrink: 0,\n color: vars.color.inkSubtle,\n display: 'inline-flex',\n})\n"],"mappings":""}
@@ -51,7 +51,7 @@ export declare const button: import('@vanilla-extract/recipes').RuntimeFn<{
51
51
  fontSize: string;
52
52
  };
53
53
  md: {
54
- minHeight: "2.5rem";
54
+ minHeight: "2.75rem";
55
55
  paddingInline: string;
56
56
  fontSize: string;
57
57
  };
@@ -1,12 +1,15 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
2
  import { ComponentProps, ReactNode } from 'react';
3
3
  export interface ButtonProps extends ComponentProps<'button'> {
4
+ /** `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */
4
5
  variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
6
+ /** `sm` for dense places such as table rows and toolbars. */
5
7
  size?: 'sm' | 'md';
6
8
  /** Icon element (e.g. a lucide-react icon) shown before the label. */
7
9
  icon?: ReactNode;
8
- /** Square button showing only the icon. Requires `aria-label`. */
10
+ /** Square button showing only the icon. `children` (or `aria-label`) still names it for screen readers. */
9
11
  iconOnly?: boolean;
12
+ /** Stretches the button to fill its container. */
10
13
  fullWidth?: boolean;
11
14
  /**
12
15
  * Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is
@@ -20,10 +23,8 @@ export interface ButtonProps extends ComponentProps<'button'> {
20
23
  * `role="status"` span rendered next to the button.
21
24
  */
22
25
  loadingLabel?: string;
23
- /** Shows `loadingLabel` next to the spinner instead of the content (the width may change). */
24
- showLoadingLabel?: boolean;
25
26
  /** Render a different element, e.g. `render={<a href="/runs" />}` or a router `<Link to="/runs" />`. */
26
27
  render?: useRender.RenderProp;
27
28
  }
28
29
  /** Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */
29
- export declare function Button({ variant, size, icon, iconOnly, fullWidth, loading, loadingLabel, showLoadingLabel, disabled, type, render, className, children, onClick, ...props }: ButtonProps): import('react').JSX.Element;
30
+ export declare function Button({ variant, size, icon, iconOnly, fullWidth, loading, loadingLabel, disabled, type, render, className, children, onClick, ...props }: ButtonProps): import('react').JSX.Element;
@@ -6,48 +6,48 @@ import { mergeProps as a } from "@base-ui/react/merge-props";
6
6
  import { useRender as o } from "@base-ui/react/use-render";
7
7
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  // src/components/Button/Button.tsx
9
- function u({ variant: u = "primary", size: d = "md", icon: f, iconOnly: p = !1, fullWidth: m = !1, loading: h = !1, loadingLabel: g, showLoadingLabel: _ = !1, disabled: v = !1, type: y = "button", render: b, className: x, children: S, onClick: C, ...w }) {
10
- let T = !b, E = v || h, D = h && !!g, O = D && _ && !p, k = /* @__PURE__ */ c(t, {
11
- size: d === "sm" ? "1.08em" : "1em",
12
- label: null
13
- }), A = o({
9
+ function u({ variant: u = "primary", size: d = "md", icon: f, iconOnly: p = !1, fullWidth: m = !1, loading: h = !1, loadingLabel: g, disabled: _ = !1, type: v = "button", render: y, className: b, children: x, onClick: S, ...C }) {
10
+ let w = !y, T = _ || h, E = h && !!g, D = o({
14
11
  defaultTagName: "button",
15
- render: b,
12
+ render: y,
16
13
  props: a({
17
- type: T ? y : void 0,
18
- disabled: T && v && !h,
19
- "aria-disabled": E || void 0,
14
+ type: w ? v : void 0,
15
+ disabled: w && _ && !h,
16
+ "aria-disabled": T || void 0,
20
17
  "aria-busy": h || void 0,
21
18
  className: i(n({
22
19
  variant: u,
23
20
  size: d,
24
21
  iconOnly: p,
25
22
  fullWidth: m
26
- }), x),
23
+ }), b),
27
24
  onClick: (e) => {
28
- E ? e.preventDefault() : C?.(e);
25
+ T ? e.preventDefault() : S?.(e);
29
26
  },
30
- children: O ? /* @__PURE__ */ l("span", {
31
- className: r,
32
- children: [k, g]
33
- }) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("span", {
27
+ children: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("span", {
34
28
  className: i(r, h && "okkfzza"),
35
- "aria-hidden": D || void 0,
36
- children: [f, !p && S]
29
+ "aria-hidden": E || void 0,
30
+ children: [f, p ? /* @__PURE__ */ c("span", {
31
+ className: e,
32
+ children: x
33
+ }) : x]
37
34
  }), h && /* @__PURE__ */ l("span", {
38
35
  className: "okkfzzb",
39
- children: [k, D && /* @__PURE__ */ c("span", {
36
+ children: [/* @__PURE__ */ c(t, {
37
+ size: d === "sm" ? "1.08em" : "1em",
38
+ label: null
39
+ }), E && /* @__PURE__ */ c("span", {
40
40
  className: "tyvs8e1",
41
41
  children: g
42
42
  })]
43
43
  })] })
44
- }, w)
44
+ }, C)
45
45
  });
46
- return g ? /* @__PURE__ */ l(s, { children: [A, /* @__PURE__ */ c("span", {
46
+ return g ? /* @__PURE__ */ l(s, { children: [D, /* @__PURE__ */ c("span", {
47
47
  role: "status",
48
48
  className: e,
49
49
  children: h ? g : ""
50
- })] }) : A;
50
+ })] }) : D;
51
51
  }
52
52
  export { u as Button };
53
53
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["styles.button","styles.content","_Fragment","Button","props","isNative","render","inactive","disabled","loading","labelled","loadingLabel","visibleLabel","showLoadingLabel","iconOnly","spinner","Loader","size","element","useRender","mergeProps","type","clsx","button","className","event","onClick","content","Fragment","icon","children","visuallyHidden"],"sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, MouseEvent, ReactNode } from 'react'\n\nimport { visuallyHidden } from '../../styles/shared.css'\nimport { Loader } from '../Loader'\nimport * as styles from './Button.css'\n\nexport interface ButtonProps extends ComponentProps<'button'> {\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger'\n size?: 'sm' | 'md'\n /** Icon element (e.g. a lucide-react icon) shown before the label. */\n icon?: ReactNode\n /** Square button showing only the icon. Requires `aria-label`. */\n iconOnly?: boolean\n fullWidth?: boolean\n /**\n * Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is\n * `aria-disabled=\"true\"` and `aria-busy=\"true\"`, not native `disabled`, so it stays focusable\n * (assert `aria-disabled` in tests, not `toBeDisabled()`).\n */\n loading?: boolean\n /**\n * Text announced to assistive tech while `loading`, e.g. \"Saving\". It becomes the button's\n * accessible name and is read out through a polite live region, a visually hidden\n * `role=\"status\"` span rendered next to the button.\n */\n loadingLabel?: string\n /** Shows `loadingLabel` next to the spinner instead of the content (the width may change). */\n showLoadingLabel?: boolean\n /** Render a different element, e.g. `render={<a href=\"/runs\" />}` or a router `<Link to=\"/runs\" />`. */\n render?: useRender.RenderProp\n}\n\n/** Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */\nexport function Button({\n variant = 'primary',\n size = 'md',\n icon,\n iconOnly = false,\n fullWidth = false,\n loading = false,\n loadingLabel,\n showLoadingLabel = false,\n disabled = false,\n type = 'button',\n render,\n className,\n children,\n onClick,\n ...props\n}: ButtonProps) {\n const isNative = !render\n const inactive = disabled || loading\n const labelled = loading && !!loadingLabel\n // A visible label replaces the content, so the button may change width.\n const visibleLabel = labelled && showLoadingLabel && !iconOnly\n const spinner = <Loader size={size === 'sm' ? '1.08em' : '1em'} label={null} />\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (inactive) {\n event.preventDefault()\n return\n }\n onClick?.(event)\n }\n\n const element = useRender({\n defaultTagName: 'button',\n render,\n props: mergeProps<'button'>(\n {\n type: isNative ? type : undefined,\n // Native disabled removes focus; a loading button keeps it so focus isn't lost mid-save.\n disabled: isNative && disabled && !loading,\n 'aria-disabled': inactive || undefined,\n 'aria-busy': loading || undefined,\n className: clsx(styles.button({ variant, size, iconOnly, fullWidth }), className),\n onClick: handleClick,\n children: visibleLabel ? (\n <span className={styles.content}>\n {spinner}\n {loadingLabel}\n </span>\n ) : (\n <>\n <span\n className={clsx(styles.content, loading && styles.hidden)}\n aria-hidden={labelled || undefined}\n >\n {icon}\n {!iconOnly && children}\n </span>\n {loading && (\n <span className={styles.overlay}>\n {spinner}\n {labelled && <span className={visuallyHidden}>{loadingLabel}</span>}\n </span>\n )}\n </>\n ),\n },\n props,\n ),\n })\n\n if (!loadingLabel) return element\n // Kept mounted so screen readers notice when the text appears.\n return (\n <>\n {element}\n <span role=\"status\" className={visuallyHidden}>\n {loading ? loadingLabel : ''}\n </span>\n </>\n )\n}\n"],"mappings":";;;;;;;;AAoCA,SAAgBG,EAAO,EACrB,aAAU,WACV,UAAO,MACP,SACA,cAAW,IACX,eAAY,IACZ,aAAU,IACV,iBACA,sBAAmB,IACnB,cAAW,IACX,UAAO,UACP,WACA,cACA,aACA,YACA,GAAGC,KACW;CACd,IAAMC,IAAW,CAACC,GACZC,IAAWC,KAAYC,GACvBC,IAAWD,KAAW,CAAC,CAACE,GAExBC,IAAeF,KAAYG,KAAoB,CAACC,GAChDC,IAAU,kBAACC,GAAD;EAAQ,MAAMC,MAAS,OAAO,WAAW;EAAO,OAAO;CAAO,CAAA,GAUxEC,IAAUC,EAAU;EACxB,gBAAgB;EAChB;EACA,OAAOC,EACL;GACE,MAAMf,IAAWgB,IAAO,KAAA;GAExB,UAAUhB,KAAYG,KAAY,CAACC;GACnC,iBAAiBF,KAAY,KAAA;GAC7B,aAAaE,KAAW,KAAA;GACxB,WAAWa,EAAKtB,EAAc;IAAE;IAAS;IAAM;IAAU;GAAU,CAAC,GAAGwB,CAAS;GAChF,UAnBe,MAAyC;IAC5D,AAAIjB,IACFkB,EAAM,eAAe,IAGvBC,IAAUD,CAAK;GACjB;GAcM,UAAUb,IACR,kBAAC,QAAD;IAAM,WAAWX;IAAjB,UAAA,CACGc,GACAJ,CACG;GAEN,CAAA,IAAA,kBAAAT,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;IACE,WAAWoB,EAAKrB,GAAgBQ,KAAW,SAAa;IACxD,eAAaC,KAAY,KAAA;IAF3B,UAAA,CAIGmB,GACA,CAACf,KAAYgB,CACV;GACL,CAAA,GAAArB,KACC,kBAAC,QAAD;IAAM,WAAW;IAAjB,UAAA,CACGM,GACAL,KAAY,kBAAC,QAAD;KAAM,WAAA;KAA4B,UAAAC;IAAmB,CAAA,CAC9D;GAER,CAAA,CAAA,EAAA,CAAA;EAEN,GACAP,CACF;CACF,CAAC;CAID,OAFKO,IAGH,kBAAAT,GAAA,EAAA,UAAA,CACGgB,GACD,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAWa;EAC5B,UAAAtB,IAAUE,IAAe;CACtB,CAAA,CACN,EAAA,CAAA,IARsBO;AAU5B"}
1
+ {"version":3,"file":"Button.js","names":["styles.button","_Fragment","styles.content","Button","props","isNative","render","inactive","disabled","loading","labelled","loadingLabel","element","useRender","mergeProps","type","clsx","button","className","event","onClick","Fragment","content","icon","iconOnly","visuallyHidden","children","Loader","size"],"sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, MouseEvent, ReactNode } from 'react'\n\nimport { visuallyHidden } from '../../styles/shared.css'\nimport { Loader } from '../Loader'\nimport * as styles from './Button.css'\n\nexport interface ButtonProps extends ComponentProps<'button'> {\n /** `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger'\n /** `sm` for dense places such as table rows and toolbars. */\n size?: 'sm' | 'md'\n /** Icon element (e.g. a lucide-react icon) shown before the label. */\n icon?: ReactNode\n /** Square button showing only the icon. `children` (or `aria-label`) still names it for screen readers. */\n iconOnly?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /**\n * Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is\n * `aria-disabled=\"true\"` and `aria-busy=\"true\"`, not native `disabled`, so it stays focusable\n * (assert `aria-disabled` in tests, not `toBeDisabled()`).\n */\n loading?: boolean\n /**\n * Text announced to assistive tech while `loading`, e.g. \"Saving\". It becomes the button's\n * accessible name and is read out through a polite live region, a visually hidden\n * `role=\"status\"` span rendered next to the button.\n */\n loadingLabel?: string\n /** Render a different element, e.g. `render={<a href=\"/runs\" />}` or a router `<Link to=\"/runs\" />`. */\n render?: useRender.RenderProp\n}\n\n/** Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */\nexport function Button({\n variant = 'primary',\n size = 'md',\n icon,\n iconOnly = false,\n fullWidth = false,\n loading = false,\n loadingLabel,\n disabled = false,\n type = 'button',\n render,\n className,\n children,\n onClick,\n ...props\n}: ButtonProps) {\n const isNative = !render\n const inactive = disabled || loading\n const labelled = loading && !!loadingLabel\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (inactive) {\n event.preventDefault()\n return\n }\n onClick?.(event)\n }\n\n const element = useRender({\n defaultTagName: 'button',\n render,\n props: mergeProps<'button'>(\n {\n type: isNative ? type : undefined,\n // Native disabled removes focus; a loading button keeps it so focus isn't lost mid-save.\n disabled: isNative && disabled && !loading,\n 'aria-disabled': inactive || undefined,\n 'aria-busy': loading || undefined,\n className: clsx(styles.button({ variant, size, iconOnly, fullWidth }), className),\n onClick: handleClick,\n children: (\n <>\n <span\n className={clsx(styles.content, loading && styles.hidden)}\n aria-hidden={labelled || undefined}\n >\n {icon}\n {iconOnly ? <span className={visuallyHidden}>{children}</span> : children}\n </span>\n {loading && (\n <span className={styles.overlay}>\n <Loader size={size === 'sm' ? '1.08em' : '1em'} label={null} />\n {labelled && <span className={visuallyHidden}>{loadingLabel}</span>}\n </span>\n )}\n </>\n ),\n },\n props,\n ),\n })\n\n if (!loadingLabel) return element\n // Kept mounted so screen readers notice when the text appears.\n return (\n <>\n {element}\n <span role=\"status\" className={visuallyHidden}>\n {loading ? loadingLabel : ''}\n </span>\n </>\n )\n}\n"],"mappings":";;;;;;;;AAqCA,SAAgBG,EAAO,EACrB,aAAU,WACV,UAAO,MACP,SACA,cAAW,IACX,eAAY,IACZ,aAAU,IACV,iBACA,cAAW,IACX,UAAO,UACP,WACA,cACA,aACA,YACA,GAAGC,KACW;CACd,IAAMC,IAAW,CAACC,GACZC,IAAWC,KAAYC,GACvBC,IAAWD,KAAW,CAAC,CAACE,GAUxBC,IAAUC,EAAU;EACxB,gBAAgB;EAChB;EACA,OAAOC,EACL;GACE,MAAMT,IAAWU,IAAO,KAAA;GAExB,UAAUV,KAAYG,KAAY,CAACC;GACnC,iBAAiBF,KAAY,KAAA;GAC7B,aAAaE,KAAW,KAAA;GACxB,WAAWO,EAAKhB,EAAc;IAAE;IAAS;IAAM;IAAU;GAAU,CAAC,GAAGkB,CAAS;GAChF,UAnBe,MAAyC;IAC5D,AAAIX,IACFY,EAAM,eAAe,IAGvBC,IAAUD,CAAK;GACjB;GAcM,UACE,kBAAAlB,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;IACE,WAAWe,EAAKd,GAAgBO,KAAW,SAAa;IACxD,eAAaC,KAAY,KAAA;IAF3B,UAAA,CAIGa,GACAC,IAAW,kBAAC,QAAD;KAAM,WAAWC;KAAiB;IAAe,CAAA,IAAIC,CAC7D;GACL,CAAA,GAAAjB,KACC,kBAAC,QAAD;IAAM,WAAW;IAAjB,UAAA,CACE,kBAACkB,GAAD;KAAQ,MAAMC,MAAS,OAAO,WAAW;KAAO,OAAO;IAAO,CAAA,GAC7DlB,KAAY,kBAAC,QAAD;KAAM,WAAA;KAA4B,UAAAC;IAAmB,CAAA,CAC9D;GAER,CAAA,CAAA,EAAA,CAAA;EAEN,GACAP,CACF;CACF,CAAC;CAID,OAFKO,IAGH,kBAAAV,GAAA,EAAA,UAAA,CACGW,GACD,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAWa;EAC5B,UAAAhB,IAAUE,IAAe;CACtB,CAAA,CACN,EAAA,CAAA,IARsBC;AAU5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.js","names":["_7a468","button","createRuntimeFn","content","hidden","overlay"],"sources":["../../../src/components/Button/Button.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const button = recipe({\n base: [\n focusRing,\n {\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n margin: 0,\n border: '1px solid transparent',\n borderRadius: radius.lg,\n fontFamily: vars.font.sans,\n fontWeight: fontWeight.medium,\n lineHeight: 1.25,\n whiteSpace: 'nowrap',\n textDecoration: 'none',\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'background-color 120ms, border-color 120ms, color 120ms',\n selectors: {\n '&[aria-disabled=\"true\"]': {\n cursor: 'not-allowed',\n color: vars.color.inkSubtle,\n backgroundColor: vars.color.surfaceSunken,\n borderColor: vars.color.border,\n },\n },\n },\n ],\n variants: {\n variant: {\n primary: {\n backgroundColor: vars.color.primary,\n color: vars.color.onPrimary,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.primaryHover },\n },\n },\n secondary: {\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: vars.color.ink,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n '&[aria-disabled=\"true\"]': { backgroundColor: 'transparent', borderColor: 'transparent' },\n },\n },\n danger: {\n backgroundColor: vars.color.surface,\n color: vars.color.dangerInk,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.dangerSubtle },\n },\n },\n },\n size: {\n sm: { minHeight: '2rem', paddingInline: space['3'], fontSize: fontSize.sm },\n md: { minHeight: '2.5rem', paddingInline: space['5'], fontSize: fontSize.lg },\n },\n iconOnly: {\n true: { paddingInline: 0, aspectRatio: '1' },\n },\n fullWidth: {\n true: { width: '100%' },\n },\n },\n defaultVariants: { variant: 'primary', size: 'md' },\n})\n\nexport type ButtonVariants = NonNullable<RecipeVariants<typeof button>>\n\nexport const content = style({ display: 'inline-flex', alignItems: 'center', gap: space['2'] })\nexport const hidden = style({ opacity: 0 })\nexport const overlay = style({\n position: 'absolute',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n})\n"],"mappings":""}
1
+ {"version":3,"file":"Button.styles.js","names":["_7a468","button","createRuntimeFn","content","hidden","overlay"],"sources":["../../../src/components/Button/Button.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const button = recipe({\n base: [\n focusRing,\n {\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n margin: 0,\n border: '1px solid transparent',\n borderRadius: radius.lg,\n fontFamily: vars.font.sans,\n fontWeight: fontWeight.medium,\n lineHeight: 1.25,\n whiteSpace: 'nowrap',\n textDecoration: 'none',\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'background-color 120ms, border-color 120ms, color 120ms',\n selectors: {\n '&[aria-disabled=\"true\"]': {\n cursor: 'not-allowed',\n color: vars.color.inkSubtle,\n backgroundColor: vars.color.surfaceSunken,\n borderColor: vars.color.border,\n },\n },\n },\n ],\n variants: {\n variant: {\n primary: {\n backgroundColor: vars.color.primary,\n color: vars.color.onPrimary,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.primaryHover },\n },\n },\n secondary: {\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: vars.color.ink,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n '&[aria-disabled=\"true\"]': { backgroundColor: 'transparent', borderColor: 'transparent' },\n },\n },\n danger: {\n backgroundColor: vars.color.surface,\n color: vars.color.dangerInk,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.dangerSubtle },\n },\n },\n },\n size: {\n sm: { minHeight: '2rem', paddingInline: space['3'], fontSize: fontSize.sm },\n md: { minHeight: '2.75rem', paddingInline: space['5'], fontSize: fontSize.lg },\n },\n iconOnly: {\n true: { paddingInline: 0, aspectRatio: '1' },\n },\n fullWidth: {\n true: { width: '100%' },\n },\n },\n defaultVariants: { variant: 'primary', size: 'md' },\n})\n\nexport type ButtonVariants = NonNullable<RecipeVariants<typeof button>>\n\nexport const content = style({ display: 'inline-flex', alignItems: 'center', gap: space['2'] })\nexport const hidden = style({ opacity: 0 })\nexport const overlay = style({\n position: 'absolute',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n})\n"],"mappings":""}
@@ -32,4 +32,6 @@ export type CardVariants = NonNullable<RecipeVariants<typeof card>>;
32
32
  export declare const header: string;
33
33
  export declare const heading: string;
34
34
  export declare const actions: string;
35
+ export declare const headings: string;
36
+ export declare const description: string;
35
37
  export {};
@@ -1,12 +1,18 @@
1
+ import { useRender } from '@base-ui/react/use-render';
1
2
  import { ComponentProps, ReactNode } from 'react';
2
3
  export interface CardProps extends ComponentProps<'section'> {
4
+ /** `sm` has tighter padding, e.g. for cards inside other content. */
3
5
  size?: 'sm' | 'md';
4
6
  /** Remove the padding, e.g. for a table that fills the card. */
5
7
  flush?: boolean;
6
8
  /** Header content. A string is rendered as an `h2`; pass your own element to pick the level. */
7
9
  heading?: ReactNode;
10
+ /** Muted subtitle under the heading. */
11
+ description?: ReactNode;
8
12
  /** Controls shown at the end of the header, e.g. buttons. */
9
13
  actions?: ReactNode;
14
+ /** Render a different element instead of `<section>`, e.g. `render={<aside />}`. */
15
+ render?: useRender.RenderProp;
10
16
  }
11
17
  /** Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables. */
12
- export declare function Card({ size, flush, heading, actions, className, children, ...props }: CardProps): import('react').JSX.Element;
18
+ export declare function Card({ size, flush, heading, description, actions, render, className, children, ...props }: CardProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -1,27 +1,38 @@
1
- import { card as e } from "./Card.styles.js";
2
- import { clsx as t } from "clsx";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { card as e, heading as t } from "./Card.styles.js";
2
+ import { clsx as n } from "clsx";
3
+ import { mergeProps as r } from "@base-ui/react/merge-props";
4
+ import { useRender as i } from "@base-ui/react/use-render";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
6
  // src/components/Card/Card.tsx
5
- function i({ size: i = "md", flush: a = !1, heading: o, actions: s, className: c, children: l, ...u }) {
6
- let d = o != null || s != null;
7
- return /* @__PURE__ */ r("section", {
8
- className: t(e({
9
- size: i,
10
- flush: a
11
- }), c),
12
- ...u,
13
- children: [d && /* @__PURE__ */ r("header", {
14
- className: "z3ah6k7",
15
- children: [typeof o == "string" ? /* @__PURE__ */ n("h2", {
16
- className: "z3ah6k8",
17
- children: o
18
- }) : o, s && /* @__PURE__ */ n("div", {
19
- className: "z3ah6k9",
20
- children: s
21
- })]
22
- }), l]
7
+ function c({ size: c = "md", flush: l = !1, heading: u, description: d, actions: f, render: p, className: m, children: h, ...g }) {
8
+ let _ = u != null || d != null || f != null, v = typeof u == "string" ? /* @__PURE__ */ o("h2", {
9
+ className: t,
10
+ children: u
11
+ }) : u;
12
+ return i({
13
+ defaultTagName: "section",
14
+ render: p,
15
+ props: r({
16
+ className: n(e({
17
+ size: c,
18
+ flush: l
19
+ }), m),
20
+ children: /* @__PURE__ */ s(a, { children: [_ && /* @__PURE__ */ s("header", {
21
+ className: "z3ah6k7",
22
+ children: [d == null ? v : /* @__PURE__ */ s("div", {
23
+ className: "z3ah6ka",
24
+ children: [v, /* @__PURE__ */ o("div", {
25
+ className: "z3ah6kb",
26
+ children: d
27
+ })]
28
+ }), f && /* @__PURE__ */ o("div", {
29
+ className: "z3ah6k9",
30
+ children: f
31
+ })]
32
+ }), h] })
33
+ }, g)
23
34
  });
24
35
  }
25
- export { i as Card };
36
+ export { c as Card };
26
37
 
27
38
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","names":["heading","actions","styles.card","Card","heading$1","actions$1","props","hasHeader","clsx","card","className","children"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './Card.css'\n\nexport interface CardProps extends ComponentProps<'section'> {\n size?: 'sm' | 'md'\n /** Remove the padding, e.g. for a table that fills the card. */\n flush?: boolean\n /** Header content. A string is rendered as an `h2`; pass your own element to pick the level. */\n heading?: ReactNode\n /** Controls shown at the end of the header, e.g. buttons. */\n actions?: ReactNode\n}\n\n/** Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables. */\nexport function Card({\n size = 'md',\n flush = false,\n heading,\n actions,\n className,\n children,\n ...props\n}: CardProps) {\n const hasHeader = heading != null || actions != null\n return (\n <section className={clsx(styles.card({ size, flush }), className)} {...props}>\n {hasHeader && (\n <header className={styles.header}>\n {typeof heading === 'string' ? <h2 className={styles.heading}>{heading}</h2> : heading}\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n )}\n {children}\n </section>\n )\n}\n"],"mappings":";;;;AAgBA,SAAgBG,EAAK,EACnB,UAAO,MACP,WAAQ,IACR,SAAAC,GACA,SAAAC,GACA,cACA,aACA,GAAGC,KACS;CACZ,IAAMC,IAAYP,KAAW,QAAQC,KAAW;CAChD,OACE,kBAAC,WAAD;EAAS,WAAWO,EAAKN,EAAY;GAAE;GAAM;EAAM,CAAC,GAAGQ,CAAS;EAAG,GAAIJ;EAAvE,UAAA,CACGC,KACC,kBAAC,UAAD;GAAQ,WAAW;GAAnB,UAAA,CACG,OAAOP,KAAY,WAAW,kBAAC,MAAD;IAAI,WAAW;IAAiB,UAAAA;GAAY,CAAA,IAAIA,GAC9EC,KAAW,kBAAC,OAAD;IAAK,WAAW;IAAiB,UAAAA;GAAa,CAAA,CACpD;EAET,CAAA,GAAAU,CACM;;AAEb"}
1
+ {"version":3,"file":"Card.js","names":["heading","description","actions","styles.heading","styles.card","_Fragment","Card","heading$1","description$1","actions$1","props","hasHeader","headingEl","heading","useRender","mergeProps","clsx","card","className","Fragment","children"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './Card.css'\n\nexport interface CardProps extends ComponentProps<'section'> {\n /** `sm` has tighter padding, e.g. for cards inside other content. */\n size?: 'sm' | 'md'\n /** Remove the padding, e.g. for a table that fills the card. */\n flush?: boolean\n /** Header content. A string is rendered as an `h2`; pass your own element to pick the level. */\n heading?: ReactNode\n /** Muted subtitle under the heading. */\n description?: ReactNode\n /** Controls shown at the end of the header, e.g. buttons. */\n actions?: ReactNode\n /** Render a different element instead of `<section>`, e.g. `render={<aside />}`. */\n render?: useRender.RenderProp\n}\n\n/** Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables. */\nexport function Card({\n size = 'md',\n flush = false,\n heading,\n description,\n actions,\n render,\n className,\n children,\n ...props\n}: CardProps) {\n const hasHeader = heading != null || description != null || actions != null\n const headingEl =\n typeof heading === 'string' ? <h2 className={styles.heading}>{heading}</h2> : heading\n return useRender({\n defaultTagName: 'section',\n render,\n props: mergeProps<'section'>(\n {\n className: clsx(styles.card({ size, flush }), className),\n children: (\n <>\n {hasHeader && (\n <header className={styles.header}>\n {description != null ? (\n <div className={styles.headings}>\n {headingEl}\n <div className={styles.description}>{description}</div>\n </div>\n ) : (\n headingEl\n )}\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n )}\n {children}\n </>\n ),\n },\n props,\n ),\n })\n}\n"],"mappings":";;;;;;AAuBA,SAAgBM,EAAK,EACnB,UAAO,MACP,WAAQ,IACR,SAAAC,GACA,aAAAC,GACA,SAAAC,GACA,WACA,cACA,aACA,GAAGC,KACS;CACZ,IAAMC,IAAYX,KAAW,QAAQC,KAAe,QAAQC,KAAW,MACjEU,IACJ,OAAOZ,KAAY,WAAW,kBAAC,MAAD;EAAI,WAAWG;EAAiB,UAAAH;CAAY,CAAA,IAAIA;CAChF,OAAOc,EAAU;EACf,gBAAgB;EAChB;EACA,OAAOC,EACL;GACE,WAAWC,EAAKZ,EAAY;IAAE;IAAM;GAAM,CAAC,GAAGc,CAAS;GACvD,UACE,kBAAAb,GAAA,EAAA,UAAA,CACGM,KACC,kBAAC,UAAD;IAAQ,WAAW;IAAnB,UAAA,CACGV,KAAe,OAMdW,IALA,kBAAC,OAAD;KAAK,WAAW;KAAhB,UAAA,CACGA,GACD,kBAAC,OAAD;MAAK,WAAW;MAAqB,UAAAX;KAAiB,CAAA,CACnD;IAEL,CAAA,GAEDC,KAAW,kBAAC,OAAD;KAAK,WAAW;KAAiB,UAAAA;IAAa,CAAA,CACpD;GAET,CAAA,GAAAkB,CACD,EAAA,CAAA;EAEN,GACAV,CACF;CACF,CAAC;AACH"}
@@ -12,7 +12,7 @@ var t = e({
12
12
  },
13
13
  defaultVariants: { size: "md" },
14
14
  compoundVariants: []
15
- }), n = "z3ah6k7", r = "z3ah6k8", i = "z3ah6k9";
16
- export { i as actions, t as card, n as header, r as heading };
15
+ }), n = "z3ah6k7", r = "z3ah6k8", i = "z3ah6k9", a = "z3ah6ka", o = "z3ah6kb";
16
+ export { i as actions, t as card, o as description, n as header, r as heading, a as headings };
17
17
 
18
18
  //# sourceMappingURL=Card.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.styles.js","names":["_7a468","card","createRuntimeFn","header","heading","actions"],"sources":["../../../src/components/Card/Card.css.ts"],"sourcesContent":["import { createVar, style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\n// Separate so the header can bleed to the card's edges whatever the padding.\nconst padY = createVar()\nconst padX = createVar()\nconst cardRadius = createVar()\n\nexport const card = recipe({\n base: {\n boxSizing: 'border-box',\n minWidth: 0,\n padding: `${padY} ${padX}`,\n borderRadius: cardRadius,\n border: `1px solid ${vars.color.border}`,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.sans,\n },\n variants: {\n size: {\n sm: { vars: { [padY]: space['4'], [padX]: space['4'], [cardRadius]: radius.xl } },\n md: { vars: { [padY]: space['6'], [padX]: space['6'], [cardRadius]: radius['2xl'] } },\n },\n flush: { true: { vars: { [padY]: '0', [padX]: '0' } } },\n },\n defaultVariants: { size: 'md' },\n})\n\nexport type CardVariants = NonNullable<RecipeVariants<typeof card>>\n\nexport const header = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: space['3'],\n margin: `calc(${padY} * -1) calc(${padX} * -1) ${padY}`,\n padding: `${space['3']} ${space['6']}`,\n borderBottom: `1px solid ${vars.color.border}`,\n borderStartStartRadius: cardRadius,\n borderStartEndRadius: cardRadius,\n backgroundColor: vars.color.surfaceSunken,\n})\n\nexport const heading = style({\n margin: 0,\n fontSize: fontSize.md,\n fontWeight: fontWeight.semibold,\n color: vars.color.ink,\n})\n\nexport const actions = style({ display: 'flex', alignItems: 'center', gap: space['2'] })\n"],"mappings":""}
1
+ {"version":3,"file":"Card.styles.js","names":["_7a468","card","createRuntimeFn","header","heading","actions","headings","description"],"sources":["../../../src/components/Card/Card.css.ts"],"sourcesContent":["import { createVar, style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\n// Separate so the header can bleed to the card's edges whatever the padding.\nconst padY = createVar()\nconst padX = createVar()\nconst cardRadius = createVar()\n\nexport const card = recipe({\n base: {\n boxSizing: 'border-box',\n minWidth: 0,\n padding: `${padY} ${padX}`,\n borderRadius: cardRadius,\n border: `1px solid ${vars.color.border}`,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.sans,\n },\n variants: {\n size: {\n sm: { vars: { [padY]: space['4'], [padX]: space['4'], [cardRadius]: radius.xl } },\n md: { vars: { [padY]: space['6'], [padX]: space['6'], [cardRadius]: radius.xl } },\n },\n flush: { true: { vars: { [padY]: '0', [padX]: '0' } } },\n },\n defaultVariants: { size: 'md' },\n})\n\nexport type CardVariants = NonNullable<RecipeVariants<typeof card>>\n\nexport const header = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: space['3'],\n margin: `calc(${padY} * -1) calc(${padX} * -1) ${padY}`,\n padding: `${space['3']} ${space['6']}`,\n borderBottom: `1px solid ${vars.color.border}`,\n borderStartStartRadius: cardRadius,\n borderStartEndRadius: cardRadius,\n backgroundColor: vars.color.surfaceSunken,\n})\n\nexport const heading = style({\n margin: 0,\n fontSize: fontSize.md,\n fontWeight: fontWeight.semibold,\n color: vars.color.ink,\n})\n\nexport const actions = style({ display: 'flex', alignItems: 'center', gap: space['2'] })\n\nexport const headings = style({ minWidth: 0 })\n\nexport const description = style({\n margin: 0,\n marginTop: space['0.5'],\n fontSize: fontSize.sm,\n color: vars.color.inkMuted,\n})\n"],"mappings":""}
@@ -66,7 +66,7 @@ export interface ChatMessage {
66
66
  }
67
67
  export interface ChatTranscriptProps extends Omit<ChatTranscriptRootProps, 'children'> {
68
68
  messages: ChatMessage[];
69
- /** Visible assistant name, e.g. "Humara". */
69
+ /** Visible assistant name, e.g. "Humara". Defaults to the `labels.assistant` name ("Assistant"), so replies are always marked. */
70
70
  assistantName?: ReactNode;
71
71
  /** Assistant avatar, e.g. `<Avatar size="sm" name="Humara" />`. */
72
72
  assistantAvatar?: ReactNode;
@@ -77,7 +77,7 @@ export interface ChatTranscriptProps extends Omit<ChatTranscriptRootProps, 'chil
77
77
  /** Shown when there are no messages. */
78
78
  empty?: ReactNode;
79
79
  }
80
- declare function ChatTranscriptComponent({ messages, assistantName, assistantAvatar, typing, typingLabel, empty, ...props }: ChatTranscriptProps): import('react').JSX.Element;
80
+ declare function ChatTranscriptComponent({ messages, labels, assistantName, assistantAvatar, typing, typingLabel, empty, ...props }: ChatTranscriptProps): import('react').JSX.Element;
81
81
  /**
82
82
  * A conversation between a shopper and the assistant. Pass `messages`, or compose
83
83
  * `ChatTranscript.Root`, `.Message`, `.Bubble`, `.Meta`, `.Divider` and `.Typing` for custom
@@ -1,56 +1,56 @@
1
1
  import { visuallyHidden as e } from "../../styles/shared.styles.js";
2
2
  import { EmptyLine as t } from "../EmptyLine/EmptyLine.js";
3
3
  import { body as n, bubble as r, content as i, divider as a, dividerContent as o, dot as s, dots as c, message as l, meta as u, root as d, row as f } from "./ChatTranscript.styles.js";
4
- import { createContext as p, useContext as m, useEffect as h, useRef as g } from "react";
5
- import { clsx as _ } from "clsx";
6
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
4
+ import { createContext as p, useContext as m, useEffect as h, useImperativeHandle as g, useRef as _ } from "react";
5
+ import { clsx as v } from "clsx";
6
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
7
7
  // src/components/ChatTranscript/ChatTranscript.tsx
8
- var b = {
8
+ var S = {
9
9
  user: "You",
10
10
  assistant: "Assistant"
11
- }, x = p(b);
12
- function S({ label: e = "Conversation", live: t = !1, labels: n, className: r, children: i, ...a }) {
13
- return /* @__PURE__ */ v(x, {
11
+ }, C = p(S);
12
+ function w({ label: e = "Conversation", live: t = !1, labels: n, className: r, children: i, ...a }) {
13
+ return /* @__PURE__ */ b(C, {
14
14
  value: {
15
- ...b,
15
+ ...S,
16
16
  ...n
17
17
  },
18
- children: /* @__PURE__ */ v("div", {
18
+ children: /* @__PURE__ */ b("div", {
19
19
  role: "log",
20
20
  "aria-label": e,
21
21
  "aria-live": t ? "polite" : "off",
22
- className: _(d, r),
22
+ className: v(d, r),
23
23
  ...a,
24
24
  children: i
25
25
  })
26
26
  });
27
27
  }
28
- function C({ speaker: t, name: r, avatar: a, continued: o = !1, actions: s, speakerLabel: c, className: u, children: d, ...p }) {
29
- let h = m(x), g = c ?? (typeof r == "string" ? r : h[t]);
30
- return /* @__PURE__ */ y("div", {
28
+ function T({ speaker: t, name: r, avatar: a, continued: o = !1, actions: s, speakerLabel: c, className: u, children: d, ...p }) {
29
+ let h = m(C), g = c ?? (typeof r == "string" ? r : h[t]);
30
+ return /* @__PURE__ */ x("div", {
31
31
  "data-speaker": t,
32
32
  "data-continued": o || void 0,
33
- className: _(l, u),
33
+ className: v(l, u),
34
34
  ...p,
35
- children: [a != null && /* @__PURE__ */ v("div", {
35
+ children: [a != null && /* @__PURE__ */ b("div", {
36
36
  className: "avcnqp2",
37
37
  "aria-hidden": !0,
38
38
  children: a
39
- }), /* @__PURE__ */ y("div", {
39
+ }), /* @__PURE__ */ x("div", {
40
40
  className: n,
41
- children: [r != null && !o && /* @__PURE__ */ v("div", {
41
+ children: [r != null && !o && /* @__PURE__ */ b("div", {
42
42
  className: "avcnqp4",
43
43
  "aria-hidden": !0,
44
44
  children: r
45
- }), /* @__PURE__ */ y("div", {
45
+ }), /* @__PURE__ */ x("div", {
46
46
  className: f,
47
- children: [/* @__PURE__ */ y("div", {
47
+ children: [/* @__PURE__ */ x("div", {
48
48
  className: i,
49
- children: [/* @__PURE__ */ y("span", {
49
+ children: [/* @__PURE__ */ x("span", {
50
50
  className: e,
51
51
  children: [g, ": "]
52
52
  }), d]
53
- }), s != null && /* @__PURE__ */ v("div", {
53
+ }), s != null && /* @__PURE__ */ b("div", {
54
54
  className: "avcnqp7",
55
55
  children: s
56
56
  })]
@@ -58,102 +58,105 @@ function C({ speaker: t, name: r, avatar: a, continued: o = !1, actions: s, spea
58
58
  })]
59
59
  });
60
60
  }
61
- function w({ className: e, ref: t, ...n }) {
62
- let i = g(null);
63
- return h(() => {
61
+ function E({ className: e, ref: t, ...n }) {
62
+ let i = _(null);
63
+ return g(t, () => i.current, []), h(() => {
64
64
  i.current?.querySelectorAll("pre:not([tabindex])").forEach((e) => {
65
65
  e.tabIndex = 0;
66
66
  });
67
- }), /* @__PURE__ */ v("div", {
68
- ref: (e) => {
69
- i.current = e, typeof t == "function" ? t(e) : t && (t.current = e);
70
- },
71
- className: _(r, e),
67
+ }), /* @__PURE__ */ b("div", {
68
+ ref: i,
69
+ className: v(r, e),
72
70
  ...n
73
71
  });
74
72
  }
75
- function T({ className: e, ...t }) {
76
- return /* @__PURE__ */ v("div", {
77
- className: _(u, e),
73
+ function D({ className: e, ...t }) {
74
+ return /* @__PURE__ */ b("div", {
75
+ className: v(u, e),
78
76
  ...t
79
77
  });
80
78
  }
81
- function E({ className: e, children: t, ...n }) {
82
- return /* @__PURE__ */ v("div", {
83
- className: _(a, e),
79
+ function O({ className: e, children: t, ...n }) {
80
+ return /* @__PURE__ */ b("div", {
81
+ className: v(a, e),
84
82
  ...n,
85
- children: /* @__PURE__ */ v("span", {
83
+ children: /* @__PURE__ */ b("span", {
86
84
  className: o,
87
85
  children: t
88
86
  })
89
87
  });
90
88
  }
91
- function D({ label: t = "Typing…", ...n }) {
92
- return /* @__PURE__ */ v(C, {
89
+ function k({ label: t = "Typing…", ...n }) {
90
+ return /* @__PURE__ */ b(T, {
93
91
  speaker: "assistant",
94
92
  ...n,
95
- children: /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ y("span", {
93
+ children: /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ x("span", {
96
94
  className: c,
97
95
  "aria-hidden": !0,
98
96
  children: [
99
- /* @__PURE__ */ v("span", { className: s }),
100
- /* @__PURE__ */ v("span", { className: s }),
101
- /* @__PURE__ */ v("span", { className: s })
97
+ /* @__PURE__ */ b("span", { className: s }),
98
+ /* @__PURE__ */ b("span", { className: s }),
99
+ /* @__PURE__ */ b("span", { className: s })
102
100
  ]
103
- }), /* @__PURE__ */ v("span", {
101
+ }), /* @__PURE__ */ b("span", {
104
102
  className: e,
105
103
  children: t
106
104
  })] })
107
105
  });
108
106
  }
109
- function O({ messages: e, assistantName: n, assistantAvatar: r, typing: i = !1, typingLabel: a, empty: o = "No messages yet.", ...s }) {
110
- let c = e.at(-1)?.role;
111
- return /* @__PURE__ */ y(S, {
112
- ...s,
107
+ function A({ messages: e, labels: n, assistantName: r = n?.assistant ?? S.assistant, assistantAvatar: i, typing: a = !1, typingLabel: o, empty: s = "No messages yet.", ...c }) {
108
+ let l = e.at(-1)?.role;
109
+ return /* @__PURE__ */ x(w, {
110
+ labels: n,
111
+ ...c,
113
112
  children: [
114
- e.length === 0 && !i && /* @__PURE__ */ v(t, {
113
+ e.length === 0 && !a && /* @__PURE__ */ b(t, {
115
114
  bare: !0,
116
115
  className: "avcnqpf",
117
- children: o
116
+ children: s
118
117
  }),
119
- e.map((t, i) => {
118
+ e.map((t, n) => {
120
119
  let { id: a, role: o, content: s, timestamp: c, meta: l, actions: u, messageProps: d } = t;
121
- if (o === "system") return /* @__PURE__ */ y(E, {
120
+ if (o === "system") return /* @__PURE__ */ x(O, {
122
121
  ...d,
123
122
  children: [
124
123
  s,
125
- c != null && /* @__PURE__ */ v("span", { children: c }),
126
- l != null && /* @__PURE__ */ v("span", { children: l })
124
+ c != null && /* @__PURE__ */ x(y, { children: [" ", /* @__PURE__ */ b("span", { children: c })] }),
125
+ l != null && /* @__PURE__ */ x(y, { children: [" ", /* @__PURE__ */ b("span", { children: l })] })
127
126
  ]
128
127
  }, a);
129
128
  let f = o === "assistant";
130
- return /* @__PURE__ */ y(C, {
129
+ return /* @__PURE__ */ x(T, {
131
130
  speaker: o,
132
- name: f ? n : void 0,
133
- avatar: f ? r : void 0,
134
- continued: e[i - 1]?.role === o,
131
+ name: f ? r : void 0,
132
+ avatar: f ? i : void 0,
133
+ continued: e[n - 1]?.role === o,
135
134
  actions: u,
136
135
  ...d,
137
- children: [/* @__PURE__ */ v(w, { children: s }), (c != null || l != null) && /* @__PURE__ */ y(T, { children: [c, l] })]
136
+ children: [/* @__PURE__ */ b(E, { children: s }), (c != null || l != null) && /* @__PURE__ */ x(D, { children: [
137
+ c,
138
+ c != null && l != null && " ",
139
+ l
140
+ ] })]
138
141
  }, a);
139
142
  }),
140
- i && /* @__PURE__ */ v(D, {
141
- name: n,
142
- avatar: r,
143
- continued: c === "assistant",
144
- label: a
143
+ a && /* @__PURE__ */ b(k, {
144
+ name: r,
145
+ avatar: i,
146
+ continued: l === "assistant",
147
+ label: o
145
148
  })
146
149
  ]
147
150
  });
148
151
  }
149
- var k = Object.assign(O, {
150
- Root: S,
151
- Message: C,
152
- Bubble: w,
153
- Meta: T,
154
- Divider: E,
155
- Typing: D
152
+ var j = Object.assign(A, {
153
+ Root: w,
154
+ Message: T,
155
+ Bubble: E,
156
+ Meta: D,
157
+ Divider: O,
158
+ Typing: k
156
159
  });
157
- export { k as ChatTranscript };
160
+ export { j as ChatTranscript };
158
161
 
159
162
  //# sourceMappingURL=ChatTranscript.js.map