@nocoo/basalt 2.0.3 → 2.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 (295) hide show
  1. package/README.md +134 -15
  2. package/ai/COMPATIBILITY.md +180 -0
  3. package/ai/INTEGRATION.md +1760 -0
  4. package/ai/RECIPES.md +161 -0
  5. package/ai/USAGE.md +99 -0
  6. package/ai/registry.json +38099 -0
  7. package/ai/sources.json +10 -0
  8. package/dist/assets/brand-mark.d.ts +1 -0
  9. package/dist/assets/brand-mark.js +7 -0
  10. package/dist/assets/brand-mark.js.map +1 -0
  11. package/dist/charts/area.d.ts +58 -5
  12. package/dist/charts/area.js +20 -12
  13. package/dist/charts/area.js.map +1 -1
  14. package/dist/charts/bar.d.ts +54 -5
  15. package/dist/charts/bar.js +16 -10
  16. package/dist/charts/bar.js.map +1 -1
  17. package/dist/charts/bullet.d.ts +18 -1
  18. package/dist/charts/bullet.js +6 -3
  19. package/dist/charts/bullet.js.map +1 -1
  20. package/dist/charts/charts.d.ts +58 -5
  21. package/dist/charts/charts.js +13 -2
  22. package/dist/charts/charts.js.map +1 -1
  23. package/dist/charts/config.d.ts +7 -0
  24. package/dist/charts/config.js +5 -1
  25. package/dist/charts/config.js.map +1 -1
  26. package/dist/charts/custom-chart.d.ts +58 -5
  27. package/dist/charts/custom-chart.js +13 -2
  28. package/dist/charts/custom-chart.js.map +1 -1
  29. package/dist/charts/donut.d.ts +18 -1
  30. package/dist/charts/donut.js +6 -3
  31. package/dist/charts/donut.js.map +1 -1
  32. package/dist/charts/frame.d.ts +40 -3
  33. package/dist/charts/frame.js +55 -28
  34. package/dist/charts/frame.js.map +1 -1
  35. package/dist/charts/funnel.d.ts +18 -1
  36. package/dist/charts/funnel.js +5 -1
  37. package/dist/charts/funnel.js.map +1 -1
  38. package/dist/charts/gauge.d.ts +18 -1
  39. package/dist/charts/gauge.js +38 -20
  40. package/dist/charts/gauge.js.map +1 -1
  41. package/dist/charts/grouped-bar.d.ts +54 -5
  42. package/dist/charts/grouped-bar.js +16 -10
  43. package/dist/charts/grouped-bar.js.map +1 -1
  44. package/dist/charts/heatmap-calendar.d.ts +61 -0
  45. package/dist/charts/heatmap-calendar.js +287 -96
  46. package/dist/charts/heatmap-calendar.js.map +1 -1
  47. package/dist/charts/heatmap-matrix.d.ts +99 -0
  48. package/dist/charts/heatmap-matrix.js +249 -0
  49. package/dist/charts/heatmap-matrix.js.map +1 -0
  50. package/dist/charts/line.d.ts +66 -5
  51. package/dist/charts/line.js +37 -30
  52. package/dist/charts/line.js.map +1 -1
  53. package/dist/charts/palette.d.ts +1 -0
  54. package/dist/charts/palette.js +7 -1
  55. package/dist/charts/palette.js.map +1 -1
  56. package/dist/charts/radar.d.ts +18 -1
  57. package/dist/charts/radar.js +26 -19
  58. package/dist/charts/radar.js.map +1 -1
  59. package/dist/charts/sankey.d.ts +18 -1
  60. package/dist/charts/sankey.js +4 -1
  61. package/dist/charts/sankey.js.map +1 -1
  62. package/dist/charts/series.d.ts +5 -7
  63. package/dist/charts/series.js.map +1 -1
  64. package/dist/charts/slot-bar.d.ts +38 -6
  65. package/dist/charts/slot-bar.js +5 -2
  66. package/dist/charts/slot-bar.js.map +1 -1
  67. package/dist/charts/sparkline.d.ts +35 -5
  68. package/dist/charts/sparkline.js +22 -18
  69. package/dist/charts/sparkline.js.map +1 -1
  70. package/dist/charts/stacked-bar.d.ts +58 -5
  71. package/dist/charts/stacked-bar.js +19 -12
  72. package/dist/charts/stacked-bar.js.map +1 -1
  73. package/dist/charts/stat-card.d.ts +51 -1
  74. package/dist/charts/stat-card.js +66 -39
  75. package/dist/charts/stat-card.js.map +1 -1
  76. package/dist/charts/timeline.d.ts +3 -0
  77. package/dist/charts/timeline.js +4 -3
  78. package/dist/charts/timeline.js.map +1 -1
  79. package/dist/charts/timeseries.d.ts +58 -5
  80. package/dist/charts/timeseries.js +13 -2
  81. package/dist/charts/timeseries.js.map +1 -1
  82. package/dist/charts/tooltip.d.ts +57 -0
  83. package/dist/charts/tooltip.js +119 -2
  84. package/dist/charts/tooltip.js.map +1 -1
  85. package/dist/components/accordion.d.ts +117 -2
  86. package/dist/components/accordion.js +20 -13
  87. package/dist/components/accordion.js.map +1 -1
  88. package/dist/components/alert-dialog.d.ts +131 -13
  89. package/dist/components/alert-dialog.js +12 -9
  90. package/dist/components/alert-dialog.js.map +1 -1
  91. package/dist/components/app-header.js +18 -17
  92. package/dist/components/app-header.js.map +1 -1
  93. package/dist/components/app-shell.js +15 -14
  94. package/dist/components/app-shell.js.map +1 -1
  95. package/dist/components/autocomplete.d.ts +4 -0
  96. package/dist/components/autocomplete.js.map +1 -1
  97. package/dist/components/avatar.d.ts +76 -3
  98. package/dist/components/avatar.js.map +1 -1
  99. package/dist/components/badge.d.ts +15 -1
  100. package/dist/components/badge.js +17 -16
  101. package/dist/components/badge.js.map +1 -1
  102. package/dist/components/banner.d.ts +88 -2
  103. package/dist/components/banner.js +41 -40
  104. package/dist/components/banner.js.map +1 -1
  105. package/dist/components/basalt-mark.js +14 -8
  106. package/dist/components/basalt-mark.js.map +1 -1
  107. package/dist/components/battery-meter.d.ts +10 -0
  108. package/dist/components/battery-meter.js +56 -0
  109. package/dist/components/battery-meter.js.map +1 -0
  110. package/dist/components/breadcrumbs.d.ts +27 -7
  111. package/dist/components/breadcrumbs.js +21 -20
  112. package/dist/components/breadcrumbs.js.map +1 -1
  113. package/dist/components/button.d.ts +48 -2
  114. package/dist/components/button.js +87 -36
  115. package/dist/components/button.js.map +1 -1
  116. package/dist/components/chat-bubble.d.ts +7 -0
  117. package/dist/components/chat-bubble.js +14 -13
  118. package/dist/components/chat-bubble.js.map +1 -1
  119. package/dist/components/chat-composer.d.ts +7 -3
  120. package/dist/components/chat-composer.js.map +1 -1
  121. package/dist/components/chat-header.d.ts +6 -1
  122. package/dist/components/chat-header.js +17 -16
  123. package/dist/components/chat-header.js.map +1 -1
  124. package/dist/components/chat-inbox.d.ts +7 -2
  125. package/dist/components/chat-inbox.js.map +1 -1
  126. package/dist/components/checkbox.js +84 -53
  127. package/dist/components/checkbox.js.map +1 -1
  128. package/dist/components/clipboard-text.d.ts +13 -2
  129. package/dist/components/clipboard-text.js +4 -4
  130. package/dist/components/clipboard-text.js.map +1 -1
  131. package/dist/components/collapsible.d.ts +58 -15
  132. package/dist/components/collapsible.js.map +1 -1
  133. package/dist/components/command-palette.d.ts +151 -61
  134. package/dist/components/command-palette.js.map +1 -1
  135. package/dist/components/confirm-dialog.d.ts +1 -1
  136. package/dist/components/confirm-dialog.js +6 -4
  137. package/dist/components/confirm-dialog.js.map +1 -1
  138. package/dist/components/context-menu.d.ts +210 -2
  139. package/dist/components/context-menu.js +7 -4
  140. package/dist/components/context-menu.js.map +1 -1
  141. package/dist/components/data-table.d.ts +40 -2
  142. package/dist/components/data-table.js +168 -120
  143. package/dist/components/data-table.js.map +1 -1
  144. package/dist/components/date-picker.d.ts +53 -2
  145. package/dist/components/date-picker.js +387 -219
  146. package/dist/components/date-picker.js.map +1 -1
  147. package/dist/components/delete-resource.d.ts +7 -1
  148. package/dist/components/delete-resource.js +22 -18
  149. package/dist/components/delete-resource.js.map +1 -1
  150. package/dist/components/description-list.js +16 -15
  151. package/dist/components/description-list.js.map +1 -1
  152. package/dist/components/dialog.d.ts +141 -12
  153. package/dist/components/dialog.js +42 -38
  154. package/dist/components/dialog.js.map +1 -1
  155. package/dist/components/dock.d.ts +1 -1
  156. package/dist/components/dock.js +39 -58
  157. package/dist/components/dock.js.map +1 -1
  158. package/dist/components/dropdown-menu.d.ts +229 -15
  159. package/dist/components/dropdown-menu.js +9 -6
  160. package/dist/components/dropdown-menu.js.map +1 -1
  161. package/dist/components/editable-nav-item.d.ts +33 -0
  162. package/dist/components/editable-nav-item.js +90 -0
  163. package/dist/components/editable-nav-item.js.map +1 -0
  164. package/dist/components/empty.d.ts +22 -2
  165. package/dist/components/empty.js +22 -13
  166. package/dist/components/empty.js.map +1 -1
  167. package/dist/components/field.js +31 -30
  168. package/dist/components/field.js.map +1 -1
  169. package/dist/components/file-dropzone.d.ts +37 -0
  170. package/dist/components/file-dropzone.js +103 -0
  171. package/dist/components/file-dropzone.js.map +1 -0
  172. package/dist/components/filter-bar.d.ts +34 -0
  173. package/dist/components/filter-bar.js +52 -0
  174. package/dist/components/filter-bar.js.map +1 -0
  175. package/dist/components/flow.js +19 -18
  176. package/dist/components/flow.js.map +1 -1
  177. package/dist/components/grid.d.ts +3 -1
  178. package/dist/components/grid.js.map +1 -1
  179. package/dist/components/hover-card.d.ts +111 -1
  180. package/dist/components/hover-card.js +9 -6
  181. package/dist/components/hover-card.js.map +1 -1
  182. package/dist/components/icon-picker.d.ts +34 -0
  183. package/dist/components/icon-picker.js +77 -0
  184. package/dist/components/icon-picker.js.map +1 -0
  185. package/dist/components/inline-editable.d.ts +46 -0
  186. package/dist/components/inline-editable.js +124 -0
  187. package/dist/components/inline-editable.js.map +1 -0
  188. package/dist/components/input-area.js +3 -3
  189. package/dist/components/input-group.js +7 -7
  190. package/dist/components/input.js +3 -3
  191. package/dist/components/label.js +18 -17
  192. package/dist/components/label.js.map +1 -1
  193. package/dist/components/layer-card.d.ts +10 -2
  194. package/dist/components/layer-card.js +71 -68
  195. package/dist/components/layer-card.js.map +1 -1
  196. package/dist/components/loader.d.ts +10 -2
  197. package/dist/components/loader.js.map +1 -1
  198. package/dist/components/menu-bar.d.ts +174 -6
  199. package/dist/components/menu-bar.js +33 -29
  200. package/dist/components/menu-bar.js.map +1 -1
  201. package/dist/components/meter.d.ts +27 -2
  202. package/dist/components/meter.js.map +1 -1
  203. package/dist/components/multi-select.d.ts +64 -0
  204. package/dist/components/multi-select.js +218 -0
  205. package/dist/components/multi-select.js.map +1 -0
  206. package/dist/components/navigation-menu.d.ts +88 -5
  207. package/dist/components/navigation-menu.js.map +1 -1
  208. package/dist/components/overlay.js +6 -5
  209. package/dist/components/overlay.js.map +1 -1
  210. package/dist/components/page-header.js +23 -21
  211. package/dist/components/page-header.js.map +1 -1
  212. package/dist/components/pagination.js +7 -7
  213. package/dist/components/popover.d.ts +136 -16
  214. package/dist/components/popover.js +32 -28
  215. package/dist/components/popover.js.map +1 -1
  216. package/dist/components/radio.js +38 -37
  217. package/dist/components/radio.js.map +1 -1
  218. package/dist/components/resource-list.d.ts +26 -1
  219. package/dist/components/resource-list.js +28 -15
  220. package/dist/components/resource-list.js.map +1 -1
  221. package/dist/components/responsive-master-detail.d.ts +27 -0
  222. package/dist/components/responsive-master-detail.js +85 -0
  223. package/dist/components/responsive-master-detail.js.map +1 -0
  224. package/dist/components/section-rule.js +23 -22
  225. package/dist/components/section-rule.js.map +1 -1
  226. package/dist/components/select.d.ts +27 -3
  227. package/dist/components/select.js +11 -11
  228. package/dist/components/select.js.map +1 -1
  229. package/dist/components/sheet.d.ts +115 -11
  230. package/dist/components/sheet.js +37 -30
  231. package/dist/components/sheet.js.map +1 -1
  232. package/dist/components/sidebar.d.ts +109 -17
  233. package/dist/components/sidebar.js +109 -108
  234. package/dist/components/sidebar.js.map +1 -1
  235. package/dist/components/skeleton-line.d.ts +22 -2
  236. package/dist/components/skeleton-line.js.map +1 -1
  237. package/dist/components/slider.d.ts +61 -1
  238. package/dist/components/slider.js +31 -15
  239. package/dist/components/slider.js.map +1 -1
  240. package/dist/components/stat-strip.js +16 -15
  241. package/dist/components/stat-strip.js.map +1 -1
  242. package/dist/components/switch.js +78 -47
  243. package/dist/components/switch.js.map +1 -1
  244. package/dist/components/table-of-contents.js +18 -17
  245. package/dist/components/table-of-contents.js.map +1 -1
  246. package/dist/components/table-pager.js +20 -19
  247. package/dist/components/table-pager.js.map +1 -1
  248. package/dist/components/table.d.ts +9 -3
  249. package/dist/components/table.js +19 -18
  250. package/dist/components/table.js.map +1 -1
  251. package/dist/components/tabs.js +29 -22
  252. package/dist/components/tabs.js.map +1 -1
  253. package/dist/components/tag-badge.d.ts +58 -0
  254. package/dist/components/tag-badge.js +72 -0
  255. package/dist/components/tag-badge.js.map +1 -0
  256. package/dist/components/tag-color-picker.d.ts +20 -0
  257. package/dist/components/tag-color-picker.js +42 -0
  258. package/dist/components/tag-color-picker.js.map +1 -0
  259. package/dist/components/text.js +17 -16
  260. package/dist/components/text.js.map +1 -1
  261. package/dist/components/toast.d.ts +173 -3
  262. package/dist/components/toast.js +1 -1
  263. package/dist/components/toast.js.map +1 -1
  264. package/dist/components/toggle-group.d.ts +88 -2
  265. package/dist/components/toggle-group.js +32 -31
  266. package/dist/components/toggle-group.js.map +1 -1
  267. package/dist/components/toggle.d.ts +35 -2
  268. package/dist/components/toggle.js +12 -11
  269. package/dist/components/toggle.js.map +1 -1
  270. package/dist/components/tooltip.d.ts +144 -6
  271. package/dist/components/tooltip.js +9 -6
  272. package/dist/components/tooltip.js.map +1 -1
  273. package/dist/components/typeahead-field.js +193 -132
  274. package/dist/components/typeahead-field.js.map +1 -1
  275. package/dist/components/upload-queue.d.ts +51 -0
  276. package/dist/components/upload-queue.js +116 -0
  277. package/dist/components/upload-queue.js.map +1 -0
  278. package/dist/providers/accent.d.ts +46 -2
  279. package/dist/providers/accent.js +358 -172
  280. package/dist/providers/accent.js.map +1 -1
  281. package/dist/providers/link.d.ts +14 -4
  282. package/dist/providers/link.js.map +1 -1
  283. package/dist/providers/theme.d.ts +38 -2
  284. package/dist/providers/theme.js +160 -27
  285. package/dist/providers/theme.js.map +1 -1
  286. package/dist/styles/base.css +83 -0
  287. package/dist/styles/standalone.css +711 -120
  288. package/dist/styles/tailwind.css +21 -7
  289. package/dist/styles/tokens.css +145 -91
  290. package/dist/utils/control-surface.d.ts +2 -1
  291. package/dist/utils/control-surface.js +4 -4
  292. package/dist/utils/control-surface.js.map +1 -1
  293. package/dist/utils/selection-indicator.js +2 -2
  294. package/dist/utils/selection-indicator.js.map +1 -1
  295. package/package.json +8 -4
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","names":[],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type TableProps = {\n\t/**\n\t * Additional classes for the table.\n\t */\n\tclassName?: string;\n};\n\nexport const Table = React.forwardRef<\n\tHTMLTableElement,\n\tTableProps & React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n\t<table\n\t\tref={ref}\n\t\tdata-basalt-table=\"\"\n\t\tclassName={cn(\n\t\t\t\"w-full border-separate border-spacing-0 caption-bottom text-left text-sm text-basalt-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTable.displayName = \"Table\";\n\nexport const TableHeader = (props: React.HTMLAttributes<HTMLTableSectionElement>) => (\n\t<thead {...props} />\n);\nexport const TableBody = (props: React.HTMLAttributes<HTMLTableSectionElement>) => (\n\t<tbody {...props} />\n);\nexport const TableFooter = (props: React.HTMLAttributes<HTMLTableSectionElement>) => (\n\t<tfoot {...props} />\n);\n\nexport type TableRowVariant = \"default\" | \"selected\";\n\nexport type TableRowProps = {\n\t/**\n\t * Highlight the row as selected.\n\t * @default \"default\"\n\t */\n\tvariant?: TableRowVariant;\n\t/**\n\t * Additional classes for the row.\n\t */\n\tclassName?: string;\n};\n\nexport const TableRow = ({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: TableRowProps & React.HTMLAttributes<HTMLTableRowElement>) => (\n\t<tr\n\t\t{...props}\n\t\taria-selected={variant === \"selected\" ? true : props[\"aria-selected\"]}\n\t\tclassName={className}\n\t/>\n);\n\nexport type TableHeadProps = {\n\t/**\n\t * Additional classes for the header cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableHead = ({\n\tclassName,\n\t...props\n}: TableHeadProps & React.ThHTMLAttributes<HTMLTableCellElement>) => (\n\t<th\n\t\tclassName={cn(\n\t\t\t\"border-b border-basalt-border p-3 text-left text-xs font-medium text-basalt-muted-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCellProps = {\n\t/**\n\t * Additional classes for the cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableCell = ({\n\tclassName,\n\t...props\n}: TableCellProps & React.TdHTMLAttributes<HTMLTableCellElement>) => (\n\t<td className={cn(\"p-3\", className)} {...props} />\n);\n\nexport type TableCaptionProps = {\n\t/**\n\t * Additional classes for the caption.\n\t */\n\tclassName?: string;\n};\n\nexport function TableCaption({\n\tclassName,\n\t...props\n}: TableCaptionProps & React.HTMLAttributes<HTMLTableCaptionElement>) {\n\treturn (\n\t\t<caption className={cn(\"mt-2 text-sm text-basalt-muted-foreground\", className)} {...props} />\n\t);\n}\n"],"mappings":";;;;;AAUA,IAAa,IAAQ,EAAM,YAGxB,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,SAAD;CACM;CACL,qBAAkB;CAClB,WAAW,EACV,mGACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAM,cAAc;AAEpB,IAAa,KAAe,MAC3B,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAEP,KAAa,MACzB,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAEP,KAAe,MAC3B,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAiBP,KAAY,EACxB,cACA,aAAU,WACV,GAAG,QAEH,kBAAC,MAAD;CACC,GAAI;CACJ,iBAAe,MAAY,cAAoB,EAAM;CAC1C;AACX,CAAA,GAUW,KAAa,EACzB,cACA,GAAG,QAEH,kBAAC,MAAD;CACC,WAAW,EACV,gGACA,CACD;CACA,GAAI;AACJ,CAAA,GAUW,KAAa,EACzB,cACA,GAAG,QAEH,kBAAC,MAAD;CAAI,WAAW,EAAG,OAAO,CAAS;CAAG,GAAI;AAAQ,CAAA;AAUlD,SAAgB,EAAa,EAC5B,cACA,GAAG,KACkE;CACrE,OACC,kBAAC,WAAD;EAAS,WAAW,EAAG,6CAA6C,CAAS;EAAG,GAAI;CAAQ,CAAA;AAE9F"}
1
+ {"version":3,"file":"table.js","names":[],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\n\nexport type TableProps = {\n\t/**\n\t * Additional classes for the table.\n\t */\n\tclassName?: string;\n};\n\nexport const Table = React.forwardRef<\n\tHTMLTableElement,\n\tTableProps & React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n\t<table\n\t\tref={ref}\n\t\tdata-basalt-table=\"\"\n\t\tclassName={cn(\n\t\t\tBASALT_UI_CLASS,\n\t\t\t\"w-full border-separate border-spacing-0 caption-bottom text-left text-sm text-basalt-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = (props: TableHeaderProps) => <thead {...props} />;\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableBody = (props: TableBodyProps) => <tbody {...props} />;\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = (props: TableFooterProps) => <tfoot {...props} />;\n\nexport type TableRowVariant = \"default\" | \"selected\";\n\nexport type TableRowProps = {\n\t/**\n\t * Highlight the row as selected.\n\t * @default \"default\"\n\t */\n\tvariant?: TableRowVariant;\n\t/**\n\t * Additional classes for the row.\n\t */\n\tclassName?: string;\n};\n\nexport const TableRow = ({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: TableRowProps & React.HTMLAttributes<HTMLTableRowElement>) => (\n\t<tr\n\t\t{...props}\n\t\taria-selected={variant === \"selected\" ? true : props[\"aria-selected\"]}\n\t\tclassName={className}\n\t/>\n);\n\nexport type TableHeadProps = {\n\t/**\n\t * Additional classes for the header cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableHead = ({\n\tclassName,\n\t...props\n}: TableHeadProps & React.ThHTMLAttributes<HTMLTableCellElement>) => (\n\t<th\n\t\tclassName={cn(\n\t\t\t\"border-b border-basalt-border p-3 text-left text-xs font-medium text-basalt-muted-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCellProps = {\n\t/**\n\t * Additional classes for the cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableCell = ({\n\tclassName,\n\t...props\n}: TableCellProps & React.TdHTMLAttributes<HTMLTableCellElement>) => (\n\t<td className={cn(\"p-3\", className)} {...props} />\n);\n\nexport type TableCaptionProps = {\n\t/**\n\t * Additional classes for the caption.\n\t */\n\tclassName?: string;\n};\n\nexport function TableCaption({\n\tclassName,\n\t...props\n}: TableCaptionProps & React.HTMLAttributes<HTMLTableCaptionElement>) {\n\treturn (\n\t\t<caption className={cn(\"mt-2 text-sm text-basalt-muted-foreground\", className)} {...props} />\n\t);\n}\n"],"mappings":";;;;;;AAWA,IAAa,IAAQ,EAAM,YAGxB,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,SAAD;CACM;CACL,qBAAkB;CAClB,WAAW,EACV,GACA,mGACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAM,cAAc;AAIpB,IAAa,KAAe,MAA4B,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAI9D,KAAa,MAA0B,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAI1D,KAAe,MAA4B,kBAAC,SAAD,EAAO,GAAI,EAAQ,CAAA,GAgB9D,KAAY,EACxB,cACA,aAAU,WACV,GAAG,QAEH,kBAAC,MAAD;CACC,GAAI;CACJ,iBAAe,MAAY,cAAoB,EAAM;CAC1C;AACX,CAAA,GAUW,KAAa,EACzB,cACA,GAAG,QAEH,kBAAC,MAAD;CACC,WAAW,EACV,gGACA,CACD;CACA,GAAI;AACJ,CAAA,GAUW,KAAa,EACzB,cACA,GAAG,QAEH,kBAAC,MAAD;CAAI,WAAW,EAAG,OAAO,CAAS;CAAG,GAAI;AAAQ,CAAA;AAUlD,SAAgB,EAAa,EAC5B,cACA,GAAG,KACkE;CACrE,OACC,kBAAC,WAAD;EAAS,WAAW,EAAG,6CAA6C,CAAS;EAAG,GAAI;CAAQ,CAAA;AAE9F"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { OVERLAY_MOTION as t } from "./overlay.js";
4
- import { useSelectionIndicator as n } from "../utils/selection-indicator.js";
5
- import * as r from "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import * as o from "@radix-ui/react-tabs";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { OVERLAY_MOTION as n } from "./overlay.js";
5
+ import { useSelectionIndicator as r } from "../utils/selection-indicator.js";
6
+ import * as i from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ import * as s from "@radix-ui/react-tabs";
8
9
  //#region src/components/tabs.tsx
9
- function s(e) {
10
+ function c(e) {
10
11
  return {
11
12
  left: e.offsetLeft,
12
13
  width: e.offsetWidth,
@@ -14,18 +15,24 @@ function s(e) {
14
15
  height: 0
15
16
  };
16
17
  }
17
- var c = o.Root, l = r.forwardRef(({ className: t, children: r, showIndicator: c = !0, ...l }, u) => {
18
- let { ref: d, state: f, motionClassName: p } = n({
18
+ var l = i.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ a(s.Root, {
19
+ ref: i,
20
+ className: e(t, n),
21
+ ...r
22
+ }));
23
+ l.displayName = s.Root.displayName;
24
+ var u = i.forwardRef(({ className: t, children: n, showIndicator: i = !0, ...l }, u) => {
25
+ let { ref: d, state: f, motionClassName: p } = r({
19
26
  itemSelector: "[role=\"tab\"][data-state=\"active\"]",
20
- enabled: c,
21
- mapGeometry: s,
27
+ enabled: i,
28
+ mapGeometry: c,
22
29
  ref: u
23
30
  });
24
- return /* @__PURE__ */ a(o.List, {
31
+ return /* @__PURE__ */ o(s.List, {
25
32
  ref: d,
26
33
  className: e("relative flex flex-wrap items-center gap-1 border-b border-basalt-border", t),
27
34
  ...l,
28
- children: [r, c ? /* @__PURE__ */ i("span", {
35
+ children: [n, i ? /* @__PURE__ */ a("span", {
29
36
  "aria-hidden": "true",
30
37
  "data-slot": "selection-indicator",
31
38
  className: e("pointer-events-none absolute h-0.5 bg-basalt-primary", p),
@@ -37,20 +44,20 @@ var c = o.Root, l = r.forwardRef(({ className: t, children: r, showIndicator: c
37
44
  }) : null]
38
45
  });
39
46
  });
40
- l.displayName = o.List.displayName;
41
- var u = r.forwardRef(({ className: n, ...r }, a) => /* @__PURE__ */ i(o.Trigger, {
42
- ref: a,
43
- className: e("inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-basalt-muted-foreground transition-colors hover:text-basalt-foreground data-[state=active]:text-basalt-primary", t, n),
47
+ u.displayName = s.List.displayName;
48
+ var d = i.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ a(s.Trigger, {
49
+ ref: i,
50
+ className: e("inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-basalt-muted-foreground transition-colors hover:text-basalt-foreground data-[state=active]:text-basalt-primary", n, t),
44
51
  ...r
45
52
  }));
46
- u.displayName = o.Trigger.displayName;
47
- var d = r.forwardRef(({ className: n, ...r }, a) => /* @__PURE__ */ i(o.Content, {
48
- ref: a,
49
- className: e("mt-3 text-sm text-basalt-foreground data-[state=active]:animate-basalt-tab-in", t, n),
53
+ d.displayName = s.Trigger.displayName;
54
+ var f = i.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ a(s.Content, {
55
+ ref: i,
56
+ className: e("mt-3 text-sm text-basalt-foreground data-[state=active]:animate-basalt-tab-in", n, t),
50
57
  ...r
51
58
  }));
52
- d.displayName = o.Content.displayName;
59
+ f.displayName = s.Content.displayName;
53
60
  //#endregion
54
- export { c as Tabs, d as TabsContent, l as TabsList, u as TabsTrigger };
61
+ export { l as Tabs, f as TabsContent, u as TabsList, d as TabsTrigger };
55
62
 
56
63
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","names":[],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { useSelectionIndicator } from \"../utils/selection-indicator\";\nimport { OVERLAY_MOTION } from \"./overlay\";\n\nfunction measureTabUnderline(item: HTMLElement): {\n\tleft: number;\n\twidth: number;\n\ttop: number;\n\theight: number;\n} {\n\treturn {\n\t\tleft: item.offsetLeft,\n\t\twidth: item.offsetWidth,\n\t\ttop: item.offsetTop + item.offsetHeight,\n\t\theight: 0,\n\t};\n}\n\nexport type TabsProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n\t\"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled selected tab.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial tab.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected tab changes.\n\t */\n\tonValueChange?: (value: string) => void;\n};\nexport const Tabs: React.FC<TabsProps> = TabsPrimitive.Root;\n\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n\t/**\n\t * Show the sliding active underline.\n\t * @default true\n\t */\n\tshowIndicator?: boolean;\n};\n\nexport const TabsList = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.List>,\n\tTabsListProps\n>(({ className, children, showIndicator = true, ...props }, ref) => {\n\tconst {\n\t\tref: listRef,\n\t\tstate,\n\t\tmotionClassName,\n\t} = useSelectionIndicator({\n\t\titemSelector: '[role=\"tab\"][data-state=\"active\"]',\n\t\tenabled: showIndicator,\n\t\tmapGeometry: measureTabUnderline,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tref={listRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex flex-wrap items-center gap-1 border-b border-basalt-border\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showIndicator ? (\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-slot=\"selection-indicator\"\n\t\t\t\t\tclassName={cn(\"pointer-events-none absolute h-0.5 bg-basalt-primary\", motionClassName)}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tleft: state.left,\n\t\t\t\t\t\twidth: state.visible ? state.width : 0,\n\t\t\t\t\t\ttop: state.top,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</TabsPrimitive.List>\n\t);\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nexport type TabsTriggerProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,\n\t\"disabled\" | \"value\"\n> & {\n\t/**\n\t * The tab value.\n\t */\n\tvalue: string;\n\t/**\n\t * Disable the tab trigger.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport const TabsTrigger = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.Trigger>,\n\tTabsTriggerProps\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-basalt-muted-foreground transition-colors hover:text-basalt-foreground data-[state=active]:text-basalt-primary\",\n\t\t\tOVERLAY_MOTION,\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nexport type TabsContentProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>,\n\t\"value\"\n> & {\n\t/**\n\t * The tab value this panel belongs to.\n\t */\n\tvalue: string;\n};\n\nexport const TabsContent = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.Content>,\n\tTabsContentProps\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitive.Content\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"mt-3 text-sm text-basalt-foreground data-[state=active]:animate-basalt-tab-in\",\n\t\t\tOVERLAY_MOTION,\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n"],"mappings":";;;;;;;;AAMA,SAAS,EAAoB,GAK3B;CACD,OAAO;EACN,MAAM,EAAK;EACX,OAAO,EAAK;EACZ,KAAK,EAAK,YAAY,EAAK;EAC3B,QAAQ;CACT;AACD;AAmBA,IAAa,IAA4B,EAAc,MAU1C,IAAW,EAAM,YAG3B,EAAE,cAAW,aAAU,mBAAgB,IAAM,GAAG,KAAS,MAAQ;CACnE,IAAM,EACL,KAAK,GACL,UACA,uBACG,EAAsB;EACzB,cAAc;EACd,SAAS;EACT,aAAa;EACb;CACD,CAAC;CAED,OACC,kBAAC,EAAc,MAAf;EACC,KAAK;EACL,WAAW,EACV,4EACA,CACD;EACA,GAAI;EANL,UAAA,CAQE,GACA,IACA,kBAAC,QAAD;GACC,eAAY;GACZ,aAAU;GACV,WAAW,EAAG,wDAAwD,CAAe;GACrF,OAAO;IACN,MAAM,EAAM;IACZ,OAAO,EAAM,UAAU,EAAM,QAAQ;IACrC,KAAK,EAAM;GACZ;EACA,CAAA,IACE,IACe;;AAEtB,CAAC;AACD,EAAS,cAAc,EAAc,KAAK;AAiB1C,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAc,SAAf;CACM;CACL,WAAW,EACV,6LACA,GACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAc,QAAQ;AAYhD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAc,SAAf;CACM;CACL,WAAW,EACV,iFACA,GACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAc,QAAQ"}
1
+ {"version":3,"file":"tabs.js","names":[],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { useSelectionIndicator } from \"../utils/selection-indicator\";\nimport { OVERLAY_MOTION } from \"./overlay\";\n\nfunction measureTabUnderline(item: HTMLElement): {\n\tleft: number;\n\twidth: number;\n\ttop: number;\n\theight: number;\n} {\n\treturn {\n\t\tleft: item.offsetLeft,\n\t\twidth: item.offsetWidth,\n\t\ttop: item.offsetTop + item.offsetHeight,\n\t\theight: 0,\n\t};\n}\n\nexport type TabsProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n\t\"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled selected tab.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial tab.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected tab changes.\n\t */\n\tonValueChange?: (value: string) => void;\n};\nexport const Tabs: React.FC<TabsProps> = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.Root>,\n\tTabsProps\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitive.Root ref={ref} className={cn(BASALT_UI_CLASS, className)} {...props} />\n));\nTabs.displayName = TabsPrimitive.Root.displayName;\n\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n\t/**\n\t * Show the sliding active underline.\n\t * @default true\n\t */\n\tshowIndicator?: boolean;\n};\n\nexport const TabsList = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.List>,\n\tTabsListProps\n>(({ className, children, showIndicator = true, ...props }, ref) => {\n\tconst {\n\t\tref: listRef,\n\t\tstate,\n\t\tmotionClassName,\n\t} = useSelectionIndicator({\n\t\titemSelector: '[role=\"tab\"][data-state=\"active\"]',\n\t\tenabled: showIndicator,\n\t\tmapGeometry: measureTabUnderline,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tref={listRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex flex-wrap items-center gap-1 border-b border-basalt-border\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showIndicator ? (\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-slot=\"selection-indicator\"\n\t\t\t\t\tclassName={cn(\"pointer-events-none absolute h-0.5 bg-basalt-primary\", motionClassName)}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tleft: state.left,\n\t\t\t\t\t\twidth: state.visible ? state.width : 0,\n\t\t\t\t\t\ttop: state.top,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</TabsPrimitive.List>\n\t);\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nexport type TabsTriggerProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,\n\t\"disabled\" | \"value\"\n> & {\n\t/**\n\t * The tab value.\n\t */\n\tvalue: string;\n\t/**\n\t * Disable the tab trigger.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport const TabsTrigger = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.Trigger>,\n\tTabsTriggerProps\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-basalt-muted-foreground transition-colors hover:text-basalt-foreground data-[state=active]:text-basalt-primary\",\n\t\t\tOVERLAY_MOTION,\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nexport type TabsContentProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>,\n\t\"value\"\n> & {\n\t/**\n\t * The tab value this panel belongs to.\n\t */\n\tvalue: string;\n};\n\nexport const TabsContent = React.forwardRef<\n\tReact.ElementRef<typeof TabsPrimitive.Content>,\n\tTabsContentProps\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitive.Content\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"mt-3 text-sm text-basalt-foreground data-[state=active]:animate-basalt-tab-in\",\n\t\t\tOVERLAY_MOTION,\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n"],"mappings":";;;;;;;;;AAOA,SAAS,EAAoB,GAK3B;CACD,OAAO;EACN,MAAM,EAAK;EACX,OAAO,EAAK;EACZ,KAAK,EAAK,YAAY,EAAK;EAC3B,QAAQ;CACT;AACD;AAmBA,IAAa,IAA4B,EAAM,YAG5C,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAc,MAAf;CAAyB;CAAK,WAAW,EAAG,GAAiB,CAAS;CAAG,GAAI;AAAQ,CAAA,CACrF;AACD,EAAK,cAAc,EAAc,KAAK;AAUtC,IAAa,IAAW,EAAM,YAG3B,EAAE,cAAW,aAAU,mBAAgB,IAAM,GAAG,KAAS,MAAQ;CACnE,IAAM,EACL,KAAK,GACL,UACA,uBACG,EAAsB;EACzB,cAAc;EACd,SAAS;EACT,aAAa;EACb;CACD,CAAC;CAED,OACC,kBAAC,EAAc,MAAf;EACC,KAAK;EACL,WAAW,EACV,4EACA,CACD;EACA,GAAI;EANL,UAAA,CAQE,GACA,IACA,kBAAC,QAAD;GACC,eAAY;GACZ,aAAU;GACV,WAAW,EAAG,wDAAwD,CAAe;GACrF,OAAO;IACN,MAAM,EAAM;IACZ,OAAO,EAAM,UAAU,EAAM,QAAQ;IACrC,KAAK,EAAM;GACZ;EACA,CAAA,IACE,IACe;;AAEtB,CAAC;AACD,EAAS,cAAc,EAAc,KAAK;AAiB1C,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAc,SAAf;CACM;CACL,WAAW,EACV,6LACA,GACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAc,QAAQ;AAYhD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAc,SAAf;CACM;CACL,WAAW,EACV,iFACA,GACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAc,QAAQ"}
@@ -0,0 +1,58 @@
1
+ import type { ComponentProps } from "react";
2
+ /** Stable identifiers, labels and opaque foreground/background pairs for both themes. */
3
+ export declare const TAG_COLORS: {
4
+ readonly slate: {
5
+ readonly label: "Slate";
6
+ readonly className: "border-slate-300 bg-slate-100 text-slate-800 basalt-dark:border-slate-600 basalt-dark:bg-slate-800 basalt-dark:text-slate-100";
7
+ };
8
+ readonly blue: {
9
+ readonly label: "Blue";
10
+ readonly className: "border-blue-300 bg-blue-50 text-blue-800 basalt-dark:border-blue-700 basalt-dark:bg-blue-950 basalt-dark:text-blue-200";
11
+ };
12
+ readonly violet: {
13
+ readonly label: "Violet";
14
+ readonly className: "border-violet-300 bg-violet-50 text-violet-800 basalt-dark:border-violet-700 basalt-dark:bg-violet-950 basalt-dark:text-violet-200";
15
+ };
16
+ readonly teal: {
17
+ readonly label: "Teal";
18
+ readonly className: "border-teal-300 bg-teal-50 text-teal-800 basalt-dark:border-teal-700 basalt-dark:bg-teal-950 basalt-dark:text-teal-200";
19
+ };
20
+ readonly amber: {
21
+ readonly label: "Amber";
22
+ readonly className: "border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200";
23
+ };
24
+ readonly rose: {
25
+ readonly label: "Rose";
26
+ readonly className: "border-rose-300 bg-rose-50 text-rose-800 basalt-dark:border-rose-700 basalt-dark:bg-rose-950 basalt-dark:text-rose-200";
27
+ };
28
+ readonly success: {
29
+ readonly label: "Success";
30
+ readonly className: "border-emerald-300 bg-emerald-50 text-emerald-800 basalt-dark:border-emerald-700 basalt-dark:bg-emerald-950 basalt-dark:text-emerald-200";
31
+ };
32
+ readonly warning: {
33
+ readonly label: "Warning";
34
+ readonly className: "border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200";
35
+ };
36
+ readonly danger: {
37
+ readonly label: "Danger";
38
+ readonly className: "border-red-300 bg-red-50 text-red-800 basalt-dark:border-red-700 basalt-dark:bg-red-950 basalt-dark:text-red-200";
39
+ };
40
+ readonly info: {
41
+ readonly label: "Info";
42
+ readonly className: "border-sky-300 bg-sky-50 text-sky-800 basalt-dark:border-sky-700 basalt-dark:bg-sky-950 basalt-dark:text-sky-200";
43
+ };
44
+ };
45
+ export type TagColor = keyof typeof TAG_COLORS;
46
+ /** Stable FNV-1a assignment to six non-semantic colors; does not infer business meaning. */
47
+ export declare function tagColorFor(key: string): TagColor;
48
+ export interface TagBadgeProps extends Omit<ComponentProps<"span">, "children" | "color"> {
49
+ /** Visible tag name; color is always accompanied by text. */
50
+ name: string;
51
+ /** Stable hash input, defaults to name. Use an entity ID to retain color after renaming. */
52
+ colorKey?: string;
53
+ /** Explicit hue or semantic color, overriding the deterministic assignment. */
54
+ color?: TagColor;
55
+ /** Badge size. @default "md" */
56
+ size?: "sm" | "md";
57
+ }
58
+ export declare function TagBadge({ name, colorKey, color, size, className, ...props }: TagBadgeProps): import("react").JSX.Element;
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { cn as e } from "../utils/cn.js";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ //#region src/components/tag-badge.tsx
6
+ var r = {
7
+ slate: {
8
+ label: "Slate",
9
+ className: "border-slate-300 bg-slate-100 text-slate-800 basalt-dark:border-slate-600 basalt-dark:bg-slate-800 basalt-dark:text-slate-100"
10
+ },
11
+ blue: {
12
+ label: "Blue",
13
+ className: "border-blue-300 bg-blue-50 text-blue-800 basalt-dark:border-blue-700 basalt-dark:bg-blue-950 basalt-dark:text-blue-200"
14
+ },
15
+ violet: {
16
+ label: "Violet",
17
+ className: "border-violet-300 bg-violet-50 text-violet-800 basalt-dark:border-violet-700 basalt-dark:bg-violet-950 basalt-dark:text-violet-200"
18
+ },
19
+ teal: {
20
+ label: "Teal",
21
+ className: "border-teal-300 bg-teal-50 text-teal-800 basalt-dark:border-teal-700 basalt-dark:bg-teal-950 basalt-dark:text-teal-200"
22
+ },
23
+ amber: {
24
+ label: "Amber",
25
+ className: "border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200"
26
+ },
27
+ rose: {
28
+ label: "Rose",
29
+ className: "border-rose-300 bg-rose-50 text-rose-800 basalt-dark:border-rose-700 basalt-dark:bg-rose-950 basalt-dark:text-rose-200"
30
+ },
31
+ success: {
32
+ label: "Success",
33
+ className: "border-emerald-300 bg-emerald-50 text-emerald-800 basalt-dark:border-emerald-700 basalt-dark:bg-emerald-950 basalt-dark:text-emerald-200"
34
+ },
35
+ warning: {
36
+ label: "Warning",
37
+ className: "border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200"
38
+ },
39
+ danger: {
40
+ label: "Danger",
41
+ className: "border-red-300 bg-red-50 text-red-800 basalt-dark:border-red-700 basalt-dark:bg-red-950 basalt-dark:text-red-200"
42
+ },
43
+ info: {
44
+ label: "Info",
45
+ className: "border-sky-300 bg-sky-50 text-sky-800 basalt-dark:border-sky-700 basalt-dark:bg-sky-950 basalt-dark:text-sky-200"
46
+ }
47
+ }, i = [
48
+ "slate",
49
+ "blue",
50
+ "violet",
51
+ "teal",
52
+ "amber",
53
+ "rose"
54
+ ];
55
+ function a(e) {
56
+ let t = 2166136261;
57
+ for (let n = 0; n < e.length; n++) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
58
+ return i[(t >>> 0) % i.length];
59
+ }
60
+ function o({ name: i, colorKey: o, color: s, size: c = "md", className: l, ...u }) {
61
+ let d = s ?? a(o ?? i);
62
+ return /* @__PURE__ */ n("span", {
63
+ ...u,
64
+ "data-tag-color": d,
65
+ className: e(t, "inline-flex max-w-full items-center break-words rounded-full border font-medium", c === "sm" ? "px-2 py-0.5 text-xs" : "px-2.5 py-1 text-sm", r[d].className, l),
66
+ children: i
67
+ });
68
+ }
69
+ //#endregion
70
+ export { r as TAG_COLORS, o as TagBadge, a as tagColorFor };
71
+
72
+ //# sourceMappingURL=tag-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-badge.js","names":[],"sources":["../../src/components/tag-badge.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\n\n/** Stable identifiers, labels and opaque foreground/background pairs for both themes. */\nexport const TAG_COLORS = {\n\tslate: {\n\t\tlabel: \"Slate\",\n\t\tclassName:\n\t\t\t\"border-slate-300 bg-slate-100 text-slate-800 basalt-dark:border-slate-600 basalt-dark:bg-slate-800 basalt-dark:text-slate-100\",\n\t},\n\tblue: {\n\t\tlabel: \"Blue\",\n\t\tclassName:\n\t\t\t\"border-blue-300 bg-blue-50 text-blue-800 basalt-dark:border-blue-700 basalt-dark:bg-blue-950 basalt-dark:text-blue-200\",\n\t},\n\tviolet: {\n\t\tlabel: \"Violet\",\n\t\tclassName:\n\t\t\t\"border-violet-300 bg-violet-50 text-violet-800 basalt-dark:border-violet-700 basalt-dark:bg-violet-950 basalt-dark:text-violet-200\",\n\t},\n\tteal: {\n\t\tlabel: \"Teal\",\n\t\tclassName:\n\t\t\t\"border-teal-300 bg-teal-50 text-teal-800 basalt-dark:border-teal-700 basalt-dark:bg-teal-950 basalt-dark:text-teal-200\",\n\t},\n\tamber: {\n\t\tlabel: \"Amber\",\n\t\tclassName:\n\t\t\t\"border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200\",\n\t},\n\trose: {\n\t\tlabel: \"Rose\",\n\t\tclassName:\n\t\t\t\"border-rose-300 bg-rose-50 text-rose-800 basalt-dark:border-rose-700 basalt-dark:bg-rose-950 basalt-dark:text-rose-200\",\n\t},\n\tsuccess: {\n\t\tlabel: \"Success\",\n\t\tclassName:\n\t\t\t\"border-emerald-300 bg-emerald-50 text-emerald-800 basalt-dark:border-emerald-700 basalt-dark:bg-emerald-950 basalt-dark:text-emerald-200\",\n\t},\n\twarning: {\n\t\tlabel: \"Warning\",\n\t\tclassName:\n\t\t\t\"border-amber-300 bg-amber-50 text-amber-900 basalt-dark:border-amber-700 basalt-dark:bg-amber-950 basalt-dark:text-amber-200\",\n\t},\n\tdanger: {\n\t\tlabel: \"Danger\",\n\t\tclassName:\n\t\t\t\"border-red-300 bg-red-50 text-red-800 basalt-dark:border-red-700 basalt-dark:bg-red-950 basalt-dark:text-red-200\",\n\t},\n\tinfo: {\n\t\tlabel: \"Info\",\n\t\tclassName:\n\t\t\t\"border-sky-300 bg-sky-50 text-sky-800 basalt-dark:border-sky-700 basalt-dark:bg-sky-950 basalt-dark:text-sky-200\",\n\t},\n} as const;\nexport type TagColor = keyof typeof TAG_COLORS;\nconst HASH_COLORS = [\"slate\", \"blue\", \"violet\", \"teal\", \"amber\", \"rose\"] as const;\n/** Stable FNV-1a assignment to six non-semantic colors; does not infer business meaning. */\nexport function tagColorFor(key: string): TagColor {\n\tlet hash = 2166136261;\n\tfor (let i = 0; i < key.length; i++) hash = Math.imul(hash ^ key.charCodeAt(i), 16777619);\n\treturn HASH_COLORS[(hash >>> 0) % HASH_COLORS.length];\n}\nexport interface TagBadgeProps extends Omit<ComponentProps<\"span\">, \"children\" | \"color\"> {\n\t/** Visible tag name; color is always accompanied by text. */\n\tname: string;\n\t/** Stable hash input, defaults to name. Use an entity ID to retain color after renaming. */\n\tcolorKey?: string;\n\t/** Explicit hue or semantic color, overriding the deterministic assignment. */\n\tcolor?: TagColor;\n\t/** Badge size. @default \"md\" */\n\tsize?: \"sm\" | \"md\";\n}\nexport function TagBadge({\n\tname,\n\tcolorKey,\n\tcolor,\n\tsize = \"md\",\n\tclassName,\n\t...props\n}: TagBadgeProps) {\n\tconst resolved = color ?? tagColorFor(colorKey ?? name);\n\treturn (\n\t\t<span\n\t\t\t{...props}\n\t\t\tdata-tag-color={resolved}\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"inline-flex max-w-full items-center break-words rounded-full border font-medium\",\n\t\t\t\tsize === \"sm\" ? \"px-2 py-0.5 text-xs\" : \"px-2.5 py-1 text-sm\",\n\t\t\t\tTAG_COLORS[resolved].className,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{name}\n\t\t</span>\n\t);\n}\n"],"mappings":";;;;;AAKA,IAAa,IAAa;CACzB,OAAO;EACN,OAAO;EACP,WACC;CACF;CACA,MAAM;EACL,OAAO;EACP,WACC;CACF;CACA,QAAQ;EACP,OAAO;EACP,WACC;CACF;CACA,MAAM;EACL,OAAO;EACP,WACC;CACF;CACA,OAAO;EACN,OAAO;EACP,WACC;CACF;CACA,MAAM;EACL,OAAO;EACP,WACC;CACF;CACA,SAAS;EACR,OAAO;EACP,WACC;CACF;CACA,SAAS;EACR,OAAO;EACP,WACC;CACF;CACA,QAAQ;EACP,OAAO;EACP,WACC;CACF;CACA,MAAM;EACL,OAAO;EACP,WACC;CACF;AACD,GAEM,IAAc;CAAC;CAAS;CAAQ;CAAU;CAAQ;CAAS;AAAM;AAEvE,SAAgB,EAAY,GAAuB;CAClD,IAAI,IAAO;CACX,KAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,KAAK,IAAO,KAAK,KAAK,IAAO,EAAI,WAAW,CAAC,GAAG,QAAQ;CACxF,OAAO,GAAa,MAAS,KAAK,EAAY;AAC/C;AAWA,SAAgB,EAAS,EACxB,SACA,aACA,UACA,UAAO,MACP,cACA,GAAG,KACc;CACjB,IAAM,IAAW,KAAS,EAAY,KAAY,CAAI;CACtD,OACC,kBAAC,QAAD;EACC,GAAI;EACJ,kBAAgB;EAChB,WAAW,EACV,GACA,mFACA,MAAS,OAAO,wBAAwB,uBACxC,EAAW,EAAS,CAAC,WACrB,CACD;EAEC,UAAA;CACI,CAAA;AAER"}
@@ -0,0 +1,20 @@
1
+ import { type TagColor } from "./tag-badge.js";
2
+ export interface TagColorPickerProps {
3
+ /** Accessible group name. */
4
+ label: string;
5
+ /** Controlled named color. */
6
+ value?: TagColor;
7
+ /** Initial uncontrolled color. @default "slate" */
8
+ defaultValue?: TagColor;
9
+ /** Color selection request. */
10
+ onValueChange?: (value: TagColor) => void;
11
+ /** Allowed color subset, in caller-defined order. */
12
+ colors?: readonly TagColor[];
13
+ /** Localized visible and accessible color names. */
14
+ labels?: Partial<Record<TagColor, string>>;
15
+ /** Disable the picker. @default false */
16
+ disabled?: boolean;
17
+ /** Additional root classes. */
18
+ className?: string;
19
+ }
20
+ export declare function TagColorPicker({ label, value, defaultValue, onValueChange, colors, labels, disabled, className, }: TagColorPickerProps): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { cn as e } from "../utils/cn.js";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { ToggleGroup as n, ToggleGroupItem as r } from "./toggle-group.js";
5
+ import { TAG_COLORS as i } from "./tag-badge.js";
6
+ import { useState as a } from "react";
7
+ import { Check as o } from "lucide-react";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ //#region src/components/tag-color-picker.tsx
10
+ var l = Object.keys(i);
11
+ function u({ label: u, value: d, defaultValue: f = "slate", onValueChange: p, colors: m = l, labels: h, disabled: g = !1, className: _ }) {
12
+ let [v, y] = a(f), b = d ?? v;
13
+ return /* @__PURE__ */ s(n, {
14
+ type: "single",
15
+ value: b,
16
+ "aria-label": u,
17
+ disabled: g,
18
+ className: e(t, "flex h-auto flex-wrap justify-start gap-2 rounded-basalt-lg p-1", _),
19
+ onValueChange: (e) => {
20
+ if (!e) return;
21
+ let t = e;
22
+ d === void 0 && y(t), p?.(t);
23
+ },
24
+ children: m.map((t) => /* @__PURE__ */ c(r, {
25
+ value: t,
26
+ "aria-label": h?.[t] ?? i[t].label,
27
+ className: "h-auto min-w-16 flex-col gap-1.5 rounded-basalt-md px-2 py-2",
28
+ children: [/* @__PURE__ */ s("span", {
29
+ "aria-hidden": "true",
30
+ className: e("flex size-7 items-center justify-center rounded-full border", i[t].className),
31
+ children: b === t && /* @__PURE__ */ s(o, { className: "size-4" })
32
+ }), /* @__PURE__ */ s("span", {
33
+ className: "text-xs",
34
+ children: h?.[t] ?? i[t].label
35
+ })]
36
+ }, t))
37
+ });
38
+ }
39
+ //#endregion
40
+ export { u as TagColorPicker };
41
+
42
+ //# sourceMappingURL=tag-color-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-color-picker.js","names":[],"sources":["../../src/components/tag-color-picker.tsx"],"sourcesContent":["import { Check } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { TAG_COLORS, type TagColor } from \"./tag-badge\";\nimport { ToggleGroup, ToggleGroupItem } from \"./toggle-group\";\n\nexport interface TagColorPickerProps {\n\t/** Accessible group name. */\n\tlabel: string;\n\t/** Controlled named color. */\n\tvalue?: TagColor;\n\t/** Initial uncontrolled color. @default \"slate\" */\n\tdefaultValue?: TagColor;\n\t/** Color selection request. */\n\tonValueChange?: (value: TagColor) => void;\n\t/** Allowed color subset, in caller-defined order. */\n\tcolors?: readonly TagColor[];\n\t/** Localized visible and accessible color names. */\n\tlabels?: Partial<Record<TagColor, string>>;\n\t/** Disable the picker. @default false */\n\tdisabled?: boolean;\n\t/** Additional root classes. */\n\tclassName?: string;\n}\nconst ALL_COLORS = Object.keys(TAG_COLORS) as TagColor[];\nexport function TagColorPicker({\n\tlabel,\n\tvalue,\n\tdefaultValue = \"slate\",\n\tonValueChange,\n\tcolors = ALL_COLORS,\n\tlabels,\n\tdisabled = false,\n\tclassName,\n}: TagColorPickerProps) {\n\tconst [localValue, setLocalValue] = useState(defaultValue);\n\tconst selected = value ?? localValue;\n\treturn (\n\t\t<ToggleGroup\n\t\t\ttype=\"single\"\n\t\t\tvalue={selected}\n\t\t\taria-label={label}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"flex h-auto flex-wrap justify-start gap-2 rounded-basalt-lg p-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonValueChange={(next) => {\n\t\t\t\tif (!next) return;\n\t\t\t\tconst color = next as TagColor;\n\t\t\t\tif (value === undefined) setLocalValue(color);\n\t\t\t\tonValueChange?.(color);\n\t\t\t}}\n\t\t>\n\t\t\t{colors.map((color) => (\n\t\t\t\t<ToggleGroupItem\n\t\t\t\t\tkey={color}\n\t\t\t\t\tvalue={color}\n\t\t\t\t\taria-label={labels?.[color] ?? TAG_COLORS[color].label}\n\t\t\t\t\tclassName=\"h-auto min-w-16 flex-col gap-1.5 rounded-basalt-md px-2 py-2\"\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"flex size-7 items-center justify-center rounded-full border\",\n\t\t\t\t\t\t\tTAG_COLORS[color].className,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{selected === color && <Check className=\"size-4\" />}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"text-xs\">{labels?.[color] ?? TAG_COLORS[color].label}</span>\n\t\t\t\t</ToggleGroupItem>\n\t\t\t))}\n\t\t</ToggleGroup>\n\t);\n}\n"],"mappings":";;;;;;;;;AAyBA,IAAM,IAAa,OAAO,KAAK,CAAU;AACzC,SAAgB,EAAe,EAC9B,UACA,UACA,kBAAe,SACf,kBACA,YAAS,GACT,WACA,cAAW,IACX,gBACuB;CACvB,IAAM,CAAC,GAAY,KAAiB,EAAS,CAAY,GACnD,IAAW,KAAS;CAC1B,OACC,kBAAC,GAAD;EACC,MAAK;EACL,OAAO;EACP,cAAY;EACF;EACV,WAAW,EACV,GACA,mEACA,CACD;EACA,gBAAgB,MAAS;GACxB,IAAI,CAAC,GAAM;GACX,IAAM,IAAQ;GAEd,AADI,MAAU,KAAA,KAAW,EAAc,CAAK,GAC5C,IAAgB,CAAK;EACtB;EAEC,UAAA,EAAO,KAAK,MACZ,kBAAC,GAAD;GAEC,OAAO;GACP,cAAY,IAAS,MAAU,EAAW,EAAM,CAAC;GACjD,WAAU;GAJX,UAAA,CAMC,kBAAC,QAAD;IACC,eAAY;IACZ,WAAW,EACV,+DACA,EAAW,EAAM,CAAC,SACnB;IAEC,UAAA,MAAa,KAAS,kBAAC,GAAD,EAAO,WAAU,SAAU,CAAA;GAC7C,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAAW,UAAA,IAAS,MAAU,EAAW,EAAM,CAAC;GAAY,CAAA,CAC5D;EAfX,GAAA,CAeW,CACjB;CACW,CAAA;AAEf"}
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import * as t from "react";
4
- import { cva as n } from "class-variance-authority";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import * as n from "react";
5
+ import { cva as r } from "class-variance-authority";
5
6
  //#region src/components/text.tsx
6
- var r = n("text-basalt-foreground", {
7
+ var i = r("text-basalt-foreground", {
7
8
  variants: {
8
9
  size: {
9
10
  xs: "text-xs",
@@ -22,25 +23,25 @@ var r = n("text-basalt-foreground", {
22
23
  tone: "default"
23
24
  }
24
25
  });
25
- function i(e) {
26
+ function a(e) {
26
27
  return e === "body" ? "p" : "span";
27
28
  }
28
- function a(e) {
29
+ function o(e) {
29
30
  return e === "heading" ? "lg" : e === "mono" ? "sm" : "md";
30
31
  }
31
- var o = t.forwardRef(({ as: n, bold: o = !1, className: s, size: c, tone: l = "default", truncate: u = !1, variant: d = "body", ...f }, p) => {
32
- let m = n ?? i(d);
33
- return t.createElement(m, {
34
- ...f,
35
- ref: p,
36
- className: e(r({
37
- size: c ?? a(d),
38
- tone: l
39
- }), d === "heading" && "font-semibold", d === "mono" && "font-mono", o && "font-semibold", u && "min-w-0 truncate", s)
32
+ var s = n.forwardRef(({ as: r, bold: s = !1, className: c, size: l, tone: u = "default", truncate: d = !1, variant: f = "body", ...p }, m) => {
33
+ let h = r ?? a(f);
34
+ return n.createElement(h, {
35
+ ...p,
36
+ ref: m,
37
+ className: e(t, i({
38
+ size: l ?? o(f),
39
+ tone: u
40
+ }), f === "heading" && "font-semibold", f === "mono" && "font-mono", s && "font-semibold", d && "min-w-0 truncate", c)
40
41
  });
41
42
  });
42
- o.displayName = "Text";
43
+ s.displayName = "Text";
43
44
  //#endregion
44
- export { o as Text };
45
+ export { s as Text };
45
46
 
46
47
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","names":[],"sources":["../../src/components/text.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type TextVariant = \"body\" | \"heading\" | \"mono\";\nexport type TextSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type TextTone = \"default\" | \"muted\";\nexport type TextElement =\n\t| \"h1\"\n\t| \"h2\"\n\t| \"h3\"\n\t| \"h4\"\n\t| \"h5\"\n\t| \"h6\"\n\t| \"p\"\n\t| \"span\"\n\t| \"label\"\n\t| \"dt\"\n\t| \"dd\"\n\t| \"li\"\n\t| \"figcaption\"\n\t| \"legend\"\n\t| \"pre\"\n\t| \"code\"\n\t| \"em\"\n\t| \"strong\"\n\t| \"small\"\n\t| \"abbr\"\n\t| \"time\";\n\nconst textVariants = cva(\"text-basalt-foreground\", {\n\tvariants: {\n\t\tsize: {\n\t\t\txs: \"text-xs\",\n\t\t\tsm: \"text-sm\",\n\t\t\tmd: \"text-sm leading-6\",\n\t\t\tlg: \"text-base\",\n\t\t\txl: \"text-lg\",\n\t\t},\n\t\ttone: {\n\t\t\tdefault: \"text-basalt-foreground\",\n\t\t\tmuted: \"text-basalt-muted-foreground\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"md\",\n\t\ttone: \"default\",\n\t},\n});\n\nexport interface TextProps extends React.HTMLAttributes<HTMLElement> {\n\t/**\n\t * Visual role. Does not infer document outline.\n\t * @default \"body\"\n\t */\n\tvariant?: TextVariant;\n\t/** Type scale. Defaults by variant: body md, heading lg, mono sm. */\n\tsize?: TextSize;\n\t/**\n\t * Foreground tone.\n\t * @default \"default\"\n\t */\n\ttone?: TextTone;\n\t/** Rendered HTML element. Defaults by variant: body p, heading/mono span. */\n\tas?: TextElement;\n\t/**\n\t * Apply semibold weight.\n\t * @default false\n\t */\n\tbold?: boolean;\n\t/**\n\t * Ellipsize overflow on one line.\n\t * @default false\n\t */\n\ttruncate?: boolean;\n}\n\nfunction defaultElement(variant: TextVariant): TextElement {\n\treturn variant === \"body\" ? \"p\" : \"span\";\n}\n\nfunction defaultSize(variant: TextVariant): TextSize {\n\tif (variant === \"heading\") {\n\t\treturn \"lg\";\n\t}\n\tif (variant === \"mono\") {\n\t\treturn \"sm\";\n\t}\n\treturn \"md\";\n}\n\nexport const Text = React.forwardRef<HTMLElement, TextProps>(\n\t(\n\t\t{\n\t\t\tas,\n\t\t\tbold = false,\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\ttone = \"default\",\n\t\t\ttruncate = false,\n\t\t\tvariant = \"body\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Component = as ?? defaultElement(variant);\n\t\treturn React.createElement(Component, {\n\t\t\t...props,\n\t\t\tref,\n\t\t\tclassName: cn(\n\t\t\t\ttextVariants({ size: size ?? defaultSize(variant), tone }),\n\t\t\t\tvariant === \"heading\" && \"font-semibold\",\n\t\t\t\tvariant === \"mono\" && \"font-mono\",\n\t\t\t\tbold && \"font-semibold\",\n\t\t\t\ttruncate && \"min-w-0 truncate\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t});\n\t},\n);\nText.displayName = \"Text\";\n"],"mappings":";;;;;AA8BA,IAAM,IAAe,EAAI,0BAA0B;CAClD,UAAU;EACT,MAAM;GACL,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACL;EACA,MAAM;GACL,SAAS;GACT,OAAO;EACR;CACD;CACA,iBAAiB;EAChB,MAAM;EACN,MAAM;CACP;AACD,CAAC;AA6BD,SAAS,EAAe,GAAmC;CAC1D,OAAO,MAAY,SAAS,MAAM;AACnC;AAEA,SAAS,EAAY,GAAgC;CAOpD,OANI,MAAY,YACR,OAEJ,MAAY,SACR,OAED;AACR;AAEA,IAAa,IAAO,EAAM,YAExB,EACC,OACA,UAAO,IACP,cACA,SACA,UAAO,WACP,cAAW,IACX,aAAU,QACV,GAAG,KAEJ,MACI;CACJ,IAAM,IAAY,KAAM,EAAe,CAAO;CAC9C,OAAO,EAAM,cAAc,GAAW;EACrC,GAAG;EACH;EACA,WAAW,EACV,EAAa;GAAE,MAAM,KAAQ,EAAY,CAAO;GAAG;EAAK,CAAC,GACzD,MAAY,aAAa,iBACzB,MAAY,UAAU,aACtB,KAAQ,iBACR,KAAY,oBACZ,CACD;CACD,CAAC;AACF,CACD;AACA,EAAK,cAAc"}
1
+ {"version":3,"file":"text.js","names":[],"sources":["../../src/components/text.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\n\nexport type TextVariant = \"body\" | \"heading\" | \"mono\";\nexport type TextSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type TextTone = \"default\" | \"muted\";\nexport type TextElement =\n\t| \"h1\"\n\t| \"h2\"\n\t| \"h3\"\n\t| \"h4\"\n\t| \"h5\"\n\t| \"h6\"\n\t| \"p\"\n\t| \"span\"\n\t| \"label\"\n\t| \"dt\"\n\t| \"dd\"\n\t| \"li\"\n\t| \"figcaption\"\n\t| \"legend\"\n\t| \"pre\"\n\t| \"code\"\n\t| \"em\"\n\t| \"strong\"\n\t| \"small\"\n\t| \"abbr\"\n\t| \"time\";\n\nconst textVariants = cva(\"text-basalt-foreground\", {\n\tvariants: {\n\t\tsize: {\n\t\t\txs: \"text-xs\",\n\t\t\tsm: \"text-sm\",\n\t\t\tmd: \"text-sm leading-6\",\n\t\t\tlg: \"text-base\",\n\t\t\txl: \"text-lg\",\n\t\t},\n\t\ttone: {\n\t\t\tdefault: \"text-basalt-foreground\",\n\t\t\tmuted: \"text-basalt-muted-foreground\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"md\",\n\t\ttone: \"default\",\n\t},\n});\n\nexport interface TextProps extends React.HTMLAttributes<HTMLElement> {\n\t/**\n\t * Visual role. Does not infer document outline.\n\t * @default \"body\"\n\t */\n\tvariant?: TextVariant;\n\t/** Type scale. Defaults by variant: body md, heading lg, mono sm. */\n\tsize?: TextSize;\n\t/**\n\t * Foreground tone.\n\t * @default \"default\"\n\t */\n\ttone?: TextTone;\n\t/** Rendered HTML element. Defaults by variant: body p, heading/mono span. */\n\tas?: TextElement;\n\t/**\n\t * Apply semibold weight.\n\t * @default false\n\t */\n\tbold?: boolean;\n\t/**\n\t * Ellipsize overflow on one line.\n\t * @default false\n\t */\n\ttruncate?: boolean;\n}\n\nfunction defaultElement(variant: TextVariant): TextElement {\n\treturn variant === \"body\" ? \"p\" : \"span\";\n}\n\nfunction defaultSize(variant: TextVariant): TextSize {\n\tif (variant === \"heading\") {\n\t\treturn \"lg\";\n\t}\n\tif (variant === \"mono\") {\n\t\treturn \"sm\";\n\t}\n\treturn \"md\";\n}\n\nexport const Text = React.forwardRef<HTMLElement, TextProps>(\n\t(\n\t\t{\n\t\t\tas,\n\t\t\tbold = false,\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\ttone = \"default\",\n\t\t\ttruncate = false,\n\t\t\tvariant = \"body\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Component = as ?? defaultElement(variant);\n\t\treturn React.createElement(Component, {\n\t\t\t...props,\n\t\t\tref,\n\t\t\tclassName: cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\ttextVariants({ size: size ?? defaultSize(variant), tone }),\n\t\t\t\tvariant === \"heading\" && \"font-semibold\",\n\t\t\t\tvariant === \"mono\" && \"font-mono\",\n\t\t\t\tbold && \"font-semibold\",\n\t\t\t\ttruncate && \"min-w-0 truncate\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t});\n\t},\n);\nText.displayName = \"Text\";\n"],"mappings":";;;;;;AA+BA,IAAM,IAAe,EAAI,0BAA0B;CAClD,UAAU;EACT,MAAM;GACL,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACL;EACA,MAAM;GACL,SAAS;GACT,OAAO;EACR;CACD;CACA,iBAAiB;EAChB,MAAM;EACN,MAAM;CACP;AACD,CAAC;AA6BD,SAAS,EAAe,GAAmC;CAC1D,OAAO,MAAY,SAAS,MAAM;AACnC;AAEA,SAAS,EAAY,GAAgC;CAOpD,OANI,MAAY,YACR,OAEJ,MAAY,SACR,OAED;AACR;AAEA,IAAa,IAAO,EAAM,YAExB,EACC,OACA,UAAO,IACP,cACA,SACA,UAAO,WACP,cAAW,IACX,aAAU,QACV,GAAG,KAEJ,MACI;CACJ,IAAM,IAAY,KAAM,EAAe,CAAO;CAC9C,OAAO,EAAM,cAAc,GAAW;EACrC,GAAG;EACH;EACA,WAAW,EACV,GACA,EAAa;GAAE,MAAM,KAAQ,EAAY,CAAO;GAAG;EAAK,CAAC,GACzD,MAAY,aAAa,iBACzB,MAAY,UAAU,aACtB,KAAQ,iBACR,KAAY,oBACZ,CACD;CACD,CAAC;AACF,CACD;AACA,EAAK,cAAc"}
@@ -2,26 +2,196 @@ import type { ComponentProps, ReactNode } from "react";
2
2
  import { Toaster as Sonner } from "sonner";
3
3
  export type ToastVariant = "default" | "success" | "error" | "warning" | "info";
4
4
  export type ToastOptions = {
5
+ /**
6
+ * Secondary supporting text or node displayed below the main message.
7
+ */
5
8
  description?: ReactNode;
9
+ /**
10
+ * Custom icon override. When set to `false`, suppresses default status or notification icons.
11
+ */
6
12
  icon?: ReactNode | false;
13
+ /**
14
+ * Whether a close button is displayed on this individual toast notification.
15
+ * @default true
16
+ */
7
17
  close?: boolean;
18
+ /**
19
+ * Visibility duration in milliseconds before auto-dismissal. Resolved as `toast.duration || (Toaster.toastOptions.duration ?? Toaster.duration) || 4000`. Infinity disables auto-closing. Setting to 0 treats it as falsy and falls back through container duration before defaulting to 4000ms.
20
+ * @default "inherited from container, finally 4000ms"
21
+ */
8
22
  duration?: number;
23
+ /**
24
+ * Unique identifier for this toast notification. Can be used with `toast.dismiss(id)` to manually dismiss this specific toast.
25
+ */
9
26
  id?: string | number;
27
+ /**
28
+ * Optional action button configuration with label and onClick handler.
29
+ */
10
30
  action?: {
11
31
  label: string;
12
32
  onClick: () => void;
13
33
  };
14
34
  };
15
- declare function show(message: ReactNode, options?: ToastOptions & {
35
+ /**
36
+ * Options accepted by the root `toast(message, options)` dispatch function, extending `ToastOptions` with an optional `variant`.
37
+ */
38
+ export type ToastCallOptions = ToastOptions & {
39
+ /**
40
+ * Visual status variant style for this toast.
41
+ * @default "default"
42
+ */
16
43
  variant?: ToastVariant;
17
- }): string | number;
44
+ };
45
+ /**
46
+ * Dispatches a toast notification with the given message and options.
47
+ * @param message Main notification content or React node.
48
+ * @param options Notification customization options including optional variant.
49
+ * @returns The unique toast identifier (string or number).
50
+ */
51
+ declare function show(message: ReactNode, options?: ToastCallOptions): string | number;
52
+ /**
53
+ * Imperative notification dispatcher. Directly callable as `toast(message, options)` to display a default notification, with helper methods for status variants (`success`, `error`, `warning`, `info`) and dismissal (`dismiss`).
54
+ */
18
55
  export declare const toast: typeof show & {
56
+ /**
57
+ * Dispatches a success status toast notification.
58
+ * @param message Main notification content or React node.
59
+ * @param options Notification customization options.
60
+ * @returns The unique toast identifier (string or number).
61
+ */
19
62
  success: (message: ReactNode, options?: ToastOptions) => string | number;
63
+ /**
64
+ * Dispatches an error status toast notification.
65
+ * @param message Main notification content or React node.
66
+ * @param options Notification customization options.
67
+ * @returns The unique toast identifier (string or number).
68
+ */
20
69
  error: (message: ReactNode, options?: ToastOptions) => string | number;
70
+ /**
71
+ * Dispatches a warning status toast notification.
72
+ * @param message Main notification content or React node.
73
+ * @param options Notification customization options.
74
+ * @returns The unique toast identifier (string or number).
75
+ */
21
76
  warning: (message: ReactNode, options?: ToastOptions) => string | number;
77
+ /**
78
+ * Dispatches an info status toast notification.
79
+ * @param message Main notification content or React node.
80
+ * @param options Notification customization options.
81
+ * @returns The unique toast identifier (string or number).
82
+ */
22
83
  info: (message: ReactNode, options?: ToastOptions) => string | number;
84
+ /**
85
+ * Dismisses an active toast by its identifier, or dismisses all toasts when called without arguments. Note: Calling without arguments returns `undefined` at runtime; calling with `id` returns the dismissed `id`.
86
+ * @param id Optional identifier of the toast to dismiss. When omitted, all toasts are dismissed.
87
+ * @returns The dismissed toast identifier if provided, or undefined if dismissed without arguments.
88
+ */
23
89
  dismiss: (id?: number | string) => string | number;
24
90
  };
25
- export declare function Toaster({ closeButton, ...props }: ComponentProps<typeof Sonner>): import("react").JSX.Element;
91
+ type SonnerComponentProps = ComponentProps<typeof Sonner>;
92
+ export type ToasterToastOptions = NonNullable<SonnerComponentProps["toastOptions"]>;
93
+ export type ToasterIcons = NonNullable<SonnerComponentProps["icons"]>;
94
+ export type ToasterSwipeDirection = NonNullable<SonnerComponentProps["swipeDirections"]>[number];
95
+ export interface ToasterProps extends Omit<SonnerComponentProps, "id" | "invert" | "theme" | "position" | "hotkey" | "richColors" | "expand" | "duration" | "gap" | "visibleToasts" | "closeButton" | "toastOptions" | "className" | "style" | "offset" | "mobileOffset" | "dir" | "swipeDirections" | "icons" | "containerAriaLabel" | "customAriaLabel"> {
96
+ /**
97
+ * Unique identifier for this toaster instance. When set, only toasts dispatched with a matching toasterId will display here. Basalt standard toast options do not expose toasterId, so global un-identified mounting is recommended.
98
+ */
99
+ id?: SonnerComponentProps["id"];
100
+ /**
101
+ * Invert toast foreground and background colors.
102
+ * @default false
103
+ */
104
+ invert?: SonnerComponentProps["invert"];
105
+ /**
106
+ * Color scheme theme override for toast notifications.
107
+ * @default "light"
108
+ */
109
+ theme?: SonnerComponentProps["theme"];
110
+ /**
111
+ * Screen positioning for the toast viewport stack.
112
+ * @default "bottom-right"
113
+ */
114
+ position?: SonnerComponentProps["position"];
115
+ /**
116
+ * Keyboard hotkey combination to expand and focus the toast viewport.
117
+ * @default ["altKey", "KeyT"]
118
+ */
119
+ hotkey?: SonnerComponentProps["hotkey"];
120
+ /**
121
+ * Whether rich semantic colors should be applied to default notification styles.
122
+ * @default false
123
+ */
124
+ richColors?: SonnerComponentProps["richColors"];
125
+ /**
126
+ * Whether toasts should be expanded by default rather than collapsed into a stacked pile.
127
+ * @default false
128
+ */
129
+ expand?: SonnerComponentProps["expand"];
130
+ /**
131
+ * Default visibility duration in milliseconds before auto-dismissal. Resolved as `toast.duration || (Toaster.toastOptions.duration ?? Toaster.duration) || 4000`. Passing Infinity prevents auto-closing. When `toastOptions.duration === 0`, it is treated as falsy and bypasses `Toaster.duration`, falling back to 4000.
132
+ * @default 4000
133
+ */
134
+ duration?: SonnerComponentProps["duration"];
135
+ /**
136
+ * Pixel gap between stacked toasts.
137
+ * @default 14
138
+ */
139
+ gap?: SonnerComponentProps["gap"];
140
+ /**
141
+ * Maximum number of toasts visible simultaneously in the stack.
142
+ * @default 3
143
+ */
144
+ visibleToasts?: SonnerComponentProps["visibleToasts"];
145
+ /**
146
+ * Whether a close button is displayed on each toast notification. Basalt enables this by default (`closeButton = true`), and Basalt single-toast calls also default to `close: true`, overriding `Toaster.closeButton = false`. To hide the close button on an individual toast, pass `close: false` in the dispatch options.
147
+ * @default true
148
+ */
149
+ closeButton?: SonnerComponentProps["closeButton"];
150
+ /**
151
+ * Default options and custom class names applied to all rendered toasts. Passing a custom `toastOptions` object will override Basalt default styling rather than deep-merging.
152
+ */
153
+ toastOptions?: ToasterToastOptions;
154
+ /**
155
+ * Additional CSS class name applied to each rendered ordered list (`ol`) toast viewport.
156
+ */
157
+ className?: SonnerComponentProps["className"];
158
+ /**
159
+ * Inline style properties applied to each rendered ordered list (`ol`) toast viewport.
160
+ */
161
+ style?: SonnerComponentProps["style"];
162
+ /**
163
+ * Viewport offset margin from screen edges on desktop screens.
164
+ * @default "24px"
165
+ */
166
+ offset?: SonnerComponentProps["offset"];
167
+ /**
168
+ * Viewport offset margin from screen edges on mobile devices.
169
+ * @default "16px"
170
+ */
171
+ mobileOffset?: SonnerComponentProps["mobileOffset"];
172
+ /**
173
+ * Layout direction of the notification viewport ('ltr', 'rtl', or document direction when unspecified).
174
+ * @default document direction
175
+ */
176
+ dir?: SonnerComponentProps["dir"];
177
+ /**
178
+ * Allowed swipe directions to dismiss toasts. Defaults based on position orientation (e.g. ['bottom', 'right'] for bottom-right).
179
+ */
180
+ swipeDirections?: ToasterSwipeDirection[];
181
+ /**
182
+ * Custom icon overrides for toast status variants. Basalt preconfigures Lucide icons; passing an `icons` object replaces defaults rather than deep-merging. Basalt status variant dispatches (`toast.success`, `error`, `warning`, `info`) supply default status icons directly, which take precedence over `Toaster.icons`; custom individual toast icons should be passed via `options.icon`.
183
+ */
184
+ icons?: ToasterIcons;
185
+ /**
186
+ * Accessible label for the notification region container.
187
+ * @default "Notifications"
188
+ */
189
+ containerAriaLabel?: SonnerComponentProps["containerAriaLabel"];
190
+ /**
191
+ * Custom accessible label overriding both containerAriaLabel and hotkey text on the section wrapper.
192
+ */
193
+ customAriaLabel?: SonnerComponentProps["customAriaLabel"];
194
+ }
195
+ export declare function Toaster({ closeButton, ...props }: ToasterProps): import("react").JSX.Element;
26
196
  export declare const Toast: typeof Toaster;
27
197
  export {};
@@ -17,7 +17,7 @@ var c = {
17
17
  info: /* @__PURE__ */ a(n, { className: "size-4" })
18
18
  };
19
19
  function u(e, t) {
20
- return t === !1 ? !1 : t ?? l[e] ?? void 0;
20
+ return t === !1 ? null : t ?? l[e] ?? void 0;
21
21
  }
22
22
  function d(e, t = {}) {
23
23
  let { variant: n = "default", icon: r, close: i = !0, ...a } = t, o = {