@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,7 +1,7 @@
1
1
  import { ChoiceKnobStyle } from "../knob-contracts/choice-knobs.js";
2
2
  import { CSSProperties } from "react";
3
3
  //#region src/ui/checkbox.d.ts
4
- type CheckboxProps = Omit<{
4
+ export type CheckboxProps = Omit<{
5
5
  checked?: boolean;
6
6
  defaultChecked?: boolean;
7
7
  onCheckedChange?: (checked: boolean) => void;
@@ -18,6 +18,5 @@ type CheckboxProps = Omit<{
18
18
  }, "style"> & {
19
19
  style?: CSSProperties & ChoiceKnobStyle;
20
20
  };
21
- declare function Checkbox({ className, checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, ...props }: CheckboxProps): import("react").JSX.Element;
22
- //#endregion
23
- export { Checkbox, CheckboxProps };
21
+ export declare function Checkbox({ className, checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, ...props }: CheckboxProps): import("react").JSX.Element;
22
+ //#endregion
@@ -2,10 +2,10 @@ import { CodeDiffKnobStyle } from "../knob-contracts/code-diff-knobs.js";
2
2
  import { CodeCopyProps, CodeOverflow } from "./code.js";
3
3
  import { CSSProperties, ComponentProps, ReactNode } from "react";
4
4
  //#region src/ui/code-diff.d.ts
5
- type DiffStyle = "unified" | "split";
6
- type DiffIndicators = "classic" | "bars" | "none";
7
- type DiffLineKind = "word" | "char" | "none";
8
- type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
5
+ export type DiffStyle = "unified" | "split";
6
+ export type DiffIndicators = "classic" | "bars" | "none";
7
+ export type DiffLineKind = "word" | "char" | "none";
8
+ export type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
9
9
  patch?: string;
10
10
  oldText?: string;
11
11
  newText?: string;
@@ -21,8 +21,7 @@ type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
21
21
  children?: ReactNode;
22
22
  style?: CSSProperties & CodeDiffKnobStyle;
23
23
  };
24
- declare function CodeDiff({ patch, oldText, newText, lang, name, diffStyle, diffIndicators, lineDiffType, overflow, maxLineDiffLength, maxHeight, header, className, style, ...props }: CodeDiffProps): import("react").JSX.Element;
25
- type CodeDiffCopyProps = CodeCopyProps;
26
- declare function CodeDiffCopy(props: CodeDiffCopyProps): import("react").JSX.Element;
27
- //#endregion
28
- export { CodeDiff, CodeDiffCopy, CodeDiffCopyProps, CodeDiffProps, DiffIndicators, DiffLineKind, DiffStyle };
24
+ export declare function CodeDiff({ patch, oldText, newText, lang, name, diffStyle, diffIndicators, lineDiffType, overflow, maxLineDiffLength, maxHeight, header, className, style, ...props }: CodeDiffProps): import("react").JSX.Element;
25
+ export type CodeDiffCopyProps = CodeCopyProps;
26
+ export declare function CodeDiffCopy(props: CodeDiffCopyProps): import("react").JSX.Element;
27
+ //#endregion
package/dist/ui/code.d.ts CHANGED
@@ -3,60 +3,69 @@ import { CodeKnobStyle } from "../knob-contracts/code-knobs.js";
3
3
  import { CodeTokenLines } from "../lib/code-tokens.js";
4
4
  import { CSSProperties, ComponentProps, ReactNode } from "react";
5
5
  //#region src/ui/code.d.ts
6
- type CodeOverflow = "wrap" | "scroll";
7
- type CodeHighlight = "auto" | "none";
8
- type CodeDensity = "default" | "compact";
9
- type CodeChrome = "standalone" | "embedded";
10
- type CodeProps = Omit<ComponentProps<"figure">, "style"> & {
6
+ export type CodeOverflow = "wrap" | "scroll";
7
+ export type CodeHighlight = "auto" | "none";
8
+ export type CodeDensity = "default" | "compact";
9
+ export type CodeChrome = "standalone" | "embedded";
10
+ export type CodeProps = Omit<ComponentProps<"figure">, "style"> & {
11
11
  overflow?: CodeOverflow;
12
12
  chrome?: CodeChrome;
13
13
  density?: CodeDensity;
14
+ /** A headerless surface overlays its own copy button; turn it off to place one yourself. */
15
+ copy?: boolean;
14
16
  style?: CSSProperties & CodeKnobStyle;
15
17
  };
16
- declare function Code({ overflow, chrome, density, className, children, ...props }: CodeProps): import("react").JSX.Element;
17
- type CodeHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
18
+ export declare function Code({ overflow, chrome, density, copy, className, children, ...props }: CodeProps): import("react").JSX.Element;
19
+ export type CodeHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
18
20
  style?: CSSProperties & CodeKnobStyle;
19
21
  };
20
- declare function CodeHeader({ className, ...props }: CodeHeaderProps): import("react").JSX.Element;
21
- type CodeTitleProps = Omit<ComponentProps<"span">, "style"> & {
22
+ export declare function CodeHeader({ className, ...props }: CodeHeaderProps): import("react").JSX.Element;
23
+ export type CodeTitleProps = Omit<ComponentProps<"span">, "style"> & {
22
24
  style?: CSSProperties & CodeKnobStyle;
23
25
  };
24
- declare function CodeTitle({ className, ...props }: CodeTitleProps): import("react").JSX.Element;
25
- type CodeActionsProps = ComponentProps<"div"> & {
26
+ export declare function CodeTitle({ className, ...props }: CodeTitleProps): import("react").JSX.Element;
27
+ export type CodeActionsProps = ComponentProps<"div"> & {
26
28
  style?: CSSProperties & CodeKnobStyle;
27
29
  };
28
- declare function CodeActions({ className, ...props }: CodeActionsProps): import("react").JSX.Element;
29
- type CodeCopyProps = Omit<ComponentProps<typeof Button>, "children" | "onClick"> & {
30
+ export declare function CodeActions({ className, ...props }: CodeActionsProps): import("react").JSX.Element;
31
+ export type CodeCopyProps = Omit<ComponentProps<typeof Button>, "children" | "onClick"> & {
30
32
  value: string;
31
33
  children?: ReactNode;
32
34
  copiedLabel?: ReactNode;
33
35
  copiedAriaLabel?: string;
34
36
  };
35
- declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
36
- type CodeFloatingCopyProps = Omit<CodeCopyProps, "children" | "copiedLabel">;
37
- declare function CodeFloatingCopy({ className, ...props }: CodeFloatingCopyProps): import("react").JSX.Element;
38
- /** Null until resolved, and whenever highlighting is off or language is unknown — callers fall back to plain text. */
39
- declare function useCodeTokens({ code, lang, tokens, highlight }: {
37
+ export declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
38
+ export type CodeFloatingCopyProps = Omit<CodeCopyProps, "children" | "copiedLabel">;
39
+ export declare function CodeFloatingCopy({ className, ...props }: CodeFloatingCopyProps): import("react").JSX.Element;
40
+ export declare function useCodeTokens({ code, lang, tokens, highlight }: {
40
41
  code: string;
41
42
  lang?: string;
42
43
  tokens?: CodeTokenLines | null;
43
44
  highlight: CodeHighlight;
44
45
  }): CodeTokenLines | null;
45
- declare function CodeTokenLine({ tokens, plain }: {
46
+ export declare function CodeTokenLine({ tokens, plain }: {
46
47
  tokens: CodeTokenLines[number] | null;
47
48
  plain: string;
48
49
  }): ReactNode;
49
- type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style"> & {
50
+ export type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style"> & {
50
51
  code: string;
51
52
  lang?: string;
52
53
  tokens?: CodeTokenLines | null;
53
54
  highlight?: CodeHighlight;
54
55
  showLineNumbers?: boolean;
55
56
  startLine?: number;
57
+ highlightLines?: readonly number[];
56
58
  maxHeight?: string;
57
59
  virtualize?: boolean;
58
60
  style?: CSSProperties & CodeKnobStyle;
59
61
  };
60
- declare function CodeContent({ code, lang, tokens, highlight, showLineNumbers, startLine, maxHeight, virtualize, className, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
61
- //#endregion
62
- export { Code, CodeActions, CodeActionsProps, CodeChrome, CodeContent, CodeContentProps, CodeCopy, CodeCopyProps, CodeDensity, CodeFloatingCopy, CodeFloatingCopyProps, CodeHeader, CodeHeaderProps, CodeHighlight, CodeOverflow, CodeProps, CodeTitle, CodeTitleProps, CodeTokenLine, useCodeTokens };
62
+ export declare function CodeContent({ code, lang, tokens, highlight, showLineNumbers, startLine, highlightLines, maxHeight, virtualize, className, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
63
+ export type CodeEditableProps = Omit<ComponentProps<"textarea">, "defaultValue" | "value" | "style"> & {
64
+ value?: string;
65
+ defaultValue?: string;
66
+ onValueChange?: (value: string) => void;
67
+ fileName?: string;
68
+ style?: CSSProperties & CodeKnobStyle;
69
+ };
70
+ export declare function CodeEditable({ value, defaultValue, onValueChange, onChange, fileName, className, "aria-label": ariaLabel, ...props }: CodeEditableProps): import("react").JSX.Element;
71
+ //#endregion
package/dist/ui/code.js CHANGED
@@ -4,13 +4,13 @@ import { cn } from "../lib/cn.js";
4
4
  import { Button } from "./button.js";
5
5
  import { ScrollArea } from "./scroll-area.js";
6
6
  import { highlightToTokens } from "../lib/code-tokens.js";
7
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
7
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
8
8
  import { Children, createContext, isValidElement, useContext, useEffect, useMemo, useRef, useState } from "react";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  import { CheckIcon, CopyIcon } from "lucide-react";
11
11
  import { useVirtualizer } from "@tanstack/react-virtual";
12
12
  //#region src/ui/code.tsx
13
- const VIRTUALIZE_THRESHOLD = 200;
13
+ const MAX_STATIC_CODE_LINES = 1e3;
14
14
  const ESTIMATED_LINE_HEIGHT = 20;
15
15
  const CodeContext = createContext(null);
16
16
  function useCodeContext() {
@@ -21,14 +21,15 @@ function useCodeContext() {
21
21
  function hasCodeHeader(children) {
22
22
  return Children.toArray(children).some((child) => isValidElement(child) && child.type === CodeHeader);
23
23
  }
24
- function Code({ overflow = "scroll", chrome = "standalone", density = "default", className, children, ...props }) {
24
+ function Code({ overflow = "scroll", chrome = "standalone", density = "default", copy = true, className, children, ...props }) {
25
25
  const hasHeader = hasCodeHeader(children);
26
26
  return /* @__PURE__ */ jsx(CodeContext.Provider, {
27
27
  value: {
28
28
  chrome,
29
29
  density,
30
30
  overflow,
31
- hasHeader
31
+ hasHeader,
32
+ copy
32
33
  },
33
34
  children: /* @__PURE__ */ jsx("figure", {
34
35
  "data-control-ui": "code",
@@ -95,13 +96,10 @@ function CodeCopy({ value, copiedLabel, copiedAriaLabel = "Copied", children, cl
95
96
  })
96
97
  });
97
98
  if (!isIconOnly) return button;
98
- return /* @__PURE__ */ jsx(TooltipProvider, {
99
- delay: 0,
100
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipContent, {
101
- side: "left",
102
- children: label
103
- })] })
104
- });
99
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipContent, {
100
+ side: "left",
101
+ children: label
102
+ })] });
105
103
  }
106
104
  function CodeFloatingCopy({ className, ...props }) {
107
105
  return /* @__PURE__ */ jsx(CodeCopy, {
@@ -110,7 +108,6 @@ function CodeFloatingCopy({ className, ...props }) {
110
108
  ...props
111
109
  });
112
110
  }
113
- /** Null until resolved, and whenever highlighting is off or language is unknown — callers fall back to plain text. */
114
111
  function useCodeTokens({ code, lang, tokens, highlight }) {
115
112
  const requestKey = `${lang ?? ""}\n${code}`;
116
113
  const [clientTokens, setClientTokens] = useState(null);
@@ -152,13 +149,14 @@ function CodeTokenLine({ tokens, plain }) {
152
149
  }, index);
153
150
  });
154
151
  }
155
- function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, measureRef, style }) {
152
+ function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, highlighted, measureRef, style }) {
156
153
  return /* @__PURE__ */ jsxs("div", {
157
154
  ref: measureRef,
158
155
  "data-index": index,
159
156
  "data-control-ui": "code",
160
157
  "data-control-family": "code",
161
158
  "data-slot": "line",
159
+ "data-highlighted": highlighted ? "true" : void 0,
162
160
  className: "flex w-full",
163
161
  style,
164
162
  children: [showLineNumbers ? /* @__PURE__ */ jsx("span", {
@@ -177,8 +175,8 @@ function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, meas
177
175
  })]
178
176
  });
179
177
  }
180
- function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, maxHeight = "32rem", virtualize, className, ref, style, ...props }) {
181
- const { chrome, density, overflow, hasHeader } = useCodeContext();
178
+ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, highlightLines, maxHeight = "32rem", virtualize, className, ref, style, ...props }) {
179
+ const { density, overflow, hasHeader, copy } = useCodeContext();
182
180
  const resolvedTokens = useCodeTokens({
183
181
  code,
184
182
  lang,
@@ -186,6 +184,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
186
184
  highlight
187
185
  });
188
186
  const plainLines = useMemo(() => code.split("\n"), [code]);
187
+ const highlightedLineNumbers = new Set(highlightLines);
189
188
  const isCompact = density === "compact";
190
189
  const scrollRef = useRef(null);
191
190
  function setScrollElement(node) {
@@ -193,7 +192,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
193
192
  if (typeof ref === "function") ref(node);
194
193
  else if (ref) ref.current = node;
195
194
  }
196
- const shouldVirtualize = virtualize ?? plainLines.length > VIRTUALIZE_THRESHOLD;
195
+ const shouldVirtualize = virtualize ?? plainLines.length > MAX_STATIC_CODE_LINES;
197
196
  const useScrollArea = density !== "compact" || overflow !== "wrap";
198
197
  const virtualizer = useVirtualizer({
199
198
  count: plainLines.length,
@@ -229,6 +228,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
229
228
  plain: plainLines[item.index] ?? "",
230
229
  overflow,
231
230
  showLineNumbers,
231
+ highlighted: highlightedLineNumbers.has(startLine + item.index),
232
232
  measureRef: virtualizer.measureElement,
233
233
  style: {
234
234
  position: "absolute",
@@ -250,7 +250,8 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
250
250
  tokens: resolvedTokens?.[index] ?? null,
251
251
  plain,
252
252
  overflow,
253
- showLineNumbers
253
+ showLineNumbers,
254
+ highlighted: highlightedLineNumbers.has(startLine + index)
254
255
  }, index))
255
256
  });
256
257
  const content = useScrollArea ? /* @__PURE__ */ jsx(ScrollArea, {
@@ -278,15 +279,35 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
278
279
  ...props,
279
280
  children: grid
280
281
  });
281
- if (hasHeader || chrome === "embedded") return content;
282
+ if (hasHeader || !copy) return content;
282
283
  return /* @__PURE__ */ jsxs("div", {
283
284
  "data-control-ui": "code",
284
285
  "data-control-family": "code",
285
286
  "data-slot": "floating-frame",
286
- "data-density": isCompact ? "compact" : "default",
287
287
  className: "relative",
288
288
  children: [/* @__PURE__ */ jsx(CodeFloatingCopy, { value: code }), content]
289
289
  });
290
290
  }
291
+ function CodeEditable({ value, defaultValue = "", onValueChange, onChange, fileName, className, "aria-label": ariaLabel, ...props }) {
292
+ const { overflow } = useCodeContext();
293
+ const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
294
+ const currentValue = value ?? uncontrolledValue;
295
+ function handleChange(event) {
296
+ if (value === void 0) setUncontrolledValue(event.target.value);
297
+ onValueChange?.(event.target.value);
298
+ onChange?.(event);
299
+ }
300
+ return /* @__PURE__ */ jsx("textarea", {
301
+ "data-control-ui": "code",
302
+ "data-control-family": "code",
303
+ "data-slot": "editor",
304
+ value: currentValue,
305
+ onChange: handleChange,
306
+ "aria-label": ariaLabel ?? (fileName ? `${fileName} code` : "Code editor"),
307
+ spellCheck: false,
308
+ className: cn("block w-full max-w-full resize-y overflow-auto", overflow === "scroll" ? "whitespace-pre" : "whitespace-pre-wrap break-words", className),
309
+ ...props
310
+ });
311
+ }
291
312
  //#endregion
292
- export { Code, CodeActions, CodeContent, CodeCopy, CodeFloatingCopy, CodeHeader, CodeTitle, CodeTokenLine, useCodeTokens };
313
+ export { Code, CodeActions, CodeContent, CodeCopy, CodeEditable, CodeFloatingCopy, CodeHeader, CodeTitle, CodeTokenLine, useCodeTokens };
@@ -2,7 +2,7 @@ import { OpenChangeEventDetails, RenderProp } from "../control-props.js";
2
2
  import { CollapsibleKnobStyle } from "../knob-contracts/collapsible-knobs.js";
3
3
  import { CSSProperties, ComponentProps, ReactNode } from "react";
4
4
  //#region src/ui/collapsible.d.ts
5
- type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
5
+ export type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
6
6
  open?: boolean;
7
7
  defaultOpen?: boolean;
8
8
  onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
@@ -10,7 +10,7 @@ type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
10
10
  } & {
11
11
  style?: CSSProperties & CollapsibleKnobStyle;
12
12
  };
13
- type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
13
+ export type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
14
14
  "data-slot"?: string;
15
15
  render?: RenderProp<ComponentProps<"button">, {
16
16
  open: boolean;
@@ -18,14 +18,13 @@ type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
18
18
  nativeButton?: boolean;
19
19
  style?: CSSProperties & CollapsibleKnobStyle;
20
20
  };
21
- type CollapsibleContentProps = ComponentProps<"div"> & {
21
+ export type CollapsibleContentProps = ComponentProps<"div"> & {
22
22
  "data-slot"?: string;
23
23
  keepMounted?: boolean;
24
24
  } & {
25
25
  style?: CSSProperties & CollapsibleKnobStyle;
26
26
  };
27
- declare function Collapsible({ className, ...props }: CollapsibleProps): import("react").JSX.Element;
28
- declare function CollapsibleTrigger({ render, className, children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
29
- declare function CollapsibleContent({ className, children, ...props }: CollapsibleContentProps): import("react").JSX.Element;
30
- //#endregion
31
- export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
27
+ export declare function Collapsible({ className, ...props }: CollapsibleProps): import("react").JSX.Element;
28
+ export declare function CollapsibleTrigger({ render, className, children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
29
+ export declare function CollapsibleContent({ className, children, ...props }: CollapsibleContentProps): import("react").JSX.Element;
30
+ //#endregion
@@ -5,8 +5,8 @@ import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
5
5
  import { ColorPickerKnobStyle } from "../knob-contracts/color-picker-knobs.js";
6
6
  import { CSSProperties, ComponentProps, ReactNode } from "react";
7
7
  //#region src/ui/color-picker.d.ts
8
- type ColorFormat = "hex" | "rgb" | "hsl" | "oklch";
9
- type ColorPickerProps = {
8
+ export type ColorFormat = "hex" | "rgb" | "hsl" | "oklch";
9
+ export type ColorPickerProps = {
10
10
  value?: string;
11
11
  defaultValue?: string;
12
12
  onValueChange?: (value: string) => void;
@@ -20,43 +20,43 @@ type ColorPickerProps = {
20
20
  onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
21
21
  children?: ReactNode;
22
22
  };
23
- type ColorPickerTriggerProps = Omit<ComponentProps<"button">, "style"> & {
23
+ export type ColorPickerTriggerProps = Omit<ComponentProps<"button">, "style"> & {
24
24
  style?: CSSProperties & ColorPickerKnobStyle;
25
25
  };
26
- type ColorPickerContentProps = Omit<ComponentProps<"div">, "style"> & {
26
+ export type ColorPickerContentProps = Omit<ComponentProps<"div">, "style"> & {
27
27
  style?: CSSProperties & PopupKnobStyle;
28
28
  } & {
29
29
  side?: "top" | "right" | "bottom" | "left";
30
30
  align?: "start" | "center" | "end";
31
31
  sideOffset?: number;
32
32
  };
33
- type ColorPickerPanelProps = Omit<ComponentProps<"div">, "style"> & {
33
+ export type ColorPickerPanelProps = Omit<ComponentProps<"div">, "style"> & {
34
34
  style?: CSSProperties & PopupKnobStyle;
35
35
  };
36
- type ColorPickerAreaProps = Omit<ComponentProps<"div">, "style"> & {
36
+ export type ColorPickerAreaProps = Omit<ComponentProps<"div">, "style"> & {
37
37
  style?: CSSProperties & ColorPickerKnobStyle;
38
38
  };
39
- type ColorPickerAreaThumbProps = Omit<ComponentProps<"div">, "style"> & {
39
+ export type ColorPickerAreaThumbProps = Omit<ComponentProps<"div">, "style"> & {
40
40
  style?: CSSProperties & ColorPickerKnobStyle;
41
41
  };
42
- type ColorPickerHueProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
42
+ export type ColorPickerHueProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
43
43
  style?: CSSProperties & ColorPickerKnobStyle;
44
44
  };
45
- type ColorPickerAlphaProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
45
+ export type ColorPickerAlphaProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
46
46
  style?: CSSProperties & ColorPickerKnobStyle;
47
47
  };
48
- type ColorPickerWheelProps = Omit<ComponentProps<"div">, "style"> & {
48
+ export type ColorPickerWheelProps = Omit<ComponentProps<"div">, "style"> & {
49
49
  style?: CSSProperties & ColorPickerKnobStyle;
50
50
  };
51
- type ColorPickerEyeDropperProps = Omit<Omit<ComponentProps<"button">, "onError">, "style"> & {
51
+ export type ColorPickerEyeDropperProps = Omit<Omit<ComponentProps<"button">, "onError">, "style"> & {
52
52
  style?: CSSProperties & ButtonKnobStyle;
53
53
  };
54
- type ColorPickerInputProps = Omit<Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size">, "style"> & {
54
+ export type ColorPickerInputProps = Omit<Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size">, "style"> & {
55
55
  style?: CSSProperties & ColorPickerKnobStyle;
56
56
  } & {
57
57
  size?: ControlSize;
58
58
  };
59
- type ColorPickerFormatSelectProps = {
59
+ export type ColorPickerFormatSelectProps = {
60
60
  formats?: ColorFormat[];
61
61
  size?: ControlSize;
62
62
  className?: string;
@@ -64,38 +64,38 @@ type ColorPickerFormatSelectProps = {
64
64
  "aria-labelledby"?: string;
65
65
  style?: CSSProperties & ButtonKnobStyle;
66
66
  };
67
- type ColorPickerChannelsProps = ComponentProps<"div"> & {
67
+ export type ColorPickerChannelsProps = ComponentProps<"div"> & {
68
68
  style?: CSSProperties & ColorPickerKnobStyle;
69
69
  };
70
- type ColorPickerChannelProps = Omit<Omit<ComponentProps<"div">, "children" | "aria-label">, "style"> & {
70
+ export type ColorPickerChannelProps = Omit<Omit<ComponentProps<"div">, "children" | "aria-label">, "style"> & {
71
71
  style?: CSSProperties & ColorPickerKnobStyle;
72
72
  } & {
73
73
  channel: "r" | "g" | "b" | "h" | "s" | "l" | "okl" | "okc" | "okh" | "a";
74
74
  label?: ReactNode;
75
75
  "aria-label"?: string;
76
76
  };
77
- type ColorPickerSwatchesProps = ComponentProps<"div"> & {
77
+ export type ColorPickerSwatchesProps = ComponentProps<"div"> & {
78
78
  colors?: string[];
79
79
  label?: ReactNode;
80
80
  } & {
81
81
  style?: CSSProperties & ColorPickerKnobStyle;
82
82
  };
83
- type ColorPickerSwatchProps = Omit<Omit<ComponentProps<"button">, "color">, "style"> & {
83
+ export type ColorPickerSwatchProps = Omit<Omit<ComponentProps<"button">, "color">, "style"> & {
84
84
  style?: CSSProperties & ColorPickerKnobStyle;
85
85
  } & {
86
86
  color: string;
87
87
  };
88
- type ColorPickerSwatchAddProps = Omit<Omit<ComponentProps<"button">, "onClick">, "style"> & {
88
+ export type ColorPickerSwatchAddProps = Omit<Omit<ComponentProps<"button">, "onClick">, "style"> & {
89
89
  style?: CSSProperties & ColorPickerKnobStyle;
90
90
  } & {
91
91
  onAdd?: (value: string) => void;
92
92
  };
93
- type ColorPickerContrastProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
93
+ export type ColorPickerContrastProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
94
94
  style?: CSSProperties & ColorPickerKnobStyle;
95
95
  } & {
96
96
  background?: string;
97
97
  };
98
- type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
98
+ export type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
99
99
  style?: CSSProperties & ColorPickerKnobStyle;
100
100
  } & {
101
101
  children?: ReactNode;
@@ -103,19 +103,19 @@ type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "sty
103
103
  value: string;
104
104
  }) => ReactNode;
105
105
  };
106
- declare function ColorPicker({ open, defaultOpen, onOpenChange, children, ...state }: ColorPickerProps): import("react").JSX.Element;
107
- declare function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerTriggerProps): import("react").JSX.Element;
108
- declare function ColorPickerContent({ className, children, side, align, sideOffset, ...props }: ColorPickerContentProps): import("react").JSX.Element;
109
- declare function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps): import("react").JSX.Element;
110
- declare function ColorPickerArea({ className, style, ...props }: ColorPickerAreaProps): import("react").JSX.Element;
111
- declare function ColorPickerAreaThumb({ className, ...props }: ColorPickerAreaThumbProps): import("react").JSX.Element;
112
- declare function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerHueProps): import("react").JSX.Element;
113
- declare function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerAlphaProps): import("react").JSX.Element | null;
114
- declare function ColorPickerWheel({ className, style, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
115
- declare function ColorPickerInput({ size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerInputProps): import("react").JSX.Element;
116
- declare function ColorPickerFormatSelect({ formats, size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style }: ColorPickerFormatSelectProps): import("react").JSX.Element;
117
- declare function ColorPickerChannels({ className, children, ...props }: ColorPickerChannelsProps): import("react").JSX.Element;
118
- declare function ColorPickerChannel({ channel, label, className, "aria-label": ariaLabel, ...props }: ColorPickerChannelProps): import("react").JSX.Element | null;
106
+ export declare function ColorPicker({ open, defaultOpen, onOpenChange, children, ...state }: ColorPickerProps): import("react").JSX.Element;
107
+ export declare function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerTriggerProps): import("react").JSX.Element;
108
+ export declare function ColorPickerContent({ className, children, side, align, sideOffset, ...props }: ColorPickerContentProps): import("react").JSX.Element;
109
+ export declare function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps): import("react").JSX.Element;
110
+ export declare function ColorPickerArea({ className, style, ...props }: ColorPickerAreaProps): import("react").JSX.Element;
111
+ export declare function ColorPickerAreaThumb({ className, ...props }: ColorPickerAreaThumbProps): import("react").JSX.Element;
112
+ export declare function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerHueProps): import("react").JSX.Element;
113
+ export declare function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerAlphaProps): import("react").JSX.Element | null;
114
+ export declare function ColorPickerWheel({ className, style, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
115
+ export declare function ColorPickerInput({ size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerInputProps): import("react").JSX.Element;
116
+ export declare function ColorPickerFormatSelect({ formats, size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style }: ColorPickerFormatSelectProps): import("react").JSX.Element;
117
+ export declare function ColorPickerChannels({ className, children, ...props }: ColorPickerChannelsProps): import("react").JSX.Element;
118
+ export declare function ColorPickerChannel({ channel, label, className, "aria-label": ariaLabel, ...props }: ColorPickerChannelProps): import("react").JSX.Element | null;
119
119
  declare global {
120
120
  interface Window {
121
121
  EyeDropper?: {
@@ -127,11 +127,10 @@ declare global {
127
127
  };
128
128
  }
129
129
  }
130
- declare function ColorPickerEyeDropper({ className, children, ...props }: ColorPickerEyeDropperProps): import("react").JSX.Element | null;
131
- declare function ColorPickerSwatches({ colors, label, className, children, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
132
- declare function ColorPickerSwatch({ color, className, "aria-label": ariaLabel, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
133
- declare function ColorPickerSwatchAdd({ onAdd, className, children, ...props }: ColorPickerSwatchAddProps): import("react").JSX.Element;
134
- declare function ColorPickerContrast({ background, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
135
- declare function ColorPickerOutput({ className, children, renderValue, ...props }: ColorPickerOutputProps): import("react").JSX.Element;
136
- //#endregion
137
- export { ColorFormat, ColorPicker, ColorPickerAlpha, ColorPickerAlphaProps, ColorPickerArea, ColorPickerAreaProps, ColorPickerAreaThumb, ColorPickerAreaThumbProps, ColorPickerChannel, ColorPickerChannelProps, ColorPickerChannels, ColorPickerChannelsProps, ColorPickerContent, ColorPickerContentProps, ColorPickerContrast, ColorPickerContrastProps, ColorPickerEyeDropper, ColorPickerEyeDropperProps, ColorPickerFormatSelect, ColorPickerFormatSelectProps, ColorPickerHue, ColorPickerHueProps, ColorPickerInput, ColorPickerInputProps, ColorPickerOutput, ColorPickerOutputProps, ColorPickerPanel, ColorPickerPanelProps, ColorPickerProps, ColorPickerSwatch, ColorPickerSwatchAdd, ColorPickerSwatchAddProps, ColorPickerSwatchProps, ColorPickerSwatches, ColorPickerSwatchesProps, ColorPickerTrigger, ColorPickerTriggerProps, ColorPickerWheel, ColorPickerWheelProps };
130
+ export declare function ColorPickerEyeDropper({ className, children, ...props }: ColorPickerEyeDropperProps): import("react").JSX.Element | null;
131
+ export declare function ColorPickerSwatches({ colors, label, className, children, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
132
+ export declare function ColorPickerSwatch({ color, className, "aria-label": ariaLabel, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
133
+ export declare function ColorPickerSwatchAdd({ onAdd, className, children, ...props }: ColorPickerSwatchAddProps): import("react").JSX.Element;
134
+ export declare function ColorPickerContrast({ background, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
135
+ export declare function ColorPickerOutput({ className, children, renderValue, ...props }: ColorPickerOutputProps): import("react").JSX.Element;
136
+ //#endregion
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
- import { skinEffects, skinId } from "../skin.js";
3
+ import { controlEffectsAttribute } from "../skin.js";
4
+ import { useSkin } from "../skin-provider.js";
4
5
  import { Button } from "./button.js";
5
6
  import { Input } from "./input.js";
6
7
  import { useColorArea } from "../hooks/use-color-area.js";
@@ -179,13 +180,14 @@ function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelled
179
180
  });
180
181
  }
181
182
  function ColorPickerContent({ className, children, side = "bottom", align = "center", sideOffset = 6, ...props }) {
183
+ const skin = useSkin();
182
184
  return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
183
185
  "data-control-ui": "color-picker",
184
186
  "data-popup-kind": "color-picker",
185
187
  "data-control-family": "popup",
186
188
  "data-slot": "positioner",
187
- "data-skin": skinId(),
188
- "data-effects": skinEffects(),
189
+ "data-skin": skin.id,
190
+ "data-effects": controlEffectsAttribute(skin.effects),
189
191
  side,
190
192
  align,
191
193
  sideOffset,
@@ -1,5 +1,4 @@
1
1
  //#region src/ui/combobox-disabled-selection.d.ts
2
- declare function shouldAcceptComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>): boolean;
3
- declare function emitComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>, onValueChange: (value: Value | null) => void): boolean;
4
- //#endregion
5
- export { emitComboboxValueChange, shouldAcceptComboboxValueChange };
2
+ export declare function shouldAcceptComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>): boolean;
3
+ export declare function emitComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>, onValueChange: (value: Value | null) => void): boolean;
4
+ //#endregion
@@ -3,8 +3,9 @@ import { ControlSize } from "../control-variants.js";
3
3
  import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
4
4
  import { FieldKnobStyle } from "../knob-contracts/field-knobs.js";
5
5
  import { CSSProperties, ComponentProps, ReactNode } from "react";
6
+ import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
6
7
  //#region src/ui/combobox.d.ts
7
- type ComboboxProps<Value = string> = {
8
+ export type ComboboxProps<Value = string> = {
8
9
  children?: ReactNode;
9
10
  items?: readonly Value[];
10
11
  value?: Value | null;
@@ -23,48 +24,48 @@ type ComboboxProps<Value = string> = {
23
24
  autoHighlight?: boolean;
24
25
  itemToStringLabel?: (itemValue: Value) => string;
25
26
  isItemEqualToValue?: (itemValue: Value, value: Value) => boolean;
27
+ filter?: Combobox$1.Root.Props<Value>["filter"];
26
28
  };
27
- type ComboboxInputProps = Omit<Omit<ComponentProps<"input">, "size">, "style"> & {
29
+ export type ComboboxInputProps = Omit<Omit<ComponentProps<"input">, "size">, "style"> & {
28
30
  style?: CSSProperties & FieldKnobStyle;
29
31
  } & {
30
32
  size?: ControlSize;
31
33
  };
32
- type ComboboxTriggerProps = ComponentProps<"button"> & {
34
+ export type ComboboxTriggerProps = ComponentProps<"button"> & {
33
35
  style?: CSSProperties & FieldKnobStyle;
34
36
  };
35
- type ComboboxContentProps = Omit<ComponentProps<"div"> & {
37
+ export type ComboboxContentProps = Omit<ComponentProps<"div"> & {
36
38
  sideOffset?: number;
37
39
  }, "style"> & {
38
40
  style?: CSSProperties & PopupKnobStyle;
39
41
  };
40
- type ComboboxListProps<Value = unknown> = Omit<ComponentProps<"div">, "children"> & {
42
+ export type ComboboxListProps<Value = unknown> = Omit<ComponentProps<"div">, "children"> & {
41
43
  children?: ReactNode | ((item: Value, index: number) => ReactNode);
42
44
  } & {
43
45
  style?: CSSProperties & PopupKnobStyle;
44
46
  };
45
- type ComboboxItemProps<Value = unknown> = Omit<Omit<ComponentProps<"div">, "value"> & {
47
+ export type ComboboxItemProps<Value = unknown> = Omit<Omit<ComponentProps<"div">, "value"> & {
46
48
  value?: Value;
47
49
  disabled?: boolean;
48
50
  }, "style"> & {
49
51
  style?: CSSProperties & PopupKnobStyle;
50
52
  };
51
- type ComboboxEmptyProps = Omit<ComponentProps<"div">, "style"> & {
53
+ export type ComboboxEmptyProps = Omit<ComponentProps<"div">, "style"> & {
52
54
  style?: CSSProperties & FieldKnobStyle;
53
55
  };
54
- type ComboboxGroupProps = ComponentProps<"div"> & {
56
+ export type ComboboxGroupProps = ComponentProps<"div"> & {
55
57
  style?: CSSProperties & FieldKnobStyle;
56
58
  };
57
- type ComboboxGroupLabelProps = Omit<ComponentProps<"div">, "style"> & {
59
+ export type ComboboxGroupLabelProps = Omit<ComponentProps<"div">, "style"> & {
58
60
  style?: CSSProperties & PopupKnobStyle;
59
61
  };
60
- declare function Combobox<Value = string>({ children, onValueChange, autoHighlight, ...props }: ComboboxProps<Value>): import("react").JSX.Element;
61
- declare function ComboboxTrigger({ className, children, ...props }: ComboboxTriggerProps): import("react").JSX.Element;
62
- declare function ComboboxInput({ size, className, ...props }: ComboboxInputProps): import("react").JSX.Element;
63
- declare function ComboboxContent({ className, children, sideOffset, ...props }: ComboboxContentProps): import("react").JSX.Element;
64
- declare function ComboboxList<Value = unknown>({ className, children, ...props }: ComboboxListProps<Value>): import("react").JSX.Element;
65
- declare function ComboboxEmpty({ className, children, ...props }: ComboboxEmptyProps): import("react").JSX.Element;
66
- declare function ComboboxItem<Value = unknown>({ className, children, disabled, value, ...props }: ComboboxItemProps<Value>): import("react").JSX.Element;
67
- declare function ComboboxGroup({ className, children, ...props }: ComboboxGroupProps): import("react").JSX.Element;
68
- declare function ComboboxGroupLabel({ className, children, ...props }: ComboboxGroupLabelProps): import("react").JSX.Element;
69
- //#endregion
70
- export { Combobox, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxTrigger, ComboboxTriggerProps };
62
+ export declare function Combobox<Value = string>({ children, onValueChange, autoHighlight, ...props }: ComboboxProps<Value>): import("react").JSX.Element;
63
+ export declare function ComboboxTrigger({ className, children, ...props }: ComboboxTriggerProps): import("react").JSX.Element;
64
+ export declare function ComboboxInput({ size, className, ...props }: ComboboxInputProps): import("react").JSX.Element;
65
+ export declare function ComboboxContent({ className, children, sideOffset, ...props }: ComboboxContentProps): import("react").JSX.Element;
66
+ export declare function ComboboxList<Value = unknown>({ className, children, ...props }: ComboboxListProps<Value>): import("react").JSX.Element;
67
+ export declare function ComboboxEmpty({ className, children, ...props }: ComboboxEmptyProps): import("react").JSX.Element;
68
+ export declare function ComboboxItem<Value = unknown>({ className, children, disabled, value, ...props }: ComboboxItemProps<Value>): import("react").JSX.Element;
69
+ export declare function ComboboxGroup({ className, children, ...props }: ComboboxGroupProps): import("react").JSX.Element;
70
+ export declare function ComboboxGroupLabel({ className, children, ...props }: ComboboxGroupLabelProps): import("react").JSX.Element;
71
+ //#endregion