@ctrl-ui/react 0.8.1 → 0.8.4

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 (377) hide show
  1. package/README.md +32 -23
  2. package/dist/action-bar.d.ts +11 -12
  3. package/dist/activity.d.ts +24 -25
  4. package/dist/audio-recorder.d.ts +16 -16
  5. package/dist/audio-visualizer.d.ts +3 -4
  6. package/dist/blocks/chat.d.ts +3 -4
  7. package/dist/blocks/chat.js +6 -3
  8. package/dist/blocks/coding-agent.d.ts +11 -12
  9. package/dist/blocks/coding-agent.js +10 -9
  10. package/dist/blocks/file-explorer-data.d.ts +11 -12
  11. package/dist/blocks/file-explorer.d.ts +3 -3
  12. package/dist/blocks/settings-data.d.ts +8 -9
  13. package/dist/blocks/settings.d.ts +4 -4
  14. package/dist/blocks/theme-toggle.d.ts +11 -12
  15. package/dist/blocks/theme-toggle.js +14 -4
  16. package/dist/chat-composer-attachment.d.ts +20 -21
  17. package/dist/chat-composer-attachment.js +24 -20
  18. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -6
  19. package/dist/chat-composer-editor/ghost.d.ts +3 -4
  20. package/dist/chat-composer-editor/schema.d.ts +2 -3
  21. package/dist/chat-composer-editor/serialize.d.ts +3 -4
  22. package/dist/chat-composer-editor/types.d.ts +5 -6
  23. package/dist/chat-composer-editor.d.ts +2 -3
  24. package/dist/chat-composer-editor.js +18 -4
  25. package/dist/chat-composer.d.ts +17 -18
  26. package/dist/chat-composer.js +14 -8
  27. package/dist/chat-layout.d.ts +12 -21
  28. package/dist/chat-layout.js +28 -83
  29. package/dist/chat-message.d.ts +14 -15
  30. package/dist/context-model.d.ts +7 -8
  31. package/dist/context.d.ts +21 -22
  32. package/dist/control-props.d.ts +10 -11
  33. package/dist/control-variants.d.ts +6 -7
  34. package/dist/dynamic-notification-glass.d.ts +3 -4
  35. package/dist/dynamic-notification-liquid.d.ts +3 -4
  36. package/dist/dynamic-notification-siri-wave.d.ts +2 -3
  37. package/dist/dynamic-notification.d.ts +28 -29
  38. package/dist/email/email.d.ts +6 -7
  39. package/dist/email/email.js +12 -3
  40. package/dist/email/length.d.ts +3 -0
  41. package/dist/email/length.js +34 -0
  42. package/dist/email/templates.d.ts +7 -8
  43. package/dist/email/templates.js +5 -5
  44. package/dist/email/theme.d.ts +16 -5
  45. package/dist/email/theme.js +21 -6
  46. package/dist/environment-variables.d.ts +35 -36
  47. package/dist/extensions/create-track-highlight.d.ts +3 -4
  48. package/dist/extensions/supports-anchor-transitions.d.ts +2 -3
  49. package/dist/extensions/track-highlight.d.ts +3 -4
  50. package/dist/hooks/use-audio-recorder.d.ts +14 -15
  51. package/dist/hooks/use-chat-composer.d.ts +5 -6
  52. package/dist/hooks/use-chat-message.d.ts +7 -8
  53. package/dist/hooks/use-color-area.d.ts +5 -6
  54. package/dist/hooks/use-copy-to-clipboard.d.ts +7 -8
  55. package/dist/hooks/use-dropzone.d.ts +11 -12
  56. package/dist/hooks/use-dynamic-notification.d.ts +6 -7
  57. package/dist/hooks/use-environment-variables.d.ts +9 -10
  58. package/dist/hooks/use-keyboard-navigation.d.ts +3 -0
  59. package/dist/hooks/use-keyboard-navigation.js +22 -0
  60. package/dist/hooks/use-mobile.d.ts +2 -3
  61. package/dist/hooks/use-textarea-trigger-menu.d.ts +2 -3
  62. package/dist/hooks/use-trigger-menu.d.ts +7 -8
  63. package/dist/hooks/use-user-ask.d.ts +6 -7
  64. package/dist/inline-attachment.d.ts +16 -17
  65. package/dist/inline-citation.d.ts +22 -23
  66. package/dist/knob-contracts/accordion-knobs.d.ts +3 -4
  67. package/dist/knob-contracts/accordion-knobs.js +1 -0
  68. package/dist/knob-contracts/action-bar-knobs.d.ts +3 -4
  69. package/dist/knob-contracts/activity-knobs.d.ts +3 -4
  70. package/dist/knob-contracts/alert-knobs.d.ts +3 -4
  71. package/dist/knob-contracts/alert-knobs.js +12 -1
  72. package/dist/knob-contracts/audio-recorder-knobs.d.ts +3 -4
  73. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +3 -4
  74. package/dist/knob-contracts/avatar-knobs.d.ts +3 -4
  75. package/dist/knob-contracts/avatar-knobs.js +2 -1
  76. package/dist/knob-contracts/badge-knobs.d.ts +3 -4
  77. package/dist/knob-contracts/button-group-knobs.d.ts +3 -4
  78. package/dist/knob-contracts/button-knobs.d.ts +3 -4
  79. package/dist/knob-contracts/button-knobs.js +1 -0
  80. package/dist/knob-contracts/calendar-knobs.d.ts +3 -4
  81. package/dist/knob-contracts/card-knobs.d.ts +3 -4
  82. package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +3 -4
  83. package/dist/knob-contracts/chat-composer-attachment-knobs.js +3 -1
  84. package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
  85. package/dist/knob-contracts/chat-composer-knobs.js +1 -0
  86. package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
  87. package/dist/knob-contracts/chat-layout-knobs.js +2 -3
  88. package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
  89. package/dist/knob-contracts/choice-knobs.d.ts +3 -4
  90. package/dist/knob-contracts/choice-knobs.js +2 -1
  91. package/dist/knob-contracts/code-diff-knobs.d.ts +3 -4
  92. package/dist/knob-contracts/code-diff-knobs.js +1 -0
  93. package/dist/knob-contracts/code-knobs.d.ts +3 -4
  94. package/dist/knob-contracts/code-knobs.js +3 -1
  95. package/dist/knob-contracts/collapsible-knobs.d.ts +3 -4
  96. package/dist/knob-contracts/color-picker-knobs.d.ts +3 -4
  97. package/dist/knob-contracts/context-knobs.d.ts +3 -4
  98. package/dist/knob-contracts/dockable-panel-knobs.d.ts +3 -4
  99. package/dist/knob-contracts/dockable-panel-knobs.js +1 -0
  100. package/dist/knob-contracts/dropzone-knobs.d.ts +3 -4
  101. package/dist/knob-contracts/dropzone-knobs.js +1 -0
  102. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +3 -4
  103. package/dist/knob-contracts/empty-knobs.d.ts +3 -4
  104. package/dist/knob-contracts/empty-knobs.js +14 -1
  105. package/dist/knob-contracts/environment-variables-knobs.d.ts +3 -4
  106. package/dist/knob-contracts/environment-variables-knobs.js +2 -1
  107. package/dist/knob-contracts/field-knobs.d.ts +3 -4
  108. package/dist/knob-contracts/gradient-editor-knobs.d.ts +3 -4
  109. package/dist/knob-contracts/gradient-editor-knobs.js +3 -1
  110. package/dist/knob-contracts/infinite-canvas-knobs.d.ts +3 -4
  111. package/dist/knob-contracts/inline-attachment-knobs.d.ts +3 -4
  112. package/dist/knob-contracts/inline-attachment-knobs.js +2 -1
  113. package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
  114. package/dist/knob-contracts/inline-citation-knobs.js +1 -0
  115. package/dist/knob-contracts/item-knobs.d.ts +3 -4
  116. package/dist/knob-contracts/kbd-knobs.d.ts +3 -4
  117. package/dist/knob-contracts/markdown-block-knobs.d.ts +3 -4
  118. package/dist/knob-contracts/markdown-block-knobs.js +2 -0
  119. package/dist/knob-contracts/markdown-knobs.d.ts +3 -4
  120. package/dist/knob-contracts/markdown-knobs.js +1 -0
  121. package/dist/knob-contracts/morphing-panel-knobs.d.ts +3 -4
  122. package/dist/knob-contracts/pagination-knobs.d.ts +3 -4
  123. package/dist/knob-contracts/phone-input-knobs.d.ts +3 -4
  124. package/dist/knob-contracts/phone-input-knobs.js +1 -0
  125. package/dist/knob-contracts/popup-knobs.d.ts +3 -4
  126. package/dist/knob-contracts/progressive-blur-knobs.d.ts +3 -4
  127. package/dist/knob-contracts/progressive-blur-knobs.js +1 -0
  128. package/dist/knob-contracts/range-knobs.d.ts +3 -4
  129. package/dist/knob-contracts/resizable-knobs.d.ts +3 -4
  130. package/dist/knob-contracts/resizable-knobs.js +1 -0
  131. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +3 -4
  132. package/dist/knob-contracts/scroll-area-knobs.d.ts +3 -4
  133. package/dist/knob-contracts/separator-knobs.d.ts +3 -4
  134. package/dist/knob-contracts/sidebar-knobs.d.ts +3 -4
  135. package/dist/knob-contracts/sidebar-knobs.js +1 -0
  136. package/dist/knob-contracts/skeleton-knobs.d.ts +3 -4
  137. package/dist/knob-contracts/skeleton-knobs.js +9 -1
  138. package/dist/knob-contracts/source-badge-knobs.d.ts +3 -4
  139. package/dist/knob-contracts/spinner-knobs.d.ts +3 -4
  140. package/dist/knob-contracts/stepper-knobs.d.ts +3 -4
  141. package/dist/knob-contracts/stepper-knobs.js +1 -0
  142. package/dist/knob-contracts/switch-knobs.d.ts +3 -4
  143. package/dist/knob-contracts/switch-knobs.js +7 -1
  144. package/dist/knob-contracts/table-knobs.d.ts +3 -4
  145. package/dist/knob-contracts/table-of-contents-knobs.d.ts +3 -4
  146. package/dist/knob-contracts/table-of-contents-knobs.js +25 -0
  147. package/dist/knob-contracts/tabs-knobs.d.ts +3 -4
  148. package/dist/knob-contracts/tabs-knobs.js +2 -1
  149. package/dist/knob-contracts/task-list-knobs.d.ts +3 -4
  150. package/dist/knob-contracts/task-list-knobs.js +1 -0
  151. package/dist/knob-contracts/thread-rail-knobs.d.ts +3 -4
  152. package/dist/knob-contracts/timeline-knobs.d.ts +3 -4
  153. package/dist/knob-contracts/toolbar-knobs.d.ts +3 -4
  154. package/dist/knob-contracts/toolbar-knobs.js +1 -0
  155. package/dist/knob-contracts/track-highlight-knobs.d.ts +3 -4
  156. package/dist/knob-contracts/transcript-divider-knobs.d.ts +3 -4
  157. package/dist/knob-contracts/tree-knobs.d.ts +3 -4
  158. package/dist/knob-contracts/user-ask-knobs.d.ts +3 -4
  159. package/dist/knob-contracts/user-ask-knobs.js +1 -0
  160. package/dist/lib/cn.d.ts +2 -3
  161. package/dist/lib/code-tokens.d.ts +12 -13
  162. package/dist/lib/color.d.ts +26 -27
  163. package/dist/lib/contrast.d.ts +12 -13
  164. package/dist/lib/diff.d.ts +14 -15
  165. package/dist/lib/dropzone-validation.d.ts +25 -26
  166. package/dist/lib/env-file.d.ts +12 -13
  167. package/dist/lib/format-audio-recorder-duration.d.ts +2 -3
  168. package/dist/lib/liquid-glass-optics.d.ts +2 -3
  169. package/dist/lib/phone-input-format.d.ts +3 -4
  170. package/dist/lib/phone-input-format.js +1 -1
  171. package/dist/lib/phone-number.d.ts +8 -9
  172. package/dist/lib/trigger-detect.d.ts +4 -5
  173. package/dist/markdown-block.d.ts +11 -12
  174. package/dist/scripts/contrast-eval.d.ts +16 -17
  175. package/dist/scripts/contrast-eval.js +13 -7
  176. package/dist/skin-provider.d.ts +14 -0
  177. package/dist/skin-provider.js +21 -0
  178. package/dist/skin.d.ts +14 -33
  179. package/dist/skin.js +3 -46
  180. package/dist/source-badge.d.ts +7 -8
  181. package/dist/styles/index.css +2 -4
  182. package/dist/styles/recipes/accordion.css +8 -2
  183. package/dist/styles/recipes/action-bar.css +5 -2
  184. package/dist/styles/recipes/alert.css +95 -16
  185. package/dist/styles/recipes/avatar.css +17 -1
  186. package/dist/styles/recipes/badge.css +0 -1
  187. package/dist/styles/recipes/button.css +34 -8
  188. package/dist/styles/recipes/calendar.css +0 -6
  189. package/dist/styles/recipes/chat-composer-attachment.css +51 -53
  190. package/dist/styles/recipes/chat-composer.css +26 -21
  191. package/dist/styles/recipes/chat-layout.css +21 -62
  192. package/dist/styles/recipes/chat-message.css +11 -5
  193. package/dist/styles/recipes/choice.css +9 -2
  194. package/dist/styles/recipes/code-diff.css +8 -1
  195. package/dist/styles/recipes/code.css +39 -17
  196. package/dist/styles/recipes/collapsible.css +0 -3
  197. package/dist/styles/recipes/color-picker-details.css +1 -2
  198. package/dist/styles/recipes/color-picker-values.css +0 -4
  199. package/dist/styles/recipes/dockable-panel.css +8 -1
  200. package/dist/styles/recipes/dropzone.css +9 -2
  201. package/dist/styles/recipes/empty.css +118 -17
  202. package/dist/styles/recipes/environment-variables.css +8 -1
  203. package/dist/styles/recipes/field-parts.css +1 -6
  204. package/dist/styles/recipes/field.css +9 -5
  205. package/dist/styles/recipes/gradient-editor.css +16 -5
  206. package/dist/styles/recipes/inline-attachment.css +13 -8
  207. package/dist/styles/recipes/inline-citation.css +8 -4
  208. package/dist/styles/recipes/item.css +1 -1
  209. package/dist/styles/recipes/kbd.css +8 -0
  210. package/dist/styles/recipes/markdown-block.css +16 -2
  211. package/dist/styles/recipes/markdown.css +12 -0
  212. package/dist/styles/recipes/morphing-panel.css +1 -1
  213. package/dist/styles/recipes/pagination.css +0 -4
  214. package/dist/styles/recipes/phone-input.css +8 -4
  215. package/dist/styles/recipes/popup-lists.css +11 -0
  216. package/dist/styles/recipes/popup-toast.css +1 -29
  217. package/dist/styles/recipes/popup.css +2 -2
  218. package/dist/styles/recipes/progressive-blur.css +28 -7
  219. package/dist/styles/recipes/range.css +50 -1
  220. package/dist/styles/recipes/resizable.css +8 -10
  221. package/dist/styles/recipes/rich-tooltip.css +0 -4
  222. package/dist/styles/recipes/scroll-area.css +8 -2
  223. package/dist/styles/recipes/sidebar-menu.css +150 -0
  224. package/dist/styles/recipes/sidebar.css +56 -110
  225. package/dist/styles/recipes/skeleton.css +85 -3
  226. package/dist/styles/recipes/source-badge.css +0 -3
  227. package/dist/styles/recipes/stepper.css +8 -1
  228. package/dist/styles/recipes/switch.css +89 -17
  229. package/dist/styles/recipes/table-of-contents.css +211 -45
  230. package/dist/styles/recipes/table.css +0 -1
  231. package/dist/styles/recipes/tabs.css +19 -2
  232. package/dist/styles/recipes/task-list.css +8 -2
  233. package/dist/styles/recipes/thread-rail.css +0 -4
  234. package/dist/styles/recipes/toolbar.css +18 -4
  235. package/dist/styles/recipes/track-highlight.css +63 -5
  236. package/dist/styles/recipes/tree.css +2 -0
  237. package/dist/styles/recipes/user-ask.css +8 -4
  238. package/dist/styles/theme.css +130 -138
  239. package/dist/surface-variants.d.ts +4 -5
  240. package/dist/task-list.d.ts +16 -17
  241. package/dist/thread-rail.d.ts +21 -22
  242. package/dist/transcript-divider.d.ts +6 -7
  243. package/dist/ui/accordion.d.ts +10 -11
  244. package/dist/ui/alert-dialog.d.ts +11 -12
  245. package/dist/ui/alert-dialog.js +8 -6
  246. package/dist/ui/alert.d.ts +9 -10
  247. package/dist/ui/alert.js +3 -3
  248. package/dist/ui/aspect-ratio.d.ts +3 -4
  249. package/dist/ui/autocomplete.d.ts +19 -20
  250. package/dist/ui/autocomplete.js +5 -3
  251. package/dist/ui/avatar.d.ts +9 -10
  252. package/dist/ui/badge.d.ts +9 -10
  253. package/dist/ui/button-group.d.ts +7 -8
  254. package/dist/ui/button-group.js +3 -2
  255. package/dist/ui/button.d.ts +17 -18
  256. package/dist/ui/button.js +20 -5
  257. package/dist/ui/calendar.d.ts +3 -4
  258. package/dist/ui/card.d.ts +16 -17
  259. package/dist/ui/checkbox-group.d.ts +4 -5
  260. package/dist/ui/checkbox-group.js +3 -2
  261. package/dist/ui/checkbox.d.ts +3 -4
  262. package/dist/ui/code-diff.d.ts +8 -9
  263. package/dist/ui/code.d.ts +32 -23
  264. package/dist/ui/code.js +41 -20
  265. package/dist/ui/collapsible.d.ts +7 -8
  266. package/dist/ui/color-picker.d.ts +40 -41
  267. package/dist/ui/color-picker.js +5 -3
  268. package/dist/ui/combobox-disabled-selection.d.ts +3 -4
  269. package/dist/ui/combobox.d.ts +21 -20
  270. package/dist/ui/combobox.js +5 -3
  271. package/dist/ui/command.d.ts +19 -18
  272. package/dist/ui/command.js +38 -12
  273. package/dist/ui/context-menu.d.ts +30 -31
  274. package/dist/ui/context-menu.js +8 -5
  275. package/dist/ui/dialog.d.ts +13 -13
  276. package/dist/ui/dialog.js +10 -8
  277. package/dist/ui/dockable-panel-geometry.d.ts +7 -8
  278. package/dist/ui/dockable-panel.d.ts +21 -22
  279. package/dist/ui/drawer.d.ts +17 -18
  280. package/dist/ui/drawer.js +7 -6
  281. package/dist/ui/dropdown-menu.d.ts +36 -29
  282. package/dist/ui/dropdown-menu.js +116 -9
  283. package/dist/ui/dropzone.d.ts +24 -24
  284. package/dist/ui/empty.d.ts +14 -14
  285. package/dist/ui/empty.js +3 -3
  286. package/dist/ui/field.d.ts +26 -27
  287. package/dist/ui/form.d.ts +4 -5
  288. package/dist/ui/gradient-editor.d.ts +16 -17
  289. package/dist/ui/hover-card.d.ts +6 -7
  290. package/dist/ui/hover-card.js +5 -3
  291. package/dist/ui/infinite-canvas.d.ts +11 -12
  292. package/dist/ui/input-group.d.ts +6 -7
  293. package/dist/ui/input-otp.d.ts +7 -8
  294. package/dist/ui/input.d.ts +3 -4
  295. package/dist/ui/item.d.ts +20 -21
  296. package/dist/ui/kbd.d.ts +7 -5
  297. package/dist/ui/kbd.js +4 -2
  298. package/dist/ui/markdown-elements.d.ts +20 -21
  299. package/dist/ui/markdown.d.ts +5 -6
  300. package/dist/ui/menubar.d.ts +25 -26
  301. package/dist/ui/menubar.js +8 -5
  302. package/dist/ui/meter.d.ts +11 -12
  303. package/dist/ui/morphing-panel.d.ts +8 -9
  304. package/dist/ui/native-select.d.ts +3 -4
  305. package/dist/ui/native-select.js +1 -1
  306. package/dist/ui/navigation-menu.d.ts +17 -18
  307. package/dist/ui/navigation-menu.js +5 -3
  308. package/dist/ui/number-field.d.ts +15 -16
  309. package/dist/ui/pagination.d.ts +10 -11
  310. package/dist/ui/phone-input.d.ts +5 -6
  311. package/dist/ui/phone-input.js +40 -37
  312. package/dist/ui/popover.d.ts +11 -12
  313. package/dist/ui/popover.js +5 -3
  314. package/dist/ui/progress.d.ts +11 -12
  315. package/dist/ui/progressive-blur.d.ts +4 -5
  316. package/dist/ui/radio-group.d.ts +5 -6
  317. package/dist/ui/resizable.d.ts +12 -13
  318. package/dist/ui/responsive-dialog.d.ts +11 -12
  319. package/dist/ui/rich-tooltip-tour.d.ts +5 -6
  320. package/dist/ui/rich-tooltip.d.ts +21 -23
  321. package/dist/ui/rich-tooltip.js +5 -5
  322. package/dist/ui/scroll-area.d.ts +7 -8
  323. package/dist/ui/scroll-area.js +9 -6
  324. package/dist/ui/select.d.ts +21 -14
  325. package/dist/ui/select.js +7 -4
  326. package/dist/ui/separator.d.ts +2 -3
  327. package/dist/ui/sheet.d.ts +8 -9
  328. package/dist/ui/sheet.js +7 -5
  329. package/dist/ui/sidebar-menu.d.ts +24 -15
  330. package/dist/ui/sidebar-menu.js +30 -4
  331. package/dist/ui/sidebar-provider.d.ts +32 -7
  332. package/dist/ui/sidebar-provider.js +82 -22
  333. package/dist/ui/sidebar-resize-rail.d.ts +8 -0
  334. package/dist/ui/sidebar-resize-rail.js +192 -0
  335. package/dist/ui/sidebar.d.ts +20 -14
  336. package/dist/ui/sidebar.js +122 -57
  337. package/dist/ui/skeleton.d.ts +7 -4
  338. package/dist/ui/skeleton.js +9 -2
  339. package/dist/ui/slider.d.ts +6 -5
  340. package/dist/ui/slider.js +16 -13
  341. package/dist/ui/spinner.d.ts +3 -4
  342. package/dist/ui/stepper.d.ts +22 -23
  343. package/dist/ui/switch.d.ts +3 -4
  344. package/dist/ui/switch.js +12 -1
  345. package/dist/ui/table-of-contents.d.ts +7 -8
  346. package/dist/ui/table-of-contents.js +4 -2
  347. package/dist/ui/table.d.ts +17 -18
  348. package/dist/ui/tabs.d.ts +14 -11
  349. package/dist/ui/textarea.d.ts +3 -4
  350. package/dist/ui/timeline.d.ts +18 -19
  351. package/dist/ui/toast.d.ts +9 -9
  352. package/dist/ui/toast.js +21 -14
  353. package/dist/ui/toggle.d.ts +5 -6
  354. package/dist/ui/toggle.js +3 -2
  355. package/dist/ui/toolbar.d.ts +15 -16
  356. package/dist/ui/toolbar.js +15 -4
  357. package/dist/ui/tooltip.d.ts +6 -13
  358. package/dist/ui/tooltip.js +7 -8
  359. package/dist/ui/tree.d.ts +18 -19
  360. package/dist/ui/tree.js +3 -2
  361. package/dist/ui/trigger-menu.d.ts +15 -16
  362. package/dist/ui/trigger-menu.js +5 -3
  363. package/dist/ui/use-switch-drag.d.ts +7 -0
  364. package/dist/ui/use-switch-drag.js +104 -0
  365. package/dist/user-ask.d.ts +24 -25
  366. package/package.json +15 -15
  367. package/dist/code-block-editor.d.ts +0 -59
  368. package/dist/code-block-editor.js +0 -250
  369. package/dist/knob-contracts/code-block-editor-knobs.d.ts +0 -5
  370. package/dist/knob-contracts/code-block-editor-knobs.js +0 -11
  371. package/dist/lib/code-block-shiki.d.ts +0 -9
  372. package/dist/lib/code-block-shiki.js +0 -6
  373. package/dist/skin.config.d.ts +0 -5
  374. package/dist/skin.config.js +0 -12
  375. package/dist/styles/recipes/code-block-editor.css +0 -136
  376. package/dist/styles/skin-theme.css +0 -137
  377. package/dist/styles/skin.css +0 -143
@@ -1,4 +1,3 @@
1
1
  //#region src/lib/liquid-glass-optics.d.ts
2
- declare const LIQUID_GLASS_OPTICS_GLSL = "\nconst float LIQUID_GLASS_REFRACTIVE_INDEX = 1.5;\n\nfloat liquidPLength(vec2 value, float exponent) {\n return pow(pow(value.x, exponent) + pow(value.y, exponent), 1.0 / exponent);\n}\n\nfloat liquidSurfaceSDF(vec2 point, vec2 halfSize, float cornerRadius, float cornerExponent) {\n float radius = min(cornerRadius, min(halfSize.x, halfSize.y));\n vec2 q = abs(point) - halfSize + vec2(radius);\n vec2 outside = max(q, vec2(0.0));\n float corner = liquidPLength(outside, cornerExponent);\n return min(max(q.x, q.y), 0.0) + corner - radius;\n}\n\nfloat liquidOpticalInsideDistance(\n vec2 point,\n vec2 halfSize,\n float cornerRadius,\n float cornerExponent\n) {\n return max(-liquidSurfaceSDF(point, halfSize, cornerRadius, cornerExponent), 0.0);\n}\n\nvec2 liquidInwardOpticalNormal(\n vec2 point,\n vec2 halfSize,\n float cornerRadius,\n float cornerExponent\n) {\n float epsilon = 0.35;\n vec2 gradient = vec2(\n liquidSurfaceSDF(point + vec2(epsilon, 0.0), halfSize, cornerRadius, cornerExponent)\n - liquidSurfaceSDF(point - vec2(epsilon, 0.0), halfSize, cornerRadius, cornerExponent),\n liquidSurfaceSDF(point + vec2(0.0, epsilon), halfSize, cornerRadius, cornerExponent)\n - liquidSurfaceSDF(point - vec2(0.0, epsilon), halfSize, cornerRadius, cornerExponent)\n );\n float gradientLength = length(gradient);\n if (gradientLength <= 0.0001) return vec2(0.0);\n return -gradient / gradientLength;\n}\n\nfloat liquidEdgeWidth(vec2 size, float edgeRatio, float edgeCap) {\n vec2 halfSize = size * 0.5;\n float requestedWidth = min(max(min(size.x, size.y) * edgeRatio, 18.0), edgeCap);\n return min(requestedWidth, max(min(halfSize.x, halfSize.y) - 1.0, 0.001));\n}\n\nfloat liquidEdgeLens(float opticalInside, float edgeWidth) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0, 1.0);\n return pow(1.0 - edgeDistance, 1.35);\n}\n\nfloat liquidConvexSurfaceSlopeForExponent(float radialDistance, float exponent) {\n float profile = max(1.0 - pow(radialDistance, exponent), 0.0001);\n return pow(radialDistance, exponent - 1.0) * pow(profile, 1.0 / exponent - 1.0);\n}\n\nfloat liquidConvexSurfaceSlope(float opticalInside, float edgeWidth) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0005, 0.9995);\n float radialDistance = 1.0 - edgeDistance;\n float squircleSlope = liquidConvexSurfaceSlopeForExponent(radialDistance, 4.0);\n float circularSlope = liquidConvexSurfaceSlopeForExponent(radialDistance, 2.0);\n return min(mix(squircleSlope, circularSlope, 0.55), 12.0);\n}\n\nvec3 liquidLensSurfaceNormal(vec2 inwardNormal, float opticalInside, float edgeWidth) {\n float slope = liquidConvexSurfaceSlope(opticalInside, edgeWidth);\n return normalize(vec3(-inwardNormal * slope, 1.0));\n}\n\nvec2 liquidRefractedOffset(\n vec2 inwardNormal,\n float opticalInside,\n float edgeWidth,\n float depthScale\n) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0, 1.0);\n if (edgeDistance >= 1.0) return vec2(0.0);\n\n vec3 surfaceNormal = liquidLensSurfaceNormal(inwardNormal, opticalInside, edgeWidth);\n vec3 ray = refract(vec3(0.0, 0.0, -1.0), surfaceNormal, 1.0 / LIQUID_GLASS_REFRACTIVE_INDEX);\n vec2 snellOffset = ray.xy / max(-ray.z, 0.2) * edgeWidth * depthScale;\n\n float radialDistance = 1.0 - edgeDistance;\n float circularRoll = 1.0 - sqrt(max(1.0 - radialDistance * radialDistance, 0.0));\n vec2 rollOffset = inwardNormal * circularRoll * edgeWidth * 0.18;\n float interiorFade = 1.0 - smoothstep(0.82, 1.0, edgeDistance);\n vec2 offset = (snellOffset + rollOffset) * interiorFade;\n float maximumOffset = edgeWidth * 1.05;\n return offset * min(1.0, maximumOffset / max(length(offset), 0.0001));\n}\n";
3
- //#endregion
4
- export { LIQUID_GLASS_OPTICS_GLSL };
2
+ export declare const LIQUID_GLASS_OPTICS_GLSL = "\nconst float LIQUID_GLASS_REFRACTIVE_INDEX = 1.5;\n\nfloat liquidPLength(vec2 value, float exponent) {\n return pow(pow(value.x, exponent) + pow(value.y, exponent), 1.0 / exponent);\n}\n\nfloat liquidSurfaceSDF(vec2 point, vec2 halfSize, float cornerRadius, float cornerExponent) {\n float radius = min(cornerRadius, min(halfSize.x, halfSize.y));\n vec2 q = abs(point) - halfSize + vec2(radius);\n vec2 outside = max(q, vec2(0.0));\n float corner = liquidPLength(outside, cornerExponent);\n return min(max(q.x, q.y), 0.0) + corner - radius;\n}\n\nfloat liquidOpticalInsideDistance(\n vec2 point,\n vec2 halfSize,\n float cornerRadius,\n float cornerExponent\n) {\n return max(-liquidSurfaceSDF(point, halfSize, cornerRadius, cornerExponent), 0.0);\n}\n\nvec2 liquidInwardOpticalNormal(\n vec2 point,\n vec2 halfSize,\n float cornerRadius,\n float cornerExponent\n) {\n float epsilon = 0.35;\n vec2 gradient = vec2(\n liquidSurfaceSDF(point + vec2(epsilon, 0.0), halfSize, cornerRadius, cornerExponent)\n - liquidSurfaceSDF(point - vec2(epsilon, 0.0), halfSize, cornerRadius, cornerExponent),\n liquidSurfaceSDF(point + vec2(0.0, epsilon), halfSize, cornerRadius, cornerExponent)\n - liquidSurfaceSDF(point - vec2(0.0, epsilon), halfSize, cornerRadius, cornerExponent)\n );\n float gradientLength = length(gradient);\n if (gradientLength <= 0.0001) return vec2(0.0);\n return -gradient / gradientLength;\n}\n\nfloat liquidEdgeWidth(vec2 size, float edgeRatio, float edgeCap) {\n vec2 halfSize = size * 0.5;\n float requestedWidth = min(max(min(size.x, size.y) * edgeRatio, 18.0), edgeCap);\n return min(requestedWidth, max(min(halfSize.x, halfSize.y) - 1.0, 0.001));\n}\n\nfloat liquidEdgeLens(float opticalInside, float edgeWidth) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0, 1.0);\n return pow(1.0 - edgeDistance, 1.35);\n}\n\nfloat liquidConvexSurfaceSlopeForExponent(float radialDistance, float exponent) {\n float profile = max(1.0 - pow(radialDistance, exponent), 0.0001);\n return pow(radialDistance, exponent - 1.0) * pow(profile, 1.0 / exponent - 1.0);\n}\n\nfloat liquidConvexSurfaceSlope(float opticalInside, float edgeWidth) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0005, 0.9995);\n float radialDistance = 1.0 - edgeDistance;\n float squircleSlope = liquidConvexSurfaceSlopeForExponent(radialDistance, 4.0);\n float circularSlope = liquidConvexSurfaceSlopeForExponent(radialDistance, 2.0);\n return min(mix(squircleSlope, circularSlope, 0.55), 12.0);\n}\n\nvec3 liquidLensSurfaceNormal(vec2 inwardNormal, float opticalInside, float edgeWidth) {\n float slope = liquidConvexSurfaceSlope(opticalInside, edgeWidth);\n return normalize(vec3(-inwardNormal * slope, 1.0));\n}\n\nvec2 liquidRefractedOffset(\n vec2 inwardNormal,\n float opticalInside,\n float edgeWidth,\n float depthScale\n) {\n float edgeDistance = clamp(opticalInside / max(edgeWidth, 0.001), 0.0, 1.0);\n if (edgeDistance >= 1.0) return vec2(0.0);\n\n vec3 surfaceNormal = liquidLensSurfaceNormal(inwardNormal, opticalInside, edgeWidth);\n vec3 ray = refract(vec3(0.0, 0.0, -1.0), surfaceNormal, 1.0 / LIQUID_GLASS_REFRACTIVE_INDEX);\n vec2 snellOffset = ray.xy / max(-ray.z, 0.2) * edgeWidth * depthScale;\n\n float radialDistance = 1.0 - edgeDistance;\n float circularRoll = 1.0 - sqrt(max(1.0 - radialDistance * radialDistance, 0.0));\n vec2 rollOffset = inwardNormal * circularRoll * edgeWidth * 0.18;\n float interiorFade = 1.0 - smoothstep(0.82, 1.0, edgeDistance);\n vec2 offset = (snellOffset + rollOffset) * interiorFade;\n float maximumOffset = edgeWidth * 1.05;\n return offset * min(1.0, maximumOffset / max(length(offset), 0.0001));\n}\n";
3
+ //#endregion
@@ -1,6 +1,5 @@
1
1
  import { Country, Value } from "react-phone-number-input/max";
2
2
  //#region src/lib/phone-input-format.d.ts
3
- declare function normalizePhoneInputText(value: string, country: Country | undefined): string;
4
- declare function normalizePhoneInputValue(value: Value | undefined, country: Country | undefined): string | undefined;
5
- //#endregion
6
- export { normalizePhoneInputText, normalizePhoneInputValue };
3
+ export declare function normalizePhoneInputText(value: string, country: Country | undefined): string;
4
+ export declare function normalizePhoneInputValue(value: Value | undefined, country: Country | undefined): string | undefined;
5
+ //#endregion
@@ -1,5 +1,5 @@
1
- import { AsYouType } from "libphonenumber-js/max";
2
1
  import { getCountryCallingCode } from "react-phone-number-input/max";
2
+ import { AsYouType } from "libphonenumber-js/max";
3
3
  //#region src/lib/phone-input-format.ts
4
4
  function normalizePhoneInputText(value, country) {
5
5
  if (!country) return value;
@@ -1,18 +1,17 @@
1
1
  //#region src/lib/phone-number.d.ts
2
- type PhoneNumberValidationMode = "possible" | "valid";
3
- type PhoneNumberSchemaMessages = {
2
+ export type PhoneNumberValidationMode = "possible" | "valid";
3
+ export type PhoneNumberSchemaMessages = {
4
4
  format?: string;
5
5
  invalid?: string;
6
6
  mobile?: string;
7
7
  };
8
- type PhoneNumberSchemaOptions = {
8
+ export type PhoneNumberSchemaOptions = {
9
9
  mode?: PhoneNumberValidationMode;
10
10
  mobileOnly?: boolean;
11
11
  messages?: PhoneNumberSchemaMessages;
12
12
  };
13
- declare function createPhoneNumberSchema({ mode, mobileOnly, messages }?: PhoneNumberSchemaOptions): import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
14
- declare const phoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
15
- declare const possiblePhoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
16
- declare const mobilePhoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
17
- //#endregion
18
- export { PhoneNumberSchemaMessages, PhoneNumberSchemaOptions, PhoneNumberValidationMode, createPhoneNumberSchema, mobilePhoneNumberSchema, phoneNumberSchema, possiblePhoneNumberSchema };
13
+ export declare function createPhoneNumberSchema({ mode, mobileOnly, messages }?: PhoneNumberSchemaOptions): import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
14
+ export declare const phoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
15
+ export declare const possiblePhoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
16
+ export declare const mobilePhoneNumberSchema: import("zod").ZodPipe<import("zod").ZodE164, import("zod").ZodTransform<string, string>>;
17
+ //#endregion
@@ -1,5 +1,5 @@
1
1
  //#region src/lib/trigger-detect.d.ts
2
- type TriggerMatch = {
2
+ export type TriggerMatch = {
3
3
  /** trigger character that opened menu (e.g. "/" or "@"). */
4
4
  char: string;
5
5
  /** Text typed after trigger char, up to caret (never contains whitespace). */
@@ -9,7 +9,6 @@ type TriggerMatch = {
9
9
  /** Offset of caret in scanned text (exclusive end of trigger token). */
10
10
  end: number;
11
11
  };
12
- declare function detectTrigger(textBeforeCaret: string, triggerChars: readonly string[]): TriggerMatch | null;
13
- declare function caretRectInTextarea(element: HTMLTextAreaElement, offset: number): DOMRect;
14
- //#endregion
15
- export { TriggerMatch, caretRectInTextarea, detectTrigger };
12
+ export declare function detectTrigger(textBeforeCaret: string, triggerChars: readonly string[]): TriggerMatch | null;
13
+ export declare function caretRectInTextarea(element: HTMLTextAreaElement, offset: number): DOMRect;
14
+ //#endregion
@@ -2,24 +2,23 @@ import { MarkdownBlockKnobStyle } from "./knob-contracts/markdown-block-knobs.js
2
2
  import { CodeCopyProps } from "./ui/code.js";
3
3
  import { CSSProperties, ComponentProps } from "react";
4
4
  //#region src/markdown-block.d.ts
5
- type MarkdownBlockProps = Omit<ComponentProps<"figure">, "style"> & {
5
+ export type MarkdownBlockProps = Omit<ComponentProps<"figure">, "style"> & {
6
6
  code: string;
7
7
  style?: CSSProperties & MarkdownBlockKnobStyle;
8
8
  };
9
- declare function MarkdownBlock({ code, className, children, ...props }: MarkdownBlockProps): import("react").JSX.Element;
10
- type MarkdownBlockHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
9
+ export declare function MarkdownBlock({ code, className, children, ...props }: MarkdownBlockProps): import("react").JSX.Element;
10
+ export type MarkdownBlockHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
11
11
  style?: CSSProperties & MarkdownBlockKnobStyle;
12
12
  };
13
- declare function MarkdownBlockHeader({ className, ...props }: MarkdownBlockHeaderProps): import("react").JSX.Element;
14
- type MarkdownBlockTitleProps = Omit<ComponentProps<"div">, "style"> & {
13
+ export declare function MarkdownBlockHeader({ className, ...props }: MarkdownBlockHeaderProps): import("react").JSX.Element;
14
+ export type MarkdownBlockTitleProps = Omit<ComponentProps<"div">, "style"> & {
15
15
  style?: CSSProperties & MarkdownBlockKnobStyle;
16
16
  };
17
- declare function MarkdownBlockTitle({ children, className, ...props }: MarkdownBlockTitleProps): import("react").JSX.Element;
18
- type MarkdownBlockCopyProps = Omit<CodeCopyProps, "value">;
19
- declare function MarkdownBlockCopy({ "aria-label": ariaLabel, ...props }: MarkdownBlockCopyProps): import("react").JSX.Element;
20
- type MarkdownBlockContentProps = ComponentProps<"div"> & {
17
+ export declare function MarkdownBlockTitle({ children, className, ...props }: MarkdownBlockTitleProps): import("react").JSX.Element;
18
+ export type MarkdownBlockCopyProps = Omit<CodeCopyProps, "value">;
19
+ export declare function MarkdownBlockCopy({ "aria-label": ariaLabel, ...props }: MarkdownBlockCopyProps): import("react").JSX.Element;
20
+ export type MarkdownBlockContentProps = ComponentProps<"div"> & {
21
21
  style?: CSSProperties & MarkdownBlockKnobStyle;
22
22
  };
23
- declare function MarkdownBlockContent({ children, className, ...props }: MarkdownBlockContentProps): import("react").JSX.Element;
24
- //#endregion
25
- export { MarkdownBlock, MarkdownBlockContent, MarkdownBlockContentProps, MarkdownBlockCopy, MarkdownBlockCopyProps, MarkdownBlockHeader, MarkdownBlockHeaderProps, MarkdownBlockProps, MarkdownBlockTitle, MarkdownBlockTitleProps };
23
+ export declare function MarkdownBlockContent({ children, className, ...props }: MarkdownBlockContentProps): import("react").JSX.Element;
24
+ //#endregion
@@ -1,46 +1,45 @@
1
1
  //#region src/scripts/contrast-eval.d.mts
2
- declare const stripComments: (css: any) => any;
3
- declare function parseBlocks(css: any): {
2
+ export declare const stripComments: (css: any) => any;
3
+ export declare function parseBlocks(css: any): {
4
4
  prelude: any;
5
5
  body: any;
6
6
  }[];
7
- declare function flattenBlocks(css: any): any;
8
- declare function declarations(body: any): Map<any, any>;
9
- /** Later source wins, so the order is Tailwind palette, core theme, skin theme, app overrides. */
10
- declare function tokenMaps(cssSources: any): {
7
+ export declare function flattenBlocks(css: any): any;
8
+ export declare function declarations(body: any): Map<any, any>;
9
+ export declare function themeTokenBlocks(css: any): any;
10
+ export declare function tokenMaps(cssSources: any): {
11
11
  light: Map<any, any>;
12
12
  dark: Map<any, any>;
13
13
  };
14
- declare function rgbToOklch(r255: any, g255: any, b255: any): {
14
+ export declare function rgbToOklch(r255: any, g255: any, b255: any): {
15
15
  L: number;
16
16
  C: number;
17
17
  H: number;
18
18
  };
19
- declare function oklchToRgb(L: any, C: any, H: any): {
19
+ export declare function oklchToRgb(L: any, C: any, H: any): {
20
20
  r: number;
21
21
  g: number;
22
22
  b: number;
23
23
  };
24
- declare const luminance: ({ r, g, b }: {
24
+ export declare const luminance: ({ r, g, b }: {
25
25
  b: any;
26
26
  g: any;
27
27
  r: any;
28
28
  }) => number;
29
- declare function contrastRatio(a: any, b: any): number;
30
- declare function parseHex(value: any): {
29
+ export declare function contrastRatio(a: any, b: any): number;
30
+ export declare function parseHex(value: any): {
31
31
  r: number;
32
32
  g: number;
33
33
  b: number;
34
34
  alpha: number;
35
35
  } | null;
36
- declare function resolveColor(value: any, tokens: any, seen?: Set<any>, depth?: number): any;
37
- declare function composite(over: any, under: any): {
36
+ export declare function resolveColor(value: any, tokens: any, seen?: Set<any>, depth?: number): any;
37
+ export declare function composite(over: any, under: any): {
38
38
  r: number;
39
39
  g: number;
40
40
  b: number;
41
41
  alpha: any;
42
42
  };
43
- declare function evaluatePair(pair: any, tokens: any): any;
44
- declare function evaluate(tokens: any, pairs: any): any;
45
- //#endregion
46
- export { composite, contrastRatio, declarations, evaluate, evaluatePair, flattenBlocks, luminance, oklchToRgb, parseBlocks, parseHex, resolveColor, rgbToOklch, stripComments, tokenMaps };
43
+ export declare function evaluatePair(pair: any, tokens: any): any;
44
+ export declare function evaluate(tokens: any, pairs: any): any;
45
+ //#endregion
@@ -40,20 +40,27 @@ function declarations(body) {
40
40
  }
41
41
  return properties;
42
42
  }
43
- const declaresTokens = (prelude) => prelude.includes("[data-skin") || prelude.startsWith("@theme") && !prelude.includes("inline");
43
+ function declaresTokens(prelude) {
44
+ if (prelude.startsWith("@")) return prelude.startsWith("@theme") && !prelude.includes("inline");
45
+ return prelude.includes("[data-skin") || /(^|[\s,(])(?::root|\.dark)(?=$|[\s,.):])/.test(prelude);
46
+ }
47
+ function themeTokenBlocks(css) {
48
+ return parseBlocks(stripComments(css)).flatMap((block) => {
49
+ if (/^@layer\b/.test(block.prelude)) return themeTokenBlocks(block.body);
50
+ return declaresTokens(block.prelude) ? [block] : [];
51
+ });
52
+ }
44
53
  function modesOf(prelude) {
45
54
  if (/\.dark\b/.test(prelude.replaceAll(/:not\([^)]*\)/g, ""))) return ["dark"];
46
55
  if (/:not\([^)]*\.dark\b/.test(prelude)) return ["light"];
47
56
  return ["light", "dark"];
48
57
  }
49
- /** Later source wins, so the order is Tailwind palette, core theme, skin theme, app overrides. */
50
58
  function tokenMaps(cssSources) {
51
59
  const maps = {
52
60
  light: /* @__PURE__ */ new Map(),
53
61
  dark: /* @__PURE__ */ new Map()
54
62
  };
55
- for (const css of cssSources) for (const block of flattenBlocks(stripComments(css))) {
56
- if (!declaresTokens(block.prelude)) continue;
63
+ for (const css of cssSources) for (const block of themeTokenBlocks(css)) {
57
64
  const modes = modesOf(block.prelude);
58
65
  for (const [name, value] of declarations(block.body)) for (const mode of modes) maps[mode].set(name, value);
59
66
  }
@@ -162,7 +169,6 @@ function splitTopLevel(text) {
162
169
  }
163
170
  const unresolved = (reason) => ({ unresolved: reason });
164
171
  const isUnresolved = (result) => Boolean(result?.unresolved);
165
- /** `calc(<base> <op> <n>)`, `calc(<n> * var(--x))` and `calc(<base> * <n>)` — the only calc shapes the packs write. */
166
172
  function evaluateCalc(expression, base, tokens, seen, depth) {
167
173
  const inner = expression.slice(5, -1).trim();
168
174
  const match = /^(\S+)\s*([+\-*])\s*(\S+)$/.exec(inner);
@@ -237,7 +243,7 @@ function literalOklch(inner, tokens, seen, depth) {
237
243
  const numbers = channels.map((part, index) => literalChannel(part, index === 0));
238
244
  if (numbers.some((number) => number === null)) return unresolved(`unsupported \`oklch(${inner})\``);
239
245
  const alphaText = slash === -1 ? null : parts.slice(slash + 1).join(" ");
240
- const alpha = alphaText === null ? 1 : resolveScalar(alphaText, tokens, seen, depth);
246
+ const alpha = alphaText === null ? 1 : alphaValue(alphaText, null, tokens, seen, depth);
241
247
  if (alpha === null) return unresolved(`unsupported alpha in \`oklch(${inner})\``);
242
248
  return {
243
249
  ...oklchToRgb(numbers[0], numbers[1], numbers[2]),
@@ -324,4 +330,4 @@ function evaluate(tokens, pairs) {
324
330
  return pairs.map((pair) => evaluatePair(pair, tokens));
325
331
  }
326
332
  //#endregion
327
- export { composite, contrastRatio, declarations, evaluate, evaluatePair, flattenBlocks, luminance, oklchToRgb, parseBlocks, parseHex, resolveColor, rgbToOklch, stripComments, tokenMaps };
333
+ export { composite, contrastRatio, declarations, evaluate, evaluatePair, flattenBlocks, luminance, oklchToRgb, parseBlocks, parseHex, resolveColor, rgbToOklch, stripComments, themeTokenBlocks, tokenMaps };
@@ -0,0 +1,14 @@
1
+ import { ControlUiSkin, SkinAdornmentContexts, SkinAdornmentPart, SkinAdornmentScope } from "./skin.js";
2
+ import { ReactNode } from "react";
3
+ //#region src/skin-provider.d.ts
4
+ export declare function SkinProvider({ skin, children }: {
5
+ skin: ControlUiSkin;
6
+ children: ReactNode;
7
+ }): import("react").JSX.Element;
8
+ export declare function useSkin(): ControlUiSkin;
9
+ export declare function SkinAdornment<Scope extends SkinAdornmentScope, Part extends SkinAdornmentPart<Scope>>({ scope, part, context }: {
10
+ scope: Scope;
11
+ part: Part;
12
+ context: SkinAdornmentContexts[Scope][Part];
13
+ }): ReactNode;
14
+ //#endregion
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { skinAdornment } from "./skin.js";
3
+ import { createContext, useContext } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/skin-provider.tsx
6
+ const SkinContext = createContext({});
7
+ function SkinProvider({ skin, children }) {
8
+ return /* @__PURE__ */ jsx(SkinContext, {
9
+ value: skin,
10
+ children
11
+ });
12
+ }
13
+ function useSkin() {
14
+ return useContext(SkinContext);
15
+ }
16
+ function SkinAdornment({ scope, part, context }) {
17
+ const skin = useSkin();
18
+ return skinAdornment(skin, scope, part, context);
19
+ }
20
+ //#endregion
21
+ export { SkinAdornment, SkinProvider, useSkin };
package/dist/skin.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ControlTone, ControlVariant } from "./control-variants.js";
3
3
  import { ReactNode } from "react";
4
4
  //#region src/skin.d.ts
5
5
  type StatelessPart = Record<never, never>;
6
- type SkinAdornmentContexts = {
6
+ export type SkinAdornmentContexts = {
7
7
  button: {
8
8
  layer: {
9
9
  variant: ControlVariant;
@@ -13,9 +13,6 @@ type SkinAdornmentContexts = {
13
13
  "chat-layout": {
14
14
  titlebar: StatelessPart;
15
15
  };
16
- "chat-thought": {
17
- details: StatelessPart;
18
- };
19
16
  dialog: {
20
17
  titlebar: StatelessPart;
21
18
  };
@@ -25,47 +22,31 @@ type SkinAdornmentContexts = {
25
22
  };
26
23
  };
27
24
  };
28
- type SkinAdornmentScope = keyof SkinAdornmentContexts;
29
- type SkinAdornmentPart<Scope extends SkinAdornmentScope> = keyof SkinAdornmentContexts[Scope];
25
+ export type SkinAdornmentScope = keyof SkinAdornmentContexts;
26
+ export type SkinAdornmentPart<Scope extends SkinAdornmentScope> = keyof SkinAdornmentContexts[Scope];
30
27
  type AdornmentEntry<Ctx> = ReactNode | ((ctx: Ctx) => ReactNode);
31
- type SkinIndicators = {
28
+ export type SkinIndicators = {
32
29
  sidebar?: SelectionIndicator | HoverIndicator;
33
30
  tree?: SelectionIndicator;
34
31
  "button-group"?: HoverIndicator;
35
32
  "toggle-group"?: HoverIndicator;
36
33
  "checkbox-group"?: HoverIndicator;
37
34
  };
38
- type ControlUiSkin = {
39
- /** Scopes theme.css/skin.css via data-skin; components stamp it on portal containers. */
40
- id: string;
41
- /** Stamps data-motion="reduced", collapsing --duration-* to 0ms. Never `animation:none` — ripple cleanup still needs `animationend` to fire. */
35
+ export type ControlUiSkin = {
36
+ id?: string;
42
37
  motion?: "reduced";
43
- /** Locks skin to one scheme; page's .dark class must then follow it, since Shiki, native color-scheme, and dark: utilities key off .dark, not skin tokens. Undefined = adaptive, both blocks authored. */
44
38
  colorScheme?: "light" | "dark";
45
- /** Geometry, not slot restyle — padding, gap, rounding, and shadow across sidebar gap/container/inner. explicit `variant` prop wins; undefined keeps "sidebar". */
46
39
  sidebarLayout?: SidebarLayout;
40
+ scrollAreaBlur?: boolean;
47
41
  indicators?: SkinIndicators;
48
- /** Any CSS length. Seeds --sidebar-width; caller's own value still wins. Undefined keeps shadcn's 16rem. */
49
42
  sidebarWidth?: string;
50
- /** effects.css keys off data-effects ancestor attribute. top-shine is CSS-only; ripple needs runtime's document pointer listener. */
51
43
  effects?: ControlEffect[];
52
44
  adornments?: { [Scope in SkinAdornmentScope]?: { [Part in SkinAdornmentPart<Scope>]?: AdornmentEntry<SkinAdornmentContexts[Scope][Part]>; }; };
53
45
  };
54
- type SidebarLayout = "sidebar" | "floating" | "inset";
55
- type ControlEffect = "top-shine" | "ripple" | "hover-circle";
56
- type ControlEffectValue = ControlEffect | ControlEffect[];
57
- declare function controlEffectsAttribute(effects?: ControlEffectValue): string | undefined;
58
- /** Read at render time so getter-based configs stay live. Portals stamp it on their positioner, which lands outside any token-scoped ancestor. */
59
- declare function activeSkin(): ControlUiSkin;
60
- declare function skinId(): string;
61
- /** Sidebar falls back: variant prop → this → "sidebar". */
62
- declare function skinSidebarLayout(): SidebarLayout | undefined;
63
- declare function skinIndicator<Component extends keyof SkinIndicators>(component: Component): SkinIndicators[Component];
64
- /** SidebarProvider seeds --sidebar-width from this; caller-provided value still wins. */
65
- declare function skinSidebarWidth(): string | undefined;
66
- /** Portals stamp result next to data-skin; ControlEffectsRuntime mirrors it on <html>. */
67
- declare function skinEffects(): string | undefined;
68
- declare function skinAdornment<Scope extends SkinAdornmentScope, Part extends SkinAdornmentPart<Scope>>(scope: Scope, part: Part, ctx: SkinAdornmentContexts[Scope][Part]): ReactNode | undefined;
69
- declare function hasSkinAdornment<Scope extends SkinAdornmentScope, Part extends SkinAdornmentPart<Scope>>(scope: Scope, part: Part): boolean;
70
- //#endregion
71
- export { ControlEffect, ControlEffectValue, ControlUiSkin, SidebarLayout, SkinAdornmentContexts, SkinAdornmentPart, SkinAdornmentScope, SkinIndicators, activeSkin, controlEffectsAttribute, hasSkinAdornment, skinAdornment, skinEffects, skinId, skinIndicator, skinSidebarLayout, skinSidebarWidth };
46
+ export type SidebarLayout = "sidebar" | "floating" | "inset" | "page";
47
+ export type ControlEffect = "top-shine" | "ripple" | "hover-circle";
48
+ export type ControlEffectValue = ControlEffect | ControlEffect[];
49
+ export declare function controlEffectsAttribute(effects?: ControlEffectValue): string | undefined;
50
+ export declare function skinAdornment<Scope extends SkinAdornmentScope, Part extends SkinAdornmentPart<Scope>>(skin: ControlUiSkin, scope: Scope, part: Part, ctx: SkinAdornmentContexts[Scope][Part]): ReactNode | undefined;
51
+ export declare function hasSkinAdornment<Scope extends SkinAdornmentScope, Part extends SkinAdornmentPart<Scope>>(skin: ControlUiSkin, scope: Scope, part: Part): boolean;
52
+ //#endregion
package/dist/skin.js CHANGED
@@ -1,61 +1,18 @@
1
- import { skin } from "./skin.config.js";
2
1
  //#region src/skin.ts
3
2
  function controlEffectsAttribute(effects) {
4
3
  if (!effects) return void 0;
5
4
  const value = (Array.isArray(effects) ? effects : [effects]).join(" ");
6
5
  return value.length > 0 ? value : void 0;
7
6
  }
8
- /** Read at render time so getter-based configs stay live. Portals stamp it on their positioner, which lands outside any token-scoped ancestor. */
9
- function activeSkin() {
10
- return skin;
11
- }
12
- const verifiedSkinIds = /* @__PURE__ */ new Set();
13
- function skinScopeProblem(id) {
14
- const boundary = document.querySelector(`[data-skin="${id}"]`);
15
- if (!boundary) return `Control UI: skin.config id is "${id}" but no element carries data-skin="${id}" (root has ${JSON.stringify(document.documentElement.dataset.skin ?? null)}); every token is undeclared until they match.`;
16
- if (getComputedStyle(boundary).getPropertyValue("--background").trim()) return void 0;
17
- return `Control UI: skin-theme.css declares no tokens for data-skin="${id}"; check the CSS entry imports (../components/control-ui/styles/skin-theme.css) or run scripts/control-ui-doctor.mjs.`;
18
- }
19
- function verifySkinScope(id) {
20
- if (process.env.NODE_ENV === "production" || typeof document === "undefined" || verifiedSkinIds.has(id)) return;
21
- verifiedSkinIds.add(id);
22
- setTimeout(() => {
23
- if (skin.id !== id) {
24
- verifiedSkinIds.delete(id);
25
- return;
26
- }
27
- const problem = skinScopeProblem(id);
28
- if (problem) console.error(problem);
29
- }, 0);
30
- }
31
- function skinId() {
32
- verifySkinScope(skin.id);
33
- return skin.id;
34
- }
35
- /** Sidebar falls back: variant prop → this → "sidebar". */
36
- function skinSidebarLayout() {
37
- return skin.sidebarLayout;
38
- }
39
- function skinIndicator(component) {
40
- return skin.indicators?.[component];
41
- }
42
- /** SidebarProvider seeds --sidebar-width from this; caller-provided value still wins. */
43
- function skinSidebarWidth() {
44
- return skin.sidebarWidth;
45
- }
46
- /** Portals stamp result next to data-skin; ControlEffectsRuntime mirrors it on <html>. */
47
- function skinEffects() {
48
- return controlEffectsAttribute(skin.effects);
49
- }
50
7
  function resolveAdornment(entry, ctx) {
51
8
  if (entry === void 0) return void 0;
52
9
  return typeof entry === "function" ? entry(ctx) : entry;
53
10
  }
54
- function skinAdornment(scope, part, ctx) {
11
+ function skinAdornment(skin, scope, part, ctx) {
55
12
  return resolveAdornment(skin.adornments?.[scope]?.[part], ctx);
56
13
  }
57
- function hasSkinAdornment(scope, part) {
14
+ function hasSkinAdornment(skin, scope, part) {
58
15
  return skin.adornments?.[scope]?.[part] !== void 0;
59
16
  }
60
17
  //#endregion
61
- export { activeSkin, controlEffectsAttribute, hasSkinAdornment, skinAdornment, skinEffects, skinId, skinIndicator, skinSidebarLayout, skinSidebarWidth };
18
+ export { controlEffectsAttribute, hasSkinAdornment, skinAdornment };
@@ -3,21 +3,20 @@ import { SourceBadgeKnobStyle } from "./knob-contracts/source-badge-knobs.js";
3
3
  import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar.js";
4
4
  import { CSSProperties, ComponentProps } from "react";
5
5
  //#region src/source-badge.d.ts
6
- type SourceBadgeProps = Omit<ComponentProps<"a">, "href" | "style"> & {
6
+ export type SourceBadgeProps = Omit<ComponentProps<"a">, "href" | "style"> & {
7
7
  faviconSrc?: string | false;
8
8
  href: string;
9
9
  style?: CSSProperties & SourceBadgeKnobStyle & BadgeKnobStyle;
10
10
  };
11
- declare function sourceHostname(href: string): string;
12
- declare function sourceFaviconHref(href: string): string | undefined;
13
- type SourceFaviconProps = Omit<ComponentProps<typeof Avatar>, "children" | "style"> & {
11
+ export declare function sourceHostname(href: string): string;
12
+ export declare function sourceFaviconHref(href: string): string | undefined;
13
+ export type SourceFaviconProps = Omit<ComponentProps<typeof Avatar>, "children" | "style"> & {
14
14
  faviconSrc?: string | false;
15
15
  href: string;
16
16
  imageProps?: Omit<ComponentProps<typeof AvatarImage>, "src">;
17
17
  fallbackProps?: ComponentProps<typeof AvatarFallback>;
18
18
  style?: CSSProperties & SourceBadgeKnobStyle;
19
19
  };
20
- declare function SourceFavicon({ faviconSrc, href, imageProps, fallbackProps, className, ...props }: SourceFaviconProps): import("react").JSX.Element;
21
- declare function SourceBadge({ faviconSrc, href, children, className, rel, target, ...props }: SourceBadgeProps): import("react").JSX.Element;
22
- //#endregion
23
- export { SourceBadge, SourceBadgeProps, SourceFavicon, SourceFaviconProps, sourceFaviconHref, sourceHostname };
20
+ export declare function SourceFavicon({ faviconSrc, href, imageProps, fallbackProps, className, ...props }: SourceFaviconProps): import("react").JSX.Element;
21
+ export declare function SourceBadge({ faviconSrc, href, children, className, rel, target, ...props }: SourceBadgeProps): import("react").JSX.Element;
22
+ //#endregion
@@ -26,13 +26,14 @@
26
26
  @import "./recipes/chat-message.css";
27
27
  @import "./recipes/chat-composer.css";
28
28
  @import "./chat-composer-editor.css";
29
+ @import "./recipes/spinner.css";
29
30
  @import "./recipes/chat-composer-attachment.css";
30
31
  @import "./recipes/choice.css";
31
32
  @import "./code.css";
32
33
  @import "./recipes/code.css";
33
- @import "./recipes/code-block-editor.css";
34
34
  @import "./recipes/code-diff.css";
35
35
  @import "./recipes/sidebar.css";
36
+ @import "./recipes/sidebar-menu.css";
36
37
  @import "./recipes/color-picker.css";
37
38
  @import "./recipes/color-picker-details.css";
38
39
  @import "./recipes/color-picker-values.css";
@@ -62,7 +63,6 @@
62
63
  @import "./recipes/phone-input.css";
63
64
  @import "./recipes/rich-tooltip.css";
64
65
  @import "./recipes/skeleton.css";
65
- @import "./recipes/spinner.css";
66
66
  @import "./recipes/stepper.css";
67
67
  @import "./recipes/switch.css";
68
68
  @import "./recipes/table.css";
@@ -78,5 +78,3 @@
78
78
  @import "./type-scale.css";
79
79
  @import "./recipes/user-ask.css";
80
80
  @import "./recipes/user-ask-details.css";
81
- @import "./skin-theme.css";
82
- @import "./skin.css";
@@ -1,12 +1,13 @@
1
1
  @layer components {
2
2
  :where([data-control-family="accordion"][data-slot="root"]) {
3
3
  --cui-accordion-item-border-color: var(--border);
4
+ --cui-accordion-item-border-width: 1px;
4
5
  --cui-accordion-trigger-foreground: var(--foreground);
5
6
  --cui-accordion-trigger-hover-foreground: oklch(from var(--foreground) l c h / 0.8);
6
7
  --cui-accordion-icon-foreground: var(--muted-foreground);
7
8
  }
8
9
  :where([data-control-family="accordion"][data-slot="item"]) {
9
- border-block-end: 1px solid var(--cui-accordion-item-border-color);
10
+ border-block-end: var(--cui-accordion-item-border-width) solid var(--cui-accordion-item-border-color);
10
11
  }
11
12
 
12
13
  :where([data-control-family="accordion"][data-slot="item"]:last-child) {
@@ -19,7 +20,6 @@
19
20
  color: var(--cui-accordion-trigger-foreground);
20
21
  font-size: var(--text-body);
21
22
  outline: none;
22
- transition: color var(--duration-fast) var(--ease-standard);
23
23
  text-align: left;
24
24
  font-weight: var(--font-weight-medium);
25
25
  }
@@ -68,6 +68,12 @@
68
68
  initial-value: transparent;
69
69
  }
70
70
 
71
+ @property --cui-accordion-item-border-width {
72
+ syntax: "<length>";
73
+ inherits: true;
74
+ initial-value: 0px;
75
+ }
76
+
71
77
  @property --cui-accordion-trigger-foreground {
72
78
  syntax: "<color>";
73
79
  inherits: true;
@@ -3,11 +3,14 @@
3
3
  margin-block-start: calc(var(--spacing) * 1);
4
4
  min-block-size: calc(var(--spacing) * 8);
5
5
  gap: calc(var(--spacing) * 1);
6
- opacity: 0;
7
- transition: opacity var(--duration-base) var(--ease-standard);
6
+ opacity: 1;
8
7
  }
9
8
 
10
9
  @media (hover: hover) {
10
+ :where([data-control-family="chat-layout"][data-slot="turn"] [data-control-family="action-bar"][data-slot="root"]) {
11
+ opacity: 0;
12
+ }
13
+
11
14
  :where([data-control-family="chat-layout"][data-slot="turn"]:hover [data-control-family="action-bar"][data-slot="root"]) {
12
15
  opacity: 1;
13
16
  }