@adea-ai/ui 0.152.1 → 0.152.3

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 (271) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +2 -2
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  4. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  5. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  6. package/dist/components/composites/action-button/action-button.js.map +1 -1
  7. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  9. package/dist/components/composites/appearance-editor/appearance-editor.js +3 -3
  10. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  14. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  15. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  16. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  17. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  18. package/dist/components/composites/chat/chat.js.map +1 -1
  19. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  20. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  21. package/dist/components/composites/context/context.js.map +1 -1
  22. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  23. package/dist/components/composites/help-center/help-center.js.map +1 -1
  24. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  25. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  26. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  27. package/dist/components/composites/list-row/list-row.js.map +1 -1
  28. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  29. package/dist/components/composites/model-selector/model-selector.js +3 -0
  30. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  31. package/dist/components/composites/plan/plan.js.map +1 -1
  32. package/dist/components/composites/queue/queue.js.map +1 -1
  33. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  34. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  35. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  36. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  37. package/dist/components/composites/settings/settings.js.map +1 -1
  38. package/dist/components/composites/sources/sources.js.map +1 -1
  39. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  40. package/dist/components/composites/stat/stat.js.map +1 -1
  41. package/dist/components/composites/subagent/subagent.js.map +1 -1
  42. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  43. package/dist/components/composites/task/task.js.map +1 -1
  44. package/dist/components/composites/terminal/terminal.js +1 -1
  45. package/dist/components/composites/terminal/terminal.js.map +1 -1
  46. package/dist/components/composites/test-results/test-results.js.map +1 -1
  47. package/dist/components/composites/tool/tool.js.map +1 -1
  48. package/dist/components/composites/tree/tree.js.map +1 -1
  49. package/dist/components/composites/update-dialog/channel-control.js +3 -3
  50. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  51. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  52. package/dist/components/composites/update-dialog/update-dialog.js +3 -3
  53. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  54. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  55. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  56. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  57. package/dist/components/conversation/atomic/chat-composer.js.map +1 -1
  58. package/dist/components/conversation/busy-send-button.js.map +1 -1
  59. package/dist/components/conversation/chat-composer.js.map +1 -1
  60. package/dist/components/conversation/composer-menu.js.map +1 -1
  61. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  62. package/dist/components/conversation/conversation-pane.js.map +1 -1
  63. package/dist/components/conversation/conversation-surface.js.map +1 -1
  64. package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
  65. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  66. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  67. package/dist/components/conversation/message-composer.js +1 -1
  68. package/dist/components/conversation/message-composer.js.map +1 -1
  69. package/dist/components/conversation/message-row.js.map +1 -1
  70. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  71. package/dist/components/conversation/thread-panel.js.map +1 -1
  72. package/dist/components/conversation/transcript-composition.js.map +1 -1
  73. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  74. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  75. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  76. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  77. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  78. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  79. package/dist/components/layout/page/page.js.map +1 -1
  80. package/dist/components/layout/panel/panel.js.map +1 -1
  81. package/dist/components/layout/pixel-pane/pixel-pane.js.map +1 -1
  82. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  83. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  84. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  85. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  86. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
  87. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  88. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  89. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  90. package/dist/components/layout/split-layout/split-layout.js +1 -1
  91. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  92. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  93. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  94. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  95. package/dist/components/motion/presence.js.map +1 -1
  96. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  97. package/dist/components/theme/appearance-panel.js +1 -1
  98. package/dist/components/theme/appearance-panel.js.map +1 -1
  99. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  100. package/dist/components/theme/theme-picker.js.map +1 -1
  101. package/dist/components/theme/theme-provider.js.map +1 -1
  102. package/dist/components/theme/theme-toggle.js.map +1 -1
  103. package/dist/components/ui/accordion/accordion.js.map +1 -1
  104. package/dist/components/ui/alert/alert.js.map +1 -1
  105. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  106. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  107. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  108. package/dist/components/ui/attachment/attachment.js.map +1 -1
  109. package/dist/components/ui/avatar/avatar.js.map +1 -1
  110. package/dist/components/ui/badge/badge.js.map +1 -1
  111. package/dist/components/ui/board/board.js.map +1 -1
  112. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  113. package/dist/components/ui/bubble/bubble.js.map +1 -1
  114. package/dist/components/ui/button/button.js.map +1 -1
  115. package/dist/components/ui/button-group/button-group.js.map +1 -1
  116. package/dist/components/ui/calendar/calendar.js.map +1 -1
  117. package/dist/components/ui/callout/callout.js.map +1 -1
  118. package/dist/components/ui/card/card.js.map +1 -1
  119. package/dist/components/ui/carousel/carousel.js.map +1 -1
  120. package/dist/components/ui/chart/chart.js.map +1 -1
  121. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  122. package/dist/components/ui/code-block/code-block.js.map +1 -1
  123. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  124. package/dist/components/ui/combobox/combobox.js.map +1 -1
  125. package/dist/components/ui/combobox/value-combobox.js.map +1 -1
  126. package/dist/components/ui/command/command.js.map +1 -1
  127. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  128. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  129. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  130. package/dist/components/ui/dialog/dialog.js.map +1 -1
  131. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  132. package/dist/components/ui/drawer/drawer.js.map +1 -1
  133. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  134. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  135. package/dist/components/ui/empty/empty-state.js.map +1 -1
  136. package/dist/components/ui/empty/empty.js.map +1 -1
  137. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  138. package/dist/components/ui/field/field.js.map +1 -1
  139. package/dist/components/ui/field/number-field.js.map +1 -1
  140. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  141. package/dist/components/ui/input/input-control.js.map +1 -1
  142. package/dist/components/ui/input/input.js.map +1 -1
  143. package/dist/components/ui/input-group/input-group.js.map +1 -1
  144. package/dist/components/ui/input-group/secret-input-group.js.map +1 -1
  145. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  146. package/dist/components/ui/item/item.js.map +1 -1
  147. package/dist/components/ui/kbd/kbd.js.map +1 -1
  148. package/dist/components/ui/label/label.js.map +1 -1
  149. package/dist/components/ui/marker/marker.js.map +1 -1
  150. package/dist/components/ui/menubar/menubar.js.map +1 -1
  151. package/dist/components/ui/message/message.js.map +1 -1
  152. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  153. package/dist/components/ui/native-select/native-select.js.map +1 -1
  154. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  155. package/dist/components/ui/pagination/pagination.js.map +1 -1
  156. package/dist/components/ui/popover/popover.js.map +1 -1
  157. package/dist/components/ui/progress/progress.js.map +1 -1
  158. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  159. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  160. package/dist/components/ui/resizable/resizable.js.map +1 -1
  161. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  162. package/dist/components/ui/select/select.js.map +1 -1
  163. package/dist/components/ui/separator/separator.js.map +1 -1
  164. package/dist/components/ui/sheet/sheet.js.map +1 -1
  165. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  166. package/dist/components/ui/slider/slider.js.map +1 -1
  167. package/dist/components/ui/spinner/spinner.js.map +1 -1
  168. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  169. package/dist/components/ui/switch/switch.js.map +1 -1
  170. package/dist/components/ui/table/table.js.map +1 -1
  171. package/dist/components/ui/tabs/tabs.js.map +1 -1
  172. package/dist/components/ui/text-link/text-link.js.map +1 -1
  173. package/dist/components/ui/textarea/textarea.js.map +1 -1
  174. package/dist/components/ui/toast/toast.js.map +1 -1
  175. package/dist/components/ui/toggle/toggle.js.map +1 -1
  176. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  177. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  178. package/dist/components/ui/trace/trace.js.map +1 -1
  179. package/dist/components/ui/typography/typography.js.map +1 -1
  180. package/dist/r/about-dialog.json +1 -1
  181. package/dist/r/accordion.json +1 -1
  182. package/dist/r/account-menu.json +1 -1
  183. package/dist/r/alert.json +1 -1
  184. package/dist/r/appearance-editor.json +1 -1
  185. package/dist/r/attachment.json +1 -1
  186. package/dist/r/breadcrumb.json +1 -1
  187. package/dist/r/calendar.json +1 -1
  188. package/dist/r/carousel.json +1 -1
  189. package/dist/r/catalog-browser.json +1 -1
  190. package/dist/r/chain-of-thought.json +1 -1
  191. package/dist/r/chat.json +1 -1
  192. package/dist/r/checkbox.json +1 -1
  193. package/dist/r/checkpoint.json +1 -1
  194. package/dist/r/code-block.json +1 -1
  195. package/dist/r/combobox.json +1 -1
  196. package/dist/r/command.json +1 -1
  197. package/dist/r/confirmation.json +1 -1
  198. package/dist/r/context.json +1 -1
  199. package/dist/r/conversation.json +1 -1
  200. package/dist/r/detail-panel.json +1 -1
  201. package/dist/r/dialog.json +1 -1
  202. package/dist/r/dropdown-menu.json +1 -1
  203. package/dist/r/empty.json +1 -1
  204. package/dist/r/file-tree.json +1 -1
  205. package/dist/r/floating-preview.json +1 -1
  206. package/dist/r/help-center.json +1 -1
  207. package/dist/r/icon-picker.json +1 -1
  208. package/dist/r/inline-citation.json +1 -1
  209. package/dist/r/lib.json +1 -1
  210. package/dist/r/message-scroller.json +1 -1
  211. package/dist/r/model-selector.json +1 -1
  212. package/dist/r/native-select.json +1 -1
  213. package/dist/r/navigation-menu.json +1 -1
  214. package/dist/r/pagination.json +1 -1
  215. package/dist/r/pixel-resize-handle.json +1 -1
  216. package/dist/r/plan.json +1 -1
  217. package/dist/r/questionnaire.json +1 -1
  218. package/dist/r/queue.json +1 -1
  219. package/dist/r/radio-group.json +1 -1
  220. package/dist/r/reasoning.json +1 -1
  221. package/dist/r/registry.json +65 -65
  222. package/dist/r/resizable.json +1 -1
  223. package/dist/r/scene-controls.json +1 -1
  224. package/dist/r/select.json +1 -1
  225. package/dist/r/settings.json +1 -1
  226. package/dist/r/sheet.json +1 -1
  227. package/dist/r/shell-rail.json +1 -1
  228. package/dist/r/sidebar-nav.json +1 -1
  229. package/dist/r/sources.json +1 -1
  230. package/dist/r/spinner.json +1 -1
  231. package/dist/r/split-layout.json +1 -1
  232. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +2 -2
  233. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
  234. package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -1
  235. package/dist/r/src/components/composites/terminal/terminal.tsx +2 -2
  236. package/dist/r/src/components/composites/update-dialog/channel-control.tsx +3 -3
  237. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +3 -5
  238. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
  239. package/dist/r/src/components/conversation/message-composer.tsx +1 -2
  240. package/dist/r/src/components/layout/split-layout/split-layout.tsx +1 -1
  241. package/dist/r/src/components/theme/appearance-panel.tsx +2 -4
  242. package/dist/r/stack-trace.json +1 -1
  243. package/dist/r/stat.json +1 -1
  244. package/dist/r/subagent.json +1 -1
  245. package/dist/r/task.json +1 -1
  246. package/dist/r/terminal.json +1 -1
  247. package/dist/r/test-results.json +1 -1
  248. package/dist/r/theming.json +1 -1
  249. package/dist/r/toast.json +1 -1
  250. package/dist/r/tool.json +1 -1
  251. package/dist/r/top-bar.json +1 -1
  252. package/dist/r/trace.json +1 -1
  253. package/dist/r/tree.json +1 -1
  254. package/dist/r/update-dialog.json +1 -1
  255. package/dist/r/workspace-switcher.json +1 -1
  256. package/dist/vite/tailwind-sources.d.ts.map +1 -1
  257. package/dist/vite/tailwind-sources.js +49 -9
  258. package/dist/vite/tailwind-sources.js.map +1 -1
  259. package/package.json +11 -11
  260. package/registry.json +65 -65
  261. package/src/components/composites/about-dialog/about-dialog.tsx +2 -2
  262. package/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
  263. package/src/components/composites/model-selector/model-selector.tsx +4 -1
  264. package/src/components/composites/terminal/terminal.tsx +2 -2
  265. package/src/components/composites/update-dialog/channel-control.tsx +3 -3
  266. package/src/components/composites/update-dialog/update-dialog.tsx +3 -5
  267. package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
  268. package/src/components/conversation/message-composer.tsx +1 -2
  269. package/src/components/layout/split-layout/split-layout.tsx +1 -1
  270. package/src/components/theme/appearance-panel.tsx +2 -4
  271. package/src/vite/tailwind-sources.ts +67 -7
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":["For","Show","createSignal","onCleanup","onMount","splitProps","JSX","Dynamic","Bar","Bubble","Doughnut","Line","Pie","PolarArea","Radar","Scatter","Chart","ChartJs","ArcElement","BarElement","CategoryScale","Filler","Legend","LineElement","LinearScale","LogarithmicScale","PointElement","RadialLinearScale","Tooltip","ChartTooltip","ChartOptions","ChartType","Plugin","cn","chartOptions","chartSeriesColors","mergeChartOptions","resolveCssVariables","ChartScaleShape","registerChartPiece","piece","Parameters","register","swatch","CanvasRenderingContext2D","toCanvasColor","value","CSS","supports","undefined","canvas","document","createElement","width","height","getContext","willReadFrequently","globalCompositeOperation","fillStyle","fillRect","r","g","b","a","getImageData","data","Math","round","length","toCanvasValue","raw","match","exec","Number","parseFloat","getComputedStyle","documentElement","fontSize","createThemeResolver","element","HTMLElement","revision","invalidate","equals","onFontsLoaded","observer","MutationObserver","observe","attributes","fonts","addEventListener","disconnect","removeEventListener","ref","el","resolve","T","style","resolved","Map","name","has","getPropertyValue","trim","set","get","ChartFrameProps","title","description","actions","Element","children","class","ChartFrame","props","local","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","_$insert","_$createComponent","when","_el$5","_tmpl$","_$effect","_$className","SeriesChartProps","labels","series","label","color","options","stacked","datasetsFor","filled","map","entry","index","borderColor","backgroundColor","pointBackgroundColor","borderWidth","pointRadius","pointHoverRadius","tension","fill","seriesOptions","extra","shape","scales","x","y","LineChart","area","theme","_el$6","_tmpl$3","_ref$","_$use","datasets","BarChart","horizontal","_el$7","_ref$2","dataset","borderRadius","indexAxis","ScatterChart","_el$8","_ref$3","point","BubbleChart","_el$9","_ref$4","RadarChart","_el$0","_ref$5","restoreRadialScale","id","afterInit","chart","scale","PolarAreaChart","_el$1","_ref$6","plugins","DonutChart","cutout","component","_el$10","_ref$7","_","ChartLegend","_el$11","_tmpl$4","each","_el$12","_tmpl$5","_el$13","_$p","_$setStyleProperty","ChartJs","ChartTooltip","_$createComponent","_$className","_$use","_$setStyleProperty"],"sources":["../../../../src/components/ui/chart/chart.tsx"],"sourcesContent":["import { For, Show, createSignal, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, Scatter } from 'solid-chartjs'\nimport {\n Chart as ChartJs,\n ArcElement,\n BarElement,\n CategoryScale,\n Filler,\n Legend,\n LineElement,\n LinearScale,\n LogarithmicScale,\n PointElement,\n RadialLinearScale,\n Tooltip as ChartTooltip,\n} from 'chart.js'\nimport type { ChartOptions, ChartType, Plugin } from 'chart.js'\nimport { cn } from '#lib/utils'\nimport {\n chartOptions,\n chartSeriesColors,\n mergeChartOptions,\n resolveCssVariables,\n type ChartScaleShape,\n} from './chart-options'\n\n/**\n * Chart.\n *\n * A thin wrapper over Chart.js, themed through the same CSS custom properties as\n * everything else. The wrapper is thin on purpose: a design system's job here is\n * to make a chart *look like the rest of the application* — the palette, the\n * type scale, the tooltip surface, the grid lines — and not to re-implement\n * scales and axes, which is where a hand-rolled chart goes wrong.\n *\n * ## Registration, and why it is here rather than left to the caller\n *\n * Chart.js is tree-shakeable through explicit registration: nothing is bundled\n * until a controller, a scale or a plugin is registered. That is the whole reason\n * it was chosen over a batteries-included charting library, and it only pays off\n * if the registrations are scoped to what a component actually uses.\n *\n * This module registers the **shared** pieces once — scales, elements, tooltip,\n * legend, filler — and nothing else. The controllers are imported per component\n * so a `LineChart` does not carry the radar controller, and a consumer that\n * imports only `LineChart` gets only that. Measured: see the story for the\n * per-component figures the tree-shaking gate publishes.\n *\n * A caller with a chart type this file does not export registers its own\n * controller with `registerChartPiece`, which is the escape hatch rather than a\n * reason to widen the registration above.\n *\n * ## Theming\n *\n * Colours come from `--chart-1` through `--chart-5`, which every theme\n * defines, and the grid, ticks and labels from `--border` and\n * `--muted-foreground`. That means a chart follows the accent axis and the\n * appearance with no per-chart configuration — and a caller that wants a\n * specific series colour passes it explicitly, as a colour or as `var(--token)`.\n *\n * A canvas cannot read a custom property, so the options and datasets carry\n * `var(--token)` strings and each chart resolves them against its own element\n * when it renders, and again whenever the root's attributes change — the\n * `.dark` class, `data-accent`, `data-font`, an inline override. The type is\n * resolved the same way: `--font-sans` for the family and a type-scale rung for\n * the size, so a chart follows the font axis too. See `createThemeResolver`.\n */\n\n/**\n * Register a piece with Chart.js. The escape hatch for a caller's own chart type.\n *\n * `solid-chartjs` re-exports the typed components but not the registry, so\n * registration comes from `chart.js` itself — which is also the honest place for\n * it, since the registry is Chart.js's global.\n */\nexport function registerChartPiece(piece: Parameters<typeof ChartJs.register>[number]): void {\n ChartJs.register(piece)\n}\n\nChartJs.register(\n CategoryScale,\n LinearScale,\n LogarithmicScale,\n RadialLinearScale,\n PointElement,\n LineElement,\n BarElement,\n ArcElement,\n Filler,\n ChartTooltip,\n Legend\n)\n\nexport { chartOptions, chartSeriesColors }\n\n/**\n * One pixel to paint a colour on, shared by every chart.\n *\n * The canvas *paints* `oklch()`, but Chart.js also *parses* colours — to derive a\n * hover shade and to animate between two colours — and its parser reads only\n * rgb, hsl, hex and names. Painting the computed value and reading the pixel\n * back gives the sRGB colour the canvas would have drawn anyway, in a form both\n * understand, whatever syntax a theme uses (`oklch()`, `color-mix()`, …).\n */\nlet swatch: CanvasRenderingContext2D | null | undefined\n\nfunction toCanvasColor(value: string): string {\n if (typeof CSS === 'undefined' || !CSS.supports('color', value)) return value\n if (swatch === undefined) {\n const canvas = document.createElement('canvas')\n canvas.width = 1\n canvas.height = 1\n swatch = canvas.getContext('2d', { willReadFrequently: true })\n }\n if (!swatch) return value\n swatch.globalCompositeOperation = 'copy'\n swatch.fillStyle = value\n swatch.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = swatch.getImageData(0, 0, 1, 1).data\n return `rgba(${r}, ${g}, ${b}, ${Math.round(((a ?? 255) / 255) * 1000) / 1000})`\n}\n\nconst length = /^(-?\\d*\\.?\\d+)(px|rem)$/\n\n/**\n * A token's computed value as a canvas option: a colour as an sRGB colour, a\n * `px`/`rem` length (a type-scale rung) as the number of pixels Chart.js wants,\n * and anything else — a font stack — as written.\n */\nfunction toCanvasValue(raw: string): string | number {\n const match = length.exec(raw)\n if (match) {\n const value = Number(match[1])\n if (match[2] === 'px') return value\n return value * (Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16)\n }\n return toCanvasColor(raw)\n}\n\n/**\n * Resolves `var(--token)` strings against a chart's element, and re-resolves\n * them when the theme changes.\n *\n * The element rather than the root, so a chart inside a subtree with its own\n * inline tokens takes those. The observer watches every attribute on `<html>`,\n * because that is where both applications switch appearance, accent and theme\n * (`.dark`, `data-accent`, `data-theme`, inline variables); a theme axis added\n * later is covered without touching this. It also re-resolves when a web font\n * finishes loading: a canvas draws text once, so a chart rendered before the\n * face selected by `data-font` arrived would otherwise keep the fallback face\n * until something else redrew it. Both are released with the chart.\n */\nfunction createThemeResolver() {\n let element: HTMLElement | undefined\n const [revision, invalidate] = createSignal(undefined, { equals: false })\n const onFontsLoaded = () => invalidate()\n\n onMount(() => {\n const observer = new MutationObserver(() => invalidate())\n observer.observe(document.documentElement, { attributes: true })\n const fonts = typeof document.fonts === 'undefined' ? undefined : document.fonts\n fonts?.addEventListener('loadingdone', onFontsLoaded)\n onCleanup(() => {\n observer.disconnect()\n fonts?.removeEventListener('loadingdone', onFontsLoaded)\n })\n })\n\n return {\n ref: (el: HTMLElement) => {\n element = el\n },\n resolve<T>(value: T): T {\n revision()\n if (!element || typeof getComputedStyle === 'undefined') return value\n const style = getComputedStyle(element)\n const resolved = new Map<string, string | number | undefined>()\n return resolveCssVariables(value, (name) => {\n if (!resolved.has(name)) {\n const raw = style.getPropertyValue(name).trim()\n resolved.set(name, raw ? toCanvasValue(raw) : undefined)\n }\n return resolved.get(name)\n })\n },\n }\n}\n\n/** A chart's frame: a bordered surface with a title and an optional description. */\nexport type ChartFrameProps = {\n /** The chart's title. Required — a chart with no name is not readable. */\n title: string\n /** What the chart shows. Announced to assistive technology, and drawn. */\n description?: string\n actions?: JSX.Element\n children: JSX.Element\n class?: string\n}\n\nexport function ChartFrame(props: ChartFrameProps) {\n const [local] = splitProps(props, ['title', 'description', 'actions', 'children', 'class'])\n\n return (\n <figure class={cn('grid gap-3 rounded-lg border border-border bg-card p-4', local.class)}>\n <figcaption class=\"flex items-start justify-between gap-3\">\n <div>\n <h3 class=\"text-sm font-semibold text-foreground\">{local.title}</h3>\n <Show when={local.description}>\n <p class=\"text-xs text-muted-foreground\">{local.description}</p>\n </Show>\n </div>\n {local.actions}\n </figcaption>\n {local.children}\n </figure>\n )\n}\n\ntype SeriesChartProps = {\n labels: readonly string[]\n /** One entry per series. `data` is aligned to `labels`. */\n series: readonly { label: string; data: readonly number[]; color?: string }[]\n /** Chart.js options, merged deeply over the theme's defaults. */\n options?: ChartOptions\n stacked?: boolean\n class?: string\n}\n\n/**\n * The data as Chart.js datasets, with the theme's colours applied in order and\n * the series' own colour winning when it has one.\n *\n * `fill: false` and a 2px border are deliberate: a filled line chart is a\n * different chart, and a 1px line at a 12px label size reads as a grid line.\n */\nfunction datasetsFor(series: SeriesChartProps['series'], filled: boolean) {\n return series.map((entry, index) => ({\n label: entry.label,\n data: [...entry.data],\n borderColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointBackgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n borderWidth: 2,\n pointRadius: 0,\n pointHoverRadius: 4,\n tension: 0.3,\n fill: filled,\n }))\n}\n\nfunction seriesOptions(\n props: SeriesChartProps,\n extra?: ChartOptions,\n shape: ChartScaleShape = 'cartesian'\n): ChartOptions {\n // Stacking is a cartesian idea; a radar has no x or y to stack, and naming\n // them would make Chart.js draw them.\n const stacked =\n props.stacked && shape === 'cartesian'\n ? { scales: { x: { stacked: true }, y: { stacked: true } } }\n : undefined\n return chartOptions(mergeChartOptions(extra, stacked, props.options), shape)\n}\n\n/** A line chart. The default for a series over time. */\nexport function LineChart(props: SeriesChartProps & { area?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Line\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, props.area ?? false),\n })}\n options={theme.resolve(seriesOptions(props))}\n />\n </div>\n )\n}\n\n/** A bar chart. `stacked` for parts of a whole over categories. */\nexport function BarChart(props: SeriesChartProps & { horizontal?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true).map((dataset) => ({\n ...dataset,\n borderWidth: 0,\n borderRadius: 3,\n })),\n })}\n options={theme.resolve(seriesOptions(props, { indexAxis: props.horizontal ? 'y' : 'x' }))}\n />\n </div>\n )\n}\n\n/** A scatter plot, for a correlation rather than a series. */\nexport function ScatterChart(props: {\n series: readonly { label: string; data: readonly { x: number; y: number }[]; color?: string }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Scatter\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointRadius: 3,\n pointHoverRadius: 5,\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A bubble chart: scatter with a third dimension carried by the radius. */\nexport function BubbleChart(props: {\n series: readonly {\n label: string\n data: readonly { x: number; y: number; r: number }[]\n color?: string\n }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bubble\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A radar chart, for a profile across fixed axes. */\nexport function RadarChart(props: SeriesChartProps) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Radar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true),\n })}\n options={theme.resolve(seriesOptions(props, undefined, 'radial'))}\n />\n </div>\n )\n}\n\n/**\n * Puts the themed radial scale back on a chart `solid-chartjs` has just created.\n *\n * `solid-chartjs` deletes `options.scales.r` for every chart type but radar when\n * it first creates a chart. Today that delete lands on a throwaway copy — Solid\n * compiles `options={…}` to a getter, so its next read rebuilds the object with\n * `r` intact — but that is an accident of how the prop is passed: a memoised or\n * static options object would lose the scale, and the polar area would fall back\n * to Chart.js's defaults (grey ticks on a translucent white box, which is a white\n * box on a dark card). Restoring it from this component's own options makes the\n * themed scale independent of both. Later option updates (every theme change)\n * pass `r` through untouched; only creation drops it.\n *\n * `afterInit` runs inside Chart.js's constructor, after the options are read and\n * before the first update builds the scales and draws, so the themed scale is in\n * place for the first frame — no default-styled frame, and no extra update. The\n * plugin is per instance, passed through the chart's `plugins` prop, so nothing\n * is registered globally.\n */\nfunction restoreRadialScale(options: () => ChartOptions): Plugin {\n return {\n id: 'adea-radial-scale',\n afterInit(chart) {\n const scale = options().scales?.['r']\n if (!scale) return\n chart.options.scales = { ...chart.options.scales, r: scale }\n },\n }\n}\n\n/** A polar area chart: radial bars, for a composition. */\nexport function PolarAreaChart(props: {\n labels: readonly string[]\n data: readonly number[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n const options = () => theme.resolve(chartOptions(props.options, 'radial'))\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <PolarArea\n plugins={[restoreRadialScale(options)]}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: [...chartSeriesColors],\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={options()}\n />\n </div>\n )\n}\n\n/**\n * A doughnut or a pie, for a composition with few enough slices to name.\n *\n * Both are one component because the only difference is the hole, and a caller\n * choosing between them is choosing a ratio rather than a chart. `cutout` is the\n * hole's share of the radius: 0 is a pie, 60% is the doughnut most dashboards\n * mean. A composition with more than about six slices should be a bar chart —\n * past that, the smallest slices become unreadable and their labels collide.\n */\nexport function DonutChart(props: {\n labels: readonly string[]\n data: readonly number[]\n /** The hole, as a percentage of the radius. 0 for a pie. */\n cutout?: number\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n // `Dynamic` rather than a local component accessor: Solid's JSX types require\n // a component reference, and an accessor returning one is a call in disguise.\n const component = () => (props.cutout === 0 ? Pie : Doughnut)\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Dynamic\n component={component()}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: props.labels.map(\n (_, index) => chartSeriesColors[index % chartSeriesColors.length]\n ),\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={theme.resolve(\n chartOptions(\n mergeChartOptions(\n props.cutout === 0\n ? undefined\n : ({\n cutout: `${props.cutout ?? 60}%`,\n } satisfies ChartOptions<'doughnut'> as ChartOptions),\n props.options\n ),\n 'none'\n )\n )}\n />\n </div>\n )\n}\n\n/** A legend built from the same five colours, for a chart whose legend is elsewhere. */\nexport function ChartLegend(props: {\n series: readonly { label: string; color?: string }[]\n class?: string\n}) {\n return (\n <ul class={cn('flex flex-wrap items-center gap-x-3 gap-y-1', props.class)}>\n <For each={props.series}>\n {(entry, index) => (\n <li class=\"flex items-center gap-1.5 text-2xs text-muted-foreground\">\n <span\n class=\"size-2 shrink-0 rounded-full\"\n style={{\n background: entry.color ?? chartSeriesColors[index() % chartSeriesColors.length],\n }}\n aria-hidden=\"true\"\n />\n {entry.label}\n </li>\n )}\n </For>\n </ul>\n )\n}\n\nexport type { ChartType, ChartOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgBuC,mBAAmBC,OAA0D;CAC3FvB,MAAQyB,SAASF,KAAK;AACxB;AAEAvB,MAAQyB,SACNtB,eACAI,aACAC,kBACAE,mBACAD,cACAH,aACAJ,YACAD,YACAG,QACA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C;IAEL,CAAC;GAAC;GAAA,IACFV,UAAO;IAAA,OAAEuB,MAAM9D,QACb7D,aACEE,kBACE8E,MAAM4E,WAAW,IACb7I,KAAAA,IACC,EACC6I,QAAQ,GAAG5E,MAAM4E,UAAU,GAAE,GAC/B,GACJ5E,MAAMoB,OACR,GACA,MACF,CACF;GAAC;EAAA,CAAA,CAAA;EAAAP,aAAAC,UAAAgE,QA5BuB/J,GAAG,QAAQiF,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAAgF;CAAA,EAAA,CAAA;AAgCvD;;AAGA,SAAgBG,YAAYjF,OAGzB;CACD,cAAA;EAAA,IAAAkF,SAAAC,QAAA;EAAA3E,OAAA0E,QAAAzE,gBAEK3H,KAAG;GAAA,IAACsM,OAAI;IAAA,OAAEpF,MAAMiB;GAAM;GAAApB,WACnB4B,OAAOC,iBAAK;IAAA,IAAA2D,SAAAC,QAAA,GAAAC,SAAAF,OAAAhF;IAAAG,OAAA6E,cAST5D,MAAMP,OAAK,IAAA;IAAAL,QAAA2E,QAAAC,iBAAAF,QAAA,cAJI9D,MAAMN,SAASlG,kBAAkByG,MAAM,IAAIzG,kBAAkBiC,OAAO,CAAA;IAAA,OAAAmI;GAAA,EAAA,CAAA;EAMvF,CAAA,CAAA;EAAAxE,aAAAC,UAAAoE,QAbMnK,GAAG,+CAA+CiF,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAAoF;CAAA,EAAA,CAAA;AAiB7E"}
1
+ {"version":3,"file":"chart.js","names":["For","Show","createSignal","onCleanup","onMount","splitProps","Dynamic","Bar","Bubble","Doughnut","Line","Pie","PolarArea","Radar","Scatter","ChartJs","ArcElement","BarElement","CategoryScale","Filler","Legend","LineElement","LinearScale","LogarithmicScale","PointElement","RadialLinearScale","ChartTooltip","cn","chartOptions","chartSeriesColors","mergeChartOptions","resolveCssVariables","registerChartPiece","piece","register","swatch","toCanvasColor","value","CSS","supports","undefined","canvas","document","createElement","width","height","getContext","willReadFrequently","globalCompositeOperation","fillStyle","fillRect","r","g","b","a","getImageData","data","Math","round","length","toCanvasValue","raw","match","exec","Number","parseFloat","getComputedStyle","documentElement","fontSize","createThemeResolver","element","revision","invalidate","equals","onFontsLoaded","observer","MutationObserver","observe","attributes","fonts","addEventListener","disconnect","removeEventListener","ref","el","resolve","style","resolved","Map","name","has","getPropertyValue","trim","set","get","title","description","actions","children","class","ChartFrame","props","local","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","_$insert","_$createComponent","when","_el$5","_tmpl$","_$effect","_$className","labels","series","label","color","options","stacked","datasetsFor","filled","map","entry","index","borderColor","backgroundColor","pointBackgroundColor","borderWidth","pointRadius","pointHoverRadius","tension","fill","seriesOptions","extra","shape","scales","x","y","LineChart","area","theme","_el$6","_tmpl$3","_ref$","_$use","datasets","BarChart","horizontal","_el$7","_ref$2","dataset","borderRadius","indexAxis","ScatterChart","_el$8","_ref$3","point","BubbleChart","_el$9","_ref$4","RadarChart","_el$0","_ref$5","restoreRadialScale","id","afterInit","chart","scale","PolarAreaChart","_el$1","_ref$6","plugins","DonutChart","cutout","component","_el$10","_ref$7","_","ChartLegend","_el$11","_tmpl$4","each","_el$12","_tmpl$5","_el$13","_$p","_$setStyleProperty"],"sources":["../../../../src/components/ui/chart/chart.tsx"],"sourcesContent":["import { For, Show, createSignal, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, Scatter } from 'solid-chartjs'\nimport {\n Chart as ChartJs,\n ArcElement,\n BarElement,\n CategoryScale,\n Filler,\n Legend,\n LineElement,\n LinearScale,\n LogarithmicScale,\n PointElement,\n RadialLinearScale,\n Tooltip as ChartTooltip,\n} from 'chart.js'\nimport type { ChartOptions, ChartType, Plugin } from 'chart.js'\nimport { cn } from '#lib/utils'\nimport {\n chartOptions,\n chartSeriesColors,\n mergeChartOptions,\n resolveCssVariables,\n type ChartScaleShape,\n} from './chart-options'\n\n/**\n * Chart.\n *\n * A thin wrapper over Chart.js, themed through the same CSS custom properties as\n * everything else. The wrapper is thin on purpose: a design system's job here is\n * to make a chart *look like the rest of the application* — the palette, the\n * type scale, the tooltip surface, the grid lines — and not to re-implement\n * scales and axes, which is where a hand-rolled chart goes wrong.\n *\n * ## Registration, and why it is here rather than left to the caller\n *\n * Chart.js is tree-shakeable through explicit registration: nothing is bundled\n * until a controller, a scale or a plugin is registered. That is the whole reason\n * it was chosen over a batteries-included charting library, and it only pays off\n * if the registrations are scoped to what a component actually uses.\n *\n * This module registers the **shared** pieces once — scales, elements, tooltip,\n * legend, filler — and nothing else. The controllers are imported per component\n * so a `LineChart` does not carry the radar controller, and a consumer that\n * imports only `LineChart` gets only that. Measured: see the story for the\n * per-component figures the tree-shaking gate publishes.\n *\n * A caller with a chart type this file does not export registers its own\n * controller with `registerChartPiece`, which is the escape hatch rather than a\n * reason to widen the registration above.\n *\n * ## Theming\n *\n * Colours come from `--chart-1` through `--chart-5`, which every theme\n * defines, and the grid, ticks and labels from `--border` and\n * `--muted-foreground`. That means a chart follows the accent axis and the\n * appearance with no per-chart configuration — and a caller that wants a\n * specific series colour passes it explicitly, as a colour or as `var(--token)`.\n *\n * A canvas cannot read a custom property, so the options and datasets carry\n * `var(--token)` strings and each chart resolves them against its own element\n * when it renders, and again whenever the root's attributes change — the\n * `.dark` class, `data-accent`, `data-font`, an inline override. The type is\n * resolved the same way: `--font-sans` for the family and a type-scale rung for\n * the size, so a chart follows the font axis too. See `createThemeResolver`.\n */\n\n/**\n * Register a piece with Chart.js. The escape hatch for a caller's own chart type.\n *\n * `solid-chartjs` re-exports the typed components but not the registry, so\n * registration comes from `chart.js` itself — which is also the honest place for\n * it, since the registry is Chart.js's global.\n */\nexport function registerChartPiece(piece: Parameters<typeof ChartJs.register>[number]): void {\n ChartJs.register(piece)\n}\n\nChartJs.register(\n CategoryScale,\n LinearScale,\n LogarithmicScale,\n RadialLinearScale,\n PointElement,\n LineElement,\n BarElement,\n ArcElement,\n Filler,\n ChartTooltip,\n Legend\n)\n\nexport { chartOptions, chartSeriesColors }\n\n/**\n * One pixel to paint a colour on, shared by every chart.\n *\n * The canvas *paints* `oklch()`, but Chart.js also *parses* colours — to derive a\n * hover shade and to animate between two colours — and its parser reads only\n * rgb, hsl, hex and names. Painting the computed value and reading the pixel\n * back gives the sRGB colour the canvas would have drawn anyway, in a form both\n * understand, whatever syntax a theme uses (`oklch()`, `color-mix()`, …).\n */\nlet swatch: CanvasRenderingContext2D | null | undefined\n\nfunction toCanvasColor(value: string): string {\n if (typeof CSS === 'undefined' || !CSS.supports('color', value)) return value\n if (swatch === undefined) {\n const canvas = document.createElement('canvas')\n canvas.width = 1\n canvas.height = 1\n swatch = canvas.getContext('2d', { willReadFrequently: true })\n }\n if (!swatch) return value\n swatch.globalCompositeOperation = 'copy'\n swatch.fillStyle = value\n swatch.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = swatch.getImageData(0, 0, 1, 1).data\n return `rgba(${r}, ${g}, ${b}, ${Math.round(((a ?? 255) / 255) * 1000) / 1000})`\n}\n\nconst length = /^(-?\\d*\\.?\\d+)(px|rem)$/\n\n/**\n * A token's computed value as a canvas option: a colour as an sRGB colour, a\n * `px`/`rem` length (a type-scale rung) as the number of pixels Chart.js wants,\n * and anything else — a font stack — as written.\n */\nfunction toCanvasValue(raw: string): string | number {\n const match = length.exec(raw)\n if (match) {\n const value = Number(match[1])\n if (match[2] === 'px') return value\n return value * (Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16)\n }\n return toCanvasColor(raw)\n}\n\n/**\n * Resolves `var(--token)` strings against a chart's element, and re-resolves\n * them when the theme changes.\n *\n * The element rather than the root, so a chart inside a subtree with its own\n * inline tokens takes those. The observer watches every attribute on `<html>`,\n * because that is where both applications switch appearance, accent and theme\n * (`.dark`, `data-accent`, `data-theme`, inline variables); a theme axis added\n * later is covered without touching this. It also re-resolves when a web font\n * finishes loading: a canvas draws text once, so a chart rendered before the\n * face selected by `data-font` arrived would otherwise keep the fallback face\n * until something else redrew it. Both are released with the chart.\n */\nfunction createThemeResolver() {\n let element: HTMLElement | undefined\n const [revision, invalidate] = createSignal(undefined, { equals: false })\n const onFontsLoaded = () => invalidate()\n\n onMount(() => {\n const observer = new MutationObserver(() => invalidate())\n observer.observe(document.documentElement, { attributes: true })\n const fonts = typeof document.fonts === 'undefined' ? undefined : document.fonts\n fonts?.addEventListener('loadingdone', onFontsLoaded)\n onCleanup(() => {\n observer.disconnect()\n fonts?.removeEventListener('loadingdone', onFontsLoaded)\n })\n })\n\n return {\n ref: (el: HTMLElement) => {\n element = el\n },\n resolve<T>(value: T): T {\n revision()\n if (!element || typeof getComputedStyle === 'undefined') return value\n const style = getComputedStyle(element)\n const resolved = new Map<string, string | number | undefined>()\n return resolveCssVariables(value, (name) => {\n if (!resolved.has(name)) {\n const raw = style.getPropertyValue(name).trim()\n resolved.set(name, raw ? toCanvasValue(raw) : undefined)\n }\n return resolved.get(name)\n })\n },\n }\n}\n\n/** A chart's frame: a bordered surface with a title and an optional description. */\nexport type ChartFrameProps = {\n /** The chart's title. Required — a chart with no name is not readable. */\n title: string\n /** What the chart shows. Announced to assistive technology, and drawn. */\n description?: string\n actions?: JSX.Element\n children: JSX.Element\n class?: string\n}\n\nexport function ChartFrame(props: ChartFrameProps) {\n const [local] = splitProps(props, ['title', 'description', 'actions', 'children', 'class'])\n\n return (\n <figure class={cn('grid gap-3 rounded-lg border border-border bg-card p-4', local.class)}>\n <figcaption class=\"flex items-start justify-between gap-3\">\n <div>\n <h3 class=\"text-sm font-semibold text-foreground\">{local.title}</h3>\n <Show when={local.description}>\n <p class=\"text-xs text-muted-foreground\">{local.description}</p>\n </Show>\n </div>\n {local.actions}\n </figcaption>\n {local.children}\n </figure>\n )\n}\n\ntype SeriesChartProps = {\n labels: readonly string[]\n /** One entry per series. `data` is aligned to `labels`. */\n series: readonly { label: string; data: readonly number[]; color?: string }[]\n /** Chart.js options, merged deeply over the theme's defaults. */\n options?: ChartOptions\n stacked?: boolean\n class?: string\n}\n\n/**\n * The data as Chart.js datasets, with the theme's colours applied in order and\n * the series' own colour winning when it has one.\n *\n * `fill: false` and a 2px border are deliberate: a filled line chart is a\n * different chart, and a 1px line at a 12px label size reads as a grid line.\n */\nfunction datasetsFor(series: SeriesChartProps['series'], filled: boolean) {\n return series.map((entry, index) => ({\n label: entry.label,\n data: [...entry.data],\n borderColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointBackgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n borderWidth: 2,\n pointRadius: 0,\n pointHoverRadius: 4,\n tension: 0.3,\n fill: filled,\n }))\n}\n\nfunction seriesOptions(\n props: SeriesChartProps,\n extra?: ChartOptions,\n shape: ChartScaleShape = 'cartesian'\n): ChartOptions {\n // Stacking is a cartesian idea; a radar has no x or y to stack, and naming\n // them would make Chart.js draw them.\n const stacked =\n props.stacked && shape === 'cartesian'\n ? { scales: { x: { stacked: true }, y: { stacked: true } } }\n : undefined\n return chartOptions(mergeChartOptions(extra, stacked, props.options), shape)\n}\n\n/** A line chart. The default for a series over time. */\nexport function LineChart(props: SeriesChartProps & { area?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Line\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, props.area ?? false),\n })}\n options={theme.resolve(seriesOptions(props))}\n />\n </div>\n )\n}\n\n/** A bar chart. `stacked` for parts of a whole over categories. */\nexport function BarChart(props: SeriesChartProps & { horizontal?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true).map((dataset) => ({\n ...dataset,\n borderWidth: 0,\n borderRadius: 3,\n })),\n })}\n options={theme.resolve(seriesOptions(props, { indexAxis: props.horizontal ? 'y' : 'x' }))}\n />\n </div>\n )\n}\n\n/** A scatter plot, for a correlation rather than a series. */\nexport function ScatterChart(props: {\n series: readonly { label: string; data: readonly { x: number; y: number }[]; color?: string }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Scatter\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointRadius: 3,\n pointHoverRadius: 5,\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A bubble chart: scatter with a third dimension carried by the radius. */\nexport function BubbleChart(props: {\n series: readonly {\n label: string\n data: readonly { x: number; y: number; r: number }[]\n color?: string\n }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bubble\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A radar chart, for a profile across fixed axes. */\nexport function RadarChart(props: SeriesChartProps) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Radar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true),\n })}\n options={theme.resolve(seriesOptions(props, undefined, 'radial'))}\n />\n </div>\n )\n}\n\n/**\n * Puts the themed radial scale back on a chart `solid-chartjs` has just created.\n *\n * `solid-chartjs` deletes `options.scales.r` for every chart type but radar when\n * it first creates a chart. Today that delete lands on a throwaway copy — Solid\n * compiles `options={…}` to a getter, so its next read rebuilds the object with\n * `r` intact — but that is an accident of how the prop is passed: a memoised or\n * static options object would lose the scale, and the polar area would fall back\n * to Chart.js's defaults (grey ticks on a translucent white box, which is a white\n * box on a dark card). Restoring it from this component's own options makes the\n * themed scale independent of both. Later option updates (every theme change)\n * pass `r` through untouched; only creation drops it.\n *\n * `afterInit` runs inside Chart.js's constructor, after the options are read and\n * before the first update builds the scales and draws, so the themed scale is in\n * place for the first frame — no default-styled frame, and no extra update. The\n * plugin is per instance, passed through the chart's `plugins` prop, so nothing\n * is registered globally.\n */\nfunction restoreRadialScale(options: () => ChartOptions): Plugin {\n return {\n id: 'adea-radial-scale',\n afterInit(chart) {\n const scale = options().scales?.['r']\n if (!scale) return\n chart.options.scales = { ...chart.options.scales, r: scale }\n },\n }\n}\n\n/** A polar area chart: radial bars, for a composition. */\nexport function PolarAreaChart(props: {\n labels: readonly string[]\n data: readonly number[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n const options = () => theme.resolve(chartOptions(props.options, 'radial'))\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <PolarArea\n plugins={[restoreRadialScale(options)]}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: [...chartSeriesColors],\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={options()}\n />\n </div>\n )\n}\n\n/**\n * A doughnut or a pie, for a composition with few enough slices to name.\n *\n * Both are one component because the only difference is the hole, and a caller\n * choosing between them is choosing a ratio rather than a chart. `cutout` is the\n * hole's share of the radius: 0 is a pie, 60% is the doughnut most dashboards\n * mean. A composition with more than about six slices should be a bar chart —\n * past that, the smallest slices become unreadable and their labels collide.\n */\nexport function DonutChart(props: {\n labels: readonly string[]\n data: readonly number[]\n /** The hole, as a percentage of the radius. 0 for a pie. */\n cutout?: number\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n // `Dynamic` rather than a local component accessor: Solid's JSX types require\n // a component reference, and an accessor returning one is a call in disguise.\n const component = () => (props.cutout === 0 ? Pie : Doughnut)\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Dynamic\n component={component()}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: props.labels.map(\n (_, index) => chartSeriesColors[index % chartSeriesColors.length]\n ),\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={theme.resolve(\n chartOptions(\n mergeChartOptions(\n props.cutout === 0\n ? undefined\n : ({\n cutout: `${props.cutout ?? 60}%`,\n } satisfies ChartOptions<'doughnut'> as ChartOptions),\n props.options\n ),\n 'none'\n )\n )}\n />\n </div>\n )\n}\n\n/** A legend built from the same five colours, for a chart whose legend is elsewhere. */\nexport function ChartLegend(props: {\n series: readonly { label: string; color?: string }[]\n class?: string\n}) {\n return (\n <ul class={cn('flex flex-wrap items-center gap-x-3 gap-y-1', props.class)}>\n <For each={props.series}>\n {(entry, index) => (\n <li class=\"flex items-center gap-1.5 text-2xs text-muted-foreground\">\n <span\n class=\"size-2 shrink-0 rounded-full\"\n style={{\n background: entry.color ?? chartSeriesColors[index() % chartSeriesColors.length],\n }}\n aria-hidden=\"true\"\n />\n {entry.label}\n </li>\n )}\n </For>\n </ul>\n )\n}\n\nexport type { ChartType, ChartOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgBgC,mBAAmBC,OAA0D;CAC3FlB,MAAQmB,SAASD,KAAK;AACxB;AAEAlB,MAAQmB,SACNhB,eACAI,aACAC,kBACAE,mBACAD,cACAH,aACAJ,YACAD,YACAG,QACAO,SACAN,MACF;;;;;;;;;;AAaA,IAAIe;AAEJ,SAASC,cAAcC,OAAuB;CAC5C,IAAI,OAAOC,QAAQ,eAAe,CAACA,IAAIC,SAAS,SAASF,KAAK,GAAG,OAAOA;CACxE,IAAIF,WAAWK,KAAAA,GAAW;EACxB,MAAMC,SAASC,SAASC,cAAc,QAAQ;EAC9CF,OAAOG,QAAQ;EACfH,OAAOI,SA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GAAG,QAAQ0E,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAA+E;CAAA,EAAA,CAAA;AAgCvD;;AAGA,SAAgBG,YAAYhF,OAGzB;CACD,cAAA;EAAA,IAAAiF,SAAAC,QAAA;EAAA1E,OAAAyE,QAAAxE,gBAEK9G,KAAG;GAAA,IAACwL,OAAI;IAAA,OAAEnF,MAAMgB;GAAM;GAAAnB,WACnB2B,OAAOC,iBAAK;IAAA,IAAA2D,SAAAC,QAAA,GAAAC,SAAAF,OAAA/E;IAAAG,OAAA4E,cAST5D,MAAMP,OAAK,IAAA;IAAAJ,QAAA0E,QAAAC,iBAAAF,QAAA,cAJI9D,MAAMN,SAAS1F,kBAAkBiG,MAAM,IAAIjG,kBAAkB8B,OAAO,CAAA;IAAA,OAAA8H;GAAA,EAAA,CAAA;EAMvF,CAAA,CAAA;EAAAvE,aAAAC,UAAAmE,QAbM3J,GAAG,+CAA+C0E,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAAmF;CAAA,EAAA,CAAA;AAiB7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["Checkbox","KobalteCheckbox","Check","Minus","ComponentProps","JSX","splitProps","useFormFieldControl","cn","CheckboxProps","Omit","inputId","controlClass","labelClass","descriptionClass","label","Element","description","children","props","local","rest","field","id","_$createComponent","_$mergeProps","undefined","title","class","Input","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","aria-busy","Control","Indicator","_$memo","indeterminate","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","CheckboxLabel","CheckboxDescription","Checkbox","_$createComponent","KobalteCheckbox","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as KobalteCheckbox } from '@kobalte/core/checkbox'\nimport { Check, Minus } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Checkbox.\n *\n * Three states: unchecked, checked, and indeterminate. Indeterminate is what a\n * \"select all\" box shows when only some rows are selected; Kobalte expresses\n * it through `checked=\"indeterminate\"` rather than a second boolean, so there\n * is no way to render a box that is both.\n *\n * The paint is `Control` and the value is a real hidden `Input`, so the control\n * participates in a form submission and in native validation while looking\n * nothing like a browser checkbox. Focus is tracked by the input, which is why\n * the ring lives on the control and reads the input's focus state.\n */\nexport type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'children'> & {\n /** ID for the hidden native checkbox input; useful with an external label. */\n inputId?: string\n controlClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Checkbox(props: CheckboxProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'indeterminate',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n ])\n const field = useFormFieldControl('control', {\n id: local.inputId ?? local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCheckbox\n data-slot=\"checkbox\"\n id={field ? undefined : local.id}\n title={local.title}\n class={cn('group/checkbox flex items-start gap-2.5', local.class)}\n {...rest}\n >\n {/*\n * The name goes on the input, which is what carries the value and takes\n * focus. On the Root it would land on a plain div and name nothing — the\n * box would announce its state with no subject.\n */}\n <KobalteCheckbox.Input\n id={field?.id ?? local.inputId}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteCheckbox.Control\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary-foreground',\n 'data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary-foreground',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteCheckbox.Indicator class=\"flex items-center justify-center\">\n {local.indeterminate ? <Minus class=\"size-3\" /> : <Check class=\"size-3\" />}\n </KobalteCheckbox.Indicator>\n </KobalteCheckbox.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteCheckbox.Label class={cn('text-sm font-medium', local.labelClass)}>\n {local.label}\n </KobalteCheckbox.Label>\n ) : null}\n {local.description ? (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteCheckbox.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteCheckbox>\n )\n}\n\n/**\n * The box's own label. Valid only inside a `<Checkbox>`, for the same reason as\n * `SwitchLabel`: outside its root there is no control to associate with.\n */\nexport function CheckboxLabel(props: ComponentProps<typeof KobalteCheckbox.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCheckbox.Label class={cn('text-sm font-medium', local.class)} {...rest} />\n}\n\nexport function CheckboxDescription(props: ComponentProps<typeof KobalteCheckbox.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgBA,WAASmB,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMG,QAAQf,oBAAoB,WAAW;EAC3CgB,IAAIH,MAAMT,WAAWS,MAAMG;EAC3B,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,OAAAI,gBACGvB,UAAewB,WAAA;EAAA,aAAA;EAAA,IAEdF,KAAE;GAAA,OAAED,QAAQI,KAAAA,IAAYN,MAAMG;EAAE;EAAA,IAChCI,QAAK;GAAA,OAAEP,MAAMO;EAAK;EAAA,KAAA,WAAA;GAAA,OACXnB,GAAG,2CAA2CY,MAAMQ,KAAK;EAAC;CAAA,GAC7DP,MAAI,EAAA,IAAAH,WAAA;EAAA,OAAA;GAAAM,gBAOPvB,SAAgB4B,OAAK;IAAA,IACpBN,KAAE;KAAA,OAAED,OAAOC,MAAMH,MAAMT;IAAO;IAAA,KAAA,gBAAA;KAAA,OAClBS,MAAM;IAAa;IAAA,KAAA,qBAAA;KAAA,OACdE,QAAQ,sBAAsBF,MAAM;IAAkB;IAAA,KAAA,sBAAA;KAAA,OACrDE,QAAQ,uBAAuBF,MAAM;IAAmB;IAAA,KAAA,kBAAA;KAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;IAAe;IAAA,KAAA,uBAAA;KAAA,OAC3CE,QAAQ,wBAAwBF,MAAM;IAAoB;IAAA,KAAA,eAAA;KAAA,OAClEA,MAAM;IAAY;IAAA,IAC7BO,QAAK;KAAA,OAAEP,MAAMO;IAAK;GAAA,CAAA;GAA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a,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBAAQvB,SAAgB2C,OAAKnB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQjB,GAAG,uBAAuBY,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AACvF;AAEA,SAAgB2B,oBAAoB7B,OAA2D;CAC7F,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGvB,SAAgB6C,aAAWrB,WAAA,EAAA,KAAA,WAAA;EAAA,OACnBjB,GAAG,iCAAiCY,MAAMQ,KAAK;CAAC,EAAA,GACnDP,IAAI,CAAA;AAGd"}
1
+ {"version":3,"file":"checkbox.js","names":["Checkbox","KobalteCheckbox","Check","Minus","splitProps","useFormFieldControl","cn","inputId","controlClass","labelClass","descriptionClass","label","description","children","props","local","rest","field","id","_$createComponent","_$mergeProps","undefined","title","class","Input","Control","Indicator","_$memo","indeterminate","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","CheckboxLabel","CheckboxDescription"],"sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as KobalteCheckbox } from '@kobalte/core/checkbox'\nimport { Check, Minus } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Checkbox.\n *\n * Three states: unchecked, checked, and indeterminate. Indeterminate is what a\n * \"select all\" box shows when only some rows are selected; Kobalte expresses\n * it through `checked=\"indeterminate\"` rather than a second boolean, so there\n * is no way to render a box that is both.\n *\n * The paint is `Control` and the value is a real hidden `Input`, so the control\n * participates in a form submission and in native validation while looking\n * nothing like a browser checkbox. Focus is tracked by the input, which is why\n * the ring lives on the control and reads the input's focus state.\n */\nexport type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'children'> & {\n /** ID for the hidden native checkbox input; useful with an external label. */\n inputId?: string\n controlClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Checkbox(props: CheckboxProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'indeterminate',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n ])\n const field = useFormFieldControl('control', {\n id: local.inputId ?? local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCheckbox\n data-slot=\"checkbox\"\n id={field ? undefined : local.id}\n title={local.title}\n class={cn('group/checkbox flex items-start gap-2.5', local.class)}\n {...rest}\n >\n {/*\n * The name goes on the input, which is what carries the value and takes\n * focus. On the Root it would land on a plain div and name nothing — the\n * box would announce its state with no subject.\n */}\n <KobalteCheckbox.Input\n id={field?.id ?? local.inputId}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteCheckbox.Control\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary-foreground',\n 'data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary-foreground',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteCheckbox.Indicator class=\"flex items-center justify-center\">\n {local.indeterminate ? <Minus class=\"size-3\" /> : <Check class=\"size-3\" />}\n </KobalteCheckbox.Indicator>\n </KobalteCheckbox.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteCheckbox.Label class={cn('text-sm font-medium', local.labelClass)}>\n {local.label}\n </KobalteCheckbox.Label>\n ) : null}\n {local.description ? (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteCheckbox.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteCheckbox>\n )\n}\n\n/**\n * The box's own label. Valid only inside a `<Checkbox>`, for the same reason as\n * `SwitchLabel`: outside its root there is no control to associate with.\n */\nexport function CheckboxLabel(props: ComponentProps<typeof KobalteCheckbox.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCheckbox.Label class={cn('text-sm font-medium', local.class)} {...rest} />\n}\n\nexport function CheckboxDescription(props: ComponentProps<typeof KobalteCheckbox.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgBA,WAASc,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMG,QAAQZ,oBAAoB,WAAW;EAC3Ca,IAAIH,MAAMR,WAAWQ,MAAMG;EAC3B,cAAcH,MAA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,MAAMQ,KAAK;CAAC,EAAA,GACnDP,IAAI,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.js","names":["createEffect","createMemo","createSignal","For","on","onCleanup","onMount","Show","splitProps","ComponentProps","JSX","Check","Copy","createCopyFeedback","cn","ActionButton","Button","CodeBlockProps","Omit","code","language","highlight","Element","complete","title","actions","copyLabel","copiedLabel","lineHeight","showLineNumbers","tallThreshold","maxHeight","wrap","size","lineMarks","Readonly","Record","CodeLineMark","loadHighlight","Promise","CodeHighlighter","lineLimit","onCopy","ok","CODE_BLOCK_LINE_LIMIT","TALL_CODE_BLOCK_PX","CodeBlock","props","local","rest","copied","failed","copy","copyText","tall","setTall","loaded","setLoaded","showAll","setShowAll","bodyElement","HTMLDivElement","trim","slice","undefined","label","groupLabel","small","lines","replace","split","visibleLines","hiddenLines","length","const","lang","load","current","resolve","then","highlighter","perLine","truncated","Actions","_el$","_tmpl$","_$insert","_$createComponent","variant","touchTarget","aria-label","_$memo","tooltip","onClick","children","when","fallback","_el$2","_tmpl$5","_el$3","firstChild","_el$4","_el$5","nextSibling","_$use","element","ref","observer","ResizeObserver","footer","querySelector","HTMLElement","offsetHeight","observe","disconnect","_$spread","_$mergeProps","data-size","class","_el$14","_tmpl$6","_el$15","each","line","index","CodeLine","number","numbered","mark","_$effect","_p$","_v$6","_v$7","e","_$className","t","_$setStyleProperty","_el$16","_tmpl$7","join","_el$6","_tmpl$2","_el$7","_el$8","_el$10","_el$9","_el$11","_el$1","toLocaleString","focus","preventScroll","_tmpl$3","_el$13","_tmpl$4","_v$","_v$2","_v$3","_v$4","_v$5","_$setAttribute","a","o","_$style","i","MARK_GLYPH","add","remove","error","content","_el$17","_tmpl$8","_el$18","_tmpl$9","_c$","_el$19","_tmpl$0","rowClass","_el$21","_v$8","_v$9","_el$22","_tmpl$10","_el$20","_tmpl$1","InlineCode","_el$23","_tmpl$11","_$createComponent","_$memo","_$mergeProps","_$className","_$setStyleProperty","_$setAttribute","_$style"],"sources":["../../../../src/components/ui/code-block/code-block.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n onCleanup,\n onMount,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Check, Copy } from 'lucide-solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../button'\n\n/**\n * CodeBlock.\n *\n * A fenced block, rendered as a surface. The library ships no highlighter —\n * syntax colouring is a large dependency with its own theme format, and a\n * component that bundled one would force every consumer to pay for it. This\n * renders the block, its chrome, and its behaviour; a caller that wants\n * highlighting passes the result through `highlight`, which is the seam a\n * Shiki/Pierre/Prism integration plugs into.\n *\n * Four details are the reason this exists rather than a styled `<pre>`:\n *\n * **Copy confirms only on success.** `navigator.clipboard.writeText` rejects\n * outside a secure context, in a sandboxed frame, and when the document is not\n * focused. Flipping to a tick unconditionally confirms a copy that did not\n * happen, and the reader pastes something stale and does not know why. The\n * rejection is caught and the button reports the failure instead.\n *\n * **A tall block repeats its action row at the bottom.** Copying from a block\n * that is taller than the viewport otherwise costs a scroll back to the top and\n * another scroll down to where you were. The threshold is a fixed 480px rather\n * than viewport-relative so the behaviour does not change when the window is\n * resized.\n *\n * **The scroller is focusable and named.** A horizontally scrollable region has\n * to be reachable by keyboard — this is axe's `scrollable-region-focusable`, and\n * a region that scrolls but cannot be focused is a WCAG 2.1.1 failure. It is a\n * labelled `group` rather than a bare `tabindex`, so the tab stop announces what\n * it is. It is deliberately not a `region` landmark: a transcript holds many\n * blocks, often in one language, and repeated landmarks of one name are noise.\n *\n * **Resolving a streaming block must not move the reader.** When `complete` is\n * false the block shows the code it has plus a generating indicator; the\n * indicator is inside the scroller's own box and does not add a line, because a\n * block that grows the moment its content resolves shifts everything below it.\n * If a caller's `highlight` changes the line box, that is the caller's height to\n * hold — `lineHeight` is a prop for exactly that reason.\n *\n * ## Output, not only source\n *\n * The same surface carries terminal output, logs and diffs inside an agent's\n * activity, so it also:\n *\n * - **loads its highlighter lazily** (`loadHighlight`). The grammar is fetched\n * only for a block that is complete and has a language, the block renders plain\n * until it arrives, and a loader that returns nothing — an unknown language, a\n * failed fetch — leaves the plain text in place without an error. Highlighting\n * a block on every streamed delta would re-tokenise the whole thing per token,\n * so a streaming block stays plain until `complete`.\n * - **marks lines** (`lineMarks`) as added, removed, highlighted or failed. A mark\n * is carried by a gutter glyph and by `<ins>`/`<del>` for the two that change\n * text, never by colour alone, and the glyph is not selectable so a copied\n * selection stays the source.\n * - **copies the source exactly.** The copy button writes `code` as given: no\n * trailing-newline trimming, no line numbers, no gutter glyphs, and the whole\n * block even when only part of it is rendered (`lineLimit`).\n * - **bounds a large render.** Past `lineLimit` lines the per-line renderer and a\n * highlighted render show the first lines and a control to show the rest,\n * because tens of thousands of row elements, or a tokenizer run over all of\n * them, are a freeze, not a transcript. Which renderer is in use is decided\n * at the time, so a highlighter that loads late takes over the bound from the\n * per-line rows and the note below the block always describes what is drawn.\n * The plain renderer is a single text node and needs no limit.\n * - **comes in a small size** (`size=\"sm\"`) for tool output inside a Trace line.\n */\nexport type CodeBlockProps = Omit<ComponentProps<'div'>, 'children' | 'onCopy'> & {\n code: string\n /** The language, shown in the header and used as the region's label. */\n language?: string\n /** The code, transformed — highlighted HTML or a component. Omit for plain text. */\n highlight?: (code: string) => JSX.Element\n /** False while the block is still streaming. Adds a generating indicator. */\n complete?: boolean\n /** A filename or title, shown instead of the language. */\n title?: string\n /** Extra header controls, before the copy button. */\n actions?: JSX.Element\n /** Copy label. Override for a non-English application. */\n copyLabel?: string\n copiedLabel?: string\n /** Line height of the rendered code. Set it when `highlight` changes the box. */\n lineHeight?: string\n /** A line-number gutter. Off by default; a short snippet rarely needs one. */\n showLineNumbers?: boolean\n /** The height above which the action row is repeated below the block. */\n tallThreshold?: number\n /**\n * Cap the code body's height and scroll it vertically past that. A number is\n * pixels; a string is any CSS length (`'20rem'`, `'50vh'`). Unset, the block\n * grows with its content.\n */\n maxHeight?: number | string\n /**\n * Soft-wrap long lines inside the block instead of scrolling sideways. Off by\n * default: wrapped code loses its column alignment, so it is for prose-like\n * output (logs, long commands) in a narrow column. Wraps the plain renderer and\n * any `pre` inside `highlight` output; line numbers stay on the first visual line.\n */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /**\n * Marks on 1-based line numbers. Applies to the per-line renderer, which is\n * used whenever marks or line numbers are present and no highlighter is in use,\n * given as `highlight` or loaded by `loadHighlight`: a highlighter replaces the\n * rows, so the marks and the gutter go with them.\n */\n lineMarks?: Readonly<Record<number, CodeLineMark>>\n /**\n * Resolve a highlighter for the block's language. Called once the block is\n * complete; resolving to `undefined` (or rejecting) keeps the plain rendering.\n */\n loadHighlight?: (language: string | undefined) => Promise<CodeHighlighter | undefined>\n /**\n * Lines the per-line and the highlighted renderer show before offering the\n * rest. Default 2000. The plain renderer is one text node and is not limited.\n */\n lineLimit?: number\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport type CodeLineMark = 'add' | 'remove' | 'highlight' | 'error'\nexport type CodeHighlighter = (code: string) => JSX.Element\n\nexport const CODE_BLOCK_LINE_LIMIT = 2_000\n\nexport const TALL_CODE_BLOCK_PX = 480\n\nexport function CodeBlock(props: CodeBlockProps) {\n const [local, rest] = splitProps(props, [\n 'code',\n 'language',\n 'highlight',\n 'complete',\n 'title',\n 'actions',\n 'copyLabel',\n 'copiedLabel',\n 'lineHeight',\n 'showLineNumbers',\n 'tallThreshold',\n 'maxHeight',\n 'wrap',\n 'size',\n 'lineMarks',\n 'loadHighlight',\n 'lineLimit',\n 'onCopy',\n 'class',\n 'ref',\n ])\n\n const { copied, failed, copy: copyText } = createCopyFeedback()\n const [tall, setTall] = createSignal(false)\n\n const [loaded, setLoaded] = createSignal<CodeHighlighter>()\n const [showAll, setShowAll] = createSignal(false)\n let bodyElement: HTMLDivElement | undefined\n\n // A language string can come from untrusted model output. It is rendered as\n // text, so it cannot inject markup; the cap keeps a pathological one from\n // swallowing the header.\n const language = () => local.language?.trim().slice(0, 40) || undefined\n const label = () => local.title ?? language() ?? 'code'\n const groupLabel = () => (language() ? `${language()} code` : 'code')\n const small = () => local.size === 'sm'\n const lines = createMemo(() => local.code.replace(/\\n$/, '').split('\\n'))\n const lineLimit = () => local.lineLimit ?? CODE_BLOCK_LINE_LIMIT\n const visibleLines = createMemo(() => (showAll() ? lines() : lines().slice(0, lineLimit())))\n const hiddenLines = () => lines().length - visibleLines().length\n\n // Load once the block has stopped changing. `on` keys the effect to the\n // language and completion, not to every streamed character, and a stale\n // resolution (the language changed while the grammar was in flight) is dropped.\n createEffect(\n on(\n () => [local.complete, language(), local.loadHighlight] as const,\n ([complete, lang, load]) => {\n setLoaded(undefined)\n if (!complete || !load || local.highlight) return\n let current = true\n onCleanup(() => (current = false))\n // Wrapped, not called bare: a loader that throws before it returns a promise\n // (a bad import path, a missing grammar table) must degrade to plain text\n // like one that rejects, not tear down the tree from inside this effect.\n new Promise<CodeHighlighter | undefined>((resolve) => resolve(load(lang))).then(\n (highlighter) => {\n if (current && highlighter) setLoaded(() => highlighter)\n },\n () => undefined\n )\n }\n )\n )\n const highlighter = (): CodeHighlighter | undefined => local.highlight ?? loaded()\n // The renderer in use decides everything about the limit, not the props alone:\n // a highlighter that has loaded since the first render replaces the per-line\n // rows, so what is drawn, and what the footer may say, follows `highlighter()`.\n const perLine = () =>\n highlighter() === undefined && (local.showLineNumbers === true || local.lineMarks !== undefined)\n const truncated = () => hiddenLines() > 0 && (highlighter() !== undefined || perLine())\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : local.maxHeight\n\n const copy = async () => {\n const ok = await copyText(local.code)\n local.onCopy?.(ok)\n }\n\n const Actions = () => (\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>\n )\n\n return (\n <div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element) => {\n // Composed rather than replaced: a caller's ref must survive.\n if (typeof local.ref === 'function') local.ref(element)\n else if (local.ref) local.ref = element\n // Measured rather than assumed: the caller controls the content, so only\n // the rendered box can say whether the action row has scrolled away.\n // The body is what is watched, not the block: the repeated action row is\n // added to the block, so watching the block made this callback resize the\n // very element it observes, which is a ResizeObserver loop (WebKit reports\n // it as an uncaught \"loop completed with undelivered notifications\" error).\n // The footer's own height is left out of the measure for the same reason: a\n // block is tall by its content, not by the row that tallness adds.\n const observer = new ResizeObserver(() => {\n const footer = element.querySelector<HTMLElement>('[data-code-block-footer]')\n setTall(\n element.offsetHeight - (footer?.offsetHeight ?? 0) >\n (local.tallThreshold ?? TALL_CODE_BLOCK_PX)\n )\n })\n onMount(() => {\n if (bodyElement) observer.observe(bodyElement)\n })\n onCleanup(() => observer.disconnect())\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>\n )\n}\n\nconst MARK_GLYPH: Readonly<Record<CodeLineMark, string>> = {\n add: '+',\n remove: '−',\n highlight: '',\n error: '!',\n}\n\n/**\n * One rendered line. The gutter glyph and the element (`ins`/`del`) carry what a\n * mark means so it survives greyscale and a screen reader; both gutters are\n * unselectable so dragging across the block and copying yields only source.\n */\nfunction CodeLine(props: {\n line: string\n number: number\n numbered: boolean\n mark?: CodeLineMark\n wrap: boolean\n}) {\n const content = () => (\n <>\n <Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>\n <span\n class=\"w-[1ch] text-center text-muted-foreground select-none\"\n aria-hidden=\"true\"\n data-slot=\"code-line-mark\"\n >\n {props.mark ? MARK_GLYPH[props.mark] : ''}\n </span>\n <span class={cn({ 'min-w-0': props.wrap })}>{props.line || ' '}</span>\n </>\n )\n const rowClass = () =>\n cn(\n 'grid gap-3 no-underline',\n props.numbered ? 'grid-cols-[3ch_1ch_1fr]' : 'grid-cols-[1ch_1fr]',\n {\n 'bg-success-subtle': props.mark === 'add',\n 'bg-destructive-subtle': props.mark === 'remove' || props.mark === 'error',\n 'bg-primary-subtle': props.mark === 'highlight',\n }\n )\n return (\n <Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>\n )\n}\n\n/**\n * InlineCode.\n *\n * The `code` inside a sentence. It is a component rather than a class because it\n * has to hold three properties at once: it uses the shared code family and size\n * preference, and it wraps rather than overflows a narrow column\n * (`overflow-wrap: anywhere` — an identifier with\n * no spaces is one long token), and it must be legible against whatever surface\n * it lands on, which is why the fill is a token and not a fixed grey.\n */\nexport function InlineCode(props: ComponentProps<'code'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgJA,IAAa4C,wBAAwB;AAErC,IAAaC,qBAAqB;AAElC,SAAgBC,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQzC,WAAWuC,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAK,CACN;CAED,MAAM,EAAEG,QAAQC,QAAQC,MAAMC,aAAaxC,mBAAmB;CAC9D,MAAM,CAACyC,MAAMC,WAAWrD,aAAa,KAAK;CAE1C,MAAM,CAACsD,QAAQC,aAAavD,aAA8B;CAC1D,MAAM,CAACwD,SAASC,cAAczD,aAAa,KAAK;CAChD,IAAI0D;CAKJ,MAAMxC,iBAAiB4B,MAAM5B,UAAU0C,KAAK,CAAC,CAACC,MAAM,GAAG,EAAE,KAAKC,KAAAA;CAC9D,MAAMC,cAAcjB,MAAMxB,SAASJ,SAAS,KAAK;CACjD,MAAM8C,mBAAoB9C,SAAS,IAAI,GAAGA,SAAS,EAAC,SAAU;CAC9D,MAAM+C,cAAcnB,MAAMf,SAAS;CACnC,MAAMmC,QAAQnE,iBAAiB+C,MAAM7B,KAAKkD,QAAQ,OAAO,EAAE,CAAC,CAACC,MAAM,IAAI,CAAC;CACxE,MAAM7B,kBAAkBO,MAAMP,aAAAA;CAC9B,MAAM8B,eAAetE,iBAAkByD,QAAQ,IAAIU,MAAM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,IAAAK,KAAAD,UAAA2C,QAAA/C,IAAAK,IAAA4C,IAAA;KAAA,OAAAjD;IAAA,GAAA;KAAAG,GAAArE,KAAAA;KAAAuE,GAAAvE,KAAAA;IAAA,CAAA;IAAA,OAAAiH;GAAA,EAAA,CAAA;EAAA;EAAA,IAAAnF,WAAA;GAAA,OAAAP,gBAK/ChF,MAAI;IAAA,IACHwF,OAAI;KAAA,OAAEhD,MAAMiF,SAAS;IAAK;IAAA,IAC1BhC,WAAQ;KAAA,cAAA;MAAA,IAAAoF,SAAAC,SAAA;MAAA/F,OAAA8F,QAEHZ,OAAO;MAAAvC,aAAAK,UAAA8C,QADqBJ,SAAS,CAAC,CAAA;MAAA,OAAAI;KAAA,EAAA,CAAA;IAAA;IAAA,IAAAtF,WAAA;KAAA,IAAAwF,SAAAC,QAAA;KAAAjG,OAAAgG,QAMxCd,OAAO;KAAAvC,aAAAK,UAAAgD,QADkBN,SAAS,CAAC,CAAA;KAAA,OAAAM;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAM9C;;;;;;;;;;;AAYA,SAAgBE,WAAWzI,OAA+B;CACxD,MAAM,CAACC,OAAOC,QAAQzC,WAAWuC,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAA0I,SAAAC,SAAA;EAAAvE,OAAAsE,QAAArE,WAAA,EAAA,KAAA,WAAA;GAAA,OAEWtG,GACL,2GACAkC,MAAMsE,KACR;EAAC,EAAA,GACGrE,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAwI;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"code-block.js","names":["createEffect","createMemo","createSignal","For","on","onCleanup","onMount","Show","splitProps","Check","Copy","createCopyFeedback","cn","ActionButton","Button","code","language","highlight","complete","title","actions","copyLabel","copiedLabel","lineHeight","showLineNumbers","tallThreshold","maxHeight","wrap","size","lineMarks","loadHighlight","Promise","lineLimit","onCopy","ok","CODE_BLOCK_LINE_LIMIT","TALL_CODE_BLOCK_PX","CodeBlock","props","local","rest","copied","failed","copy","copyText","tall","setTall","loaded","setLoaded","showAll","setShowAll","bodyElement","trim","slice","undefined","label","groupLabel","small","lines","replace","split","visibleLines","hiddenLines","length","lang","load","current","resolve","then","highlighter","perLine","truncated","Actions","_el$","_tmpl$","_$insert","_$createComponent","variant","touchTarget","_$memo","tooltip","onClick","children","when","fallback","_el$2","_tmpl$5","_el$3","firstChild","_el$4","_el$5","nextSibling","_$use","element","ref","observer","ResizeObserver","footer","querySelector","offsetHeight","observe","disconnect","_$spread","_$mergeProps","class","_el$14","_tmpl$6","_el$15","each","line","index","CodeLine","number","numbered","mark","_$effect","_p$","_v$6","_v$7","e","_$className","t","_$setStyleProperty","_el$16","_tmpl$7","join","_el$6","_tmpl$2","_el$7","_el$10","_el$11","toLocaleString","focus","preventScroll","_tmpl$3","_el$13","_tmpl$4","_v$","_v$2","_v$3","_v$4","_v$5","_$setAttribute","a","o","_$style","i","MARK_GLYPH","add","remove","error","content","_el$17","_tmpl$8","_el$18","_tmpl$9","_c$","_el$19","_tmpl$0","rowClass","_el$21","_v$8","_v$9","_el$22","_tmpl$10","_el$20","_tmpl$1","InlineCode","_el$23","_tmpl$11"],"sources":["../../../../src/components/ui/code-block/code-block.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n onCleanup,\n onMount,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Check, Copy } from 'lucide-solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../button'\n\n/**\n * CodeBlock.\n *\n * A fenced block, rendered as a surface. The library ships no highlighter —\n * syntax colouring is a large dependency with its own theme format, and a\n * component that bundled one would force every consumer to pay for it. This\n * renders the block, its chrome, and its behaviour; a caller that wants\n * highlighting passes the result through `highlight`, which is the seam a\n * Shiki/Pierre/Prism integration plugs into.\n *\n * Four details are the reason this exists rather than a styled `<pre>`:\n *\n * **Copy confirms only on success.** `navigator.clipboard.writeText` rejects\n * outside a secure context, in a sandboxed frame, and when the document is not\n * focused. Flipping to a tick unconditionally confirms a copy that did not\n * happen, and the reader pastes something stale and does not know why. The\n * rejection is caught and the button reports the failure instead.\n *\n * **A tall block repeats its action row at the bottom.** Copying from a block\n * that is taller than the viewport otherwise costs a scroll back to the top and\n * another scroll down to where you were. The threshold is a fixed 480px rather\n * than viewport-relative so the behaviour does not change when the window is\n * resized.\n *\n * **The scroller is focusable and named.** A horizontally scrollable region has\n * to be reachable by keyboard — this is axe's `scrollable-region-focusable`, and\n * a region that scrolls but cannot be focused is a WCAG 2.1.1 failure. It is a\n * labelled `group` rather than a bare `tabindex`, so the tab stop announces what\n * it is. It is deliberately not a `region` landmark: a transcript holds many\n * blocks, often in one language, and repeated landmarks of one name are noise.\n *\n * **Resolving a streaming block must not move the reader.** When `complete` is\n * false the block shows the code it has plus a generating indicator; the\n * indicator is inside the scroller's own box and does not add a line, because a\n * block that grows the moment its content resolves shifts everything below it.\n * If a caller's `highlight` changes the line box, that is the caller's height to\n * hold — `lineHeight` is a prop for exactly that reason.\n *\n * ## Output, not only source\n *\n * The same surface carries terminal output, logs and diffs inside an agent's\n * activity, so it also:\n *\n * - **loads its highlighter lazily** (`loadHighlight`). The grammar is fetched\n * only for a block that is complete and has a language, the block renders plain\n * until it arrives, and a loader that returns nothing — an unknown language, a\n * failed fetch — leaves the plain text in place without an error. Highlighting\n * a block on every streamed delta would re-tokenise the whole thing per token,\n * so a streaming block stays plain until `complete`.\n * - **marks lines** (`lineMarks`) as added, removed, highlighted or failed. A mark\n * is carried by a gutter glyph and by `<ins>`/`<del>` for the two that change\n * text, never by colour alone, and the glyph is not selectable so a copied\n * selection stays the source.\n * - **copies the source exactly.** The copy button writes `code` as given: no\n * trailing-newline trimming, no line numbers, no gutter glyphs, and the whole\n * block even when only part of it is rendered (`lineLimit`).\n * - **bounds a large render.** Past `lineLimit` lines the per-line renderer and a\n * highlighted render show the first lines and a control to show the rest,\n * because tens of thousands of row elements, or a tokenizer run over all of\n * them, are a freeze, not a transcript. Which renderer is in use is decided\n * at the time, so a highlighter that loads late takes over the bound from the\n * per-line rows and the note below the block always describes what is drawn.\n * The plain renderer is a single text node and needs no limit.\n * - **comes in a small size** (`size=\"sm\"`) for tool output inside a Trace line.\n */\nexport type CodeBlockProps = Omit<ComponentProps<'div'>, 'children' | 'onCopy'> & {\n code: string\n /** The language, shown in the header and used as the region's label. */\n language?: string\n /** The code, transformed — highlighted HTML or a component. Omit for plain text. */\n highlight?: (code: string) => JSX.Element\n /** False while the block is still streaming. Adds a generating indicator. */\n complete?: boolean\n /** A filename or title, shown instead of the language. */\n title?: string\n /** Extra header controls, before the copy button. */\n actions?: JSX.Element\n /** Copy label. Override for a non-English application. */\n copyLabel?: string\n copiedLabel?: string\n /** Line height of the rendered code. Set it when `highlight` changes the box. */\n lineHeight?: string\n /** A line-number gutter. Off by default; a short snippet rarely needs one. */\n showLineNumbers?: boolean\n /** The height above which the action row is repeated below the block. */\n tallThreshold?: number\n /**\n * Cap the code body's height and scroll it vertically past that. A number is\n * pixels; a string is any CSS length (`'20rem'`, `'50vh'`). Unset, the block\n * grows with its content.\n */\n maxHeight?: number | string\n /**\n * Soft-wrap long lines inside the block instead of scrolling sideways. Off by\n * default: wrapped code loses its column alignment, so it is for prose-like\n * output (logs, long commands) in a narrow column. Wraps the plain renderer and\n * any `pre` inside `highlight` output; line numbers stay on the first visual line.\n */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /**\n * Marks on 1-based line numbers. Applies to the per-line renderer, which is\n * used whenever marks or line numbers are present and no highlighter is in use,\n * given as `highlight` or loaded by `loadHighlight`: a highlighter replaces the\n * rows, so the marks and the gutter go with them.\n */\n lineMarks?: Readonly<Record<number, CodeLineMark>>\n /**\n * Resolve a highlighter for the block's language. Called once the block is\n * complete; resolving to `undefined` (or rejecting) keeps the plain rendering.\n */\n loadHighlight?: (language: string | undefined) => Promise<CodeHighlighter | undefined>\n /**\n * Lines the per-line and the highlighted renderer show before offering the\n * rest. Default 2000. The plain renderer is one text node and is not limited.\n */\n lineLimit?: number\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport type CodeLineMark = 'add' | 'remove' | 'highlight' | 'error'\nexport type CodeHighlighter = (code: string) => JSX.Element\n\nexport const CODE_BLOCK_LINE_LIMIT = 2_000\n\nexport const TALL_CODE_BLOCK_PX = 480\n\nexport function CodeBlock(props: CodeBlockProps) {\n const [local, rest] = splitProps(props, [\n 'code',\n 'language',\n 'highlight',\n 'complete',\n 'title',\n 'actions',\n 'copyLabel',\n 'copiedLabel',\n 'lineHeight',\n 'showLineNumbers',\n 'tallThreshold',\n 'maxHeight',\n 'wrap',\n 'size',\n 'lineMarks',\n 'loadHighlight',\n 'lineLimit',\n 'onCopy',\n 'class',\n 'ref',\n ])\n\n const { copied, failed, copy: copyText } = createCopyFeedback()\n const [tall, setTall] = createSignal(false)\n\n const [loaded, setLoaded] = createSignal<CodeHighlighter>()\n const [showAll, setShowAll] = createSignal(false)\n let bodyElement: HTMLDivElement | undefined\n\n // A language string can come from untrusted model output. It is rendered as\n // text, so it cannot inject markup; the cap keeps a pathological one from\n // swallowing the header.\n const language = () => local.language?.trim().slice(0, 40) || undefined\n const label = () => local.title ?? language() ?? 'code'\n const groupLabel = () => (language() ? `${language()} code` : 'code')\n const small = () => local.size === 'sm'\n const lines = createMemo(() => local.code.replace(/\\n$/, '').split('\\n'))\n const lineLimit = () => local.lineLimit ?? CODE_BLOCK_LINE_LIMIT\n const visibleLines = createMemo(() => (showAll() ? lines() : lines().slice(0, lineLimit())))\n const hiddenLines = () => lines().length - visibleLines().length\n\n // Load once the block has stopped changing. `on` keys the effect to the\n // language and completion, not to every streamed character, and a stale\n // resolution (the language changed while the grammar was in flight) is dropped.\n createEffect(\n on(\n () => [local.complete, language(), local.loadHighlight] as const,\n ([complete, lang, load]) => {\n setLoaded(undefined)\n if (!complete || !load || local.highlight) return\n let current = true\n onCleanup(() => (current = false))\n // Wrapped, not called bare: a loader that throws before it returns a promise\n // (a bad import path, a missing grammar table) must degrade to plain text\n // like one that rejects, not tear down the tree from inside this effect.\n new Promise<CodeHighlighter | undefined>((resolve) => resolve(load(lang))).then(\n (highlighter) => {\n if (current && highlighter) setLoaded(() => highlighter)\n },\n () => undefined\n )\n }\n )\n )\n const highlighter = (): CodeHighlighter | undefined => local.highlight ?? loaded()\n // The renderer in use decides everything about the limit, not the props alone:\n // a highlighter that has loaded since the first render replaces the per-line\n // rows, so what is drawn, and what the footer may say, follows `highlighter()`.\n const perLine = () =>\n highlighter() === undefined && (local.showLineNumbers === true || local.lineMarks !== undefined)\n const truncated = () => hiddenLines() > 0 && (highlighter() !== undefined || perLine())\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : local.maxHeight\n\n const copy = async () => {\n const ok = await copyText(local.code)\n local.onCopy?.(ok)\n }\n\n const Actions = () => (\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>\n )\n\n return (\n <div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element) => {\n // Composed rather than replaced: a caller's ref must survive.\n if (typeof local.ref === 'function') local.ref(element)\n else if (local.ref) local.ref = element\n // Measured rather than assumed: the caller controls the content, so only\n // the rendered box can say whether the action row has scrolled away.\n // The body is what is watched, not the block: the repeated action row is\n // added to the block, so watching the block made this callback resize the\n // very element it observes, which is a ResizeObserver loop (WebKit reports\n // it as an uncaught \"loop completed with undelivered notifications\" error).\n // The footer's own height is left out of the measure for the same reason: a\n // block is tall by its content, not by the row that tallness adds.\n const observer = new ResizeObserver(() => {\n const footer = element.querySelector<HTMLElement>('[data-code-block-footer]')\n setTall(\n element.offsetHeight - (footer?.offsetHeight ?? 0) >\n (local.tallThreshold ?? TALL_CODE_BLOCK_PX)\n )\n })\n onMount(() => {\n if (bodyElement) observer.observe(bodyElement)\n })\n onCleanup(() => observer.disconnect())\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>\n )\n}\n\nconst MARK_GLYPH: Readonly<Record<CodeLineMark, string>> = {\n add: '+',\n remove: '−',\n highlight: '',\n error: '!',\n}\n\n/**\n * One rendered line. The gutter glyph and the element (`ins`/`del`) carry what a\n * mark means so it survives greyscale and a screen reader; both gutters are\n * unselectable so dragging across the block and copying yields only source.\n */\nfunction CodeLine(props: {\n line: string\n number: number\n numbered: boolean\n mark?: CodeLineMark\n wrap: boolean\n}) {\n const content = () => (\n <>\n <Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>\n <span\n class=\"w-[1ch] text-center text-muted-foreground select-none\"\n aria-hidden=\"true\"\n data-slot=\"code-line-mark\"\n >\n {props.mark ? MARK_GLYPH[props.mark] : ''}\n </span>\n <span class={cn({ 'min-w-0': props.wrap })}>{props.line || ' '}</span>\n </>\n )\n const rowClass = () =>\n cn(\n 'grid gap-3 no-underline',\n props.numbered ? 'grid-cols-[3ch_1ch_1fr]' : 'grid-cols-[1ch_1fr]',\n {\n 'bg-success-subtle': props.mark === 'add',\n 'bg-destructive-subtle': props.mark === 'remove' || props.mark === 'error',\n 'bg-primary-subtle': props.mark === 'highlight',\n }\n )\n return (\n <Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>\n )\n}\n\n/**\n * InlineCode.\n *\n * The `code` inside a sentence. It is a component rather than a class because it\n * has to hold three properties at once: it uses the shared code family and size\n * preference, and it wraps rather than overflows a narrow column\n * (`overflow-wrap: anywhere` — an identifier with\n * no spaces is one long token), and it must be legible against whatever surface\n * it lands on, which is why the fill is a token and not a fixed grey.\n */\nexport function InlineCode(props: ComponentProps<'code'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgJA,IAAamC,wBAAwB;AAErC,IAAaC,qBAAqB;AAElC,SAAgBC,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO;EACtC;EACA;EACA;E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,OAAA0F,QAMxCd,OAAO;KAAApC,aAAAK,UAAA6C,QADkBN,SAAS,CAAC,CAAA;KAAA,OAAAM;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAM9C;;;;;;;;;;;AAYA,SAAgBE,WAAWjI,OAA+B;CACxD,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAkI,SAAAC,SAAA;EAAAnE,OAAAkE,QAAAjE,WAAA,EAAA,KAAA,WAAA;GAAA,OAEW3F,GACL,2GACA2B,MAAMiE,KACR;EAAC,EAAA,GACGhE,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAgI;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.js","names":["Collapsible","KobalteCollapsible","ComponentProps","splitProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","CollapsibleTrigger","Trigger","CollapsibleContent","Content","Collapsible","_$createComponent","KobalteCollapsible","_$mergeProps"],"sources":["../../../../src/components/ui/collapsible/collapsible.tsx"],"sourcesContent":["import { Collapsible as KobalteCollapsible } from '@kobalte/core/collapsible'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Collapsible.\n *\n * One region that shows and hides. Accordion is this in a list; reach for\n * Collapsible when there is exactly one, so a caller does not have to build a\n * one-item accordion whose semantics say \"list of one\".\n *\n * The content animates its height rather than appearing, which is what keeps a\n * disclosure from reading as a layout jump. Kobalte publishes the measured\n * height as `--kb-collapsible-content-height`.\n */\nexport function Collapsible(props: ComponentProps<typeof KobalteCollapsible>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCollapsible class={cn('flex w-full flex-col', local.class)} {...rest} />\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof KobalteCollapsible.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCollapsible.Trigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CollapsibleContent(props: ComponentProps<typeof KobalteCollapsible.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCollapsible.Content\n class={cn(\n 'overflow-hidden',\n /* Kobalte measures the content and exposes the height; the transition\n reads it so the panel opens to its real size rather than a guess. */\n 'data-[expanded]:animate-in data-[expanded]:fade-in-0 data-[expanded]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgBA,cAAYK,OAAkD;CAC5E,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQP,aAAkBQ,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAG,wBAAwBE,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACrF;AAEA,SAAgBI,mBAAmBN,OAA0D;CAC3F,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGP,YAAmBW,SAAOH,WAAA,EAAA,KAAA,WAAA;EAAA,OAClBL,GACL,iDACA,2CACA,oFACA,oDACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBM,mBAAmBR,OAA0D;CAC3F,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGP,YAAmBa,SAAOL,WAAA,EAAA,KAAA,WAAA;EAAA,OAClBL,GACL,mBAGA,4FACA,uFACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd"}
1
+ {"version":3,"file":"collapsible.js","names":["Collapsible","KobalteCollapsible","splitProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","CollapsibleTrigger","Trigger","CollapsibleContent","Content"],"sources":["../../../../src/components/ui/collapsible/collapsible.tsx"],"sourcesContent":["import { Collapsible as KobalteCollapsible } from '@kobalte/core/collapsible'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Collapsible.\n *\n * One region that shows and hides. Accordion is this in a list; reach for\n * Collapsible when there is exactly one, so a caller does not have to build a\n * one-item accordion whose semantics say \"list of one\".\n *\n * The content animates its height rather than appearing, which is what keeps a\n * disclosure from reading as a layout jump. Kobalte publishes the measured\n * height as `--kb-collapsible-content-height`.\n */\nexport function Collapsible(props: ComponentProps<typeof KobalteCollapsible>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCollapsible class={cn('flex w-full flex-col', local.class)} {...rest} />\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof KobalteCollapsible.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCollapsible.Trigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CollapsibleContent(props: ComponentProps<typeof KobalteCollapsible.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCollapsible.Content\n class={cn(\n 'overflow-hidden',\n /* Kobalte measures the content and exposes the height; the transition\n reads it so the panel opens to its real size rather than a guess. */\n 'data-[expanded]:animate-in data-[expanded]:fade-in-0 data-[expanded]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgBA,cAAYI,OAAkD;CAC5E,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQN,aAAkBO,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAG,wBAAwBE,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACrF;AAEA,SAAgBI,mBAAmBN,OAA0D;CAC3F,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGN,YAAmBU,SAAOH,WAAA,EAAA,KAAA,WAAA;EAAA,OAClBL,GACL,iDACA,2CACA,oFACA,oDACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBM,mBAAmBR,OAA0D;CAC3F,MAAM,CAACC,OAAOC,QAAQJ,WAAWE,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGN,YAAmBY,SAAOL,WAAA,EAAA,KAAA,WAAA;EAAA,OAClBL,GACL,mBAGA,4FACA,uFACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","topLayerProps","useFormFieldControl","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","field","id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCombobox.Input\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteCombobox.ItemIndicator\n data-slot=\"combobox-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBA,WACdc,OACA;CACA,OAAAG,gBAAQhB,UAAoBa,KAAK;AACnC;AAEA,SAAgBI,gBAAgBJ,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQd,WAAWO,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGhB,SAAgBkB,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfT,GACL,6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,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgB6C,gBAAgBjC,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQd,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQhB,SAAgB+C,SAAO1B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAG,iBAAiBO,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgB4B,cAAcnC,OAAgD;CAC5E,OAAAG,gBACGX,MAAI;EAAA,IAAC6C,OAAI;GAAA,OAAErC,MAAMoC;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINxC,MAAMoC,QAAQ;GAACK,OAAAH,MAAAnC,gBAQ7Bb,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAAoD,aAAAC,UAAAL,MAPKvC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAA6B;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","Show","splitProps","menuItem","popoverArrow","topLayerProps","useFormFieldControl","cn","props","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","field","id","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCombobox.Input\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteCombobox.ItemIndicator\n data-slot=\"combobox-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBA,WACdY,OACA;CACA,OAAAC,gBAAQZ,UAAoBW,KAAK;AACnC;AAEA,SAAgBE,gBAAgBF,OAAuD;CACrF,MAAM,CAACI,OAAOC,QAAQX,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGZ,SAAgBc,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfP,GACL,6GACA,uDACA,iFACA,kGACA,iEACAK,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAEA,SAAgBG,cAAcR,OAAqD;CACjF,MAAM,CAACI,OAAOC,QAAQX,WAAWM,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CA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A,OAAQP,GAAG,iBAAiBK,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgBuB,cAAc5B,OAAgD;CAC5E,OAAAC,gBACGR,MAAI;EAAA,IAACqC,OAAI;GAAA,OAAE9B,MAAM6B;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINjC,MAAM6B,QAAQ;GAACK,OAAAH,MAAA9B,gBAQ7BT,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAA2C,aAAAC,UAAAL,MAPKhC,GACL,qFACA,iEACA,oFACAC,MAAMO,KACR,CAAC,CAAA;GAAA,OAAAwB;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"value-combobox.js","names":["splitProps","ComponentProps","JSX","Combobox","ComboboxContent","ComboboxInput","ComboboxItem","ValueComboboxChoice","value","label","textValue","Element","ValueComboboxProps","Omit","choices","onValueChange","ValueCombobox","props","local","rest","_$createComponent","options","optionValue","optionTextValue","choice","textFromLabel","optionLabel","find","String","onChange","option","itemComponent","itemProps","item","children","rawValue","_$createComponent"],"sources":["../../../../src/components/ui/combobox/value-combobox.tsx"],"sourcesContent":["import { splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { Combobox, ComboboxContent, ComboboxInput, ComboboxItem } from './combobox'\n\nexport type ValueComboboxChoice =\n | { value: string; label: string | number; textValue?: string }\n | { value: string; label: JSX.Element; textValue: string }\n\nexport type ValueComboboxProps = Omit<ComponentProps<typeof ComboboxInput>, 'value'> & {\n value: string\n choices: ValueComboboxChoice[]\n onValueChange: (value: string) => void\n}\n\n/** A single-choice combobox for a controlled string value and labelled choices. */\nexport function ValueCombobox(props: ValueComboboxProps) {\n const [local, rest] = splitProps(props, ['value', 'choices', 'onValueChange'])\n\n return (\n <Combobox\n options={local.choices}\n optionValue=\"value\"\n optionTextValue={(choice) => choice.textValue ?? textFromLabel(choice.label)}\n optionLabel={(choice) => choice.textValue ?? textFromLabel(choice.label)}\n value={local.choices.find((choice) => String(choice.value) === local.value) ?? null}\n onChange={(option) => option && local.onValueChange(String(option.value))}\n itemComponent={(itemProps) => (\n <ComboboxItem item={itemProps.item}>{itemProps.item.rawValue.label}</ComboboxItem>\n )}\n >\n <ComboboxInput {...rest} />\n <ComboboxContent />\n </Combobox>\n )\n}\n\nfunction textFromLabel(label: JSX.Element) {\n return typeof label === 'string' || typeof label === 'number' ? String(label) : ''\n}\n"],"mappings":";;;;;AAcA,SAAgBgB,cAAcC,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO;EAAC;EAAS;EAAW;CAAe,CAAC;CAE7E,OAAAG,gBACGjB,UAAQ;EAAA,IACPkB,UAAO;GAAA,OAAEH,MAAMJ;EAAO;EACtBQ,aAAW;EACXC,kBAAkBC,WAAWA,OAAOd,aAAae,cAAcD,OAAOf,KAAK;EAC3EiB,cAAcF,WAAWA,OAAOd,aAAae,cAAcD,OAAOf,KAAK;EAAC,IACxED,QAAK;GAAA,OAAEU,MAAMJ,QAAQa,MAAMH,WAAWI,OAAOJ,OAAOhB,KAAK,MAAMU,MAAMV,KAAK,KAAK;EAAI;EACnFqB,WAAWC,WAAWA,UAAUZ,MAAMH,cAAca,OAAOE,OAAOtB,KAAK,CAAC;EACxEuB,gBAAgBC,cAASZ,gBACtBd,cAAY;GAAA,IAAC2B,OAAI;IAAA,OAAED,UAAUC;GAAI;GAAA,IAAAC,WAAA;IAAA,OAAGF,UAAUC,KAAKE,SAAS1B;GAAK;EAAA,CAAA;EACnE,IAAAyB,WAAA;GAAA,OAAA,CAAAd,gBAEAf,eAAkBc,IAAI,GAAAC,gBACtBhB,iBAAe,CAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAGtB;AAEA,SAASqB,cAAchB,OAAoB;CACzC,OAAO,OAAOA,UAAU,YAAY,OAAOA,UAAU,WAAWmB,OAAOnB,KAAK,IAAI;AAClF"}
1
+ {"version":3,"file":"value-combobox.js","names":["splitProps","Combobox","ComboboxContent","ComboboxInput","ComboboxItem","value","label","textValue","choices","onValueChange","ValueCombobox","props","local","rest","_$createComponent","options","optionValue","optionTextValue","choice","textFromLabel","optionLabel","find","String","onChange","option","itemComponent","itemProps","item","children","rawValue"],"sources":["../../../../src/components/ui/combobox/value-combobox.tsx"],"sourcesContent":["import { splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { Combobox, ComboboxContent, ComboboxInput, ComboboxItem } from './combobox'\n\nexport type ValueComboboxChoice =\n | { value: string; label: string | number; textValue?: string }\n | { value: string; label: JSX.Element; textValue: string }\n\nexport type ValueComboboxProps = Omit<ComponentProps<typeof ComboboxInput>, 'value'> & {\n value: string\n choices: ValueComboboxChoice[]\n onValueChange: (value: string) => void\n}\n\n/** A single-choice combobox for a controlled string value and labelled choices. */\nexport function ValueCombobox(props: ValueComboboxProps) {\n const [local, rest] = splitProps(props, ['value', 'choices', 'onValueChange'])\n\n return (\n <Combobox\n options={local.choices}\n optionValue=\"value\"\n optionTextValue={(choice) => choice.textValue ?? textFromLabel(choice.label)}\n optionLabel={(choice) => choice.textValue ?? textFromLabel(choice.label)}\n value={local.choices.find((choice) => String(choice.value) === local.value) ?? null}\n onChange={(option) => option && local.onValueChange(String(option.value))}\n itemComponent={(itemProps) => (\n <ComboboxItem item={itemProps.item}>{itemProps.item.rawValue.label}</ComboboxItem>\n )}\n >\n <ComboboxInput {...rest} />\n <ComboboxContent />\n </Combobox>\n )\n}\n\nfunction textFromLabel(label: JSX.Element) {\n return typeof label === 'string' || typeof label === 'number' ? String(label) : ''\n}\n"],"mappings":";;;;;AAcA,SAAgBU,cAAcC,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO;EAAC;EAAS;EAAW;CAAe,CAAC;CAE7E,OAAAG,gBACGb,UAAQ;EAAA,IACPc,UAAO;GAAA,OAAEH,MAAMJ;EAAO;EACtBQ,aAAW;EACXC,kBAAkBC,WAAWA,OAAOX,aAAaY,cAAcD,OAAOZ,KAAK;EAC3Ec,cAAcF,WAAWA,OAAOX,aAAaY,cAAcD,OAAOZ,KAAK;EAAC,IACxED,QAAK;GAAA,OAAEO,MAAMJ,QAAQa,MAAMH,WAAWI,OAAOJ,OAAOb,KAAK,MAAMO,MAAMP,KAAK,KAAK;EAAI;EACnFkB,WAAWC,WAAWA,UAAUZ,MAAMH,cAAca,OAAOE,OAAOnB,KAAK,CAAC;EACxEoB,gBAAgBC,cAASZ,gBACtBV,cAAY;GAAA,IAACuB,OAAI;IAAA,OAAED,UAAUC;GAAI;GAAA,IAAAC,WAAA;IAAA,OAAGF,UAAUC,KAAKE,SAASvB;GAAK;EAAA,CAAA;EACnE,IAAAsB,WAAA;GAAA,OAAA,CAAAd,gBAEAX,eAAkBU,IAAI,GAAAC,gBACtBZ,iBAAe,CAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAGtB;AAEA,SAASiB,cAAcb,OAAoB;CACzC,OAAO,OAAOA,UAAU,YAAY,OAAOA,UAAU,WAAWgB,OAAOhB,KAAK,IAAI;AAClF"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","names":["CommandDialog","CmdkDialog","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandInput","CmdkInput","CommandItem","CmdkItem","CommandList","CmdkList","CommandLoading","CmdkLoading","CommandRoot","CmdkRoot","CommandSeparator","CmdkSeparator","useCommandState","Dialog","KobalteDialog","Search","ComponentProps","createEffect","createSignal","splitProps","createDialogLayer","menuItem","menuShortcut","overlaySurface","overlayZoom","cn","commandItem","replace","Command","props","local","rest","_$createComponent","_$mergeProps","class","CommandDialogProps","Pick","Content","dialogProps","commandProps","children","Portal","mount","container","Overlay","overlayClassName","CommandDialogContent","label","contentClassName","onOpenAutoFocus","onCloseAutoFocus","layer","event","aria-label","role","_el$","_tmpl$","_$insert","wrapper","setWrapper","HTMLDivElement","resultCount","state","filtered","count","root","selector","querySelector","setAttribute","_el$2","_tmpl$2","_$use","CommandShortcut","_el$3","_tmpl$3","_$effect","_$className","CommandStatus","_el$4","_tmpl$4","_$spread","CommandHint","_el$5","_tmpl$5","_$createComponent","CmdkRoot","_$mergeProps","KobalteDialog","CommandInput","CmdkInput","CommandList","CmdkList","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandItem","CmdkItem","CommandSeparator","CmdkSeparator","CommandLoading","CmdkLoading","_$className"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n CommandDialog as CmdkDialog,\n CommandEmpty as CmdkEmpty,\n CommandGroup as CmdkGroup,\n CommandInput as CmdkInput,\n CommandItem as CmdkItem,\n CommandList as CmdkList,\n CommandLoading as CmdkLoading,\n CommandRoot as CmdkRoot,\n CommandSeparator as CmdkSeparator,\n useCommandState,\n} from 'cmdk-solid'\nimport { Dialog as KobalteDialog } from '@kobalte/core/dialog'\nimport { Search } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport { createDialogLayer } from '../dialog/dialog-layer'\nimport { menuItem, menuShortcut, overlaySurface, overlayZoom } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n// cmdk emits data-disabled=\"false\" on enabled items, unlike the presence-only\n// attributes Kobalte menu rows use. Apply those shared disabled styles only when\n// cmdk's value is true.\nconst commandItem = menuItem\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:text-muted-foreground', '')\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology — it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * cmdk-solid supplies the filter, the scoring, the `aria-activedescendant`\n * wiring and the arrow-key navigation.\n */\nexport function Command(props: ComponentProps<typeof CmdkRoot>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkRoot\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n local.class\n )}\n {...rest}\n />\n )\n}\n\ntype CommandDialogProps = ComponentProps<typeof CmdkDialog> &\n Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>\n\nexport function CommandDialog(props: CommandDialogProps) {\n // cmdk-solid's Dialog does not forward Content autofocus props: unknown\n // props fall through to its Command root. Compose Kobalte's dialog surface\n // here so it gets the kit's focus return. Preserve the shared wrapper's\n // `class` contract on the dialog surface; `contentClassName` adds to it,\n // while the nested Command keeps its own API.\n const [local, dialogProps, commandProps] = splitProps(\n props,\n [\n 'class',\n 'contentClassName',\n 'overlayClassName',\n 'container',\n 'onCloseAutoFocus',\n 'onOpenAutoFocus',\n ],\n [\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'id',\n 'modal',\n 'preventScroll',\n 'forceMount',\n 'translations',\n ]\n )\n\n return (\n <KobalteDialog {...dialogProps}>\n <KobalteDialog.Portal mount={local.container}>\n <KobalteDialog.Overlay cmdk-overlay=\"\" class={local.overlayClassName} />\n <CommandDialogContent\n label={commandProps.label}\n class={cn(local.class, local.contentClassName)}\n onOpenAutoFocus={local.onOpenAutoFocus}\n onCloseAutoFocus={local.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </KobalteDialog.Portal>\n </KobalteDialog>\n )\n}\n\nfunction CommandDialogContent(\n props: Pick<CommandDialogProps, 'onCloseAutoFocus' | 'onOpenAutoFocus' | 'children'> & {\n label?: string\n class?: string\n }\n) {\n const layer = createDialogLayer({\n onOpenAutoFocus: (event) => props.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => props.onCloseAutoFocus?.(event),\n })\n return (\n <KobalteDialog.Content\n aria-label={props.label}\n cmdk-dialog=\"\"\n role=\"dialog\"\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n {props.children}\n </KobalteDialog.Content>\n )\n}\n\nexport function CommandInput(props: ComponentProps<typeof CmdkInput>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CmdkInput\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list.\n *\n * Two DOM corrections, and both are deliberate. cmdk builds a `role=\"listbox\"`\n * whose children include two elements ARIA does not allow there:\n *\n * - a bare `<div cmdk-list-sizer>` with no role, wrapped around every group;\n * - a `<div cmdk-separator role=\"separator\">`, and `separator` is a menu and\n * toolbar role — inside a listbox the only owned elements may be `option`\n * and `group`.\n *\n * Both are pure presentation: the sizer is layout, and the separator is a\n * hairline between groups that the groups already structure. `role=\"presentation\"`\n * is their accurate role rather than a workaround — each is flattened out of the\n * accessibility tree, and the options inside are reached exactly as before.\n *\n * Written onto the mounted nodes rather than through props, because cmdk owns\n * this markup and does not forward a `ref`; in an effect rather than `onMount`,\n * because cmdk renders the sizer with the first item, after the list itself.\n */\nexport function CommandList(props: ComponentProps<typeof CmdkList>) {\n const [local, rest] = splitProps(props, ['class'])\n const [wrapper, setWrapper] = createSignal<HTMLDivElement>()\n const resultCount = useCommandState((state) => state.filtered.count)\n\n createEffect(() => {\n const root = wrapper()\n if (!root) return\n for (const selector of ['[cmdk-list-sizer]', '[cmdk-separator]']) {\n root.querySelector(selector)?.setAttribute('role', 'presentation')\n }\n\n /*\n * A `listbox` must own at least one `option`, so a listbox with nothing in it\n * is invalid ARIA — which is what a search with no matches produces. When\n * there are no results the list is inert, so it becomes presentational and\n * the empty message carries the information instead. It keeps its `id`, so\n * the input's `aria-controls` still resolves.\n */\n root\n .querySelector('[cmdk-list]')\n ?.setAttribute('role', resultCount() > 0 ? 'listbox' : 'presentation')\n })\n\n return (\n <div ref={setWrapper} class=\"contents\">\n <CmdkList\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', local.class)}\n {...rest}\n />\n </div>\n )\n}\n\nexport function CommandEmpty(props: ComponentProps<typeof CmdkEmpty>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkEmpty\n /*\n * A status rather than plain text: when the list is presentational, this is\n * the only thing that tells a screen reader the search matched nothing.\n */\n role=\"status\"\n class={cn('text-muted-foreground py-8 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CommandGroup(props: ComponentProps<typeof CmdkGroup>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkGroup\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandItem(props: ComponentProps<typeof CmdkItem>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkItem\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung — the same primary-subtle\n // fill the settings navigation's selected row owns — instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<typeof CmdkSeparator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <CmdkSeparator class={cn('bg-border -mx-1 my-1 h-px', local.class)} {...rest} />\n}\n\nexport function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <CmdkLoading\n class={cn('text-muted-foreground py-6 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/** The keyboard hint a palette item usually carries. */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>\n )\n}\n\n/**\n * The status line a command surface reports under its list: searching, offline,\n * a partial result caveat. The copy and the live-role semantics (`status`,\n * `alert`) are the caller's — a palette's failure modes are app facts — but the\n * line's shape is not something every caller should redraw.\n */\nexport function CommandStatus(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The keyboard hint a palette footer carries, right-aligned under the list so\n * it reads as furniture rather than a result. Muted on purpose: the arrows are\n * what the user has already been doing by the time they read it.\n */\nexport function CommandHint(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAMgC,cAAcL,SACjBM,QAAQ,uCAAuC,EAAE,CAAC,CAClDA,QAAQ,yCAAyC,EAAE;;;;;;;;;;;;;;;;;AAkBtD,SAAgBC,QAAQC,OAAwC;CAC9D,MAAM,CAACC,OAA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AAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGzB,gBAAW0B,WAAA,EAAA,KAAA,WAAA;EAAA,OACHR,GAAG,kDAAkDK,MAAMI,KAAK;CAAC,EAAA,GACpEH,IAAI,CAAA;AAGd;;AAGA,SAAgByC,gBAAgB3C,OAG7B;CACD,cAAA;EAAA,IAAA4C,QAAAC,QAAA;EAAAjB,OAAAgB,aAQK5C,MAAMW,QAAQ;EAAAmC,aAAAC,UAAAH,OANRhD,GACLH,cACA,2DACAO,MAAMK,KACR,CAAC,CAAA;EAAA,OAAAuC;CAAA,EAAA,CAAA;AAKP;;;;;;;AAQA,SAAgBI,cAAchD,OAA4B;CACxD,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAiD,QAAAC,QAAA;EAAAC,OAAAF,OAAA7C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,uDAAuDK,MAAMI,KAAK;EAAC,EAAA,GACzEH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA+C;CAAA,EAAA,CAAA;AAGd;;;;;;AAOA,SAAgBG,YAAYpD,OAA4B;CACtD,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAqD,QAAAC,QAAA;EAAAH,OAAAE,OAAAjD,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,wDAAwDK,MAAMI,KAAK;EAAC,EAAA,GAC1EH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAmD;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"command.js","names":["CommandDialog","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandInput","CmdkInput","CommandItem","CmdkItem","CommandList","CmdkList","CommandLoading","CmdkLoading","CmdkRoot","CommandSeparator","CmdkSeparator","useCommandState","KobalteDialog","Search","createEffect","createSignal","splitProps","createDialogLayer","menuItem","menuShortcut","overlaySurface","overlayZoom","cn","commandItem","replace","Command","props","local","rest","_$createComponent","_$mergeProps","class","Content","dialogProps","commandProps","children","Portal","mount","container","Overlay","overlayClassName","CommandDialogContent","label","contentClassName","onOpenAutoFocus","onCloseAutoFocus","layer","event","role","_el$","_tmpl$","_$insert","wrapper","setWrapper","resultCount","state","filtered","count","root","selector","querySelector","setAttribute","_el$2","_tmpl$2","_$use","CommandShortcut","_el$3","_tmpl$3","_$effect","_$className","CommandStatus","_el$4","_tmpl$4","_$spread","CommandHint","_el$5","_tmpl$5"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n CommandDialog as CmdkDialog,\n CommandEmpty as CmdkEmpty,\n CommandGroup as CmdkGroup,\n CommandInput as CmdkInput,\n CommandItem as CmdkItem,\n CommandList as CmdkList,\n CommandLoading as CmdkLoading,\n CommandRoot as CmdkRoot,\n CommandSeparator as CmdkSeparator,\n useCommandState,\n} from 'cmdk-solid'\nimport { Dialog as KobalteDialog } from '@kobalte/core/dialog'\nimport { Search } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport { createDialogLayer } from '../dialog/dialog-layer'\nimport { menuItem, menuShortcut, overlaySurface, overlayZoom } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n// cmdk emits data-disabled=\"false\" on enabled items, unlike the presence-only\n// attributes Kobalte menu rows use. Apply those shared disabled styles only when\n// cmdk's value is true.\nconst commandItem = menuItem\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:text-muted-foreground', '')\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology — it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * cmdk-solid supplies the filter, the scoring, the `aria-activedescendant`\n * wiring and the arrow-key navigation.\n */\nexport function Command(props: ComponentProps<typeof CmdkRoot>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkRoot\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n local.class\n )}\n {...rest}\n />\n )\n}\n\ntype CommandDialogProps = ComponentProps<typeof CmdkDialog> &\n Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>\n\nexport function CommandDialog(props: CommandDialogProps) {\n // cmdk-solid's Dialog does not forward Content autofocus props: unknown\n // props fall through to its Command root. Compose Kobalte's dialog surface\n // here so it gets the kit's focus return. Preserve the shared wrapper's\n // `class` contract on the dialog surface; `contentClassName` adds to it,\n // while the nested Command keeps its own API.\n const [local, dialogProps, commandProps] = splitProps(\n props,\n [\n 'class',\n 'contentClassName',\n 'overlayClassName',\n 'container',\n 'onCloseAutoFocus',\n 'onOpenAutoFocus',\n ],\n [\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'id',\n 'modal',\n 'preventScroll',\n 'forceMount',\n 'translations',\n ]\n )\n\n return (\n <KobalteDialog {...dialogProps}>\n <KobalteDialog.Portal mount={local.container}>\n <KobalteDialog.Overlay cmdk-overlay=\"\" class={local.overlayClassName} />\n <CommandDialogContent\n label={commandProps.label}\n class={cn(local.class, local.contentClassName)}\n onOpenAutoFocus={local.onOpenAutoFocus}\n onCloseAutoFocus={local.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </KobalteDialog.Portal>\n </KobalteDialog>\n )\n}\n\nfunction CommandDialogContent(\n props: Pick<CommandDialogProps, 'onCloseAutoFocus' | 'onOpenAutoFocus' | 'children'> & {\n label?: string\n class?: string\n }\n) {\n const layer = createDialogLayer({\n onOpenAutoFocus: (event) => props.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => props.onCloseAutoFocus?.(event),\n })\n return (\n <KobalteDialog.Content\n aria-label={props.label}\n cmdk-dialog=\"\"\n role=\"dialog\"\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n {props.children}\n </KobalteDialog.Content>\n )\n}\n\nexport function CommandInput(props: ComponentProps<typeof CmdkInput>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CmdkInput\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list.\n *\n * Two DOM corrections, and both are deliberate. cmdk builds a `role=\"listbox\"`\n * whose children include two elements ARIA does not allow there:\n *\n * - a bare `<div cmdk-list-sizer>` with no role, wrapped around every group;\n * - a `<div cmdk-separator role=\"separator\">`, and `separator` is a menu and\n * toolbar role — inside a listbox the only owned elements may be `option`\n * and `group`.\n *\n * Both are pure presentation: the sizer is layout, and the separator is a\n * hairline between groups that the groups already structure. `role=\"presentation\"`\n * is their accurate role rather than a workaround — each is flattened out of the\n * accessibility tree, and the options inside are reached exactly as before.\n *\n * Written onto the mounted nodes rather than through props, because cmdk owns\n * this markup and does not forward a `ref`; in an effect rather than `onMount`,\n * because cmdk renders the sizer with the first item, after the list itself.\n */\nexport function CommandList(props: ComponentProps<typeof CmdkList>) {\n const [local, rest] = splitProps(props, ['class'])\n const [wrapper, setWrapper] = createSignal<HTMLDivElement>()\n const resultCount = useCommandState((state) => state.filtered.count)\n\n createEffect(() => {\n const root = wrapper()\n if (!root) return\n for (const selector of ['[cmdk-list-sizer]', '[cmdk-separator]']) {\n root.querySelector(selector)?.setAttribute('role', 'presentation')\n }\n\n /*\n * A `listbox` must own at least one `option`, so a listbox with nothing in it\n * is invalid ARIA — which is what a search with no matches produces. When\n * there are no results the list is inert, so it becomes presentational and\n * the empty message carries the information instead. It keeps its `id`, so\n * the input's `aria-controls` still resolves.\n */\n root\n .querySelector('[cmdk-list]')\n ?.setAttribute('role', resultCount() > 0 ? 'listbox' : 'presentation')\n })\n\n return (\n <div ref={setWrapper} class=\"contents\">\n <CmdkList\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', local.class)}\n {...rest}\n />\n </div>\n )\n}\n\nexport function CommandEmpty(props: ComponentProps<typeof CmdkEmpty>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkEmpty\n /*\n * A status rather than plain text: when the list is presentational, this is\n * the only thing that tells a screen reader the search matched nothing.\n */\n role=\"status\"\n class={cn('text-muted-foreground py-8 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CommandGroup(props: ComponentProps<typeof CmdkGroup>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkGroup\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandItem(props: ComponentProps<typeof CmdkItem>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkItem\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung — the same primary-subtle\n // fill the settings navigation's selected row owns — instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<typeof CmdkSeparator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <CmdkSeparator class={cn('bg-border -mx-1 my-1 h-px', local.class)} {...rest} />\n}\n\nexport function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <CmdkLoading\n class={cn('text-muted-foreground py-6 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/** The keyboard hint a palette item usually carries. */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>\n )\n}\n\n/**\n * The status line a command surface reports under its list: searching, offline,\n * a partial result caveat. The copy and the live-role semantics (`status`,\n * `alert`) are the caller's — a palette's failure modes are app facts — but the\n * line's shape is not something every caller should redraw.\n */\nexport function CommandStatus(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The keyboard hint a palette footer carries, right-aligned under the list so\n * it reads as furniture rather than a result. Muted on purpose: the arrows are\n * what the user has already been doing by the time they read it.\n */\nexport function CommandHint(props: ComponentProps<'p'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAM4B,cAAcL,SACjBM,QAAQ,uCAAuC,EAAE,CAAC,CAClDA,QAAQ,yCAAyC,E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I,CAAA;AACrF;AAEA,SAAgBtB,iBAAeoB,OAA2C;CACxE,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGtB,gBAAWuB,WAAA,EAAA,KAAA,WAAA;EAAA,OACHR,GAAG,kDAAkDK,MAAMI,KAAK;CAAC,EAAA,GACpEH,IAAI,CAAA;AAGd;;AAGA,SAAgBqC,gBAAgBvC,OAG7B;CACD,cAAA;EAAA,IAAAwC,QAAAC,QAAA;EAAAhB,OAAAe,aAQKxC,MAAMS,QAAQ;EAAAiC,aAAAC,UAAAH,OANR5C,GACLH,cACA,2DACAO,MAAMK,KACR,CAAC,CAAA;EAAA,OAAAmC;CAAA,EAAA,CAAA;AAKP;;;;;;;AAQA,SAAgBI,cAAc5C,OAA4B;CACxD,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAA6C,QAAAC,QAAA;EAAAC,OAAAF,OAAAzC,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,uDAAuDK,MAAMI,KAAK;EAAC,EAAA,GACzEH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA2C;CAAA,EAAA,CAAA;AAGd;;;;;;AAOA,SAAgBG,YAAYhD,OAA4B;CACtD,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAiD,QAAAC,QAAA;EAAAH,OAAAE,OAAA7C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWR,GAAG,wDAAwDK,MAAMI,KAAK;EAAC,EAAA,GAC1EH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA+C;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","names":["ContextMenu","KobalteContextMenu","ComponentProps","splitProps","topLayerProps","cn","createMenuParts","menuPanel","Root","Trigger","ContextMenuTrigger","Group","ContextMenuGroup","RadioGroup","ContextMenuRadioGroup","Sub","ContextMenuSub","ContextMenuContent","props","Content","local","rest","_$createComponent","Portal","children","_$mergeProps","class","parts","ContextMenuItem","Item","ContextMenuCheckboxItem","CheckboxItem","ContextMenuRadioItem","RadioItem","ContextMenuLabel","Label","ContextMenuSeparator","Separator","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent","_$createComponent","KobalteContextMenu","_$mergeProps"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createMenuParts, menuPanel } from '../dropdown-menu/menu-parts'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport {\n Root as ContextMenu,\n Trigger as ContextMenuTrigger,\n Group as ContextMenuGroup,\n RadioGroup as ContextMenuRadioGroup,\n Sub as ContextMenuSub,\n} from '@kobalte/core/context-menu'\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[10rem]', local.class)}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nconst parts = createMenuParts(KobalteContextMenu, 'context-menu')\n\nexport const ContextMenuItem = parts.Item\nexport const ContextMenuCheckboxItem = parts.CheckboxItem\nexport const ContextMenuRadioItem = parts.RadioItem\nexport const ContextMenuLabel = parts.Label\nexport const ContextMenuSeparator = parts.Separator\nexport const ContextMenuSubTrigger = parts.SubTrigger\nexport const ContextMenuSubContent = parts.SubContent\n"],"mappings":";;;;;;;AA4BA,SAAgBiB,mBAAmBC,OAA0D;CAC3F,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAI,gBACGrB,YAAmBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAF,gBACvBrB,YAAmBkB,SAAOM,WACrBrB,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GAAGE,WAAW,iBAAiBa,MAAMM,KAAK;EAAC,EAAA,GAC9CL,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB;AAEA,IAAMM,QAAQrB,gBAAgBL,aAAoB,cAAc;AAEhE,IAAa2B,kBAAkBD,MAAME;AACrC,IAAaC,0BAA0BH,MAAMI;AAC7C,IAAaC,uBAAuBL,MAAMM;AAC1C,IAAaC,mBAAmBP,MAAMQ;AACtC,IAAaC,uBAAuBT,MAAMU;AAC1C,IAAaC,wBAAwBX,MAAMY;AAC3C,IAAaC,wBAAwBb,MAAMc"}
1
+ {"version":3,"file":"context-menu.js","names":["KobalteContextMenu","splitProps","topLayerProps","cn","createMenuParts","menuPanel","ContextMenuContent","props","Content","local","rest","_$createComponent","Portal","children","_$mergeProps","class","parts","ContextMenuItem","Item","ContextMenuCheckboxItem","CheckboxItem","ContextMenuRadioItem","RadioItem","ContextMenuLabel","Label","ContextMenuSeparator","Separator","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createMenuParts, menuPanel } from '../dropdown-menu/menu-parts'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport {\n Root as ContextMenu,\n Trigger as ContextMenuTrigger,\n Group as ContextMenuGroup,\n RadioGroup as ContextMenuRadioGroup,\n Sub as ContextMenuSub,\n} from '@kobalte/core/context-menu'\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[10rem]', local.class)}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nconst parts = createMenuParts(KobalteContextMenu, 'context-menu')\n\nexport const ContextMenuItem = parts.Item\nexport const ContextMenuCheckboxItem = parts.CheckboxItem\nexport const ContextMenuRadioItem = parts.RadioItem\nexport const ContextMenuLabel = parts.Label\nexport const ContextMenuSeparator = parts.Separator\nexport const ContextMenuSubTrigger = parts.SubTrigger\nexport const ContextMenuSubContent = parts.SubContent\n"],"mappings":";;;;;;;AA4BA,SAAgBM,mBAAmBC,OAA0D;CAC3F,MAAM,CAACE,OAAOC,QAAQT,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAI,gBACGX,YAAmBY,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAF,gBACvBX,YAAmBQ,SAAOM,WACrBZ,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GAAGE,WAAW,iBAAiBI,MAAMM,KAAK;EAAC,EAAA,GAC9CL,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB;AAEA,IAAMM,QAAQZ,gBAAgBJ,aAAoB,cAAc;AAEhE,IAAaiB,kBAAkBD,MAAME;AACrC,IAAaC,0BAA0BH,MAAMI;AAC7C,IAAaC,uBAAuBL,MAAMM;AAC1C,IAAaC,mBAAmBP,MAAMQ;AACtC,IAAaC,uBAAuBT,MAAMU;AAC1C,IAAaC,wBAAwBX,MAAMY;AAC3C,IAAaC,wBAAwBb,MAAMc"}