@burtson-labs/ui 0.14.0 → 0.15.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 (245) hide show
  1. package/LICENSES/DEPENDENCIES.txt +1 -1
  2. package/README.md +15 -11
  3. package/dist/components/accordion.d.ts +3 -3
  4. package/dist/components/accordion.js +13 -10
  5. package/dist/components/accordion.js.map +1 -1
  6. package/dist/components/agent-run.d.ts +22 -0
  7. package/dist/components/agent-run.js +131 -0
  8. package/dist/components/agent-run.js.map +1 -0
  9. package/dist/components/alert-dialog.d.ts +12 -10
  10. package/dist/components/alert-dialog.js +29 -20
  11. package/dist/components/alert-dialog.js.map +1 -1
  12. package/dist/components/alert.d.ts +5 -3
  13. package/dist/components/alert.js +11 -7
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/app-shell.d.ts +7 -6
  16. package/dist/components/app-shell.js +21 -14
  17. package/dist/components/app-shell.js.map +1 -1
  18. package/dist/components/attachment.d.ts +3 -3
  19. package/dist/components/attachment.js +10 -7
  20. package/dist/components/attachment.js.map +1 -1
  21. package/dist/components/audio-player.d.ts +2 -2
  22. package/dist/components/audio-player.js +8 -6
  23. package/dist/components/audio-player.js.map +1 -1
  24. package/dist/components/avatar-upload.d.ts +19 -0
  25. package/dist/components/avatar-upload.js +359 -0
  26. package/dist/components/avatar-upload.js.map +1 -0
  27. package/dist/components/avatar.d.ts +3 -3
  28. package/dist/components/avatar.js +10 -7
  29. package/dist/components/avatar.js.map +1 -1
  30. package/dist/components/badge.d.ts +1 -1
  31. package/dist/components/badge.js +12 -10
  32. package/dist/components/badge.js.map +1 -1
  33. package/dist/components/breadcrumb.d.ts +8 -8
  34. package/dist/components/breadcrumb.js +24 -17
  35. package/dist/components/breadcrumb.js.map +1 -1
  36. package/dist/components/button.d.ts +8 -1
  37. package/dist/components/button.js +12 -3
  38. package/dist/components/button.js.map +1 -1
  39. package/dist/components/card.d.ts +8 -8
  40. package/dist/components/card.js +32 -23
  41. package/dist/components/card.js.map +1 -1
  42. package/dist/components/chat-history.d.ts +1 -1
  43. package/dist/components/chat-history.js +10 -9
  44. package/dist/components/chat-history.js.map +1 -1
  45. package/dist/components/chat-layout.d.ts +1 -1
  46. package/dist/components/chat-layout.js +7 -3
  47. package/dist/components/chat-layout.js.map +1 -1
  48. package/dist/components/checkbox-card.d.ts +2 -2
  49. package/dist/components/checkbox-card.js +9 -7
  50. package/dist/components/checkbox-card.js.map +1 -1
  51. package/dist/components/checkbox.d.ts +23 -2
  52. package/dist/components/checkbox.js +48 -6
  53. package/dist/components/checkbox.js.map +1 -1
  54. package/dist/components/collapsible.d.ts +2 -2
  55. package/dist/components/collapsible.js +7 -5
  56. package/dist/components/collapsible.js.map +1 -1
  57. package/dist/components/combobox.d.ts +14 -4
  58. package/dist/components/combobox.js +18 -8
  59. package/dist/components/combobox.js.map +1 -1
  60. package/dist/components/command.d.ts +68 -12
  61. package/dist/components/command.js +38 -25
  62. package/dist/components/command.js.map +1 -1
  63. package/dist/components/composer.d.ts +2 -2
  64. package/dist/components/composer.js +9 -7
  65. package/dist/components/composer.js.map +1 -1
  66. package/dist/components/connection-status.d.ts +3 -3
  67. package/dist/components/connection-status.js +18 -14
  68. package/dist/components/connection-status.js.map +1 -1
  69. package/dist/components/context-menu.d.ts +14 -13
  70. package/dist/components/context-menu.js +33 -23
  71. package/dist/components/context-menu.js.map +1 -1
  72. package/dist/components/conversation.d.ts +1 -1
  73. package/dist/components/conversation.js +6 -5
  74. package/dist/components/conversation.js.map +1 -1
  75. package/dist/components/copy-button.d.ts +1 -1
  76. package/dist/components/copy-button.js +3 -2
  77. package/dist/components/copy-button.js.map +1 -1
  78. package/dist/components/data-table.d.ts +7 -2
  79. package/dist/components/data-table.js +16 -42
  80. package/dist/components/data-table.js.map +1 -1
  81. package/dist/components/dialog.d.ts +18 -9
  82. package/dist/components/dialog.js +38 -22
  83. package/dist/components/dialog.js.map +1 -1
  84. package/dist/components/dropdown-menu.d.ts +14 -13
  85. package/dist/components/dropdown-menu.js +33 -23
  86. package/dist/components/dropdown-menu.js.map +1 -1
  87. package/dist/components/editor-tabs.d.ts +1 -1
  88. package/dist/components/editor-tabs.js +6 -5
  89. package/dist/components/editor-tabs.js.map +1 -1
  90. package/dist/components/empty-state.d.ts +5 -5
  91. package/dist/components/empty-state.js +16 -11
  92. package/dist/components/empty-state.js.map +1 -1
  93. package/dist/components/error-summary.d.ts +21 -0
  94. package/dist/components/error-summary.js +62 -0
  95. package/dist/components/error-summary.js.map +1 -0
  96. package/dist/components/field.d.ts +66 -7
  97. package/dist/components/field.js +151 -20
  98. package/dist/components/field.js.map +1 -1
  99. package/dist/components/form-actions.d.ts +18 -0
  100. package/dist/components/form-actions.js +30 -0
  101. package/dist/components/form-actions.js.map +1 -0
  102. package/dist/components/icon-button.d.ts +3 -1
  103. package/dist/components/icon-button.js +5 -3
  104. package/dist/components/icon-button.js.map +1 -1
  105. package/dist/components/input.d.ts +42 -7
  106. package/dist/components/input.js +53 -10
  107. package/dist/components/input.js.map +1 -1
  108. package/dist/components/kbd.d.ts +2 -2
  109. package/dist/components/kbd.js +7 -5
  110. package/dist/components/kbd.js.map +1 -1
  111. package/dist/components/label.d.ts +6 -1
  112. package/dist/components/label.js +10 -4
  113. package/dist/components/label.js.map +1 -1
  114. package/dist/components/markdown.d.ts +4 -3
  115. package/dist/components/markdown.js +7 -6
  116. package/dist/components/markdown.js.map +1 -1
  117. package/dist/components/menubar.d.ts +16 -14
  118. package/dist/components/menubar.js +39 -27
  119. package/dist/components/menubar.js.map +1 -1
  120. package/dist/components/message-actions.d.ts +3 -3
  121. package/dist/components/message-actions.js +15 -12
  122. package/dist/components/message-actions.js.map +1 -1
  123. package/dist/components/message.d.ts +1 -1
  124. package/dist/components/message.js +5 -3
  125. package/dist/components/message.js.map +1 -1
  126. package/dist/components/mobile-nav.d.ts +1 -1
  127. package/dist/components/mobile-nav.js +6 -5
  128. package/dist/components/mobile-nav.js.map +1 -1
  129. package/dist/components/native-select.d.ts +16 -0
  130. package/dist/components/native-select.js +33 -0
  131. package/dist/components/native-select.js.map +1 -0
  132. package/dist/components/navigation-menu.d.ts +12 -11
  133. package/dist/components/navigation-menu.js +32 -23
  134. package/dist/components/navigation-menu.js.map +1 -1
  135. package/dist/components/number-input.d.ts +23 -0
  136. package/dist/components/number-input.js +45 -0
  137. package/dist/components/number-input.js.map +1 -0
  138. package/dist/components/onboarding-checklist.d.ts +1 -1
  139. package/dist/components/onboarding-checklist.js +4 -3
  140. package/dist/components/onboarding-checklist.js.map +1 -1
  141. package/dist/components/page-header.d.ts +7 -6
  142. package/dist/components/page-header.js +22 -15
  143. package/dist/components/page-header.js.map +1 -1
  144. package/dist/components/pagination.d.ts +1 -1
  145. package/dist/components/pagination.js +3 -2
  146. package/dist/components/pagination.js.map +1 -1
  147. package/dist/components/popover.d.ts +13 -10
  148. package/dist/components/popover.js +23 -17
  149. package/dist/components/popover.js.map +1 -1
  150. package/dist/components/progress.d.ts +1 -1
  151. package/dist/components/progress.js +6 -5
  152. package/dist/components/progress.js.map +1 -1
  153. package/dist/components/radio-group.d.ts +22 -3
  154. package/dist/components/radio-group.js +51 -10
  155. package/dist/components/radio-group.js.map +1 -1
  156. package/dist/components/reasoning.d.ts +3 -3
  157. package/dist/components/reasoning.js +9 -7
  158. package/dist/components/reasoning.js.map +1 -1
  159. package/dist/components/scroll-area.d.ts +3 -2
  160. package/dist/components/scroll-area.js +10 -7
  161. package/dist/components/scroll-area.js.map +1 -1
  162. package/dist/components/secret-input.d.ts +3 -2
  163. package/dist/components/secret-input.js +6 -4
  164. package/dist/components/secret-input.js.map +1 -1
  165. package/dist/components/select.d.ts +11 -6
  166. package/dist/components/select.js +24 -18
  167. package/dist/components/select.js.map +1 -1
  168. package/dist/components/separator.d.ts +1 -1
  169. package/dist/components/separator.js +4 -3
  170. package/dist/components/separator.js.map +1 -1
  171. package/dist/components/sheet.d.ts +10 -8
  172. package/dist/components/sheet.js +31 -20
  173. package/dist/components/sheet.js.map +1 -1
  174. package/dist/components/skeleton.d.ts +2 -1
  175. package/dist/components/skeleton.js +6 -4
  176. package/dist/components/skeleton.js.map +1 -1
  177. package/dist/components/slider.d.ts +10 -6
  178. package/dist/components/slider.js +15 -7
  179. package/dist/components/slider.js.map +1 -1
  180. package/dist/components/source.d.ts +2 -2
  181. package/dist/components/source.js +9 -7
  182. package/dist/components/source.js.map +1 -1
  183. package/dist/components/spinner.d.ts +4 -2
  184. package/dist/components/spinner.js +4 -3
  185. package/dist/components/spinner.js.map +1 -1
  186. package/dist/components/stat-card.d.ts +27 -2
  187. package/dist/components/stat-card.js +69 -9
  188. package/dist/components/stat-card.js.map +1 -1
  189. package/dist/components/status.d.ts +7 -6
  190. package/dist/components/status.js +11 -5
  191. package/dist/components/status.js.map +1 -1
  192. package/dist/components/steps.d.ts +1 -1
  193. package/dist/components/steps.js +4 -3
  194. package/dist/components/steps.js.map +1 -1
  195. package/dist/components/switch.d.ts +46 -2
  196. package/dist/components/switch.js +85 -8
  197. package/dist/components/switch.js.map +1 -1
  198. package/dist/components/table.d.ts +29 -12
  199. package/dist/components/table.js +79 -34
  200. package/dist/components/table.js.map +1 -1
  201. package/dist/components/tabs.d.ts +9 -4
  202. package/dist/components/tabs.js +22 -13
  203. package/dist/components/tabs.js.map +1 -1
  204. package/dist/components/textarea.d.ts +6 -1
  205. package/dist/components/textarea.js +3 -3
  206. package/dist/components/textarea.js.map +1 -1
  207. package/dist/components/toast.d.ts +10 -6
  208. package/dist/components/toast.js +27 -18
  209. package/dist/components/toast.js.map +1 -1
  210. package/dist/components/toaster.d.ts +4 -2
  211. package/dist/components/toaster.js +6 -2
  212. package/dist/components/toaster.js.map +1 -1
  213. package/dist/components/tool-call.d.ts +3 -3
  214. package/dist/components/tool-call.js +16 -12
  215. package/dist/components/tool-call.js.map +1 -1
  216. package/dist/components/toolbar.d.ts +9 -4
  217. package/dist/components/toolbar.js +14 -9
  218. package/dist/components/toolbar.js.map +1 -1
  219. package/dist/components/tooltip.d.ts +3 -2
  220. package/dist/components/tooltip.js +7 -4
  221. package/dist/components/tooltip.js.map +1 -1
  222. package/dist/components/tour.js +2 -2
  223. package/dist/components/tour.js.map +1 -1
  224. package/dist/components/tree-view.d.ts +1 -1
  225. package/dist/components/tree-view.js +9 -5
  226. package/dist/components/tree-view.js.map +1 -1
  227. package/dist/components/voice-recorder.d.ts +1 -1
  228. package/dist/components/voice-recorder.js +4 -2
  229. package/dist/components/voice-recorder.js.map +1 -1
  230. package/dist/index.d.ts +8 -1
  231. package/dist/index.js +19 -12
  232. package/dist/lib/media.d.ts +18 -0
  233. package/dist/lib/media.js +34 -0
  234. package/dist/lib/media.js.map +1 -0
  235. package/dist/lib/utils.d.ts +32 -0
  236. package/dist/lib/utils.js +33 -1
  237. package/dist/lib/utils.js.map +1 -1
  238. package/dist/mui/index.js +20 -8
  239. package/dist/mui/index.js.map +1 -1
  240. package/dist/styles.css +1 -1
  241. package/dist/theme.css +36 -17
  242. package/dist/tokens.d.ts +78 -36
  243. package/dist/tokens.js +63 -32
  244. package/dist/tokens.js.map +1 -1
  245. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card.js","names":[],"sources":["../../src/components/stat-card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { Card } from './card';\n\nexport interface StatCardProps extends React.ComponentProps<typeof Card> {\n label: React.ReactNode;\n value: React.ReactNode;\n icon?: React.ReactNode;\n detail?: React.ReactNode;\n trend?: React.ReactNode;\n}\n\nfunction StatCard({ label, value, icon, detail, trend, className, ...props }: StatCardProps) {\n return (\n <Card density=\"compact\" className={cn('min-w-0', className)} {...props}>\n <div className=\"flex items-start justify-between gap-4 p-4\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-semibold tracking-[0.08em] text-muted-foreground uppercase\">\n {label}\n </div>\n <div className=\"mt-1 truncate text-2xl font-semibold tracking-[-0.035em] text-foreground\">\n {value}\n </div>\n {detail ? <div className=\"mt-1 text-xs text-muted-foreground\">{detail}</div> : null}\n </div>\n {icon ? (\n <div className=\"grid size-9 shrink-0 place-items-center rounded-lg border border-brand/15 bg-brand-soft text-brand [&_svg]:size-4.5\">\n {icon}\n </div>\n ) : null}\n </div>\n {trend ? <div className=\"border-t border-border px-4 py-2.5 text-xs\">{trend}</div> : null}\n </Card>\n );\n}\n\nexport { StatCard };\n"],"mappings":";;;;;;AAcA,SAAS,SAAS,EAAE,OAAO,OAAO,MAAM,QAAQ,OAAO,WAAW,GAAG,SAAwB;CAC3F,OACE,qBAAC,MAAD;EAAM,SAAQ;EAAU,WAAW,GAAG,WAAW,SAAS;EAAG,GAAI;EAAjE,UAAA,CACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA;KACE,CAAA;KACL,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA;KACE,CAAA;KACJ,SAAS,oBAAC,OAAD;MAAK,WAAU;MAAsC,UAAA;KAAY,CAAA,IAAI;IAC5E;GACJ,CAAA,GAAA,OACC,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA,IACH,IACD;EACJ,CAAA,GAAA,QAAQ,oBAAC,OAAD;GAAK,WAAU;GAA8C,UAAA;EAAW,CAAA,IAAI,IACjF;;AAEV"}
1
+ {"version":3,"file":"stat-card.js","names":["_Fragment"],"sources":["../../src/components/stat-card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\n\nimport { Card } from './card';\n\nexport interface StatCardProps extends React.ComponentProps<typeof Card> {\n label: React.ReactNode;\n value: React.ReactNode;\n icon?: React.ReactNode;\n detail?: React.ReactNode;\n trend?: React.ReactNode;\n}\n\n/** One metric with context. A row of them on a phone is better as a StatStrip. */\nconst StatCard = React.forwardRef<HTMLDivElement, StatCardProps>(function StatCard(\n { label, value, icon, detail, trend, className, ...props },\n ref,\n) {\n return (\n <Card\n ref={ref}\n density=\"compact\"\n data-slot=\"stat-card\"\n className={cn('min-w-0', className)}\n {...props}\n >\n <div className=\"flex items-start justify-between gap-4 p-4\">\n <div className=\"min-w-0\">\n <div\n data-slot=\"stat-card-label\"\n className=\"text-[11px] font-semibold tracking-[0.06em] text-muted-foreground uppercase\"\n >\n {label}\n </div>\n <div\n data-slot=\"stat-card-value\"\n className=\"mt-1 truncate text-2xl font-semibold tracking-[-0.035em] text-foreground tabular-nums\"\n >\n {value}\n </div>\n {detail ? (\n <div data-slot=\"stat-card-detail\" className=\"mt-1 text-xs text-muted-foreground\">\n {detail}\n </div>\n ) : null}\n </div>\n {icon ? (\n <div className=\"grid size-9 shrink-0 place-items-center rounded-lg border border-brand/15 bg-brand-soft text-brand [&_svg]:size-4\">\n {icon}\n </div>\n ) : null}\n </div>\n {trend ? (\n <div data-slot=\"stat-card-trend\" className=\"border-t border-border px-4 py-2.5 text-xs\">\n {trend}\n </div>\n ) : null}\n </Card>\n );\n});\n\nexport interface StatStripItem {\n label: React.ReactNode;\n value: React.ReactNode;\n detail?: React.ReactNode;\n /** Makes the figure a link to this page. */\n href?: string;\n /** Makes the figure a button. */\n onSelect?: () => void;\n}\n\nexport interface StatStripProps extends Omit<React.ComponentProps<typeof Card>, 'children'> {\n /** Two to four figures. */\n stats: StatStripItem[];\n /**\n * Renders each linked figure through your router's link: it receives\n * `href` and the figure's content as children.\n */\n renderLink?: (href: string, children: React.ReactNode, className: string) => React.ReactNode;\n}\n\n/**\n * Up to four headline figures in one card, side by side: the phone form of a\n * row of StatCards, which would otherwise stack into a screen of boxes. A\n * figure with `href` or `onSelect` is a target.\n */\nconst StatStrip = React.forwardRef<HTMLDivElement, StatStripProps>(function StatStrip(\n { stats, renderLink, className, ...props },\n ref,\n) {\n const cell = cn(\n 'grid min-w-0 content-start px-3 py-3 text-left first:rounded-l-[inherit] last:rounded-r-[inherit]',\n focusRingClasses,\n 'focus-visible:outline-offset-[-2px]',\n );\n const interactive = cn(cell, 'transition-colors hover:bg-muted/60 active:bg-muted');\n return (\n <Card ref={ref} data-slot=\"stat-strip\" className={cn('gap-0 py-0', className)} {...props}>\n <div\n className=\"grid divide-x divide-border\"\n style={{ gridTemplateColumns: `repeat(${Math.max(1, stats.length)}, minmax(0, 1fr))` }}\n >\n {stats.map((s, i) => {\n const body = (\n <>\n <span className=\"text-[10.5px] leading-4 font-semibold tracking-[0.06em] text-muted-foreground uppercase\">\n {s.label}\n </span>\n <span className=\"mt-1 text-xl font-semibold tracking-[-0.03em] tabular-nums\">\n {s.value}\n </span>\n {s.detail && (\n <span className=\"mt-0.5 text-[11.5px] leading-4 text-muted-foreground\">\n {s.detail}\n </span>\n )}\n </>\n );\n if (s.href)\n return (\n <React.Fragment key={i}>\n {renderLink ? (\n renderLink(s.href, body, interactive)\n ) : (\n <a href={s.href} data-slot=\"stat-strip-item\" className={interactive}>\n {body}\n </a>\n )}\n </React.Fragment>\n );\n if (s.onSelect)\n return (\n <button\n key={i}\n type=\"button\"\n data-slot=\"stat-strip-item\"\n onClick={s.onSelect}\n className={interactive}\n >\n {body}\n </button>\n );\n return (\n <div key={i} data-slot=\"stat-strip-item\" className={cell}>\n {body}\n </div>\n );\n })}\n </div>\n </Card>\n );\n});\n\nexport { StatCard, StatStrip };\n"],"mappings":";;;;;;;AAeA,IAAM,WAAW,MAAM,WAA0C,SAAS,SACxE,EAAE,OAAO,OAAO,MAAM,QAAQ,OAAO,WAAW,GAAG,SACnD,KACA;CACA,OACE,qBAAC,MAAD;EACO;EACL,SAAQ;EACR,aAAU;EACV,WAAW,GAAG,WAAW,SAAS;EAClC,GAAI;EALN,UAAA,CAOE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,oBAAC,OAAD;MACE,aAAU;MACV,WAAU;MAET,UAAA;KACE,CAAA;KACL,oBAAC,OAAD;MACE,aAAU;MACV,WAAU;MAET,UAAA;KACE,CAAA;KACJ,SACC,oBAAC,OAAD;MAAK,aAAU;MAAmB,WAAU;MACzC,UAAA;KACE,CAAA,IACH;IACD;GACJ,CAAA,GAAA,OACC,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA,IACH,IACD;EACJ,CAAA,GAAA,QACC,oBAAC,OAAD;GAAK,aAAU;GAAkB,WAAU;GACxC,UAAA;EACE,CAAA,IACH,IACA;;AAEV,CAAC;;;;;;AA2BD,IAAM,YAAY,MAAM,WAA2C,SAAS,UAC1E,EAAE,OAAO,YAAY,WAAW,GAAG,SACnC,KACA;CACA,MAAM,OAAO,GACX,qGACA,kBACA,qCACF;CACA,MAAM,cAAc,GAAG,MAAM,qDAAqD;CAClF,OACE,oBAAC,MAAD;EAAW;EAAK,aAAU;EAAa,WAAW,GAAG,cAAc,SAAS;EAAG,GAAI;EACjF,UAAA,oBAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,qBAAqB,UAAU,KAAK,IAAI,GAAG,MAAM,MAAM,EAAE,mBAAmB;GAEpF,UAAA,MAAM,KAAK,GAAG,MAAM;IACnB,MAAM,OACJ,qBAAAA,UAAA,EAAA,UAAA;KACE,oBAAC,QAAD;MAAM,WAAU;MACb,UAAA,EAAE;KACC,CAAA;KACN,oBAAC,QAAD;MAAM,WAAU;MACb,UAAA,EAAE;KACC,CAAA;KACL,EAAE,UACD,oBAAC,QAAD;MAAM,WAAU;MACb,UAAA,EAAE;KACC,CAAA;IAER,EAAA,CAAA;IAEJ,IAAI,EAAE,MACJ,OACE,oBAAC,MAAM,UAAP,EAAA,UACG,aACC,WAAW,EAAE,MAAM,MAAM,WAAW,IAEpC,oBAAC,KAAD;KAAG,MAAM,EAAE;KAAM,aAAU;KAAkB,WAAW;KACrD,UAAA;IACA,CAAA,EAES,GARK,CAQL;IAEpB,IAAI,EAAE,UACJ,OACE,oBAAC,UAAD;KAEE,MAAK;KACL,aAAU;KACV,SAAS,EAAE;KACX,WAAW;KAEV,UAAA;IACK,GAPD,CAOC;IAEZ,OACE,oBAAC,OAAD;KAAa,aAAU;KAAkB,WAAW;KACjD,UAAA;IACE,GAFK,CAEL;GAET,CAAC;EACE,CAAA;CACD,CAAA;AAEV,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const statusDotVariants: (props?: ({
4
- status?: "success" | "warning" | "info" | "brand" | "neutral" | "danger" | null | undefined;
4
+ status?: "destructive" | "success" | "warning" | "info" | "brand" | "neutral" | "danger" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function StatusDot({ className, status, pulse, ...props }: React.ComponentProps<'span'> & VariantProps<typeof statusDotVariants> & {
6
+ export type StatusTone = NonNullable<VariantProps<typeof statusDotVariants>['status']>;
7
+ export interface StatusDotProps extends React.ComponentProps<'span'>, VariantProps<typeof statusDotVariants> {
8
+ /** A ripple for a live state (running, connecting). Still under reduced motion. */
7
9
  pulse?: boolean;
8
- }): React.JSX.Element;
9
- declare function Status({ className, status, pulse, children, ...props }: React.ComponentProps<'span'> & VariantProps<typeof statusDotVariants> & {
10
- pulse?: boolean;
11
- }): React.JSX.Element;
10
+ }
11
+ declare const StatusDot: React.ForwardRefExoticComponent<Omit<StatusDotProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
12
+ declare const Status: React.ForwardRefExoticComponent<Omit<StatusDotProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
12
13
  export { Status, StatusDot, statusDotVariants };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/utils.js";
3
- import "react";
3
+ import * as React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { cva } from "class-variance-authority";
6
6
  //#region src/components/status.tsx
@@ -10,23 +10,29 @@ var statusDotVariants = cva("size-2 shrink-0 rounded-full ring-2 ring-current/10
10
10
  brand: "bg-brand text-brand",
11
11
  success: "bg-success text-success",
12
12
  warning: "bg-warning text-warning",
13
+ destructive: "bg-destructive text-destructive",
14
+ /** 0.x name for `destructive`; kept so existing apps keep compiling. */
13
15
  danger: "bg-destructive text-destructive",
14
16
  info: "bg-info text-info"
15
17
  } },
16
18
  defaultVariants: { status: "neutral" }
17
19
  });
18
- function StatusDot({ className, status, pulse = false, ...props }) {
20
+ var StatusDot = React.forwardRef(function StatusDot({ className, status, pulse = false, ...props }, ref) {
19
21
  return /* @__PURE__ */ jsxs("span", {
22
+ ref,
20
23
  "data-slot": "status-dot",
24
+ "data-status": status ?? "neutral",
21
25
  className: cn("relative inline-flex", className),
22
26
  "aria-hidden": "true",
23
27
  ...props,
24
28
  children: [pulse ? /* @__PURE__ */ jsx("span", { className: cn(statusDotVariants({ status }), "absolute inset-0 animate-ping opacity-40 motion-reduce:hidden") }) : null, /* @__PURE__ */ jsx("span", { className: statusDotVariants({ status }) })]
25
29
  });
26
- }
27
- function Status({ className, status, pulse, children, ...props }) {
30
+ });
31
+ var Status = React.forwardRef(function Status({ className, status, pulse, children, ...props }, ref) {
28
32
  return /* @__PURE__ */ jsxs("span", {
33
+ ref,
29
34
  "data-slot": "status",
35
+ "data-status": status ?? "neutral",
30
36
  className: cn("inline-flex items-center gap-2 text-xs font-medium text-muted-foreground", className),
31
37
  ...props,
32
38
  children: [/* @__PURE__ */ jsx(StatusDot, {
@@ -34,7 +40,7 @@ function Status({ className, status, pulse, children, ...props }) {
34
40
  pulse
35
41
  }), children]
36
42
  });
37
- }
43
+ });
38
44
  //#endregion
39
45
  export { Status, StatusDot, statusDotVariants };
40
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","names":[],"sources":["../../src/components/status.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nconst statusDotVariants = cva('size-2 shrink-0 rounded-full ring-2 ring-current/10', {\n variants: {\n status: {\n neutral: 'bg-muted-foreground text-muted-foreground',\n brand: 'bg-brand text-brand',\n success: 'bg-success text-success',\n warning: 'bg-warning text-warning',\n danger: 'bg-destructive text-destructive',\n info: 'bg-info text-info',\n },\n },\n defaultVariants: { status: 'neutral' },\n});\n\nfunction StatusDot({\n className,\n status,\n pulse = false,\n ...props\n}: React.ComponentProps<'span'> & VariantProps<typeof statusDotVariants> & { pulse?: boolean }) {\n return (\n <span\n data-slot=\"status-dot\"\n className={cn('relative inline-flex', className)}\n aria-hidden=\"true\"\n {...props}\n >\n {pulse ? (\n <span\n className={cn(\n statusDotVariants({ status }),\n 'absolute inset-0 animate-ping opacity-40 motion-reduce:hidden',\n )}\n />\n ) : null}\n <span className={statusDotVariants({ status })} />\n </span>\n );\n}\n\nfunction Status({\n className,\n status,\n pulse,\n children,\n ...props\n}: React.ComponentProps<'span'> & VariantProps<typeof statusDotVariants> & { pulse?: boolean }) {\n return (\n <span\n data-slot=\"status\"\n className={cn(\n 'inline-flex items-center gap-2 text-xs font-medium text-muted-foreground',\n className,\n )}\n {...props}\n >\n <StatusDot status={status} pulse={pulse} />\n {children}\n </span>\n );\n}\n\nexport { Status, StatusDot, statusDotVariants };\n"],"mappings":";;;;;;AAKA,IAAM,oBAAoB,IAAI,uDAAuD;CACnF,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,QAAQ,UAAU;AACvC,CAAC;AAED,SAAS,UAAU,EACjB,WACA,QACA,QAAQ,OACR,GAAG,SAC2F;CAC9F,OACE,qBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,wBAAwB,SAAS;EAC/C,eAAY;EACZ,GAAI;EAJN,UAAA,CAMG,QACC,oBAAC,QAAD,EACE,WAAW,GACT,kBAAkB,EAAE,OAAO,CAAC,GAC5B,+DACF,EACD,CAAA,IACC,MACJ,oBAAC,QAAD,EAAM,WAAW,kBAAkB,EAAE,OAAO,CAAC,EAAI,CAAA,CAC7C;;AAEV;AAEA,SAAS,OAAO,EACd,WACA,QACA,OACA,UACA,GAAG,SAC2F;CAC9F,OACE,qBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,4EACA,SACF;EACA,GAAI;EANN,UAAA,CAQE,oBAAC,WAAD;GAAmB;GAAe;EAAQ,CAAA,GACzC,QACG;;AAEV"}
1
+ {"version":3,"file":"status.js","names":[],"sources":["../../src/components/status.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nconst statusDotVariants = cva('size-2 shrink-0 rounded-full ring-2 ring-current/10', {\n variants: {\n status: {\n neutral: 'bg-muted-foreground text-muted-foreground',\n brand: 'bg-brand text-brand',\n success: 'bg-success text-success',\n warning: 'bg-warning text-warning',\n destructive: 'bg-destructive text-destructive',\n /** 0.x name for `destructive`; kept so existing apps keep compiling. */\n danger: 'bg-destructive text-destructive',\n info: 'bg-info text-info',\n },\n },\n defaultVariants: { status: 'neutral' },\n});\n\nexport type StatusTone = NonNullable<VariantProps<typeof statusDotVariants>['status']>;\n\nexport interface StatusDotProps\n extends React.ComponentProps<'span'>, VariantProps<typeof statusDotVariants> {\n /** A ripple for a live state (running, connecting). Still under reduced motion. */\n pulse?: boolean;\n}\n\nconst StatusDot = React.forwardRef<HTMLSpanElement, StatusDotProps>(function StatusDot(\n { className, status, pulse = false, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n data-slot=\"status-dot\"\n data-status={status ?? 'neutral'}\n className={cn('relative inline-flex', className)}\n aria-hidden=\"true\"\n {...props}\n >\n {pulse ? (\n <span\n className={cn(\n statusDotVariants({ status }),\n 'absolute inset-0 animate-ping opacity-40 motion-reduce:hidden',\n )}\n />\n ) : null}\n <span className={statusDotVariants({ status })} />\n </span>\n );\n});\n\nconst Status = React.forwardRef<HTMLSpanElement, StatusDotProps>(function Status(\n { className, status, pulse, children, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n data-slot=\"status\"\n data-status={status ?? 'neutral'}\n className={cn(\n 'inline-flex items-center gap-2 text-xs font-medium text-muted-foreground',\n className,\n )}\n {...props}\n >\n <StatusDot status={status} pulse={pulse} />\n {children}\n </span>\n );\n});\n\nexport { Status, StatusDot, statusDotVariants };\n"],"mappings":";;;;;;AAKA,IAAM,oBAAoB,IAAI,uDAAuD;CACnF,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,aAAa;;EAEb,QAAQ;EACR,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,QAAQ,UAAU;AACvC,CAAC;AAUD,IAAM,YAAY,MAAM,WAA4C,SAAS,UAC3E,EAAE,WAAW,QAAQ,QAAQ,OAAO,GAAG,SACvC,KACA;CACA,OACE,qBAAC,QAAD;EACO;EACL,aAAU;EACV,eAAa,UAAU;EACvB,WAAW,GAAG,wBAAwB,SAAS;EAC/C,eAAY;EACZ,GAAI;EANN,UAAA,CAQG,QACC,oBAAC,QAAD,EACE,WAAW,GACT,kBAAkB,EAAE,OAAO,CAAC,GAC5B,+DACF,EACD,CAAA,IACC,MACJ,oBAAC,QAAD,EAAM,WAAW,kBAAkB,EAAE,OAAO,CAAC,EAAI,CAAA,CAC7C;;AAEV,CAAC;AAED,IAAM,SAAS,MAAM,WAA4C,SAAS,OACxE,EAAE,WAAW,QAAQ,OAAO,UAAU,GAAG,SACzC,KACA;CACA,OACE,qBAAC,QAAD;EACO;EACL,aAAU;EACV,eAAa,UAAU;EACvB,WAAW,GACT,4EACA,SACF;EACA,GAAI;EARN,UAAA,CAUE,oBAAC,WAAD;GAAmB;GAAe;EAAQ,CAAA,GACzC,QACG;;AAEV,CAAC"}
@@ -23,5 +23,5 @@ export interface StepsProps extends React.ComponentProps<'ol'> {
23
23
  * phone a horizontal Steps collapses to the current step, "Step 2 of 5" and
24
24
  * a progress bar, instead of squeezing every title into a few letters.
25
25
  */
26
- declare function Steps({ items, current, orientation, compactBelow, formatCounter, className, ...props }: StepsProps): React.JSX.Element;
26
+ declare const Steps: React.ForwardRefExoticComponent<Omit<StepsProps, "ref"> & React.RefAttributes<HTMLOListElement>>;
27
27
  export { Steps };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/utils.js";
3
- import "react";
3
+ import * as React from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import Check from "@burtson-labs/icons/react/check";
6
6
  //#region src/components/steps.tsx
@@ -35,10 +35,11 @@ var compactClasses = {
35
35
  * phone a horizontal Steps collapses to the current step, "Step 2 of 5" and
36
36
  * a progress bar, instead of squeezing every title into a few letters.
37
37
  */
38
- function Steps({ items, current, orientation = "horizontal", compactBelow = orientation === "horizontal" ? "sm" : false, formatCounter = (step, total) => `Step ${step} of ${total}`, className, ...props }) {
38
+ var Steps = React.forwardRef(function Steps({ items, current, orientation = "horizontal", compactBelow = orientation === "horizontal" ? "sm" : false, formatCounter = (step, total) => `Step ${step} of ${total}`, className, ...props }, ref) {
39
39
  const compact = compactBelow ? compactClasses[compactBelow] : null;
40
40
  const focus = Math.min(Math.max(0, current), items.length - 1);
41
41
  return /* @__PURE__ */ jsx("ol", {
42
+ ref,
42
43
  "data-slot": "steps",
43
44
  "data-orientation": orientation,
44
45
  className: cn("flex gap-3", orientation === "horizontal" ? "flex-row items-start" : "flex-col", className),
@@ -85,7 +86,7 @@ function Steps({ items, current, orientation = "horizontal", compactBelow = orie
85
86
  }, i);
86
87
  })
87
88
  });
88
- }
89
+ });
89
90
  //#endregion
90
91
  export { Steps };
91
92
 
@@ -1 +1 @@
1
- {"version":3,"file":"steps.js","names":["_Fragment"],"sources":["../../src/components/steps.tsx"],"sourcesContent":["import Check from '@burtson-labs/icons/react/check';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface StepItem {\n title: React.ReactNode;\n description?: React.ReactNode;\n}\n\nexport type StepsBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface StepsProps extends React.ComponentProps<'ol'> {\n items: StepItem[];\n /** 0-based index of the step in progress; earlier steps show as done. */\n current: number;\n orientation?: 'horizontal' | 'vertical';\n /**\n * Below this width a horizontal Steps shows only where you are: the step's\n * title, \"Step 2 of 5\" and a segmented progress bar. `sm` (640px) by\n * default for horizontal steps; `false` keeps every step visible.\n */\n compactBelow?: StepsBreakpoint | false;\n /** The compact counter's text. */\n formatCounter?: (step: number, total: number) => string;\n}\n\n// Written out in full per breakpoint so Tailwind finds every class.\nconst compactClasses: Record<\n StepsBreakpoint,\n { other: string; item: string; marker: string; counter: string; bar: string; text: string }\n> = {\n sm: {\n other: 'max-sm:hidden',\n item: 'max-sm:grid max-sm:grid-cols-[minmax(0,1fr)_auto] max-sm:items-baseline max-sm:gap-x-3 max-sm:gap-y-2',\n marker: 'max-sm:hidden',\n counter: 'hidden max-sm:block',\n bar: 'hidden max-sm:flex max-sm:col-span-2',\n text: 'max-sm:pt-0',\n },\n md: {\n other: 'max-md:hidden',\n item: 'max-md:grid max-md:grid-cols-[minmax(0,1fr)_auto] max-md:items-baseline max-md:gap-x-3 max-md:gap-y-2',\n marker: 'max-md:hidden',\n counter: 'hidden max-md:block',\n bar: 'hidden max-md:flex max-md:col-span-2',\n text: 'max-md:pt-0',\n },\n lg: {\n other: 'max-lg:hidden',\n item: 'max-lg:grid max-lg:grid-cols-[minmax(0,1fr)_auto] max-lg:items-baseline max-lg:gap-x-3 max-lg:gap-y-2',\n marker: 'max-lg:hidden',\n counter: 'hidden max-lg:block',\n bar: 'hidden max-lg:flex max-lg:col-span-2',\n text: 'max-lg:pt-0',\n },\n};\n\n/**\n * Progress through a short multi-step flow (a wizard, an onboarding). On a\n * phone a horizontal Steps collapses to the current step, \"Step 2 of 5\" and\n * a progress bar, instead of squeezing every title into a few letters.\n */\nfunction Steps({\n items,\n current,\n orientation = 'horizontal',\n compactBelow = orientation === 'horizontal' ? 'sm' : false,\n formatCounter = (step, total) => `Step ${step} of ${total}`,\n className,\n ...props\n}: StepsProps) {\n const compact = compactBelow ? compactClasses[compactBelow] : null;\n // The step the compact form shows: the current one, or the last when all are done.\n const focus = Math.min(Math.max(0, current), items.length - 1);\n return (\n <ol\n data-slot=\"steps\"\n data-orientation={orientation}\n className={cn(\n 'flex gap-3',\n orientation === 'horizontal' ? 'flex-row items-start' : 'flex-col',\n className,\n )}\n {...props}\n >\n {items.map((item, i) => {\n const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming';\n const isFocus = compact && i === focus;\n return (\n <li\n key={i}\n data-state={state}\n aria-current={state === 'current' ? 'step' : undefined}\n className={cn(\n 'flex min-w-0 items-start gap-2.5',\n orientation === 'horizontal' && 'flex-1',\n compact && (isFocus ? compact.item : compact.other),\n )}\n >\n <span\n className={cn(\n 'grid size-6 shrink-0 place-items-center rounded-full border text-xs font-semibold tabular-nums',\n state === 'complete' && 'border-primary bg-primary text-primary-foreground',\n state === 'current' && 'border-brand bg-brand-soft text-brand',\n state === 'upcoming' && 'border-border-strong text-muted-foreground',\n isFocus && compact.marker,\n )}\n >\n {state === 'complete' ? <Check className=\"size-3.5\" aria-hidden /> : i + 1}\n </span>\n <span className={cn('grid min-w-0 gap-0.5 pt-0.5', isFocus && compact.text)}>\n <span\n className={cn(\n 'break-words text-[13px] font-semibold',\n state === 'upcoming' && 'text-muted-foreground',\n )}\n >\n {item.title}\n <span className=\"sr-only\">\n {state === 'complete' ? ' (done)' : state === 'current' ? ' (current)' : ''}\n </span>\n </span>\n {item.description && (\n <span className=\"text-xs text-muted-foreground\">{item.description}</span>\n )}\n </span>\n {isFocus && (\n <>\n <span\n data-slot=\"steps-counter\"\n className={cn(\n 'text-xs whitespace-nowrap text-muted-foreground tabular-nums',\n compact.counter,\n )}\n >\n {formatCounter(focus + 1, items.length)}\n </span>\n <span data-slot=\"steps-bar\" aria-hidden className={cn('gap-1', compact.bar)}>\n {items.map((_, j) => (\n <span\n key={j}\n className={cn(\n 'h-1 flex-1 rounded-full',\n j <= current ? 'bg-brand' : 'bg-muted',\n )}\n />\n ))}\n </span>\n </>\n )}\n </li>\n );\n })}\n </ol>\n );\n}\n\nexport { Steps };\n"],"mappings":";;;;;;AA4BA,IAAM,iBAGF;CACF,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;AACF;;;;;;AAOA,SAAS,MAAM,EACb,OACA,SACA,cAAc,cACd,eAAe,gBAAgB,eAAe,OAAO,OACrD,iBAAiB,MAAM,UAAU,QAAQ,KAAK,MAAM,SACpD,WACA,GAAG,SACU;CACb,MAAM,UAAU,eAAe,eAAe,gBAAgB;CAE9D,MAAM,QAAQ,KAAK,IAAI,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,SAAS,CAAC;CAC7D,OACE,oBAAC,MAAD;EACE,aAAU;EACV,oBAAkB;EAClB,WAAW,GACT,cACA,gBAAgB,eAAe,yBAAyB,YACxD,SACF;EACA,GAAI;EAEH,UAAA,MAAM,KAAK,MAAM,MAAM;GACtB,MAAM,QAAQ,IAAI,UAAU,aAAa,MAAM,UAAU,YAAY;GACrE,MAAM,UAAU,WAAW,MAAM;GACjC,OACE,qBAAC,MAAD;IAEE,cAAY;IACZ,gBAAc,UAAU,YAAY,SAAS,KAAA;IAC7C,WAAW,GACT,oCACA,gBAAgB,gBAAgB,UAChC,YAAY,UAAU,QAAQ,OAAO,QAAQ,MAC/C;IARF,UAAA;KAUE,oBAAC,QAAD;MACE,WAAW,GACT,kGACA,UAAU,cAAc,qDACxB,UAAU,aAAa,yCACvB,UAAU,cAAc,8CACxB,WAAW,QAAQ,MACrB;MAEC,UAAA,UAAU,aAAa,oBAAC,OAAD;OAAO,WAAU;OAAW,eAAA;MAAa,CAAA,IAAI,IAAI;KACrE,CAAA;KACN,qBAAC,QAAD;MAAM,WAAW,GAAG,+BAA+B,WAAW,QAAQ,IAAI;MAA1E,UAAA,CACE,qBAAC,QAAD;OACE,WAAW,GACT,yCACA,UAAU,cAAc,uBAC1B;OAJF,UAAA,CAMG,KAAK,OACN,oBAAC,QAAD;QAAM,WAAU;QACb,UAAA,UAAU,aAAa,YAAY,UAAU,YAAY,eAAe;OACrE,CAAA,CACF;MACL,CAAA,GAAA,KAAK,eACJ,oBAAC,QAAD;OAAM,WAAU;OAAiC,UAAA,KAAK;MAAkB,CAAA,CAEtE;;KACL,WACC,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;MACE,aAAU;MACV,WAAW,GACT,gEACA,QAAQ,OACV;MAEC,UAAA,cAAc,QAAQ,GAAG,MAAM,MAAM;KAClC,CAAA,GACN,oBAAC,QAAD;MAAM,aAAU;MAAY,eAAA;MAAY,WAAW,GAAG,SAAS,QAAQ,GAAG;MACvE,UAAA,MAAM,KAAK,GAAG,MACb,oBAAC,QAAD,EAEE,WAAW,GACT,2BACA,KAAK,UAAU,aAAa,UAC9B,EACD,GALM,CAKN,CACF;KACG,CAAA,CACN,EAAA,CAAA;IAEF;GA5DG,GAAA,CA4DH;EAER,CAAC;CACC,CAAA;AAER"}
1
+ {"version":3,"file":"steps.js","names":["_Fragment"],"sources":["../../src/components/steps.tsx"],"sourcesContent":["import Check from '@burtson-labs/icons/react/check';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface StepItem {\n title: React.ReactNode;\n description?: React.ReactNode;\n}\n\nexport type StepsBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface StepsProps extends React.ComponentProps<'ol'> {\n items: StepItem[];\n /** 0-based index of the step in progress; earlier steps show as done. */\n current: number;\n orientation?: 'horizontal' | 'vertical';\n /**\n * Below this width a horizontal Steps shows only where you are: the step's\n * title, \"Step 2 of 5\" and a segmented progress bar. `sm` (640px) by\n * default for horizontal steps; `false` keeps every step visible.\n */\n compactBelow?: StepsBreakpoint | false;\n /** The compact counter's text. */\n formatCounter?: (step: number, total: number) => string;\n}\n\n// Written out in full per breakpoint so Tailwind finds every class.\nconst compactClasses: Record<\n StepsBreakpoint,\n { other: string; item: string; marker: string; counter: string; bar: string; text: string }\n> = {\n sm: {\n other: 'max-sm:hidden',\n item: 'max-sm:grid max-sm:grid-cols-[minmax(0,1fr)_auto] max-sm:items-baseline max-sm:gap-x-3 max-sm:gap-y-2',\n marker: 'max-sm:hidden',\n counter: 'hidden max-sm:block',\n bar: 'hidden max-sm:flex max-sm:col-span-2',\n text: 'max-sm:pt-0',\n },\n md: {\n other: 'max-md:hidden',\n item: 'max-md:grid max-md:grid-cols-[minmax(0,1fr)_auto] max-md:items-baseline max-md:gap-x-3 max-md:gap-y-2',\n marker: 'max-md:hidden',\n counter: 'hidden max-md:block',\n bar: 'hidden max-md:flex max-md:col-span-2',\n text: 'max-md:pt-0',\n },\n lg: {\n other: 'max-lg:hidden',\n item: 'max-lg:grid max-lg:grid-cols-[minmax(0,1fr)_auto] max-lg:items-baseline max-lg:gap-x-3 max-lg:gap-y-2',\n marker: 'max-lg:hidden',\n counter: 'hidden max-lg:block',\n bar: 'hidden max-lg:flex max-lg:col-span-2',\n text: 'max-lg:pt-0',\n },\n};\n\n/**\n * Progress through a short multi-step flow (a wizard, an onboarding). On a\n * phone a horizontal Steps collapses to the current step, \"Step 2 of 5\" and\n * a progress bar, instead of squeezing every title into a few letters.\n */\nconst Steps = React.forwardRef<HTMLOListElement, StepsProps>(function Steps(\n {\n items,\n current,\n orientation = 'horizontal',\n compactBelow = orientation === 'horizontal' ? 'sm' : false,\n formatCounter = (step, total) => `Step ${step} of ${total}`,\n className,\n ...props\n },\n ref,\n) {\n const compact = compactBelow ? compactClasses[compactBelow] : null;\n // The step the compact form shows: the current one, or the last when all are done.\n const focus = Math.min(Math.max(0, current), items.length - 1);\n return (\n <ol\n ref={ref}\n data-slot=\"steps\"\n data-orientation={orientation}\n className={cn(\n 'flex gap-3',\n orientation === 'horizontal' ? 'flex-row items-start' : 'flex-col',\n className,\n )}\n {...props}\n >\n {items.map((item, i) => {\n const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming';\n const isFocus = compact && i === focus;\n return (\n <li\n key={i}\n data-state={state}\n aria-current={state === 'current' ? 'step' : undefined}\n className={cn(\n 'flex min-w-0 items-start gap-2.5',\n orientation === 'horizontal' && 'flex-1',\n compact && (isFocus ? compact.item : compact.other),\n )}\n >\n <span\n className={cn(\n 'grid size-6 shrink-0 place-items-center rounded-full border text-xs font-semibold tabular-nums',\n state === 'complete' && 'border-primary bg-primary text-primary-foreground',\n state === 'current' && 'border-brand bg-brand-soft text-brand',\n state === 'upcoming' && 'border-border-strong text-muted-foreground',\n isFocus && compact.marker,\n )}\n >\n {state === 'complete' ? <Check className=\"size-3.5\" aria-hidden /> : i + 1}\n </span>\n <span className={cn('grid min-w-0 gap-0.5 pt-0.5', isFocus && compact.text)}>\n <span\n className={cn(\n 'break-words text-[13px] font-semibold',\n state === 'upcoming' && 'text-muted-foreground',\n )}\n >\n {item.title}\n <span className=\"sr-only\">\n {state === 'complete' ? ' (done)' : state === 'current' ? ' (current)' : ''}\n </span>\n </span>\n {item.description && (\n <span className=\"text-xs text-muted-foreground\">{item.description}</span>\n )}\n </span>\n {isFocus && (\n <>\n <span\n data-slot=\"steps-counter\"\n className={cn(\n 'text-xs whitespace-nowrap text-muted-foreground tabular-nums',\n compact.counter,\n )}\n >\n {formatCounter(focus + 1, items.length)}\n </span>\n <span data-slot=\"steps-bar\" aria-hidden className={cn('gap-1', compact.bar)}>\n {items.map((_, j) => (\n <span\n key={j}\n className={cn(\n 'h-1 flex-1 rounded-full',\n j <= current ? 'bg-brand' : 'bg-muted',\n )}\n />\n ))}\n </span>\n </>\n )}\n </li>\n );\n })}\n </ol>\n );\n});\n\nexport { Steps };\n"],"mappings":";;;;;;AA4BA,IAAM,iBAGF;CACF,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,IAAI;EACF,OAAO;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;EACL,MAAM;CACR;AACF;;;;;;AAOA,IAAM,QAAQ,MAAM,WAAyC,SAAS,MACpE,EACE,OACA,SACA,cAAc,cACd,eAAe,gBAAgB,eAAe,OAAO,OACrD,iBAAiB,MAAM,UAAU,QAAQ,KAAK,MAAM,SACpD,WACA,GAAG,SAEL,KACA;CACA,MAAM,UAAU,eAAe,eAAe,gBAAgB;CAE9D,MAAM,QAAQ,KAAK,IAAI,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,SAAS,CAAC;CAC7D,OACE,oBAAC,MAAD;EACO;EACL,aAAU;EACV,oBAAkB;EAClB,WAAW,GACT,cACA,gBAAgB,eAAe,yBAAyB,YACxD,SACF;EACA,GAAI;EAEH,UAAA,MAAM,KAAK,MAAM,MAAM;GACtB,MAAM,QAAQ,IAAI,UAAU,aAAa,MAAM,UAAU,YAAY;GACrE,MAAM,UAAU,WAAW,MAAM;GACjC,OACE,qBAAC,MAAD;IAEE,cAAY;IACZ,gBAAc,UAAU,YAAY,SAAS,KAAA;IAC7C,WAAW,GACT,oCACA,gBAAgB,gBAAgB,UAChC,YAAY,UAAU,QAAQ,OAAO,QAAQ,MAC/C;IARF,UAAA;KAUE,oBAAC,QAAD;MACE,WAAW,GACT,kGACA,UAAU,cAAc,qDACxB,UAAU,aAAa,yCACvB,UAAU,cAAc,8CACxB,WAAW,QAAQ,MACrB;MAEC,UAAA,UAAU,aAAa,oBAAC,OAAD;OAAO,WAAU;OAAW,eAAA;MAAa,CAAA,IAAI,IAAI;KACrE,CAAA;KACN,qBAAC,QAAD;MAAM,WAAW,GAAG,+BAA+B,WAAW,QAAQ,IAAI;MAA1E,UAAA,CACE,qBAAC,QAAD;OACE,WAAW,GACT,yCACA,UAAU,cAAc,uBAC1B;OAJF,UAAA,CAMG,KAAK,OACN,oBAAC,QAAD;QAAM,WAAU;QACb,UAAA,UAAU,aAAa,YAAY,UAAU,YAAY,eAAe;OACrE,CAAA,CACF;MACL,CAAA,GAAA,KAAK,eACJ,oBAAC,QAAD;OAAM,WAAU;OAAiC,UAAA,KAAK;MAAkB,CAAA,CAEtE;;KACL,WACC,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;MACE,aAAU;MACV,WAAW,GACT,gEACA,QAAQ,OACV;MAEC,UAAA,cAAc,QAAQ,GAAG,MAAM,MAAM;KAClC,CAAA,GACN,oBAAC,QAAD;MAAM,aAAU;MAAY,eAAA;MAAY,WAAW,GAAG,SAAS,QAAQ,GAAG;MACvE,UAAA,MAAM,KAAK,GAAG,MACb,oBAAC,QAAD,EAEE,WAAW,GACT,2BACA,KAAK,UAAU,aAAa,UAC9B,EACD,GALM,CAKN,CACF;KACG,CAAA,CACN,EAAA,CAAA;IAEF;GA5DG,GAAA,CA4DH;EAER,CAAC;CACC,CAAA;AAER,CAAC"}
@@ -1,4 +1,48 @@
1
1
  import * as React from 'react';
2
2
  import * as SwitchPrimitive from '../primitives/vendor/radix/react-switch';
3
- declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): React.JSX.Element;
4
- export { Switch };
3
+ /**
4
+ * A 36×20 toggle with a 44px hit area on touch screens; the off track is the
5
+ * field border tone (`input`, 3:1 on the page), the on track primary in light
6
+ * mode and brand in dark mode (see Checkbox), focus the shared 2px outline.
7
+ */
8
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
+ export interface SwitchRowProps extends Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, 'children'> {
10
+ /** The setting's name. */
11
+ label: React.ReactNode;
12
+ /** What it does, under the name. */
13
+ description?: React.ReactNode;
14
+ /** Beside the label: a Badge such as "Always on". */
15
+ badge?: React.ReactNode;
16
+ /** Padding for a row in a SwitchList. */
17
+ inset?: boolean;
18
+ /** A control that belongs to the switch (a minutes field for "Alert when late"), beside it on wide screens and under the label on phones. */
19
+ before?: React.ReactNode;
20
+ /** Extra classes for the row; className goes to the switch. */
21
+ rowClassName?: string;
22
+ /** Extra lines under the description. */
23
+ children?: React.ReactNode;
24
+ }
25
+ /**
26
+ * A setting that is on or off: what it is (and what it does) on the left,
27
+ * the switch on the right, level with the first line of the label. Several
28
+ * of them stack in a SwitchList.
29
+ */
30
+ declare const SwitchRow: React.ForwardRefExoticComponent<Omit<SwitchRowProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
31
+ export interface SwitchListProps extends React.ComponentProps<'div'> {
32
+ /** A rounded border around the list, for a list that is not already in a Card. */
33
+ bordered?: boolean;
34
+ }
35
+ /** SwitchRows (with `inset`) divided by rules, in a Card or a bordered box. */
36
+ declare const SwitchList: React.ForwardRefExoticComponent<Omit<SwitchListProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
37
+ export interface InlineSwitchProps extends Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, 'children'> {
38
+ label: React.ReactNode;
39
+ /** Extra classes for the label; className goes to the switch. */
40
+ rowClassName?: string;
41
+ }
42
+ /**
43
+ * A filter that is on or off, in a row of filters: the switch first, its
44
+ * label after it, at least 44px tall on touch screens. (Settings put the
45
+ * switch on the right: SwitchRow.)
46
+ */
47
+ declare const InlineSwitch: React.ForwardRefExoticComponent<Omit<InlineSwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
48
+ export { InlineSwitch, Switch, SwitchList, SwitchRow };
@@ -1,21 +1,98 @@
1
1
  "use client";
2
- import { cn } from "../lib/utils.js";
2
+ import { cn, focusRingClasses, touchTargetClasses } from "../lib/utils.js";
3
3
  import { Root as Switch$1, SwitchThumb } from "../primitives/vendor/radix/react-switch/switch.js";
4
- import "react";
5
- import { jsx } from "react/jsx-runtime";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/switch.tsx
7
- function Switch({ className, ...props }) {
7
+ /**
8
+ * A 36×20 toggle with a 44px hit area on touch screens; the off track is the
9
+ * field border tone (`input`, 3:1 on the page), the on track primary in light
10
+ * mode and brand in dark mode (see Checkbox), focus the shared 2px outline.
11
+ */
12
+ var Switch = React.forwardRef(function Switch({ className, ...props }, ref) {
8
13
  return /* @__PURE__ */ jsx(Switch$1, {
14
+ ref,
9
15
  "data-slot": "switch",
10
- className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border-strong", className),
16
+ className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=unchecked]:hover:bg-muted-foreground/70 dark:data-[state=checked]:bg-brand", focusRingClasses, touchTargetClasses, className),
11
17
  ...props,
12
18
  children: /* @__PURE__ */ jsx(SwitchThumb, {
13
19
  "data-slot": "switch-thumb",
14
- className: "pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground/80"
20
+ className: "pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-background dark:data-[state=unchecked]:bg-foreground/80"
15
21
  })
16
22
  });
17
- }
23
+ });
24
+ /**
25
+ * A setting that is on or off: what it is (and what it does) on the left,
26
+ * the switch on the right, level with the first line of the label. Several
27
+ * of them stack in a SwitchList.
28
+ */
29
+ var SwitchRow = React.forwardRef(function SwitchRow({ label, description, badge, inset, before, id: idProp, className, rowClassName, children, ...props }, ref) {
30
+ const auto = React.useId();
31
+ const id = idProp ?? auto;
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ "data-slot": "switch-row",
34
+ className: cn("grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4", before && "gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]", inset && "px-4 py-3.5 sm:px-5 sm:py-4", rowClassName),
35
+ children: [
36
+ /* @__PURE__ */ jsxs("div", {
37
+ className: "grid min-w-0 gap-1",
38
+ children: [
39
+ /* @__PURE__ */ jsxs("label", {
40
+ htmlFor: id,
41
+ className: "flex min-h-5 flex-wrap items-center gap-x-2 gap-y-1 text-sm leading-5 font-medium",
42
+ children: [label, badge]
43
+ }),
44
+ description && /* @__PURE__ */ jsx("p", {
45
+ id: `${id}-description`,
46
+ className: "text-[13px] leading-5 text-muted-foreground",
47
+ children: description
48
+ }),
49
+ children
50
+ ]
51
+ }),
52
+ before && /* @__PURE__ */ jsx("div", {
53
+ className: "col-start-1 row-start-2 flex items-center sm:col-start-2 sm:row-start-1 sm:-my-2",
54
+ children: before
55
+ }),
56
+ /* @__PURE__ */ jsx(Switch, {
57
+ ref,
58
+ id,
59
+ "aria-describedby": description ? `${id}-description` : void 0,
60
+ className: cn("col-start-2 row-start-1", before && "sm:col-start-3", className),
61
+ ...props
62
+ })
63
+ ]
64
+ });
65
+ });
66
+ /** SwitchRows (with `inset`) divided by rules, in a Card or a bordered box. */
67
+ var SwitchList = React.forwardRef(function SwitchList({ bordered, className, ...props }, ref) {
68
+ return /* @__PURE__ */ jsx("div", {
69
+ ref,
70
+ "data-slot": "switch-list",
71
+ className: cn("grid divide-y divide-border", bordered && "rounded-lg border", className),
72
+ ...props
73
+ });
74
+ });
75
+ /**
76
+ * A filter that is on or off, in a row of filters: the switch first, its
77
+ * label after it, at least 44px tall on touch screens. (Settings put the
78
+ * switch on the right: SwitchRow.)
79
+ */
80
+ var InlineSwitch = React.forwardRef(function InlineSwitch({ label, id: idProp, className, rowClassName, ...props }, ref) {
81
+ const auto = React.useId();
82
+ const id = idProp ?? auto;
83
+ return /* @__PURE__ */ jsxs("label", {
84
+ htmlFor: id,
85
+ "data-slot": "inline-switch",
86
+ className: cn("flex min-h-5 cursor-pointer items-center gap-2.5 text-sm leading-5 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60 pointer-coarse:min-h-11", rowClassName),
87
+ children: [/* @__PURE__ */ jsx(Switch, {
88
+ ref,
89
+ id,
90
+ className,
91
+ ...props
92
+ }), label]
93
+ });
94
+ });
18
95
  //#endregion
19
- export { Switch };
96
+ export { InlineSwitch, Switch, SwitchList, SwitchRow };
20
97
 
21
98
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","names":["SwitchPrimitive.Root","SwitchPrimitive.Thumb"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport * as SwitchPrimitive from '../primitives/vendor/radix/react-switch';\n\nfunction Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border-strong',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground/80\"\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n"],"mappings":";;;;;;AAKA,SAAS,OAAO,EAAE,WAAW,GAAG,SAA4D;CAC1F,OACE,oBAACA,UAAD;EACE,aAAU;EACV,WAAW,GACT,8SACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACC,aAAD;GACE,aAAU;GACV,WAAU;EACX,CAAA;CACmB,CAAA;AAE1B"}
1
+ {"version":3,"file":"switch.js","names":["SwitchPrimitive.Root","SwitchPrimitive.Thumb"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses, touchTargetClasses } from '../lib/utils';\nimport * as SwitchPrimitive from '../primitives/vendor/radix/react-switch';\n\n/**\n * A 36×20 toggle with a 44px hit area on touch screens; the off track is the\n * field border tone (`input`, 3:1 on the page), the on track primary in light\n * mode and brand in dark mode (see Checkbox), focus the shared 2px outline.\n */\nconst Switch = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof SwitchPrimitive.Root>\n>(function Switch({ className, ...props }, ref) {\n return (\n <SwitchPrimitive.Root\n ref={ref}\n data-slot=\"switch\"\n className={cn(\n 'peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=unchecked]:hover:bg-muted-foreground/70 dark:data-[state=checked]:bg-brand',\n focusRingClasses,\n touchTargetClasses,\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-background dark:data-[state=unchecked]:bg-foreground/80\"\n />\n </SwitchPrimitive.Root>\n );\n});\n\nexport interface SwitchRowProps extends Omit<\n React.ComponentProps<typeof SwitchPrimitive.Root>,\n 'children'\n> {\n /** The setting's name. */\n label: React.ReactNode;\n /** What it does, under the name. */\n description?: React.ReactNode;\n /** Beside the label: a Badge such as \"Always on\". */\n badge?: React.ReactNode;\n /** Padding for a row in a SwitchList. */\n inset?: boolean;\n /** A control that belongs to the switch (a minutes field for \"Alert when late\"), beside it on wide screens and under the label on phones. */\n before?: React.ReactNode;\n /** Extra classes for the row; className goes to the switch. */\n rowClassName?: string;\n /** Extra lines under the description. */\n children?: React.ReactNode;\n}\n\n/**\n * A setting that is on or off: what it is (and what it does) on the left,\n * the switch on the right, level with the first line of the label. Several\n * of them stack in a SwitchList.\n */\nconst SwitchRow = React.forwardRef<HTMLButtonElement, SwitchRowProps>(function SwitchRow(\n {\n label,\n description,\n badge,\n inset,\n before,\n id: idProp,\n className,\n rowClassName,\n children,\n ...props\n },\n ref,\n) {\n const auto = React.useId();\n const id = idProp ?? auto;\n return (\n <div\n data-slot=\"switch-row\"\n className={cn(\n 'grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4',\n before && 'gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]',\n inset && 'px-4 py-3.5 sm:px-5 sm:py-4',\n rowClassName,\n )}\n >\n <div className=\"grid min-w-0 gap-1\">\n <label\n htmlFor={id}\n className=\"flex min-h-5 flex-wrap items-center gap-x-2 gap-y-1 text-sm leading-5 font-medium\"\n >\n {label}\n {badge}\n </label>\n {description && (\n <p id={`${id}-description`} className=\"text-[13px] leading-5 text-muted-foreground\">\n {description}\n </p>\n )}\n {children}\n </div>\n {before && (\n <div className=\"col-start-1 row-start-2 flex items-center sm:col-start-2 sm:row-start-1 sm:-my-2\">\n {before}\n </div>\n )}\n <Switch\n ref={ref}\n id={id}\n aria-describedby={description ? `${id}-description` : undefined}\n className={cn('col-start-2 row-start-1', before && 'sm:col-start-3', className)}\n {...props}\n />\n </div>\n );\n});\n\nexport interface SwitchListProps extends React.ComponentProps<'div'> {\n /** A rounded border around the list, for a list that is not already in a Card. */\n bordered?: boolean;\n}\n\n/** SwitchRows (with `inset`) divided by rules, in a Card or a bordered box. */\nconst SwitchList = React.forwardRef<HTMLDivElement, SwitchListProps>(function SwitchList(\n { bordered, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"switch-list\"\n className={cn('grid divide-y divide-border', bordered && 'rounded-lg border', className)}\n {...props}\n />\n );\n});\n\nexport interface InlineSwitchProps extends Omit<\n React.ComponentProps<typeof SwitchPrimitive.Root>,\n 'children'\n> {\n label: React.ReactNode;\n /** Extra classes for the label; className goes to the switch. */\n rowClassName?: string;\n}\n\n/**\n * A filter that is on or off, in a row of filters: the switch first, its\n * label after it, at least 44px tall on touch screens. (Settings put the\n * switch on the right: SwitchRow.)\n */\nconst InlineSwitch = React.forwardRef<HTMLButtonElement, InlineSwitchProps>(function InlineSwitch(\n { label, id: idProp, className, rowClassName, ...props },\n ref,\n) {\n const auto = React.useId();\n const id = idProp ?? auto;\n return (\n <label\n htmlFor={id}\n data-slot=\"inline-switch\"\n className={cn(\n 'flex min-h-5 cursor-pointer items-center gap-2.5 text-sm leading-5 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60 pointer-coarse:min-h-11',\n rowClassName,\n )}\n >\n <Switch ref={ref} id={id} className={className} {...props} />\n {label}\n </label>\n );\n});\n\nexport { InlineSwitch, Switch, SwitchList, SwitchRow };\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,SAAS,MAAM,WAGnB,SAAS,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK;CAC9C,OACE,oBAACA,UAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,4TACA,kBACA,oBACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACC,aAAD;GACE,aAAU;GACV,WAAU;EACX,CAAA;CACmB,CAAA;AAE1B,CAAC;;;;;;AA2BD,IAAM,YAAY,MAAM,WAA8C,SAAS,UAC7E,EACE,OACA,aACA,OACA,OACA,QACA,IAAI,QACJ,WACA,cACA,UACA,GAAG,SAEL,KACA;CACA,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,KAAK,UAAU;CACrB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,2DACA,UAAU,kDACV,SAAS,+BACT,YACF;EAPF,UAAA;GASE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,qBAAC,SAAD;MACE,SAAS;MACT,WAAU;MAFZ,UAAA,CAIG,OACA,KACI;;KACN,eACC,oBAAC,KAAD;MAAG,IAAI,GAAG,GAAG;MAAe,WAAU;MACnC,UAAA;KACA,CAAA;KAEJ;IACE;;GACJ,UACC,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA;GAEP,oBAAC,QAAD;IACO;IACD;IACJ,oBAAkB,cAAc,GAAG,GAAG,gBAAgB,KAAA;IACtD,WAAW,GAAG,2BAA2B,UAAU,kBAAkB,SAAS;IAC9E,GAAI;GACL,CAAA;EACE;;AAET,CAAC;;AAQD,IAAM,aAAa,MAAM,WAA4C,SAAS,WAC5E,EAAE,UAAU,WAAW,GAAG,SAC1B,KACA;CACA,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,+BAA+B,YAAY,qBAAqB,SAAS;EACvF,GAAI;CACL,CAAA;AAEL,CAAC;;;;;;AAgBD,IAAM,eAAe,MAAM,WAAiD,SAAS,aACnF,EAAE,OAAO,IAAI,QAAQ,WAAW,cAAc,GAAG,SACjD,KACA;CACA,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,KAAK,UAAU;CACrB,OACE,qBAAC,SAAD;EACE,SAAS;EACT,aAAU;EACV,WAAW,GACT,4JACA,YACF;EANF,UAAA,CAQE,oBAAC,QAAD;GAAa;GAAS;GAAe;GAAW,GAAI;EAAQ,CAAA,GAC3D,KACI;;AAEX,CAAC"}
@@ -17,21 +17,38 @@ export interface TableProps extends React.ComponentProps<'table'> {
17
17
  * can scroll it (WCAG 2.1.1, axe scrollable-region-focusable).
18
18
  */
19
19
  scrollLabel?: string;
20
+ /**
21
+ * Keep the first column in view while the table scrolls sideways (a name
22
+ * column beside numbers). The pinned cells take the surface colour.
23
+ */
24
+ pinFirstColumn?: boolean;
25
+ /**
26
+ * The line under a table that scrolls sideways, until it is scrolled to the
27
+ * end. Shown on touch screens only (a mouse has a scrollbar). `false`
28
+ * turns it off.
29
+ */
30
+ overflowHint?: React.ReactNode | false;
20
31
  }
21
- declare function Table({ className, density, stickyHeader, containerClassName, containerProps, scrollLabel, ...props }: TableProps): React.JSX.Element;
22
- declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
23
- declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
24
- declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
25
- /** Set `data-state="selected"` (or `selected`) to mark a chosen row. */
26
- declare function TableRow({ className, selected, ...props }: React.ComponentProps<'tr'> & {
32
+ /** How a box overflows sideways: more to the `end`, more to the `start`, or `both`. */
33
+ export declare function overflowState(el: {
34
+ scrollLeft: number;
35
+ scrollWidth: number;
36
+ clientWidth: number;
37
+ }): 'start' | 'end' | 'both' | undefined;
38
+ declare const Table: React.ForwardRefExoticComponent<Omit<TableProps, "ref"> & React.RefAttributes<HTMLTableElement>>;
39
+ declare const TableHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
40
+ declare const TableBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
41
+ declare const TableFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
42
+ /** Set `selected` to mark a chosen row: a soft fill and a brand bar on its left edge. */
43
+ declare const TableRow: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableRowElement> & React.HTMLAttributes<HTMLTableRowElement> & {
27
44
  selected?: boolean;
28
- }): React.JSX.Element;
45
+ }, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
29
46
  /** `numeric` right-aligns with tabular figures, for counts, money and durations. */
30
- declare function TableHead({ className, numeric, ...props }: React.ComponentProps<'th'> & {
47
+ declare const TableHead: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableHeaderCellElement> & React.ThHTMLAttributes<HTMLTableHeaderCellElement> & {
31
48
  numeric?: boolean;
32
- }): React.JSX.Element;
33
- declare function TableCell({ className, numeric, ...props }: React.ComponentProps<'td'> & {
49
+ }, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
50
+ declare const TableCell: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableDataCellElement> & React.TdHTMLAttributes<HTMLTableDataCellElement> & {
34
51
  numeric?: boolean;
35
- }): React.JSX.Element;
36
- declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
52
+ }, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
53
+ declare const TableCaption: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLTableCaptionElement>>;
37
54
  export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };