@adea-ai/ui 0.162.6 → 0.162.8

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 (364) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +5 -5
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js +3 -3
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  5. package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
  6. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +22 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.js +2 -2
  10. package/dist/components/composites/action-button/action-button.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
  14. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
  16. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
  18. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
  20. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  21. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  22. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  23. package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
  24. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
  26. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  29. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
  30. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  31. package/dist/components/composites/chat/chat.js +7 -7
  32. package/dist/components/composites/chat/chat.js.map +1 -1
  33. package/dist/components/composites/checkpoint/checkpoint.js +5 -5
  34. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  35. package/dist/components/composites/confirmation/confirmation.js +13 -13
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  37. package/dist/components/composites/context/context.js +7 -7
  38. package/dist/components/composites/context/context.js.map +1 -1
  39. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  40. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  41. package/dist/components/composites/file-tree/file-tree.js +9 -9
  42. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  43. package/dist/components/composites/help-center/help-center.js +5 -5
  44. package/dist/components/composites/help-center/help-center.js.map +1 -1
  45. package/dist/components/composites/icon-picker/icon-picker.js +10 -10
  46. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  47. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
  48. package/dist/components/composites/icon-picker/shell-icons.js +117 -117
  49. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  50. package/dist/components/composites/inline-citation/inline-citation.js +7 -7
  51. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  52. package/dist/components/composites/list-row/list-row-control.js +1 -1
  53. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  54. package/dist/components/composites/list-row/list-row.js +2 -2
  55. package/dist/components/composites/list-row/list-row.js.map +1 -1
  56. package/dist/components/composites/message-scroller/message-scroller.js +7 -7
  57. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  58. package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
  59. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  60. package/dist/components/composites/model-selector/model-selector.js +12 -12
  61. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  62. package/dist/components/composites/plan/plan.js +5 -5
  63. package/dist/components/composites/plan/plan.js.map +1 -1
  64. package/dist/components/composites/prompt-input/prompt-input.js +3 -3
  65. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
  66. package/dist/components/composites/queue/queue.js +13 -13
  67. package/dist/components/composites/queue/queue.js.map +1 -1
  68. package/dist/components/composites/reasoning/reasoning.js +5 -5
  69. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  70. package/dist/components/composites/scene-controls/scene-controls.js +16 -16
  71. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  72. package/dist/components/composites/settings/settings-layout.js +2 -2
  73. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  74. package/dist/components/composites/settings/settings-navigation.js +2 -2
  75. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  76. package/dist/components/composites/settings/settings.js +5 -5
  77. package/dist/components/composites/settings/settings.js.map +1 -1
  78. package/dist/components/composites/sources/sources.js +5 -5
  79. package/dist/components/composites/sources/sources.js.map +1 -1
  80. package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
  81. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  82. package/dist/components/composites/stack-trace/stack-trace.js +10 -10
  83. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  84. package/dist/components/composites/stat/stat.js +6 -6
  85. package/dist/components/composites/stat/stat.js.map +1 -1
  86. package/dist/components/composites/subagent/subagent.js +5 -5
  87. package/dist/components/composites/subagent/subagent.js.map +1 -1
  88. package/dist/components/composites/suggestion/suggestion.js +2 -2
  89. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  90. package/dist/components/composites/task/task.js +5 -5
  91. package/dist/components/composites/task/task.js.map +1 -1
  92. package/dist/components/composites/terminal/ansi.js +1 -1
  93. package/dist/components/composites/terminal/ansi.js.map +1 -1
  94. package/dist/components/composites/terminal/terminal.js +18 -18
  95. package/dist/components/composites/terminal/terminal.js.map +1 -1
  96. package/dist/components/composites/test-results/test-results.js +17 -17
  97. package/dist/components/composites/test-results/test-results.js.map +1 -1
  98. package/dist/components/composites/tool/tool.js +5 -5
  99. package/dist/components/composites/tool/tool.js.map +1 -1
  100. package/dist/components/composites/tree/tree.js +6 -6
  101. package/dist/components/composites/tree/tree.js.map +1 -1
  102. package/dist/components/composites/update-dialog/channel-control.js +1 -1
  103. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  104. package/dist/components/composites/update-dialog/update-dialog.js +23 -23
  105. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  106. package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
  107. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  108. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
  109. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  110. package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
  111. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  112. package/dist/components/conversation/atomic/chat-composer.js +1 -1
  113. package/dist/components/conversation/busy-send-button.js +10 -10
  114. package/dist/components/conversation/busy-send-button.js.map +1 -1
  115. package/dist/components/conversation/chat-composer.js +1 -1
  116. package/dist/components/conversation/composer-core.js +1 -1
  117. package/dist/components/conversation/composer-menu.js +2 -2
  118. package/dist/components/conversation/composer-menu.js.map +1 -1
  119. package/dist/components/conversation/conversation-avatar.js +7 -7
  120. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  121. package/dist/components/conversation/conversation-pane.js +1 -1
  122. package/dist/components/conversation/conversation-pane.js.map +1 -1
  123. package/dist/components/conversation/conversation-surface.js +5 -5
  124. package/dist/components/conversation/conversation-surface.js.map +1 -1
  125. package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
  126. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  127. package/dist/components/conversation/message-composer.js +9 -9
  128. package/dist/components/conversation/message-composer.js.map +1 -1
  129. package/dist/components/conversation/message-row.js +13 -13
  130. package/dist/components/conversation/message-row.js.map +1 -1
  131. package/dist/components/conversation/paste-token-editor.js +1 -1
  132. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  133. package/dist/components/conversation/scroll-follow.js +1 -1
  134. package/dist/components/conversation/thread-panel.js +5 -5
  135. package/dist/components/conversation/thread-panel.js.map +1 -1
  136. package/dist/components/conversation/transcript-composition.js +5 -5
  137. package/dist/components/conversation/transcript-composition.js.map +1 -1
  138. package/dist/components/layout/app-shell/app-shell.js +1 -1
  139. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  140. package/dist/components/layout/app-shell/skip-link.js +1 -1
  141. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  142. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
  143. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  144. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  145. package/dist/components/layout/floating-preview/floating-preview.js +7 -7
  146. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  147. package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
  148. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  149. package/dist/components/layout/page/page.js +2 -2
  150. package/dist/components/layout/page/page.js.map +1 -1
  151. package/dist/components/layout/panel/panel.js +1 -1
  152. package/dist/components/layout/panel/panel.js.map +1 -1
  153. package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
  154. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  156. package/dist/components/layout/shell-rail/shell-rail.js +5 -5
  157. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  158. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
  159. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  160. package/dist/components/layout/side-rail/side-rail.js +2 -2
  161. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
  164. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  165. package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
  166. package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
  167. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  168. package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
  169. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  170. package/dist/components/layout/split-layout/split-layout.js +7 -7
  171. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  172. package/dist/components/layout/status-bar/status-bar.js +1 -1
  173. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  174. package/dist/components/layout/top-bar/top-bar.js +5 -5
  175. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  176. package/dist/components/layout/virtual-window/virtual-window.js +1 -1
  177. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  178. package/dist/components/motion/presence.js +1 -1
  179. package/dist/components/theme/appearance-panel.js +3 -3
  180. package/dist/components/theme/appearance-panel.js.map +1 -1
  181. package/dist/components/theme/lazy.js +3 -3
  182. package/dist/components/theme/lazy.js.map +1 -1
  183. package/dist/components/theme/script-projection.js +1 -1
  184. package/dist/components/theme/theme-catalogue-source.js +1 -1
  185. package/dist/components/theme/theme-document.js.map +1 -1
  186. package/dist/components/theme/theme-mode-toggle.js +7 -7
  187. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  188. package/dist/components/theme/theme-picker.js +2 -2
  189. package/dist/components/theme/theme-picker.js.map +1 -1
  190. package/dist/components/theme/theme-provider-value.js +1 -1
  191. package/dist/components/theme/theme-provider-value.js.map +1 -1
  192. package/dist/components/theme/theme-provider.js +1 -1
  193. package/dist/components/theme/theme-toggle.js +7 -7
  194. package/dist/components/theme/theme-toggle.js.map +1 -1
  195. package/dist/components/ui/accordion/accordion.js +13 -13
  196. package/dist/components/ui/accordion/accordion.js.map +1 -1
  197. package/dist/components/ui/alert/alert.js +12 -12
  198. package/dist/components/ui/alert/alert.js.map +1 -1
  199. package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
  200. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  201. package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
  202. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  203. package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
  204. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  205. package/dist/components/ui/attachment/attachment.js +16 -16
  206. package/dist/components/ui/attachment/attachment.js.map +1 -1
  207. package/dist/components/ui/avatar/avatar.js +1 -1
  208. package/dist/components/ui/avatar/avatar.js.map +1 -1
  209. package/dist/components/ui/badge/badge.js +2 -2
  210. package/dist/components/ui/badge/badge.js.map +1 -1
  211. package/dist/components/ui/board/board.js +2 -2
  212. package/dist/components/ui/board/board.js.map +1 -1
  213. package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
  214. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  215. package/dist/components/ui/bubble/bubble.js +2 -2
  216. package/dist/components/ui/bubble/bubble.js.map +1 -1
  217. package/dist/components/ui/button/button.js +2 -2
  218. package/dist/components/ui/button-group/button-group.js +2 -2
  219. package/dist/components/ui/button-group/button-group.js.map +1 -1
  220. package/dist/components/ui/calendar/calendar.js +8 -8
  221. package/dist/components/ui/calendar/calendar.js.map +1 -1
  222. package/dist/components/ui/callout/callout.js +2 -2
  223. package/dist/components/ui/callout/callout.js.map +1 -1
  224. package/dist/components/ui/card/card.js +2 -2
  225. package/dist/components/ui/card/card.js.map +1 -1
  226. package/dist/components/ui/carousel/carousel.js +8 -8
  227. package/dist/components/ui/carousel/carousel.js.map +1 -1
  228. package/dist/components/ui/chart/chart.js +2 -2
  229. package/dist/components/ui/chart/chart.js.map +1 -1
  230. package/dist/components/ui/checkbox/checkbox.js +6 -6
  231. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  232. package/dist/components/ui/code-block/code-block.js +6 -6
  233. package/dist/components/ui/code-block/code-block.js.map +1 -1
  234. package/dist/components/ui/collapsible/collapsible.js +7 -7
  235. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  236. package/dist/components/ui/combobox/combobox.js +21 -21
  237. package/dist/components/ui/combobox/combobox.js.map +1 -1
  238. package/dist/components/ui/combobox/value-combobox.js +1 -1
  239. package/dist/components/ui/command/command.js +23 -23
  240. package/dist/components/ui/command/command.js.map +1 -1
  241. package/dist/components/ui/context-menu/context-menu.js +2 -2
  242. package/dist/components/ui/detail-panel/detail-panel.js +5 -5
  243. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  244. package/dist/components/ui/dialog/dialog-layer.js +2 -2
  245. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  246. package/dist/components/ui/dialog/dialog.js +21 -21
  247. package/dist/components/ui/dialog/dialog.js.map +1 -1
  248. package/dist/components/ui/diff-block/diff-block.js +2 -2
  249. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  250. package/dist/components/ui/drawer/drawer.js +14 -14
  251. package/dist/components/ui/drawer/drawer.js.map +1 -1
  252. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  253. package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
  254. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  255. package/dist/components/ui/empty/empty-state.js +5 -5
  256. package/dist/components/ui/empty/empty-state.js.map +1 -1
  257. package/dist/components/ui/empty/empty.js +1 -1
  258. package/dist/components/ui/empty/empty.js.map +1 -1
  259. package/dist/components/ui/entity-icon/entity-icon.js +2 -2
  260. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  261. package/dist/components/ui/field/field.js +14 -14
  262. package/dist/components/ui/field/field.js.map +1 -1
  263. package/dist/components/ui/field/number-field.js +2 -2
  264. package/dist/components/ui/field/number-field.js.map +1 -1
  265. package/dist/components/ui/hover-card/hover-card.js +10 -10
  266. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  267. package/dist/components/ui/input/input-control.js +1 -1
  268. package/dist/components/ui/input/input-control.js.map +1 -1
  269. package/dist/components/ui/input/input.js +2 -2
  270. package/dist/components/ui/input/input.js.map +1 -1
  271. package/dist/components/ui/input-group/input-group.js +2 -2
  272. package/dist/components/ui/input-group/input-group.js.map +1 -1
  273. package/dist/components/ui/input-group/secret-input-group.js +2 -2
  274. package/dist/components/ui/input-otp/input-otp.js +2 -2
  275. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  276. package/dist/components/ui/item/item.js +2 -2
  277. package/dist/components/ui/item/item.js.map +1 -1
  278. package/dist/components/ui/kbd/kbd.js +2 -2
  279. package/dist/components/ui/kbd/kbd.js.map +1 -1
  280. package/dist/components/ui/label/label.js +1 -1
  281. package/dist/components/ui/label/label.js.map +1 -1
  282. package/dist/components/ui/marker/marker.js +2 -2
  283. package/dist/components/ui/marker/marker.js.map +1 -1
  284. package/dist/components/ui/menubar/menubar.js +7 -7
  285. package/dist/components/ui/menubar/menubar.js.map +1 -1
  286. package/dist/components/ui/message/message.js +3 -3
  287. package/dist/components/ui/message/message.js.map +1 -1
  288. package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
  289. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  290. package/dist/components/ui/native-select/native-select.js +5 -5
  291. package/dist/components/ui/native-select/native-select.js.map +1 -1
  292. package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
  293. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  294. package/dist/components/ui/pagination/pagination.js +28 -28
  295. package/dist/components/ui/pagination/pagination.js.map +1 -1
  296. package/dist/components/ui/popover/popover.js +15 -15
  297. package/dist/components/ui/popover/popover.js.map +1 -1
  298. package/dist/components/ui/progress/progress.js +5 -5
  299. package/dist/components/ui/progress/progress.js.map +1 -1
  300. package/dist/components/ui/questionnaire/questionnaire.js +10 -10
  301. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  302. package/dist/components/ui/radio-group/radio-group.js +9 -9
  303. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  304. package/dist/components/ui/resizable/resizable.js +11 -11
  305. package/dist/components/ui/resizable/resizable.js.map +1 -1
  306. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  308. package/dist/components/ui/select/select.js +21 -21
  309. package/dist/components/ui/select/select.js.map +1 -1
  310. package/dist/components/ui/separator/separator.js +5 -5
  311. package/dist/components/ui/separator/separator.js.map +1 -1
  312. package/dist/components/ui/sheet/sheet.js +6 -6
  313. package/dist/components/ui/sheet/sheet.js.map +1 -1
  314. package/dist/components/ui/skeleton/skeleton.js +1 -1
  315. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  316. package/dist/components/ui/slider/slider.js +5 -5
  317. package/dist/components/ui/slider/slider.js.map +1 -1
  318. package/dist/components/ui/spinner/spinner.js +5 -5
  319. package/dist/components/ui/spinner/spinner.js.map +1 -1
  320. package/dist/components/ui/status-chip/status-chip.js +2 -2
  321. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  322. package/dist/components/ui/switch/switch.js +4 -4
  323. package/dist/components/ui/switch/switch.js.map +1 -1
  324. package/dist/components/ui/table/table.js +1 -1
  325. package/dist/components/ui/table/table.js.map +1 -1
  326. package/dist/components/ui/tabs/tabs.js +7 -7
  327. package/dist/components/ui/tabs/tabs.js.map +1 -1
  328. package/dist/components/ui/text-link/text-link.js +1 -1
  329. package/dist/components/ui/text-link/text-link.js.map +1 -1
  330. package/dist/components/ui/textarea/textarea.js +2 -2
  331. package/dist/components/ui/textarea/textarea.js.map +1 -1
  332. package/dist/components/ui/toast/toast.js +7 -7
  333. package/dist/components/ui/toast/toast.js.map +1 -1
  334. package/dist/components/ui/toggle/toggle.js +6 -6
  335. package/dist/components/ui/toggle/toggle.js.map +1 -1
  336. package/dist/components/ui/toggle-group/toggle-group.js +7 -8
  337. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  338. package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
  339. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  340. package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
  341. package/dist/components/ui/tooltip/tooltip.js +10 -10
  342. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  343. package/dist/components/ui/trace/trace.js +19 -19
  344. package/dist/components/ui/trace/trace.js.map +1 -1
  345. package/dist/components/ui/typography/typography.js +2 -2
  346. package/dist/lib/accent-presets.js +1 -1
  347. package/dist/lib/accent-roles.js +2 -2
  348. package/dist/lib/async-action.js +1 -1
  349. package/dist/lib/create-poll.js +1 -1
  350. package/dist/lib/create-poll.js.map +1 -1
  351. package/dist/lib/external-link.js +1 -1
  352. package/dist/lib/external-link.js.map +1 -1
  353. package/dist/lib/fast-icon.js +1 -1
  354. package/dist/lib/theme-css.js +1 -1
  355. package/dist/lib/theme-engine-light.js +1 -1
  356. package/dist/lib/theme-projection.js +2 -2
  357. package/dist/lib/theme-records.js +1 -1
  358. package/dist/lib/themes.js +1 -1
  359. package/dist/lib/themes.js.map +1 -1
  360. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  361. package/dist/lib/utils.js +1 -1
  362. package/dist/vite/source-parser.js +1 -1
  363. package/dist/vite/tailwind-sources.js +1 -1
  364. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"theme-picker.js","names":["<For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>","<span\n data-slot=\"theme-swatch\"\n aria-hidden=\"true\"\n class={cn(\n 'border-border inline-flex shrink-0 overflow-hidden rounded-md border',\n local.class\n )}\n {...rest}\n >\n <For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>\n </span>","'--preview-edge': c().sidebarBorder","'background-color': c().primary","'background-color': c().sidebarAccent","'background-color': c().foreground","'background-color': c().mutedForeground","'background-color': c().destructiveAction","'background-color': c().secondary","<div\n data-slot=\"theme-preview\"\n class={cn(\n 'w-44 overflow-hidden rounded-lg border shadow-xs',\n local.selected ? 'border-primary ring-3 ring-primary-subtle' : 'border-border',\n local.class\n )}\n style={{ 'background-color': c().background }}\n {...rest}\n >\n <div class=\"flex h-24\">\n {/* A rail and a panel: the two surfaces a user spends the day looking at. */}\n <div\n class=\"theme-preview-edge flex w-6 flex-col items-center gap-1.5 border-e py-2\"\n style={{ 'background-color': c().sidebar, '--preview-edge': c().sidebarBorder }}\n >\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n </div>\n <div class=\"flex flex-1 flex-col gap-1.5 p-2\">\n <div class=\"h-1.5 w-14 rounded-full\" style={{ 'background-color': c().foreground }} />\n <div class=\"h-1 w-20 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"h-1 w-16 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"mt-auto flex items-center gap-1\">\n <span class=\"h-3 w-9 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span\n class=\"h-3 w-6 rounded-sm\"\n style={{ 'background-color': c().destructiveAction }}\n />\n <span class=\"h-3 w-6 rounded-sm\" style={{ 'background-color': c().secondary }} />\n </div>\n </div>\n </div>\n </div>","role=\"radiogroup\"","<For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>","<Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>","as=\"button\"","type=\"button\"","variant=\"ghost\"","size=\"sm\"","role=\"radio\"","class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"","onClick={() => local.onThemeSelect(theme)}","<ThemePreview theme={theme} selected={local.selectedId === theme.id} />","<div\n data-slot=\"theme-picker\"\n role=\"radiogroup\"\n aria-label=\"Theme\"\n class={cn('flex flex-wrap gap-3', local.class)}\n {...rest}\n >\n <For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>\n </div>","_$readShallow","_$setStyleProperty"],"sources":["../../../src/components/theme/theme-picker.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport type { ThemeVariant } from '#lib/theme-types'\nimport { Button } from '../ui/button'\n\n/**\n * ThemeSwatch.\n *\n * The colours of a theme, as a small readable strip: the canvas, a card, the\n * primary, an accent and the destructive fill. Enough to tell two dark themes\n * apart at a glance and to recognise the one you want without applying it.\n *\n * A swatch is **read from the variant object**, not from a stylesheet, so a picker\n * can show a theme that is not currently applied, which is the whole point of a\n * picker. That is also why the catalogue is data rather than CSS.\n */\nexport type ThemeSwatchProps = ComponentProps<'span'> & {\n theme: ThemeVariant\n /** Draw the swatch at the given size. */\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst swatchSizes = {\n sm: 'h-4 w-4',\n md: 'h-6 w-6',\n lg: 'h-8 w-8',\n} as const\n\nexport function ThemeSwatch(props: ThemeSwatchProps) {\n const local = props\n const rest = omit(props, 'class', 'theme', 'size')\n const colors = () => local.theme.colors\n\n return (\n <span\n data-slot=\"theme-swatch\"\n aria-hidden=\"true\"\n class={cn(\n 'border-border inline-flex shrink-0 overflow-hidden rounded-md border',\n local.class\n )}\n {...rest}\n >\n <For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>\n </span>\n )\n}\n\n/**\n * ThemePreview.\n *\n * A miniature of the interface, painted in a theme's own colours: a rail, a panel,\n * a heading, body text, a primary button and a destructive one.\n *\n * The point is that a colour strip cannot answer the question a user actually has,\n * \"would I want to look at this all day?\", and a real preview can. It is drawn\n * with inline colours from the variant rather than by applying the theme, so a list\n * of twenty previews costs one object read each instead of twenty theme swaps.\n */\nexport type ThemePreviewProps = ComponentProps<'div'> & {\n theme: ThemeVariant\n /** Highlight the preview as the current selection. */\n selected?: boolean\n}\n\nexport function ThemePreview(props: ThemePreviewProps) {\n const local = props\n const rest = omit(props, 'class', 'theme', 'selected')\n const c = () => local.theme.colors\n\n return (\n <div\n data-slot=\"theme-preview\"\n class={cn(\n 'w-44 overflow-hidden rounded-lg border shadow-xs',\n local.selected ? 'border-primary ring-3 ring-primary-subtle' : 'border-border',\n local.class\n )}\n style={{ 'background-color': c().background }}\n {...rest}\n >\n <div class=\"flex h-24\">\n {/* A rail and a panel: the two surfaces a user spends the day looking at. */}\n <div\n class=\"theme-preview-edge flex w-6 flex-col items-center gap-1.5 border-e py-2\"\n style={{ 'background-color': c().sidebar, '--preview-edge': c().sidebarBorder }}\n >\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n </div>\n <div class=\"flex flex-1 flex-col gap-1.5 p-2\">\n <div class=\"h-1.5 w-14 rounded-full\" style={{ 'background-color': c().foreground }} />\n <div class=\"h-1 w-20 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"h-1 w-16 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"mt-auto flex items-center gap-1\">\n <span class=\"h-3 w-9 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span\n class=\"h-3 w-6 rounded-sm\"\n style={{ 'background-color': c().destructiveAction }}\n />\n <span class=\"h-3 w-6 rounded-sm\" style={{ 'background-color': c().secondary }} />\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * ThemePicker.\n *\n * The catalogue as a selectable grid. One appearance at a time, a light picker\n * lists light themes and a dark picker lists dark ones, because choosing a dark\n * theme while looking at a light interface is a choice nobody can evaluate.\n *\n * `onSelect` rather than an internal signal: the selection belongs to the\n * preference the provider owns, and a picker that kept its own copy could disagree\n * with what is applied.\n */\nexport type ThemePickerProps = ComponentProps<'div'> & {\n themes: readonly ThemeVariant[]\n selectedId: string\n onThemeSelect: (theme: ThemeVariant) => void\n}\n\nexport function ThemePicker(props: ThemePickerProps) {\n const local = props\n const rest = omit(props, 'class', 'themes', 'selectedId', 'onThemeSelect')\n\n return (\n <div\n data-slot=\"theme-picker\"\n role=\"radiogroup\"\n aria-label=\"Theme\"\n class={cn('flex flex-wrap gap-3', local.class)}\n {...rest}\n >\n <For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,MAAM;CACjD,MAAM,eAAe,MAAM,MAAM;CAG/B,IAAA,OAAA,OAyBM;CAlBJ,OAAA,MAAA,CAAA;EANA,aAAA;EACA,eAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,wEACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAPN,OAAA,MASEA,gBAAAA,KAAAA;EACE,IAAA,OAAA;GAAM,OAAA;IACJ,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;GACX;EAAC;EAPHA,WASI,iBACA;GAGC,IAAA,QAAA,OAAA;GADU,iBAAA,OAAA,oBAAoB,KAAI;GADjC,aAAAsB,YAAO,GAAG,SAAS,YAAY,MAAM,QAAQ,KAAK,CAAC,IAAnD,KAAA,QAAA;IAAmD,UAAA,OAAA,KAAA,GAAA;;GADrD,OAAA;EAGC,EAAA,CAAA;CAEA,CAAA,CACD;CA1BR,OACErB;AA2BJ;AAmBA,SAAgB,aAAa,OAA0B;CACrD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,UAAU;CACrD,MAAM,UAAU,MAAM,MAAM;CAG1B,IAAA,QAAA,QAkCK;CAtBD,IAAA,QAFF,MAAA,WAEE;CAIE,IAAA,QAAA,MA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AA,WADJ;QAAsE,IAAA,SAAA,QAAA;QAAtE,OAAA,cAA6C;SAAC,OAAA,MAAM;QAAW,CAAO;QAAtE,OAAA;OAAsE,EAAA,CAAA,IADxE,KAAA;MAEM;KAAC,EAAA,CAAD,GAJR,IAKM;KALN,OAAA;IAKM,EAAA,CAAA,CANP;GAOO;;CAEP,CAAA,CACF;CAnCP,OACEC;AAoCJ"}
1
+ {"version":3,"file":"theme-picker.js","names":["<For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>","<span\n data-slot=\"theme-swatch\"\n aria-hidden=\"true\"\n class={cn(\n 'border-border inline-flex shrink-0 overflow-hidden rounded-md border',\n local.class\n )}\n {...rest}\n >\n <For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>\n </span>","'--preview-edge': c().sidebarBorder","'background-color': c().primary","'background-color': c().sidebarAccent","'background-color': c().foreground","'background-color': c().mutedForeground","'background-color': c().destructiveAction","'background-color': c().secondary","<div\n data-slot=\"theme-preview\"\n class={cn(\n 'w-44 overflow-hidden rounded-lg border shadow-xs',\n local.selected ? 'border-primary ring-3 ring-primary-subtle' : 'border-border',\n local.class\n )}\n style={{ 'background-color': c().background }}\n {...rest}\n >\n <div class=\"flex h-24\">\n {/* A rail and a panel: the two surfaces a user spends the day looking at. */}\n <div\n class=\"theme-preview-edge flex w-6 flex-col items-center gap-1.5 border-e py-2\"\n style={{ 'background-color': c().sidebar, '--preview-edge': c().sidebarBorder }}\n >\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n </div>\n <div class=\"flex flex-1 flex-col gap-1.5 p-2\">\n <div class=\"h-1.5 w-14 rounded-full\" style={{ 'background-color': c().foreground }} />\n <div class=\"h-1 w-20 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"h-1 w-16 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"mt-auto flex items-center gap-1\">\n <span class=\"h-3 w-9 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span\n class=\"h-3 w-6 rounded-sm\"\n style={{ 'background-color': c().destructiveAction }}\n />\n <span class=\"h-3 w-6 rounded-sm\" style={{ 'background-color': c().secondary }} />\n </div>\n </div>\n </div>\n </div>","role=\"radiogroup\"","<For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>","<Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>","as=\"button\"","type=\"button\"","variant=\"ghost\"","size=\"sm\"","role=\"radio\"","class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"","onClick={() => local.onThemeSelect(theme)}","<ThemePreview theme={theme} selected={local.selectedId === theme.id} />","<div\n data-slot=\"theme-picker\"\n role=\"radiogroup\"\n aria-label=\"Theme\"\n class={cn('flex flex-wrap gap-3', local.class)}\n {...rest}\n >\n <For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>\n </div>","_$spread","_$insert","_$setStyleProperty","_$effect","_$readShallow","_$className"],"sources":["../../../src/components/theme/theme-picker.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport type { ThemeVariant } from '#lib/theme-types'\nimport { Button } from '../ui/button'\n\n/**\n * ThemeSwatch.\n *\n * The colours of a theme, as a small readable strip: the canvas, a card, the\n * primary, an accent and the destructive fill. Enough to tell two dark themes\n * apart at a glance and to recognise the one you want without applying it.\n *\n * A swatch is **read from the variant object**, not from a stylesheet, so a picker\n * can show a theme that is not currently applied, which is the whole point of a\n * picker. That is also why the catalogue is data rather than CSS.\n */\nexport type ThemeSwatchProps = ComponentProps<'span'> & {\n theme: ThemeVariant\n /** Draw the swatch at the given size. */\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst swatchSizes = {\n sm: 'h-4 w-4',\n md: 'h-6 w-6',\n lg: 'h-8 w-8',\n} as const\n\nexport function ThemeSwatch(props: ThemeSwatchProps) {\n const local = props\n const rest = omit(props, 'class', 'theme', 'size')\n const colors = () => local.theme.colors\n\n return (\n <span\n data-slot=\"theme-swatch\"\n aria-hidden=\"true\"\n class={cn(\n 'border-border inline-flex shrink-0 overflow-hidden rounded-md border',\n local.class\n )}\n {...rest}\n >\n <For\n each={[\n colors().background,\n colors().card,\n colors().primary,\n colors().accent,\n colors().destructiveAction,\n ]}\n >\n {(color) => (\n <span\n class={cn('block', swatchSizes[local.size ?? 'md'])}\n style={{ 'background-color': color }}\n />\n )}\n </For>\n </span>\n )\n}\n\n/**\n * ThemePreview.\n *\n * A miniature of the interface, painted in a theme's own colours: a rail, a panel,\n * a heading, body text, a primary button and a destructive one.\n *\n * The point is that a colour strip cannot answer the question a user actually has,\n * \"would I want to look at this all day?\", and a real preview can. It is drawn\n * with inline colours from the variant rather than by applying the theme, so a list\n * of twenty previews costs one object read each instead of twenty theme swaps.\n */\nexport type ThemePreviewProps = ComponentProps<'div'> & {\n theme: ThemeVariant\n /** Highlight the preview as the current selection. */\n selected?: boolean\n}\n\nexport function ThemePreview(props: ThemePreviewProps) {\n const local = props\n const rest = omit(props, 'class', 'theme', 'selected')\n const c = () => local.theme.colors\n\n return (\n <div\n data-slot=\"theme-preview\"\n class={cn(\n 'w-44 overflow-hidden rounded-lg border shadow-xs',\n local.selected ? 'border-primary ring-3 ring-primary-subtle' : 'border-border',\n local.class\n )}\n style={{ 'background-color': c().background }}\n {...rest}\n >\n <div class=\"flex h-24\">\n {/* A rail and a panel: the two surfaces a user spends the day looking at. */}\n <div\n class=\"theme-preview-edge flex w-6 flex-col items-center gap-1.5 border-e py-2\"\n style={{ 'background-color': c().sidebar, '--preview-edge': c().sidebarBorder }}\n >\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n <span class=\"size-2.5 rounded-sm\" style={{ 'background-color': c().sidebarAccent }} />\n </div>\n <div class=\"flex flex-1 flex-col gap-1.5 p-2\">\n <div class=\"h-1.5 w-14 rounded-full\" style={{ 'background-color': c().foreground }} />\n <div class=\"h-1 w-20 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"h-1 w-16 rounded-full\" style={{ 'background-color': c().mutedForeground }} />\n <div class=\"mt-auto flex items-center gap-1\">\n <span class=\"h-3 w-9 rounded-sm\" style={{ 'background-color': c().primary }} />\n <span\n class=\"h-3 w-6 rounded-sm\"\n style={{ 'background-color': c().destructiveAction }}\n />\n <span class=\"h-3 w-6 rounded-sm\" style={{ 'background-color': c().secondary }} />\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * ThemePicker.\n *\n * The catalogue as a selectable grid. One appearance at a time, a light picker\n * lists light themes and a dark picker lists dark ones, because choosing a dark\n * theme while looking at a light interface is a choice nobody can evaluate.\n *\n * `onSelect` rather than an internal signal: the selection belongs to the\n * preference the provider owns, and a picker that kept its own copy could disagree\n * with what is applied.\n */\nexport type ThemePickerProps = ComponentProps<'div'> & {\n themes: readonly ThemeVariant[]\n selectedId: string\n onThemeSelect: (theme: ThemeVariant) => void\n}\n\nexport function ThemePicker(props: ThemePickerProps) {\n const local = props\n const rest = omit(props, 'class', 'themes', 'selectedId', 'onThemeSelect')\n\n return (\n <div\n data-slot=\"theme-picker\"\n role=\"radiogroup\"\n aria-label=\"Theme\"\n class={cn('flex flex-wrap gap-3', local.class)}\n {...rest}\n >\n <For each={local.themes}>\n {(theme) => (\n <Button\n as=\"button\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n role=\"radio\"\n aria-checked={local.selectedId === theme.id ? 'true' : 'false'}\n aria-label={`${theme.familyLabel} ${theme.label}`}\n // `justify-start`: the options in a wrapped row stretch to its tallest\n // member, and an option whose label has a second line (the family)\n // is that member. Centred, every shorter option's preview dropped below\n // its neighbours'; pinned to the top, the previews share one line.\n class=\"h-auto flex-col justify-start gap-1.5 p-0 hover:bg-transparent\"\n onClick={() => local.onThemeSelect(theme)}\n >\n <ThemePreview theme={theme} selected={local.selectedId === theme.id} />\n <span class=\"flex flex-col items-center\">\n <span class=\"text-xs font-medium\">{theme.label}</span>\n <Show when={theme.family !== 'adea'}>\n <span class=\"text-muted-foreground text-2xs\">{theme.familyLabel}</span>\n </Show>\n </span>\n </Button>\n )}\n </For>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,MAAM;CACjD,MAAM,eAAe,MAAM,MAAM;CAG/B,IAAA,OAAA,OAyBM;CAlBJsB,OAAA,MAAA,CAAA;EANA,aAAA;EACA,eAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,wEACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAPNC,OAAA,MASEvB,gBAAAA,KAAAA;EACE,IAAA,OAAA;GAAM,OAAA;IACJ,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IACT,OAAO,CAAC,CAAC;IAC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AK;GACLC,MAAK;GACL,IAAA,iBAAA;IAAc,OAAA,MAAM,eAAe,MAAM,KAAK,SAAS;GAAO;GAC9D,IAAA,eAAA;IAAY,OAAA,GAAG,MAAM,YAAY,GAAG,MAAM;GAAO;GAKjDC,OAAM;GACNC,eAAe,MAAM,cAAc,KAAK;GAb1C,IAAA,WAAA;IAcC,OAAA,CACCC,gBAAAA,cAAAA;KAAqB;KAAO,IAAA,WAAA;MAAU,OAAA,MAAM,eAAe,MAAM;KAAE;IAAG,CAAA,UACtE;KAKM,IAAA,SAAA,QAAA;KAJJ,IAAA,SAAA,OAAA;KAAkCG,OAAA,cAAA;MAAC,OAAA,MAAM;KAAK,CAAO;KADvDA,OAAA,eAEE;;OAAY,OAAA,MAAM,WAAW;MAEvB,CAAA;MAFN,aAAA;OAEM,OAAA,IAAA,WADJ;QAAsE,IAAA,SAAA,QAAA;QAAtEA,OAAA,cAA6C;SAAC,OAAA,MAAM;QAAW,CAAO;QAAtE,OAAA;OAAsE,EAAA,CAAA,IADxE,KAAA;MAEM;KAAC,EAAA,CAAD,GAJR,IAKM;KALN,OAAA;IAKM,EAAA,CAAA,CANP;GAOO;;CAEP,CAAA,CACF;CAnCP,OACEF;AAoCJ"}
@@ -1,3 +1,4 @@
1
+ import { createComponent, createEffect, createMemo, createSignal, onCleanup, untrack } from "solid-js";
1
2
  import { assertThemeTokenProjectionConfig } from "./token-projection-options.js";
2
3
  import { fontZoomShortcut } from "../../lib/font-zoom.js";
3
4
  import "../../lib/theme-defaults.js";
@@ -7,7 +8,6 @@ import { themeContext } from "./theme-context.js";
7
8
  import { applyThemeToRoot, applyWithoutTransitions } from "./theme-document.js";
8
9
  import { localStoragePersistence, readPersisted, writePersisted } from "./theme-persistence.js";
9
10
  import { accentRolesForState, initialThemeSelection, mergeRegistry, mergeThemeSelection, resolveCodeVariant, resolveTerminalVariant, resolveThemeState, zoomedFontSettings } from "./theme-state.js";
10
- import { createComponent, createEffect, createMemo, createSignal, onCleanup, untrack } from "solid-js";
11
11
  // src/components/theme/theme-provider-value.ts
12
12
  /** The operating system's Reduce Transparency query, where there is a window to ask. */
13
13
  function reducedTransparencyMedia() {
@@ -1 +1 @@
1
- {"version":3,"file":"theme-provider-value.js","names":[],"sources":["../../../src/components/theme/theme-provider-value.ts"],"sourcesContent":["import type { JSX } from '@solidjs/web'\nimport {\n createComponent,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n untrack,\n} from 'solid-js'\nimport type { ThemeTokenProjectionOptions } from './token-projection'\nimport { assertThemeTokenProjectionConfig } from './token-projection-options'\nimport { fontZoomShortcut, type FontZoomIntent } from '#lib/font-zoom'\nimport { DEFAULT_THEME_STORAGE_KEY } from '#lib/theme-defaults'\nimport { REDUCED_TRANSPARENCY_QUERY, resolveSurfaceState } from '#lib/theme-surface'\nimport { needsCatalogue, pairNeedsData, type ThemeEngine } from '#lib/theme-engine'\nimport type { EditorRolesMode, ThemeAppearance, ThemeVariant } from '#lib/theme-types'\nimport { themeContext } from './theme-context'\nimport { applyThemeToRoot, applyWithoutTransitions } from './theme-document'\nimport {\n localStoragePersistence,\n readPersisted,\n writePersisted,\n type ThemePersistence,\n} from './theme-persistence'\nimport {\n accentRolesForState,\n initialThemeSelection,\n mergeRegistry,\n mergeThemeSelection,\n resolveCodeVariant,\n resolveTerminalVariant,\n resolveThemeState,\n zoomedFontSettings,\n type ThemeContextValue,\n type ThemeSelection,\n} from './theme-state'\n\n/**\n * The props both `ThemeProvider`s take.\n *\n * ## What a preference is\n *\n * Four independent choices (`ThemeSelection`), and keeping them independent is the\n * point: appearance, a theme per appearance, an accent and fonts. They compose: a\n * user who wants Nord with a violet accent and the system font should not need\n * someone to author that combination.\n *\n * ## Where the rules live\n *\n * The provider is wiring. What a selection merges to and resolves to is\n * `theme-state.ts`; what lands on `<html>` is `theme-document.ts`; where the\n * preference is kept is `theme-persistence.ts`.\n *\n * ## Why the variants are applied as inline properties\n *\n * The catalogue is data, and a theme is applied by writing its roles onto\n * `<html>` as custom properties. That is what makes an imported palette work\n * without a hand-written `[data-theme]` block per theme, and it is why a settings\n * UI can show a preview by reading the same object rather than by loading a\n * stylesheet. `theme.css` keeps the default theme's values so the first paint is\n * correct before any script runs.\n */\nexport type ThemeProviderProps = {\n children?: JSX.Element\n /** Where the preference is persisted. Distinct per application. */\n storageKey?: string\n /** Start from this instead of the stored preference. */\n initial?: Partial<ThemeSelection>\n /**\n * The selection, owned by the caller.\n *\n * For a consumer that keeps the state itself — a settings store, or a workshop\n * whose selection lives in Storybook globals — rather than handing it to this\n * provider's signal. Each change lands here and the document follows; nothing is\n * written to the store, because the caller is the one who persists. A picker\n * below the provider still works, and its change is the caller's to read back.\n *\n * Absent, the provider is the whole owner: it reads `storageKey` on mount,\n * seeds from `initial`, and persists every `setSelection`.\n */\n selection?: Partial<ThemeSelection>\n /**\n * Where the preference is kept, in place of `localStorage` under `storageKey`.\n *\n * Read once when the provider is created, so changing the prop later does not\n * move the store. `storageKey` is ignored when this is given.\n */\n persistence?: ThemePersistence\n /**\n * Variants the host adds to the built-in catalogue — themes a user imported.\n *\n * A function is read inside the provider's reactive scope, so one that reads a\n * signal keeps the picker and the document current when the set changes. A\n * stored id that names no variant, built in or added, paints the default of its\n * appearance and stays in the selection untouched.\n */\n themes?: readonly ThemeVariant[] | (() => readonly ThemeVariant[])\n /**\n * Rewrites the custom properties of each pass before they are written to\n * `<html>`: the variant's roles with the accent over them. `tokensAsHex` from\n * `lib/themes` is the one the system ships.\n */\n transformTokens?: (tokens: Record<string, string>) => Record<string, string>\n /**\n * Switch CSS transitions off for the frame that carries a change, so a theme\n * switch cannot animate the whole page. Off by default: it adds a `<style>`\n * element to `<head>` for two frames on every change.\n */\n disableTransitionOnChange?: boolean\n /**\n * The contrast ratio an accent is held to against the variant's background,\n * repaired to the nearest passing colour when it falls short. Absent, presets\n * are painted verbatim — the catalogue measured them for its own themes — and\n * only a custom `#rrggbb` is held to 3:1. A host that adds themes the catalogue\n * never measured passes 3 to hold the presets to it as well; for the catalogue's\n * own themes the floor changes no preset.\n */\n accentContrastFloor?: number\n /**\n * Turns the surface axis on: `selection.surface` and `selection.reduceTransparency`\n * are resolved against the operating system's Reduce Transparency setting and the\n * host's capability, and `data-surface`, `data-reduce-transparency` and\n * `--surface-alpha` are written to `<html>` (the frost rule in `theme.css` reads\n * them). Off by default: a provider that never opts in writes none of them, adds no\n * media-query listener, and stores nothing new.\n *\n * An object also states the host's capability. `nativeTranslucency` is whether the\n * window can render the OS's own translucency; without it a `translucent`\n * preference paints the tokenized `frosted` surface instead of pretending to\n * vibrancy. A function is read inside the provider's reactive scope, for a\n * capability that is learned after mount.\n *\n * A selection that already carries a `surface` turns the axis on for itself, so a\n * host that stores the field gets the same document without the prop.\n */\n surface?: boolean | { nativeTranslucency?: boolean | (() => boolean) }\n /**\n * Where a catalogue variant's palette comes from. `inline` (the default) writes\n * every role onto `<html>`. `stylesheet` leaves a catalogue variant to the host's\n * `[data-theme]` stylesheet and writes inline only what no stylesheet can know: a\n * host's own `themes`, the accent, the pinned terminal palette, the surface alpha\n * and the fonts. Switching from a host variant back to a catalogue one removes the\n * properties the host variant wrote.\n */\n palette?: 'inline' | 'stylesheet'\n /**\n * The projection behind the `--editor-*` ramp. `syntax` (the default) is the\n * catalogue's quiet syntax roles, a comment among them deliberately below\n * body-text contrast. `floor` holds every role to 4.5:1 on the canvas, as\n * hex, for a host that renders code as content (a diff, a file view) rather than\n * as decoration.\n *\n * Applies to catalogue variants; a host's own `themes` keep their `editor` and\n * their `tokens`. With `palette=\"stylesheet\"` it is the one palette property a\n * catalogue variant still writes inline, because `theme-variants.css` is generated\n * for `syntax`. Absent, nothing changes.\n */\n editorRoles?: EditorRolesMode\n /**\n * Bind the platform zoom chords (Cmd or Ctrl with `=`, `+`, `-`, `0`) to the three\n * text sizes instead of the browser's page zoom: stepping them together is zoom\n * inside the persisted type system. Off by default: it adds a capturing `keydown`\n * listener to `window`, and an event already handled elsewhere is left alone.\n * `zoomFonts` on the context does the same from a menu or a host's own binding.\n */\n fontZoom?: boolean\n} & ThemeTokenProjectionOptions\n\n/**\n * Where the provider's catalogue questions are answered, and whether the whole\n * catalogue is available yet.\n *\n * The eager provider's source is the full catalogue and is always loaded. The lazy\n * provider's source starts on the default pair that ships with it and swaps to the\n * full catalogue when {@link ThemeCatalogueSource.load} resolves. Both read the same\n * way in the provider: `engine()` is reactive, so everything derived from it follows\n * the swap.\n */\nexport type ThemeCatalogueSource = {\n /** The engine answering catalogue questions now. Changes once, when loading completes. */\n engine: () => ThemeEngine\n /** True when `engine()` is the full catalogue. */\n loaded: () => boolean\n /** True when loading failed; the provider then paints what it can without the rest. */\n failed: () => boolean\n /** Start loading the full catalogue (idempotent). Resolves when `loaded()` is true. */\n load: () => Promise<void>\n}\n\n/** The operating system's Reduce Transparency query, where there is a window to ask. */\nfunction reducedTransparencyMedia(): MediaQueryList | undefined {\n return typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia(REDUCED_TRANSPARENCY_QUERY)\n : undefined\n}\n\n/**\n * The provider, parameterised by where its catalogue comes from: the eager\n * `ThemeProvider` passes the whole catalogue, the lazy one a source that loads it.\n * Nothing here imports catalogue code or data, which is what lets the lazy entry keep\n * them out of a consumer's start-up chunk.\n */\n\n/** Selections are small plain records built in one key order, so this is exact. */\nfunction sameThemeSelection(a: ThemeSelection, b: ThemeSelection) {\n return a === b || JSON.stringify(a) === JSON.stringify(b)\n}\n\nexport function ThemeProviderWith(\n props: ThemeProviderProps & { catalogue: ThemeCatalogueSource }\n): JSX.Element {\n const value = createThemeContextValue(props)\n return createComponent(themeContext(), {\n value,\n get children() {\n return props.children\n },\n })\n}\n\n/**\n * Everything the provider is, as a value: the context object, with its effects and\n * listeners created in the caller's reactive scope.\n */\nexport function createThemeContextValue(\n props: ThemeProviderProps & { catalogue: ThemeCatalogueSource }\n): ThemeContextValue {\n const local = props\n // Two deliberate one-time reads. A broken projection config throws here, at the\n // call that made it, rather than later inside an effect (the document pass checks\n // a changed config again); and `persistence` is documented as read once, so the\n // store never moves under a running provider.\n untrack(() => assertThemeTokenProjectionConfig(local.tokenProjection))\n const storageKey = () => local.storageKey ?? DEFAULT_THEME_STORAGE_KEY\n const persistence = untrack(() => local.persistence) ?? localStoragePersistence(storageKey)\n\n // Read before the first resolution and before the store is, so a persistence whose\n // answer depends on the extras (an id it only accepts if the theme exists) sees\n // them.\n const extraThemes = createMemo(() =>\n typeof local.themes === 'function' ? local.themes() : (local.themes ?? [])\n )\n const source = () => local.catalogue\n const engine = () => source().engine()\n const registry = createMemo(() => mergeRegistry(engine().builtinThemes, extraThemes()))\n\n // A patch that changes nothing (pressing the current toggle again, a font step\n // that clamps) leaves the signal alone, so the document pass and the store write\n // that follow every change do not run for it.\n //\n // A writable derivation. Its first run seeds from the store and `initial`; after\n // that it re-runs only for the controlled half of the contract: a patch from the\n // owner (`selection`) replaces the matching axes of whatever is current, and the\n // stored preference is untouched, since the owner is the one that persists.\n // `setSelection` writes it directly.\n const [selection, setSelectionState] = createSignal<ThemeSelection>(\n (current) => {\n const base = current ?? initialThemeSelection(readPersisted(persistence), local.initial)\n const incoming = local.selection\n return incoming ? mergeThemeSelection(base, incoming) : base\n },\n { equals: sameThemeSelection }\n )\n\n const colorScheme =\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-color-scheme: dark)')\n : undefined\n const [systemAppearance, setSystemAppearance] = createSignal<ThemeAppearance>(\n colorScheme?.matches ? 'dark' : 'light'\n )\n if (colorScheme) {\n const onChange = (event: MediaQueryListEvent) =>\n setSystemAppearance(event.matches ? 'dark' : 'light')\n colorScheme.addEventListener('change', onChange)\n onCleanup(() => colorScheme.removeEventListener('change', onChange))\n }\n\n // What the stored preference resolves to. `selection()`, `variant()` and\n // `resolvedAppearance()` answer from this and never from a preview, so a picker\n // that previews a draft still reads back what is committed.\n const committed = createMemo(() => resolveThemeState(selection(), systemAppearance(), registry()))\n const resolvedAppearance = createMemo<ThemeAppearance>(() => committed().appearance)\n const variant = createMemo<ThemeVariant>(() => committed().variant)\n\n const [draft, setDraft] = createSignal<Partial<ThemeSelection> | undefined>()\n const shownSelection = createMemo(() => {\n const preview = draft()\n return preview ? mergeThemeSelection(selection(), preview) : selection()\n })\n const shown = createMemo(() =>\n draft() ? resolveThemeState(shownSelection(), systemAppearance(), registry()) : committed()\n )\n const shownAppearance = createMemo<ThemeAppearance>(() => shown().appearance)\n\n // The surface axis. Off, none of this reads the operating system: the media query\n // is subscribed only while the axis is on, so a provider that never opts in adds no\n // listener and no repaint.\n const surfaceOn = (candidate: ThemeSelection) =>\n local.surface === true || typeof local.surface === 'object' || candidate.surface !== undefined\n const nativeTranslucency = () => {\n const capability = typeof local.surface === 'object' ? local.surface.nativeTranslucency : false\n return (typeof capability === 'function' ? capability() : capability) === true\n }\n const axisOn = createMemo(() => surfaceOn(shownSelection()))\n // Asked again whenever the axis turns on; the listener below keeps it current.\n const [osReducedTransparency, setOsReducedTransparency] = createSignal(() =>\n axisOn() ? (reducedTransparencyMedia()?.matches ?? false) : false\n )\n const onReducedTransparencyChange = (event: MediaQueryListEvent) =>\n setOsReducedTransparency(event.matches)\n createEffect(axisOn, (on) => {\n const query = on ? reducedTransparencyMedia() : undefined\n if (!query) return\n query.addEventListener('change', onReducedTransparencyChange)\n return () => query.removeEventListener('change', onReducedTransparencyChange)\n })\n const surfaceStateOf = (candidate: ThemeSelection) =>\n resolveSurfaceState(candidate.surface, {\n osReducedTransparency: osReducedTransparency(),\n userReducedTransparency: candidate.reduceTransparency === true,\n nativeTranslucency: nativeTranslucency(),\n })\n const committedSurface = createMemo(() =>\n surfaceOn(selection()) ? surfaceStateOf(selection()) : undefined\n )\n\n // A selection that names a catalogue theme beyond the shipped default pair cannot be\n // painted or previewed until the whole catalogue has loaded. Once a load has failed\n // the provider paints what the shipped data can.\n const waitingFor = (candidate: ThemeSelection, appearance: ThemeAppearance) =>\n !source().loaded() && !source().failed() && needsCatalogue(candidate, appearance)\n createEffect(\n () =>\n needsCatalogue(selection(), committed().appearance) ||\n needsCatalogue(shownSelection(), shown().appearance)\n ? source()\n : undefined,\n (catalogue) => {\n if (catalogue) void catalogue.load()\n }\n )\n\n let written: ReadonlySet<string> | undefined\n let restoreTransitions: (() => void) | undefined\n // The compute gathers the pass (and tracks what it reads); the apply writes it.\n createEffect(\n () => {\n if (typeof document === 'undefined') return undefined\n const current = engine()\n const display = shown()\n // Until the catalogue arrives the document keeps what is already on it — the\n // stylesheet's theme, set before first paint by `themeScript` — instead of\n // flashing the default for a theme that is only not loaded yet.\n if (waitingFor(shownSelection(), display.appearance)) return undefined\n const state = {\n selection: shownSelection(),\n appearance: display.appearance,\n variant: display.variant,\n terminalVariant: resolveTerminalVariant(shownSelection().terminalThemeId, registry()),\n codeVariant: resolveCodeVariant(shownSelection().codeThemeId, registry()),\n surface: axisOn() ? surfaceStateOf(shownSelection()) : undefined,\n }\n assertThemeTokenProjectionConfig(local.tokenProjection)\n const projectionOptions = local.tokenProjection\n ? { tokenProjection: local.tokenProjection }\n : {}\n const options = {\n transformTokens: local.transformTokens,\n ...projectionOptions,\n accentContrastFloor: local.accentContrastFloor,\n palette: local.palette,\n editorRoles: local.editorRoles,\n }\n return {\n current,\n state,\n options,\n withoutTransitions: local.disableTransitionOnChange === true,\n }\n },\n (pass) => {\n if (!pass) return\n const apply = () => {\n written = applyThemeToRoot(\n pass.current,\n document.documentElement,\n pass.state,\n pass.options,\n written\n )\n }\n if (pass.withoutTransitions) {\n restoreTransitions?.()\n restoreTransitions = applyWithoutTransitions(document, apply)\n } else {\n apply()\n }\n }\n )\n onCleanup(() => restoreTransitions?.())\n\n // A pair beyond the defaults offers its accents once the catalogue is here; reading\n // them is not a reason to load it.\n const lightThemeId = createMemo(() => selection().lightThemeId)\n const darkThemeId = createMemo(() => selection().darkThemeId)\n const themeAccents = createMemo(() => {\n const pair = { lightThemeId: lightThemeId(), darkThemeId: darkThemeId() }\n return !source().loaded() && pairNeedsData(pair)\n ? []\n : engine().themeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n })\n\n const zoomFonts = (intent: FontZoomIntent) =>\n value.setSelection({ fonts: zoomedFontSettings(selection(), intent) })\n\n // The platform zoom chords drive the three text sizes, captured like the other\n // global chords; an event something else already handled never double-steps.\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented) return\n const intent = fontZoomShortcut(event)\n if (!intent) return\n event.preventDefault()\n zoomFonts(intent)\n }\n createEffect(\n () => local.fontZoom === true,\n (bound) => {\n if (!bound || typeof window === 'undefined') return\n window.addEventListener('keydown', onKeyDown, { capture: true })\n return () => window.removeEventListener('keydown', onKeyDown, { capture: true })\n }\n )\n\n const value: ThemeContextValue = {\n selection,\n resolvedAppearance,\n shownAppearance,\n variant,\n get themes() {\n return engine().builtinThemes\n },\n themeAccents,\n allThemes: registry,\n preview(next) {\n setDraft(next ? { ...next } : undefined)\n },\n previewing: () => draft() !== undefined,\n accentRolesFor(accent, variantId) {\n // Before the catalogue arrives the light engine answers provisionally and asks\n // for it; reading `engine()` re-runs a reactive caller on arrival.\n return accentRolesForState(engine(), accent, variantId, {\n selection: selection(),\n variant: variant(),\n registry: registry(),\n accentContrastFloor: local.accentContrastFloor,\n })\n },\n catalogueReady: () => source().loaded(),\n loadCatalogue: () => source().load(),\n effectiveSurface: () => committedSurface()?.surface ?? 'opaque',\n reduceTransparencyActive: () => committedSurface()?.reduceTransparencyActive ?? false,\n zoomFonts,\n setSelection(patch) {\n setDraft(undefined)\n // The updater sees a write made earlier in the same tick, which a read of\n // `selection()` would not until the next flush; two patches must compose.\n setSelectionState((current) => {\n const next = mergeThemeSelection(current, patch)\n if (!sameThemeSelection(current, next)) writePersisted(persistence, next)\n return next\n })\n },\n }\n\n return value\n}\n"],"mappings":";;;;;;;;;;;;AA8LA,SAAS,2BAAuD;CAC9D,OAAO,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,aACjE,OAAO,WAAW,0BAA0B,IAC5C,KAAA;AACN;;;;;;;;AAUA,SAAS,mBA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qB,MAAM;GAC7B,CAAC;EACH;EACA,sBAAsB,OAAO,CAAC,CAAC,OAAO;EACtC,qBAAqB,OAAO,CAAC,CAAC,KAAK;EACnC,wBAAwB,iBAAiB,CAAC,EAAE,WAAW;EACvD,gCAAgC,iBAAiB,CAAC,EAAE,4BAA4B;EAChF;EACA,aAAa,OAAO;GAClB,SAAS,KAAA,CAAS;GAGlB,mBAAmB,YAAY;IAC7B,MAAM,OAAO,oBAAoB,SAAS,KAAK;IAC/C,IAAI,CAAC,mBAAmB,SAAS,IAAI,GAAG,eAAe,aAAa,IAAI;IACxE,OAAO;GACT,CAAC;EACH;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"theme-provider-value.js","names":[],"sources":["../../../src/components/theme/theme-provider-value.ts"],"sourcesContent":["import type { JSX } from '@solidjs/web'\nimport {\n createComponent,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n untrack,\n} from 'solid-js'\nimport type { ThemeTokenProjectionOptions } from './token-projection'\nimport { assertThemeTokenProjectionConfig } from './token-projection-options'\nimport { fontZoomShortcut, type FontZoomIntent } from '#lib/font-zoom'\nimport { DEFAULT_THEME_STORAGE_KEY } from '#lib/theme-defaults'\nimport { REDUCED_TRANSPARENCY_QUERY, resolveSurfaceState } from '#lib/theme-surface'\nimport { needsCatalogue, pairNeedsData, type ThemeEngine } from '#lib/theme-engine'\nimport type { EditorRolesMode, ThemeAppearance, ThemeVariant } from '#lib/theme-types'\nimport { themeContext } from './theme-context'\nimport { applyThemeToRoot, applyWithoutTransitions } from './theme-document'\nimport {\n localStoragePersistence,\n readPersisted,\n writePersisted,\n type ThemePersistence,\n} from './theme-persistence'\nimport {\n accentRolesForState,\n initialThemeSelection,\n mergeRegistry,\n mergeThemeSelection,\n resolveCodeVariant,\n resolveTerminalVariant,\n resolveThemeState,\n zoomedFontSettings,\n type ThemeContextValue,\n type ThemeSelection,\n} from './theme-state'\n\n/**\n * The props both `ThemeProvider`s take.\n *\n * ## What a preference is\n *\n * Four independent choices (`ThemeSelection`), and keeping them independent is the\n * point: appearance, a theme per appearance, an accent and fonts. They compose: a\n * user who wants Nord with a violet accent and the system font should not need\n * someone to author that combination.\n *\n * ## Where the rules live\n *\n * The provider is wiring. What a selection merges to and resolves to is\n * `theme-state.ts`; what lands on `<html>` is `theme-document.ts`; where the\n * preference is kept is `theme-persistence.ts`.\n *\n * ## Why the variants are applied as inline properties\n *\n * The catalogue is data, and a theme is applied by writing its roles onto\n * `<html>` as custom properties. That is what makes an imported palette work\n * without a hand-written `[data-theme]` block per theme, and it is why a settings\n * UI can show a preview by reading the same object rather than by loading a\n * stylesheet. `theme.css` keeps the default theme's values so the first paint is\n * correct before any script runs.\n */\nexport type ThemeProviderProps = {\n children?: JSX.Element\n /** Where the preference is persisted. Distinct per application. */\n storageKey?: string\n /** Start from this instead of the stored preference. */\n initial?: Partial<ThemeSelection>\n /**\n * The selection, owned by the caller.\n *\n * For a consumer that keeps the state itself — a settings store, or a workshop\n * whose selection lives in Storybook globals — rather than handing it to this\n * provider's signal. Each change lands here and the document follows; nothing is\n * written to the store, because the caller is the one who persists. A picker\n * below the provider still works, and its change is the caller's to read back.\n *\n * Absent, the provider is the whole owner: it reads `storageKey` on mount,\n * seeds from `initial`, and persists every `setSelection`.\n */\n selection?: Partial<ThemeSelection>\n /**\n * Where the preference is kept, in place of `localStorage` under `storageKey`.\n *\n * Read once when the provider is created, so changing the prop later does not\n * move the store. `storageKey` is ignored when this is given.\n */\n persistence?: ThemePersistence\n /**\n * Variants the host adds to the built-in catalogue — themes a user imported.\n *\n * A function is read inside the provider's reactive scope, so one that reads a\n * signal keeps the picker and the document current when the set changes. A\n * stored id that names no variant, built in or added, paints the default of its\n * appearance and stays in the selection untouched.\n */\n themes?: readonly ThemeVariant[] | (() => readonly ThemeVariant[])\n /**\n * Rewrites the custom properties of each pass before they are written to\n * `<html>`: the variant's roles with the accent over them. `tokensAsHex` from\n * `lib/themes` is the one the system ships.\n */\n transformTokens?: (tokens: Record<string, string>) => Record<string, string>\n /**\n * Switch CSS transitions off for the frame that carries a change, so a theme\n * switch cannot animate the whole page. Off by default: it adds a `<style>`\n * element to `<head>` for two frames on every change.\n */\n disableTransitionOnChange?: boolean\n /**\n * The contrast ratio an accent is held to against the variant's background,\n * repaired to the nearest passing colour when it falls short. Absent, presets\n * are painted verbatim — the catalogue measured them for its own themes — and\n * only a custom `#rrggbb` is held to 3:1. A host that adds themes the catalogue\n * never measured passes 3 to hold the presets to it as well; for the catalogue's\n * own themes the floor changes no preset.\n */\n accentContrastFloor?: number\n /**\n * Turns the surface axis on: `selection.surface` and `selection.reduceTransparency`\n * are resolved against the operating system's Reduce Transparency setting and the\n * host's capability, and `data-surface`, `data-reduce-transparency` and\n * `--surface-alpha` are written to `<html>` (the frost rule in `theme.css` reads\n * them). Off by default: a provider that never opts in writes none of them, adds no\n * media-query listener, and stores nothing new.\n *\n * An object also states the host's capability. `nativeTranslucency` is whether the\n * window can render the OS's own translucency; without it a `translucent`\n * preference paints the tokenized `frosted` surface instead of pretending to\n * vibrancy. A function is read inside the provider's reactive scope, for a\n * capability that is learned after mount.\n *\n * A selection that already carries a `surface` turns the axis on for itself, so a\n * host that stores the field gets the same document without the prop.\n */\n surface?: boolean | { nativeTranslucency?: boolean | (() => boolean) }\n /**\n * Where a catalogue variant's palette comes from. `inline` (the default) writes\n * every role onto `<html>`. `stylesheet` leaves a catalogue variant to the host's\n * `[data-theme]` stylesheet and writes inline only what no stylesheet can know: a\n * host's own `themes`, the accent, the pinned terminal palette, the surface alpha\n * and the fonts. Switching from a host variant back to a catalogue one removes the\n * properties the host variant wrote.\n */\n palette?: 'inline' | 'stylesheet'\n /**\n * The projection behind the `--editor-*` ramp. `syntax` (the default) is the\n * catalogue's quiet syntax roles, a comment among them deliberately below\n * body-text contrast. `floor` holds every role to 4.5:1 on the canvas, as\n * hex, for a host that renders code as content (a diff, a file view) rather than\n * as decoration.\n *\n * Applies to catalogue variants; a host's own `themes` keep their `editor` and\n * their `tokens`. With `palette=\"stylesheet\"` it is the one palette property a\n * catalogue variant still writes inline, because `theme-variants.css` is generated\n * for `syntax`. Absent, nothing changes.\n */\n editorRoles?: EditorRolesMode\n /**\n * Bind the platform zoom chords (Cmd or Ctrl with `=`, `+`, `-`, `0`) to the three\n * text sizes instead of the browser's page zoom: stepping them together is zoom\n * inside the persisted type system. Off by default: it adds a capturing `keydown`\n * listener to `window`, and an event already handled elsewhere is left alone.\n * `zoomFonts` on the context does the same from a menu or a host's own binding.\n */\n fontZoom?: boolean\n} & ThemeTokenProjectionOptions\n\n/**\n * Where the provider's catalogue questions are answered, and whether the whole\n * catalogue is available yet.\n *\n * The eager provider's source is the full catalogue and is always loaded. The lazy\n * provider's source starts on the default pair that ships with it and swaps to the\n * full catalogue when {@link ThemeCatalogueSource.load} resolves. Both read the same\n * way in the provider: `engine()` is reactive, so everything derived from it follows\n * the swap.\n */\nexport type ThemeCatalogueSource = {\n /** The engine answering catalogue questions now. Changes once, when loading completes. */\n engine: () => ThemeEngine\n /** True when `engine()` is the full catalogue. */\n loaded: () => boolean\n /** True when loading failed; the provider then paints what it can without the rest. */\n failed: () => boolean\n /** Start loading the full catalogue (idempotent). Resolves when `loaded()` is true. */\n load: () => Promise<void>\n}\n\n/** The operating system's Reduce Transparency query, where there is a window to ask. */\nfunction reducedTransparencyMedia(): MediaQueryList | undefined {\n return typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia(REDUCED_TRANSPARENCY_QUERY)\n : undefined\n}\n\n/**\n * The provider, parameterised by where its catalogue comes from: the eager\n * `ThemeProvider` passes the whole catalogue, the lazy one a source that loads it.\n * Nothing here imports catalogue code or data, which is what lets the lazy entry keep\n * them out of a consumer's start-up chunk.\n */\n\n/** Selections are small plain records built in one key order, so this is exact. */\nfunction sameThemeSelection(a: ThemeSelection, b: ThemeSelection) {\n return a === b || JSON.stringify(a) === JSON.stringify(b)\n}\n\nexport function ThemeProviderWith(\n props: ThemeProviderProps & { catalogue: ThemeCatalogueSource }\n): JSX.Element {\n const value = createThemeContextValue(props)\n return createComponent(themeContext(), {\n value,\n get children() {\n return props.children\n },\n })\n}\n\n/**\n * Everything the provider is, as a value: the context object, with its effects and\n * listeners created in the caller's reactive scope.\n */\nexport function createThemeContextValue(\n props: ThemeProviderProps & { catalogue: ThemeCatalogueSource }\n): ThemeContextValue {\n const local = props\n // Two deliberate one-time reads. A broken projection config throws here, at the\n // call that made it, rather than later inside an effect (the document pass checks\n // a changed config again); and `persistence` is documented as read once, so the\n // store never moves under a running provider.\n untrack(() => assertThemeTokenProjectionConfig(local.tokenProjection))\n const storageKey = () => local.storageKey ?? DEFAULT_THEME_STORAGE_KEY\n const persistence = untrack(() => local.persistence) ?? localStoragePersistence(storageKey)\n\n // Read before the first resolution and before the store is, so a persistence whose\n // answer depends on the extras (an id it only accepts if the theme exists) sees\n // them.\n const extraThemes = createMemo(() =>\n typeof local.themes === 'function' ? local.themes() : (local.themes ?? [])\n )\n const source = () => local.catalogue\n const engine = () => source().engine()\n const registry = createMemo(() => mergeRegistry(engine().builtinThemes, extraThemes()))\n\n // A patch that changes nothing (pressing the current toggle again, a font step\n // that clamps) leaves the signal alone, so the document pass and the store write\n // that follow every change do not run for it.\n //\n // A writable derivation. Its first run seeds from the store and `initial`; after\n // that it re-runs only for the controlled half of the contract: a patch from the\n // owner (`selection`) replaces the matching axes of whatever is current, and the\n // stored preference is untouched, since the owner is the one that persists.\n // `setSelection` writes it directly.\n const [selection, setSelectionState] = createSignal<ThemeSelection>(\n (current) => {\n const base = current ?? initialThemeSelection(readPersisted(persistence), local.initial)\n const incoming = local.selection\n return incoming ? mergeThemeSelection(base, incoming) : base\n },\n { equals: sameThemeSelection }\n )\n\n const colorScheme =\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-color-scheme: dark)')\n : undefined\n const [systemAppearance, setSystemAppearance] = createSignal<ThemeAppearance>(\n colorScheme?.matches ? 'dark' : 'light'\n )\n if (colorScheme) {\n const onChange = (event: MediaQueryListEvent) =>\n setSystemAppearance(event.matches ? 'dark' : 'light')\n colorScheme.addEventListener('change', onChange)\n onCleanup(() => colorScheme.removeEventListener('change', onChange))\n }\n\n // What the stored preference resolves to. `selection()`, `variant()` and\n // `resolvedAppearance()` answer from this and never from a preview, so a picker\n // that previews a draft still reads back what is committed.\n const committed = createMemo(() => resolveThemeState(selection(), systemAppearance(), registry()))\n const resolvedAppearance = createMemo<ThemeAppearance>(() => committed().appearance)\n const variant = createMemo<ThemeVariant>(() => committed().variant)\n\n const [draft, setDraft] = createSignal<Partial<ThemeSelection> | undefined>()\n const shownSelection = createMemo(() => {\n const preview = draft()\n return preview ? mergeThemeSelection(selection(), preview) : selection()\n })\n const shown = createMemo(() =>\n draft() ? resolveThemeState(shownSelection(), systemAppearance(), registry()) : committed()\n )\n const shownAppearance = createMemo<ThemeAppearance>(() => shown().appearance)\n\n // The surface axis. Off, none of this reads the operating system: the media query\n // is subscribed only while the axis is on, so a provider that never opts in adds no\n // listener and no repaint.\n const surfaceOn = (candidate: ThemeSelection) =>\n local.surface === true || typeof local.surface === 'object' || candidate.surface !== undefined\n const nativeTranslucency = () => {\n const capability = typeof local.surface === 'object' ? local.surface.nativeTranslucency : false\n return (typeof capability === 'function' ? capability() : capability) === true\n }\n const axisOn = createMemo(() => surfaceOn(shownSelection()))\n // Asked again whenever the axis turns on; the listener below keeps it current.\n const [osReducedTransparency, setOsReducedTransparency] = createSignal(() =>\n axisOn() ? (reducedTransparencyMedia()?.matches ?? false) : false\n )\n const onReducedTransparencyChange = (event: MediaQueryListEvent) =>\n setOsReducedTransparency(event.matches)\n createEffect(axisOn, (on) => {\n const query = on ? reducedTransparencyMedia() : undefined\n if (!query) return\n query.addEventListener('change', onReducedTransparencyChange)\n return () => query.removeEventListener('change', onReducedTransparencyChange)\n })\n const surfaceStateOf = (candidate: ThemeSelection) =>\n resolveSurfaceState(candidate.surface, {\n osReducedTransparency: osReducedTransparency(),\n userReducedTransparency: candidate.reduceTransparency === true,\n nativeTranslucency: nativeTranslucency(),\n })\n const committedSurface = createMemo(() =>\n surfaceOn(selection()) ? surfaceStateOf(selection()) : undefined\n )\n\n // A selection that names a catalogue theme beyond the shipped default pair cannot be\n // painted or previewed until the whole catalogue has loaded. Once a load has failed\n // the provider paints what the shipped data can.\n const waitingFor = (candidate: ThemeSelection, appearance: ThemeAppearance) =>\n !source().loaded() && !source().failed() && needsCatalogue(candidate, appearance)\n createEffect(\n () =>\n needsCatalogue(selection(), committed().appearance) ||\n needsCatalogue(shownSelection(), shown().appearance)\n ? source()\n : undefined,\n (catalogue) => {\n if (catalogue) void catalogue.load()\n }\n )\n\n let written: ReadonlySet<string> | undefined\n let restoreTransitions: (() => void) | undefined\n // The compute gathers the pass (and tracks what it reads); the apply writes it.\n createEffect(\n () => {\n if (typeof document === 'undefined') return undefined\n const current = engine()\n const display = shown()\n // Until the catalogue arrives the document keeps what is already on it — the\n // stylesheet's theme, set before first paint by `themeScript` — instead of\n // flashing the default for a theme that is only not loaded yet.\n if (waitingFor(shownSelection(), display.appearance)) return undefined\n const state = {\n selection: shownSelection(),\n appearance: display.appearance,\n variant: display.variant,\n terminalVariant: resolveTerminalVariant(shownSelection().terminalThemeId, registry()),\n codeVariant: resolveCodeVariant(shownSelection().codeThemeId, registry()),\n surface: axisOn() ? surfaceStateOf(shownSelection()) : undefined,\n }\n assertThemeTokenProjectionConfig(local.tokenProjection)\n const projectionOptions = local.tokenProjection\n ? { tokenProjection: local.tokenProjection }\n : {}\n const options = {\n transformTokens: local.transformTokens,\n ...projectionOptions,\n accentContrastFloor: local.accentContrastFloor,\n palette: local.palette,\n editorRoles: local.editorRoles,\n }\n return {\n current,\n state,\n options,\n withoutTransitions: local.disableTransitionOnChange === true,\n }\n },\n (pass) => {\n if (!pass) return\n const apply = () => {\n written = applyThemeToRoot(\n pass.current,\n document.documentElement,\n pass.state,\n pass.options,\n written\n )\n }\n if (pass.withoutTransitions) {\n restoreTransitions?.()\n restoreTransitions = applyWithoutTransitions(document, apply)\n } else {\n apply()\n }\n }\n )\n onCleanup(() => restoreTransitions?.())\n\n // A pair beyond the defaults offers its accents once the catalogue is here; reading\n // them is not a reason to load it.\n const lightThemeId = createMemo(() => selection().lightThemeId)\n const darkThemeId = createMemo(() => selection().darkThemeId)\n const themeAccents = createMemo(() => {\n const pair = { lightThemeId: lightThemeId(), darkThemeId: darkThemeId() }\n return !source().loaded() && pairNeedsData(pair)\n ? []\n : engine().themeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n })\n\n const zoomFonts = (intent: FontZoomIntent) =>\n value.setSelection({ fonts: zoomedFontSettings(selection(), intent) })\n\n // The platform zoom chords drive the three text sizes, captured like the other\n // global chords; an event something else already handled never double-steps.\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented) return\n const intent = fontZoomShortcut(event)\n if (!intent) return\n event.preventDefault()\n zoomFonts(intent)\n }\n createEffect(\n () => local.fontZoom === true,\n (bound) => {\n if (!bound || typeof window === 'undefined') return\n window.addEventListener('keydown', onKeyDown, { capture: true })\n return () => window.removeEventListener('keydown', onKeyDown, { capture: true })\n }\n )\n\n const value: ThemeContextValue = {\n selection,\n resolvedAppearance,\n shownAppearance,\n variant,\n get themes() {\n return engine().builtinThemes\n },\n themeAccents,\n allThemes: registry,\n preview(next) {\n setDraft(next ? { ...next } : undefined)\n },\n previewing: () => draft() !== undefined,\n accentRolesFor(accent, variantId) {\n // Before the catalogue arrives the light engine answers provisionally and asks\n // for it; reading `engine()` re-runs a reactive caller on arrival.\n return accentRolesForState(engine(), accent, variantId, {\n selection: selection(),\n variant: variant(),\n registry: registry(),\n accentContrastFloor: local.accentContrastFloor,\n })\n },\n catalogueReady: () => source().loaded(),\n loadCatalogue: () => source().load(),\n effectiveSurface: () => committedSurface()?.surface ?? 'opaque',\n reduceTransparencyActive: () => committedSurface()?.reduceTransparencyActive ?? false,\n zoomFonts,\n setSelection(patch) {\n setDraft(undefined)\n // The updater sees a write made earlier in the same tick, which a read of\n // `selection()` would not until the next flush; two patches must compose.\n setSelectionState((current) => {\n const next = mergeThemeSelection(current, patch)\n if (!sameThemeSelection(current, next)) writePersisted(persistence, next)\n return next\n })\n },\n }\n\n return value\n}\n"],"mappings":";;;;;;;;;;;;AA8LA,SAAS,2BAAuD;CAC9D,OAAO,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,aACjE,OAAO,WAAW,0BAA0B,IAC5C,KAAA;AACN;;;;;;;;AAUA,SAAS,mBAAmB,GAAmB,GAAmB;CAChE,OAAO,MAAM,KAAK,KAAK,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC;AAC1D;AAEA,SAAgB,kBACd,OACa;CACb,MAAM,QAAQ,wBAAwB,KAAK;CAC3C,OAAO,gBAAgB,aAAa,GAAG;EACrC;EACA,IAAI,WAAW;GACb,OAAO,MAAM;EACf;CACF,CAAC;AACH;;;;;AAMA,SAAgB,wBACd,OACmB;CACnB,MAAM,QAAQ;CAKd,cAAc,iCAAiC,MAAM,eAAe,CAAC;CACrE,MAAM,mBAAmB,MAAM,cAAA;CAC/B,MAAM,cAAc,cAAc,MAAM,WAAW,KAAK,wBAAwB,UAAU;CAK1F,MAAM,cAAc,iBAClB,OAAO,MAAM,WAAW,aAAa,MAAM,OAAO,IAAK,MAAM,UAAU,CAAC,CAC1E;CACA,MAAM,eAAe,MAAM;CAC3B,MAAM,eAAe,OAAO,CAAC,CAAC,OAAO;CACrC,MAAM,WAAW,iBAAiB,cAAc,OAAO,CAAC,CAAC,eAAe,YAAY,CAAC,CAAC;CAWtF,MAAM,CAAC,WAAW,qBAAqB,cACpC,YAAY;EACX,MAAM,OAAO,WAAW,sBAAsB,cAAc,WAAW,GAAG,MAAM,OAAO;EACvF,MAAM,WAAW,MAAM;EACvB,OAAO,WAAW,oBAAoB,MAAM,QAAQ,IAAI;CAC1D,GACA,EAAE,QAAQ,mBAAmB,CAC/B;CAEA,MAAM,cACJ,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,aAC1D,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ACX,OAAO,OAAO,CAAC,CAAC;EAClB;EACA;EACA,WAAW;EACX,QAAQ,MAAM;GACZ,SAAS,OAAO,EAAE,GAAG,KAAK,IAAI,KAAA,CAAS;EACzC;EACA,kBAAkB,MAAM,MAAM,KAAA;EAC9B,eAAe,QAAQ,WAAW;GAGhC,OAAO,oBAAoB,OAAO,GAAG,QAAQ,WAAW;IACtD,WAAW,UAAU;IACrB,SAAS,QAAQ;IACjB,UAAU,SAAS;IACnB,qBAAqB,MAAM;GAC7B,CAAC;EACH;EACA,sBAAsB,OAAO,CAAC,CAAC,OAAO;EACtC,qBAAqB,OAAO,CAAC,CAAC,KAAK;EACnC,wBAAwB,iBAAiB,CAAC,EAAE,WAAW;EACvD,gCAAgC,iBAAiB,CAAC,EAAE,4BAA4B;EAChF;EACA,aAAa,OAAO;GAClB,SAAS,KAAA,CAAS;GAGlB,mBAAmB,YAAY;IAC7B,MAAM,OAAO,oBAAoB,SAAS,KAAK;IAC/C,IAAI,CAAC,mBAAmB,SAAS,IAAI,GAAG,eAAe,aAAa,IAAI;IACxE,OAAO;GACT,CAAC;EACH;CACF;CAEA,OAAO;AACT"}
@@ -1,11 +1,11 @@
1
1
  import { safeScriptStringLiteral } from "../../lib/safe-script.js";
2
2
  import { useOptionalTheme, useTheme } from "./theme-context.js";
3
+ import { createComponent, mergeProps } from "@solidjs/web";
3
4
  import { catalogueThemeEngine } from "../../lib/theme-catalogue.js";
4
5
  import { defaultThemeSelection, resolvedDensity } from "./theme-state.js";
5
6
  import { createVersionedPersistence, localStoragePersistence } from "./theme-persistence.js";
6
7
  import { ThemeProviderWith } from "./theme-provider-value.js";
7
8
  import { themeScript } from "./theme-script.js";
8
- import { createComponent, mergeProps } from "@solidjs/web";
9
9
  // src/components/theme/theme-provider.tsx
10
10
  /** The whole catalogue, already imported: nothing to load, nothing to wait for. */
11
11
  var eagerCatalogue = {
@@ -1,14 +1,14 @@
1
+ import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
2
+ import { Monitor as Monitor$1, Moon as Moon$1, Sun } from "@lucide/solid";
3
+ import { For, omit } from "solid-js";
1
4
  import { cn } from "../../lib/utils.js";
2
5
  import { ToggleGroup, ToggleGroupItem } from "../ui/toggle-group/toggle-group.js";
3
6
  import { useTheme } from "./theme-context.js";
4
7
  import { fastIcon } from "../../lib/fast-icon.js";
5
- import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
6
- import { Monitor, Moon, Sun } from "@lucide/solid";
7
- import { For, omit } from "solid-js";
8
8
  // src/components/theme/theme-toggle.tsx
9
9
  var _tmpl$ = /* @__PURE__ */ template(`<span>`);
10
- var Monitor$1 = fastIcon(Monitor);
11
- var Moon$1 = fastIcon(Moon);
10
+ var Monitor = fastIcon(Monitor$1);
11
+ var Moon = fastIcon(Moon$1);
12
12
  var APPEARANCES = [
13
13
  {
14
14
  value: "light",
@@ -18,12 +18,12 @@ var APPEARANCES = [
18
18
  {
19
19
  value: "dark",
20
20
  label: "Dark",
21
- icon: Moon$1
21
+ icon: Moon
22
22
  },
23
23
  {
24
24
  value: "system",
25
25
  label: "System",
26
- icon: Monitor$1
26
+ icon: Monitor
27
27
  }
28
28
  ];
29
29
  function ThemeToggle(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"theme-toggle.js","names":["<ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>","onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}","<For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>","each={APPEARANCES}","<ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>","variant=\"outline\"","<appearance.icon />","appearance.icon","{local.withLabels ? <span>{appearance.label}</span> : null}","Monitor","LucideMonitor","Moon","LucideMoon","LucideSun"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor as LucideMonitor, Moon as LucideMoon, Sun as LucideSun } from '@lucide/solid'\nimport type { ComponentProps } from '@solidjs/web'\nimport { For, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Monitor = fastIcon(LucideMonitor)\nconst Moon = fastIcon(LucideMoon)\nconst Sun = fastIcon(LucideSun)\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake, it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const local = props\n const rest = omit(props, 'class', 'withLabels')\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":";;;;;;;;;AASA,IAAMS,YAAU,SAASC,OAAa;AACtC,IAAMC,SAAO,SAASC,IAAU;AAmBhC,IAAM,cAAc;CAClB;EAAE,OAAO;EAAS,OAAO;EAAS,MAnBxB,SAASC,GAmBqB;CAAI;CAC5C;EAAE,OAAO;EAAQ,OAAO;EAAQ,MAAMF;CAAK;CAC3C;EAAE,OAAO;EAAU,OAAO;EAAU,MAAMF;CAAQ;AACpD;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY;CAC9C,MAAM,EAAE,WAAW,iBAAiB,SAAS;CAE7C,OACET,gBAAAA,aAAAA,WAAAA;EACE,UAAA;EACA,IAAA,QAAA;GAAO,OAAA,UAAU,CAAC,CAAC;EAAU;EAC7BC,WAAW,UAAyB;GAGlC,IAAI,OAAO,UAAU,UACnB,aAAa,EAAE,YAAY,MAAqC,CAAC;EAErE;EACA,cAAW;EACX,IAAA,UAAA;GAAO,OAAA,GAAG,MAAM,KAAK;EAAC;CAgBX,GAfP,MAZN,EAAA,IAAA,WAAA;EAcEC,OAAAA,gBAAAA,KAAAA;GAAKC,MAAM;GAAXD,WACI,eACAE,gBAAAA,iBAAAA;IACE,IAAA,QAAA;KAAO,OAAA,WAAW;IAAK;IACvBC,SAAQ;IACR,IAAA,OAAA;KAAM,OAAA,MAAM,aAAa,OAAO;IAAS;IACzC,IAAA,eAAA;KAAY,OAAA,WAAW;IAAK;IAJ9B,IAAA,WAAA;KAKC,OAAA,CACCC,gBAAAA,WAACC,MAAD,CAAkB,CAAA,GAClBC,WAAAA;;OAAC,OAAA,CAAA,CAAA,MAAM;MAAmD,CAAA,CAAC,CAAD,WAAtC;OAA8B,IAAA,OAAA,OAAA;OAA9B,OAAA,YAAM;QAAC,OAAA,WAAW;OAAK,CAAO;OAA9B,OAAA;MAA8B,EAAA,CAAA,IAAI;KAAI,CAAA,CAD3D;IAEgB;;EAEhB,CAAA;CACM,EAAA,CAAA,CAAA;AAEjB"}
1
+ {"version":3,"file":"theme-toggle.js","names":["<ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>","onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}","<For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>","each={APPEARANCES}","<ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>","variant=\"outline\"","<appearance.icon />","appearance.icon","{local.withLabels ? <span>{appearance.label}</span> : null}","LucideMonitor","LucideMoon","LucideSun","_$insert"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor as LucideMonitor, Moon as LucideMoon, Sun as LucideSun } from '@lucide/solid'\nimport type { ComponentProps } from '@solidjs/web'\nimport { For, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Monitor = fastIcon(LucideMonitor)\nconst Moon = fastIcon(LucideMoon)\nconst Sun = fastIcon(LucideSun)\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake, it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const local = props\n const rest = omit(props, 'class', 'withLabels')\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":";;;;;;;;;AASA,IAAM,UAAU,SAASS,SAAa;AACtC,IAAM,OAAO,SAASC,MAAU;AAmBhC,IAAM,cAAc;CAClB;EAAE,OAAO;EAAS,OAAO;EAAS,MAnBxB,SAASC,GAmBqB;CAAI;CAC5C;EAAE,OAAO;EAAQ,OAAO;EAAQ,MAAM;CAAK;CAC3C;EAAE,OAAO;EAAU,OAAO;EAAU,MAAM;CAAQ;AACpD;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY;CAC9C,MAAM,EAAE,WAAW,iBAAiB,SAAS;CAE7C,OACEX,gBAAAA,aAAAA,WAAAA;EACE,UAAA;EACA,IAAA,QAAA;GAAO,OAAA,UAAU,CAAC,CAAC;EAAU;EAC7BC,WAAW,UAAyB;GAGlC,IAAI,OAAO,UAAU,UACnB,aAAa,EAAE,YAAY,MAAqC,CAAC;EAErE;EACA,cAAW;EACX,IAAA,UAAA;GAAO,OAAA,GAAG,MAAM,KAAK;EAAC;CAgBX,GAfP,MAZN,EAAA,IAAA,WAAA;EAcEC,OAAAA,gBAAAA,KAAAA;GAAKC,MAAM;GAAXD,WACI,eACAE,gBAAAA,iBAAAA;IACE,IAAA,QAAA;KAAO,OAAA,WAAW;IAAK;IACvBC,SAAQ;IACR,IAAA,OAAA;KAAM,OAAA,MAAM,aAAa,OAAO;IAAS;IACzC,IAAA,eAAA;KAAY,OAAA,WAAW;IAAK;IAJ9B,IAAA,WAAA;KAKC,OAAA,CACCC,gBAAAA,WAACC,MAAD,CAAkB,CAAA,GAClBC,WAAAA;;OAAC,OAAA,CAAA,CAAA,MAAM;MAAmD,CAAA,CAAC,CAAD,WAAtC;OAA8B,IAAA,OAAA,OAAA;OAA9BI,OAAA,YAAM;QAAC,OAAA,WAAW;OAAK,CAAO;OAA9B,OAAA;MAA8B,EAAA,CAAA,IAAI;KAAI,CAAA,CAD3D;IAEgB;;EAEhB,CAAA;CACM,EAAA,CAAA,CAAA;AAEjB"}
@@ -1,15 +1,15 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { fastIcon } from "../../../lib/fast-icon.js";
3
1
  import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
4
- import { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger } from "@ui-sdk/solid/accordion";
5
- import { ChevronDown } from "@lucide/solid";
2
+ import { Accordion as Accordion$1, AccordionHeader, AccordionItem as AccordionItem$1, AccordionPanel, AccordionTrigger as AccordionTrigger$1 } from "@ui-sdk/solid/accordion";
3
+ import { ChevronDown as ChevronDown$1 } from "@lucide/solid";
6
4
  import { omit } from "solid-js";
5
+ import { cn } from "../../../lib/utils.js";
6
+ import { fastIcon } from "../../../lib/fast-icon.js";
7
7
  // src/components/ui/accordion/accordion.tsx
8
8
  var _tmpl$ = /* @__PURE__ */ template(`<div class="pt-0 pb-3">`);
9
- var ChevronDown$1 = fastIcon(ChevronDown);
10
- function Accordion$1(props) {
9
+ var ChevronDown = fastIcon(ChevronDown$1);
10
+ function Accordion(props) {
11
11
  const rest = omit(props, "class", "onChange", "collapsible");
12
- return createComponent(Accordion, mergeProps({
12
+ return createComponent(Accordion$1, mergeProps({
13
13
  get "class"() {
14
14
  return cn("flex w-full flex-col", props.class);
15
15
  },
@@ -19,23 +19,23 @@ function Accordion$1(props) {
19
19
  onValueChange: (value) => props.onChange?.(value)
20
20
  }, rest));
21
21
  }
22
- function AccordionItem$1(props) {
22
+ function AccordionItem(props) {
23
23
  const rest = omit(props, "class");
24
- return createComponent(AccordionItem, mergeProps({ get "class"() {
24
+ return createComponent(AccordionItem$1, mergeProps({ get "class"() {
25
25
  return cn("border-b border-border last:border-b-0", props.class);
26
26
  } }, rest));
27
27
  }
28
- function AccordionTrigger$1(props) {
28
+ function AccordionTrigger(props) {
29
29
  const rest = omit(props, "class", "children");
30
30
  return createComponent(AccordionHeader, {
31
31
  class: "flex",
32
32
  get children() {
33
- return createComponent(AccordionTrigger, mergeProps({ get "class"() {
33
+ return createComponent(AccordionTrigger$1, mergeProps({ get "class"() {
34
34
  return cn("group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium", "transition-colors ease-out outline-none", "hover:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "disabled:pointer-events-none disabled:opacity-50", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", props.class);
35
35
  } }, rest, { get children() {
36
36
  return [memo(() => {
37
37
  return props.children;
38
- }), createComponent(ChevronDown$1, {
38
+ }), createComponent(ChevronDown, {
39
39
  class: "text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180",
40
40
  "aria-hidden": "true"
41
41
  })];
@@ -60,6 +60,6 @@ function AccordionContent(props) {
60
60
  return _el$;
61
61
  } }));
62
62
  }
63
- export { Accordion$1 as Accordion, AccordionContent, AccordionItem$1 as AccordionItem, AccordionTrigger$1 as AccordionTrigger };
63
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
64
64
 
65
65
  //# sourceMappingURL=accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","names":["<SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />","onValueChange={(value) => props.onChange?.(value)}","<SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />","<SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>","class=\"flex\"","<SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>","props.children","<ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />","class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"","<SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>\n </SdkAccordionPanel>","<div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>","ChevronDown","LucideChevronDown","Accordion","AccordionItem","AccordionTrigger"],"sources":["../../../../src/components/ui/accordion/accordion.tsx"],"sourcesContent":["import {\n Accordion as SdkAccordion,\n AccordionHeader as SdkAccordionHeader,\n AccordionItem as SdkAccordionItem,\n AccordionPanel as SdkAccordionPanel,\n AccordionTrigger as SdkAccordionTrigger,\n} from '@ui-sdk/solid/accordion'\nimport { ChevronDown as LucideChevronDown } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * Accordion.\n *\n * A list of collapsible sections. `collapsible` lets the user close the open\n * section; without it (the default) one section stays open once any is, which\n * is what a settings page usually wants and a FAQ usually does not.\n *\n * Built on ui-sdk's Accordion: the trigger is a real button inside an `h3`\n * with `aria-expanded`, and the panel is `aria-labelledby` the trigger, so the\n * relationship survives even when the panel is empty. A disabled trigger stays\n * focusable and says so with `aria-disabled`.\n */\nexport type AccordionProps = Omit<\n ComponentProps<typeof SdkAccordion>,\n 'onValueChange' | 'onChange' | 'value' | 'defaultValue'\n> & {\n /** The open items' values. Pass it to control the accordion. */\n value?: string[]\n /** The items open at first, when uncontrolled. */\n defaultValue?: string[]\n /** Called with the open items' values. */\n onChange?: (value: string[]) => void\n}\n\nexport function Accordion(props: AccordionProps) {\n const rest = omit(props, 'class', 'onChange', 'collapsible')\n return (\n <SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />\n )\n}\n\nexport function AccordionItem(props: ComponentProps<typeof SdkAccordionItem>) {\n const rest = omit(props, 'class')\n return (\n <SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />\n )\n}\n\nexport function AccordionTrigger(props: ComponentProps<typeof SdkAccordionTrigger>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>\n )\n}\n\nexport type AccordionContentProps = ComponentProps<typeof SdkAccordionPanel> & {\n /** Keeps the panel in the page, hidden, while its item is closed. */\n forceMount?: boolean\n}\n\nexport function AccordionContent(props: AccordionContentProps) {\n const rest = omit(props, 'class', 'children', 'forceMount')\n return (\n <SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div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;EAAU;CAIZ,GAHb,MAHN,EAAA,IAAA,WAAA;EAKE,IAAA,OAAA,OAA2D;EAA3D,OAAA,YAAuB;GAAC,OAAA,MAAM;EAAuB,CAAM;EAL7D,OAKEC;CACiB,EAAA,CAAA,CAAA;AAEvB"}
1
+ {"version":3,"file":"accordion.js","names":["<SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />","onValueChange={(value) => props.onChange?.(value)}","<SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />","<SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>","class=\"flex\"","<SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>","props.children","<ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />","class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"","<SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>\n </SdkAccordionPanel>","<div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>","LucideChevronDown","_$insert"],"sources":["../../../../src/components/ui/accordion/accordion.tsx"],"sourcesContent":["import {\n Accordion as SdkAccordion,\n AccordionHeader as SdkAccordionHeader,\n AccordionItem as SdkAccordionItem,\n AccordionPanel as SdkAccordionPanel,\n AccordionTrigger as SdkAccordionTrigger,\n} from '@ui-sdk/solid/accordion'\nimport { ChevronDown as LucideChevronDown } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * Accordion.\n *\n * A list of collapsible sections. `collapsible` lets the user close the open\n * section; without it (the default) one section stays open once any is, which\n * is what a settings page usually wants and a FAQ usually does not.\n *\n * Built on ui-sdk's Accordion: the trigger is a real button inside an `h3`\n * with `aria-expanded`, and the panel is `aria-labelledby` the trigger, so the\n * relationship survives even when the panel is empty. A disabled trigger stays\n * focusable and says so with `aria-disabled`.\n */\nexport type AccordionProps = Omit<\n ComponentProps<typeof SdkAccordion>,\n 'onValueChange' | 'onChange' | 'value' | 'defaultValue'\n> & {\n /** The open items' values. Pass it to control the accordion. */\n value?: string[]\n /** The items open at first, when uncontrolled. */\n defaultValue?: string[]\n /** Called with the open items' values. */\n onChange?: (value: string[]) => void\n}\n\nexport function Accordion(props: AccordionProps) {\n const rest = omit(props, 'class', 'onChange', 'collapsible')\n return (\n <SdkAccordion\n class={cn('flex w-full flex-col', props.class as string)}\n collapsible={props.collapsible ?? false}\n onValueChange={(value) => props.onChange?.(value)}\n {...rest}\n />\n )\n}\n\nexport function AccordionItem(props: ComponentProps<typeof SdkAccordionItem>) {\n const rest = omit(props, 'class')\n return (\n <SdkAccordionItem\n class={cn('border-b border-border last:border-b-0', props.class as string)}\n {...rest}\n />\n )\n}\n\nexport function AccordionTrigger(props: ComponentProps<typeof SdkAccordionTrigger>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkAccordionHeader class=\"flex\">\n <SdkAccordionTrigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[open]/accordion`\n // reads. ui-sdk puts `data-open` on this trigger (and on the item), so\n // the trigger is the group; without the class the rotation selector has\n // no ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n '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 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[open]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </SdkAccordionTrigger>\n </SdkAccordionHeader>\n )\n}\n\nexport type AccordionContentProps = ComponentProps<typeof SdkAccordionPanel> & {\n /** Keeps the panel in the page, hidden, while its item is closed. */\n forceMount?: boolean\n}\n\nexport function AccordionContent(props: AccordionContentProps) {\n const rest = omit(props, 'class', 'children', 'forceMount')\n return (\n <SdkAccordionPanel\n class={cn('overflow-hidden text-sm', props.class as string)}\n keepMounted={props.forceMount}\n {...rest}\n >\n <div class=\"pt-0 pb-3\">{props.children as JSX.Element}</div>\n </SdkAccordionPanel>\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAM,cAAc,SAASW,aAAiB;AA0B9C,SAAgB,UAAU,OAAuB;CAC/C,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY,aAAa;CAC3D,OACEX,gBAAAA,aAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,wBAAwB,MAAM,KAAe;EAAC;EACxD,IAAA,cAAA;GAAa,OAAA,MAAM,eAAe;EAAK;EACvCC,gBAAgB,UAAU,MAAM,WAAW,KAAK;CAEjD,GADK,IACL,CAAA;AAEL;AAEA,SAAgB,cAAc,OAAgD;CAC5E,MAAM,OAAO,KAAK,OAAO,OAAO;CAChC,OACEC,gBAAAA,iBAAAA,WAAAA,EACE,IAAA,UAAA;EAAO,OAAA,GAAG,0CAA0C,MAAM,KAAe;CAAC,EAE3E,GADK,IACL,CAAA;AAEL;AAEA,SAAgB,iBAAiB,OAAmD;CAClF,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE5C,OACEC,gBAAAA,iBAAAA;EAAoBC,OAAM;EAA1B,IAAA,WAAA;GACEC,OAAAA,gBAAAA,oBAAAA,WAAAA,EACE,IAAA,UAAA;IAAO,OAAA,GAKL,qGACA,2CACA,yBACA,oFACA,oDACA,kEACA,MAAM,KACR;GAAC,EAQkB,GAPf,MAdN,EAAA,IAAA,WAAA;IAeC,OAAA,CACEC,WAAAA;KAAM,OAAA,MAAA;IAAO,CAAA,GACdC,gBAAAA,aAAAA;KACEC,OAAM;KACN,eAAY;IACb,CAAA,CAJF;GAKoB,EAAA,CAAA,CAAA;EACH;;AAExB;AAOA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY,YAAY;CAC1D,OACEC,gBAAAA,gBAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,2BAA2B,MAAM,KAAe;EAAC;EAC3D,IAAA,cAAA;GAAa,OAAA,MAAM;EAAU;CAIZ,GAHb,MAHN,EAAA,IAAA,WAAA;EAKE,IAAA,OAAA,OAA2D;EAA3DG,OAAA,YAAuB;GAAC,OAAA,MAAM;EAAuB,CAAM;EAL7D,OAKEF;CACiB,EAAA,CAAA,CAAA;AAEvB"}
@@ -1,17 +1,17 @@
1
+ import { className, createComponent, effect, insert, memo, readShallow, spread, template } from "@solidjs/web";
2
+ import { AlertCircle as AlertCircle$1, CheckCircle2 as CheckCircle2$1, Info as Info$1, TriangleAlert as TriangleAlert$1 } from "@lucide/solid";
3
+ import { children, omit } from "solid-js";
1
4
  import { cva } from "../../../lib/variants.js";
2
5
  import { cn } from "../../../lib/utils.js";
3
6
  import { fastIcon } from "../../../lib/fast-icon.js";
4
- import { className, createComponent, effect, insert, memo, readShallow, spread, template } from "@solidjs/web";
5
- import { AlertCircle, CheckCircle2, Info, TriangleAlert } from "@lucide/solid";
6
- import { children, omit } from "solid-js";
7
7
  // src/components/ui/alert/alert.tsx
8
8
  var _tmpl$ = /* @__PURE__ */ template(`<div><!><!>`);
9
9
  var _tmpl$2 = /* @__PURE__ */ template(`<span data-slot=alert-icon>`);
10
10
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
11
- var AlertCircle$1 = fastIcon(AlertCircle);
12
- var CheckCircle2$1 = fastIcon(CheckCircle2);
13
- var Info$1 = fastIcon(Info);
14
- var TriangleAlert$1 = fastIcon(TriangleAlert);
11
+ var AlertCircle = fastIcon(AlertCircle$1);
12
+ var CheckCircle2 = fastIcon(CheckCircle2$1);
13
+ var Info = fastIcon(Info$1);
14
+ var TriangleAlert = fastIcon(TriangleAlert$1);
15
15
  /**
16
16
  * Alert.
17
17
  *
@@ -36,11 +36,11 @@ var alertVariants = cva("relative grid w-full grid-cols-[auto_1fr] items-start g
36
36
  defaultVariants: { variant: "default" }
37
37
  });
38
38
  var alertIcons = {
39
- default: Info$1,
40
- destructive: AlertCircle$1,
41
- success: CheckCircle2$1,
42
- warning: TriangleAlert$1,
43
- info: Info$1
39
+ default: Info,
40
+ destructive: AlertCircle,
41
+ success: CheckCircle2,
42
+ warning: TriangleAlert,
43
+ info: Info
44
44
  };
45
45
  var alertIconTones = {
46
46
  default: "text-muted-foreground",
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":["role=\"alert\"","<Icon />","<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ??\n (() => {\n // Called directly rather than through Dynamic: no memo or\n // component wrapper for a glyph that only changes with the tone.\n const Icon = alertIcons[tone()]\n return <Icon />\n })()}\n </span>\n )}\n {local.children}\n </div>","<div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />","<div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />","<div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />","AlertCircle","LucideAlertCircle","CheckCircle2","LucideCheckCircle2","Info","LucideInfo","TriangleAlert","LucideTriangleAlert","resolveChildren","_$readShallow"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import {\n AlertCircle as LucideAlertCircle,\n CheckCircle2 as LucideCheckCircle2,\n Info as LucideInfo,\n TriangleAlert as LucideTriangleAlert,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { children as resolveChildren, omit } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst AlertCircle = fastIcon(LucideAlertCircle)\nconst CheckCircle2 = fastIcon(LucideCheckCircle2)\nconst Info = fastIcon(LucideInfo)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const local = props\n const rest = omit(props, 'class', 'variant', 'icon', 'children')\n\n const tone = () => local.variant ?? 'default'\n const icon = resolveChildren(() => local.icon)\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ??\n (() => {\n // Called directly rather than through Dynamic: no memo or\n // component wrapper for a glyph that only changes with the tone.\n const Icon = alertIcons[tone()]\n return <Icon />\n })()}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;AAaA,IAAMM,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,iBAAe,SAASC,YAAkB;AAChD,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,kBAAgB,SAASC,aAAmB;;;;;;;;;;;;;;AAelD,IAAM,gBAAgB,IACpB,+GACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,aAAa;EACb,SAAS;EACT,SAAS;EACT,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CACF;AAEA,IAAM,aAAa;CACjB,SAASH;C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A0C,MAAM,KAAK;EAAC;CACxD,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEC;AAMJ;AAEA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,QAAA,QAIC;CADC,OAAA,OAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,6CAA6C,MAAM,KAAK;EAAC;CAC3D,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEC;AAMJ;;;;;;;AAQA,SAAgB,YAAY,OAA8B;CACxD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAE9B,IAAA,QAAA,QAIC;CADC,OAAA,OAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,sDAAsD,MAAM,KAAK;EAAC;CACpE,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEC;AAMJ"}
1
+ {"version":3,"file":"alert.js","names":["role=\"alert\"","<Icon />","<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ??\n (() => {\n // Called directly rather than through Dynamic: no memo or\n // component wrapper for a glyph that only changes with the tone.\n const Icon = alertIcons[tone()]\n return <Icon />\n })()}\n </span>\n )}\n {local.children}\n </div>","<div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />","<div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />","<div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />","LucideAlertCircle","LucideCheckCircle2","LucideInfo","LucideTriangleAlert","resolveChildren","_$spread","_$insert","_$effect","_$readShallow","_$className"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import {\n AlertCircle as LucideAlertCircle,\n CheckCircle2 as LucideCheckCircle2,\n Info as LucideInfo,\n TriangleAlert as LucideTriangleAlert,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { children as resolveChildren, omit } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst AlertCircle = fastIcon(LucideAlertCircle)\nconst CheckCircle2 = fastIcon(LucideCheckCircle2)\nconst Info = fastIcon(LucideInfo)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const local = props\n const rest = omit(props, 'class', 'variant', 'icon', 'children')\n\n const tone = () => local.variant ?? 'default'\n const icon = resolveChildren(() => local.icon)\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ??\n (() => {\n // Called directly rather than through Dynamic: no memo or\n // component wrapper for a glyph that only changes with the tone.\n const Icon = alertIcons[tone()]\n return <Icon />\n })()}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class')\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;AAaA,IAAM,cAAc,SAASM,aAAiB;AAC9C,IAAM,eAAe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