@ctrl-ui/react 0.8.2 → 0.8.5

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 (417) 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/audio-visualizer.js +1 -1
  7. package/dist/blocks/chat.d.ts +3 -4
  8. package/dist/blocks/chat.js +6 -3
  9. package/dist/blocks/coding-agent.d.ts +11 -12
  10. package/dist/blocks/coding-agent.js +10 -9
  11. package/dist/blocks/file-explorer-data.d.ts +11 -12
  12. package/dist/blocks/file-explorer.d.ts +3 -3
  13. package/dist/blocks/settings-data.d.ts +8 -9
  14. package/dist/blocks/settings.d.ts +4 -4
  15. package/dist/blocks/theme-toggle.d.ts +11 -12
  16. package/dist/blocks/theme-toggle.js +14 -4
  17. package/dist/chat-composer-attachment.d.ts +20 -21
  18. package/dist/chat-composer-attachment.js +24 -20
  19. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -6
  20. package/dist/chat-composer-editor/extensions/mention.js +4 -0
  21. package/dist/chat-composer-editor/ghost.d.ts +3 -4
  22. package/dist/chat-composer-editor/schema.d.ts +2 -3
  23. package/dist/chat-composer-editor/serialize.d.ts +3 -4
  24. package/dist/chat-composer-editor/types.d.ts +5 -6
  25. package/dist/chat-composer-editor.d.ts +2 -3
  26. package/dist/chat-composer-editor.js +18 -4
  27. package/dist/chat-composer.d.ts +17 -18
  28. package/dist/chat-composer.js +14 -8
  29. package/dist/chat-layout.d.ts +17 -21
  30. package/dist/chat-layout.js +72 -86
  31. package/dist/chat-message.d.ts +19 -15
  32. package/dist/chat-message.js +19 -2
  33. package/dist/context-model.d.ts +7 -8
  34. package/dist/context.d.ts +21 -22
  35. package/dist/context.js +0 -2
  36. package/dist/control-props.d.ts +10 -11
  37. package/dist/control-variants.d.ts +6 -7
  38. package/dist/dynamic-notification-glass.d.ts +3 -4
  39. package/dist/dynamic-notification-liquid.d.ts +3 -4
  40. package/dist/dynamic-notification-siri-wave.d.ts +2 -3
  41. package/dist/dynamic-notification.d.ts +28 -29
  42. package/dist/email/email-brand.d.ts +60 -0
  43. package/dist/email/email-brand.js +101 -0
  44. package/dist/email/email-code.d.ts +18 -0
  45. package/dist/email/email-code.js +172 -0
  46. package/dist/email/email-footer.d.ts +63 -0
  47. package/dist/email/email-footer.js +98 -0
  48. package/dist/email/email.d.ts +62 -14
  49. package/dist/email/email.js +155 -24
  50. package/dist/email/length.d.ts +2 -3
  51. package/dist/email/templates.d.ts +56 -12
  52. package/dist/email/templates.js +314 -116
  53. package/dist/email/theme.d.ts +15 -8
  54. package/dist/email/theme.js +30 -8
  55. package/dist/environment-variables.d.ts +35 -36
  56. package/dist/extensions/create-track-highlight.d.ts +3 -4
  57. package/dist/extensions/supports-anchor-transitions.d.ts +2 -3
  58. package/dist/extensions/track-highlight.d.ts +3 -4
  59. package/dist/hooks/use-audio-recorder.d.ts +14 -15
  60. package/dist/hooks/use-chat-composer.d.ts +5 -6
  61. package/dist/hooks/use-chat-message.d.ts +8 -8
  62. package/dist/hooks/use-chat-message.js +1 -0
  63. package/dist/hooks/use-chat-thread-scroll.d.ts +8 -0
  64. package/dist/hooks/use-chat-thread-scroll.js +66 -0
  65. package/dist/hooks/use-color-area.d.ts +5 -6
  66. package/dist/hooks/use-copy-to-clipboard.d.ts +7 -8
  67. package/dist/hooks/use-dropzone.d.ts +11 -12
  68. package/dist/hooks/use-dynamic-notification.d.ts +6 -7
  69. package/dist/hooks/use-environment-variables.d.ts +9 -10
  70. package/dist/hooks/use-keyboard-navigation.d.ts +3 -0
  71. package/dist/hooks/use-keyboard-navigation.js +22 -0
  72. package/dist/hooks/use-mobile.d.ts +2 -3
  73. package/dist/hooks/use-textarea-trigger-menu.d.ts +2 -3
  74. package/dist/hooks/use-trigger-menu.d.ts +7 -8
  75. package/dist/hooks/use-user-ask.d.ts +11 -10
  76. package/dist/hooks/use-user-ask.js +56 -17
  77. package/dist/inline-attachment.d.ts +16 -17
  78. package/dist/inline-attachment.js +1 -1
  79. package/dist/inline-citation.d.ts +22 -23
  80. package/dist/knob-contracts/accordion-knobs.d.ts +3 -4
  81. package/dist/knob-contracts/accordion-knobs.js +1 -0
  82. package/dist/knob-contracts/action-bar-knobs.d.ts +3 -4
  83. package/dist/knob-contracts/action-bar-knobs.js +1 -1
  84. package/dist/knob-contracts/activity-knobs.d.ts +3 -4
  85. package/dist/knob-contracts/activity-knobs.js +2 -1
  86. package/dist/knob-contracts/alert-knobs.d.ts +3 -4
  87. package/dist/knob-contracts/alert-knobs.js +12 -1
  88. package/dist/knob-contracts/audio-recorder-knobs.d.ts +3 -4
  89. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +3 -4
  90. package/dist/knob-contracts/audio-visualizer-knobs.js +1 -0
  91. package/dist/knob-contracts/avatar-knobs.d.ts +3 -4
  92. package/dist/knob-contracts/avatar-knobs.js +2 -1
  93. package/dist/knob-contracts/badge-knobs.d.ts +3 -4
  94. package/dist/knob-contracts/button-group-knobs.d.ts +3 -4
  95. package/dist/knob-contracts/button-knobs.d.ts +3 -4
  96. package/dist/knob-contracts/button-knobs.js +1 -0
  97. package/dist/knob-contracts/calendar-knobs.d.ts +3 -4
  98. package/dist/knob-contracts/card-knobs.d.ts +3 -4
  99. package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +3 -4
  100. package/dist/knob-contracts/chat-composer-attachment-knobs.js +5 -1
  101. package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
  102. package/dist/knob-contracts/chat-composer-knobs.js +2 -0
  103. package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
  104. package/dist/knob-contracts/chat-layout-knobs.js +2 -2
  105. package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
  106. package/dist/knob-contracts/chat-message-knobs.js +3 -1
  107. package/dist/knob-contracts/choice-knobs.d.ts +3 -4
  108. package/dist/knob-contracts/choice-knobs.js +2 -1
  109. package/dist/knob-contracts/code-diff-knobs.d.ts +3 -4
  110. package/dist/knob-contracts/code-diff-knobs.js +1 -0
  111. package/dist/knob-contracts/code-knobs.d.ts +3 -4
  112. package/dist/knob-contracts/code-knobs.js +3 -1
  113. package/dist/knob-contracts/collapsible-knobs.d.ts +3 -4
  114. package/dist/knob-contracts/color-picker-knobs.d.ts +3 -4
  115. package/dist/knob-contracts/context-knobs.d.ts +3 -4
  116. package/dist/knob-contracts/context-knobs.js +3 -0
  117. package/dist/knob-contracts/dockable-panel-knobs.d.ts +3 -4
  118. package/dist/knob-contracts/dockable-panel-knobs.js +1 -0
  119. package/dist/knob-contracts/dropzone-knobs.d.ts +3 -4
  120. package/dist/knob-contracts/dropzone-knobs.js +1 -0
  121. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +3 -4
  122. package/dist/knob-contracts/empty-knobs.d.ts +3 -4
  123. package/dist/knob-contracts/empty-knobs.js +14 -1
  124. package/dist/knob-contracts/environment-variables-knobs.d.ts +3 -4
  125. package/dist/knob-contracts/environment-variables-knobs.js +2 -1
  126. package/dist/knob-contracts/field-knobs.d.ts +3 -4
  127. package/dist/knob-contracts/gradient-editor-knobs.d.ts +3 -4
  128. package/dist/knob-contracts/gradient-editor-knobs.js +3 -1
  129. package/dist/knob-contracts/infinite-canvas-knobs.d.ts +3 -4
  130. package/dist/knob-contracts/inline-attachment-knobs.d.ts +3 -4
  131. package/dist/knob-contracts/inline-attachment-knobs.js +6 -1
  132. package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
  133. package/dist/knob-contracts/inline-citation-knobs.js +4 -1
  134. package/dist/knob-contracts/item-knobs.d.ts +3 -4
  135. package/dist/knob-contracts/kbd-knobs.d.ts +3 -4
  136. package/dist/knob-contracts/markdown-block-knobs.d.ts +3 -4
  137. package/dist/knob-contracts/markdown-block-knobs.js +2 -0
  138. package/dist/knob-contracts/markdown-knobs.d.ts +3 -4
  139. package/dist/knob-contracts/markdown-knobs.js +1 -0
  140. package/dist/knob-contracts/morphing-panel-knobs.d.ts +3 -4
  141. package/dist/knob-contracts/page-layout-knobs.d.ts +4 -0
  142. package/dist/knob-contracts/page-layout-knobs.js +15 -0
  143. package/dist/knob-contracts/pagination-knobs.d.ts +3 -4
  144. package/dist/knob-contracts/phone-input-knobs.d.ts +3 -4
  145. package/dist/knob-contracts/phone-input-knobs.js +1 -0
  146. package/dist/knob-contracts/popup-knobs.d.ts +3 -4
  147. package/dist/knob-contracts/progressive-blur-knobs.d.ts +3 -4
  148. package/dist/knob-contracts/progressive-blur-knobs.js +1 -0
  149. package/dist/knob-contracts/range-knobs.d.ts +3 -4
  150. package/dist/knob-contracts/resizable-knobs.d.ts +3 -4
  151. package/dist/knob-contracts/resizable-knobs.js +1 -0
  152. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +3 -4
  153. package/dist/knob-contracts/scroll-area-knobs.d.ts +3 -4
  154. package/dist/knob-contracts/separator-knobs.d.ts +3 -4
  155. package/dist/knob-contracts/sidebar-knobs.d.ts +3 -4
  156. package/dist/knob-contracts/sidebar-knobs.js +1 -0
  157. package/dist/knob-contracts/skeleton-knobs.d.ts +3 -4
  158. package/dist/knob-contracts/skeleton-knobs.js +9 -1
  159. package/dist/knob-contracts/source-badge-knobs.d.ts +3 -4
  160. package/dist/knob-contracts/spinner-knobs.d.ts +3 -4
  161. package/dist/knob-contracts/stepper-knobs.d.ts +3 -4
  162. package/dist/knob-contracts/stepper-knobs.js +1 -0
  163. package/dist/knob-contracts/switch-knobs.d.ts +3 -4
  164. package/dist/knob-contracts/switch-knobs.js +7 -1
  165. package/dist/knob-contracts/table-knobs.d.ts +3 -4
  166. package/dist/knob-contracts/table-of-contents-knobs.d.ts +3 -4
  167. package/dist/knob-contracts/table-of-contents-knobs.js +25 -0
  168. package/dist/knob-contracts/tabs-knobs.d.ts +3 -4
  169. package/dist/knob-contracts/tabs-knobs.js +2 -1
  170. package/dist/knob-contracts/task-list-knobs.d.ts +3 -4
  171. package/dist/knob-contracts/task-list-knobs.js +5 -0
  172. package/dist/knob-contracts/thread-rail-knobs.d.ts +3 -4
  173. package/dist/knob-contracts/timeline-knobs.d.ts +3 -4
  174. package/dist/knob-contracts/toolbar-knobs.d.ts +3 -4
  175. package/dist/knob-contracts/toolbar-knobs.js +1 -0
  176. package/dist/knob-contracts/track-highlight-knobs.d.ts +3 -4
  177. package/dist/knob-contracts/transcript-divider-knobs.d.ts +3 -4
  178. package/dist/knob-contracts/tree-knobs.d.ts +3 -4
  179. package/dist/knob-contracts/user-ask-knobs.d.ts +3 -4
  180. package/dist/knob-contracts/user-ask-knobs.js +5 -0
  181. package/dist/lib/cn.d.ts +2 -3
  182. package/dist/lib/code-tokens.d.ts +12 -13
  183. package/dist/lib/color.d.ts +26 -27
  184. package/dist/lib/contrast.d.ts +12 -13
  185. package/dist/lib/diff.d.ts +14 -15
  186. package/dist/lib/dropzone-validation.d.ts +25 -26
  187. package/dist/lib/env-file.d.ts +12 -13
  188. package/dist/lib/format-audio-recorder-duration.d.ts +2 -3
  189. package/dist/lib/liquid-glass-optics.d.ts +2 -3
  190. package/dist/lib/phone-input-format.d.ts +3 -4
  191. package/dist/lib/phone-number.d.ts +8 -9
  192. package/dist/lib/trigger-detect.d.ts +4 -5
  193. package/dist/markdown-block.d.ts +11 -12
  194. package/dist/markdown-block.js +1 -1
  195. package/dist/scripts/contrast-eval.d.ts +16 -17
  196. package/dist/scripts/contrast-eval.js +13 -7
  197. package/dist/skin-provider.d.ts +14 -0
  198. package/dist/skin-provider.js +21 -0
  199. package/dist/skin.d.ts +14 -33
  200. package/dist/skin.js +3 -46
  201. package/dist/source-badge.d.ts +7 -8
  202. package/dist/styles/index.css +3 -5
  203. package/dist/styles/recipes/accordion.css +8 -2
  204. package/dist/styles/recipes/action-bar.css +40 -5
  205. package/dist/styles/recipes/activity.css +36 -3
  206. package/dist/styles/recipes/alert.css +97 -16
  207. package/dist/styles/recipes/audio-visualizer.css +8 -1
  208. package/dist/styles/recipes/avatar.css +17 -1
  209. package/dist/styles/recipes/badge.css +0 -1
  210. package/dist/styles/recipes/button-group.css +8 -0
  211. package/dist/styles/recipes/button.css +49 -8
  212. package/dist/styles/recipes/calendar.css +21 -6
  213. package/dist/styles/recipes/card.css +2 -0
  214. package/dist/styles/recipes/chat-composer-attachment.css +83 -54
  215. package/dist/styles/recipes/chat-composer.css +41 -22
  216. package/dist/styles/recipes/chat-layout.css +37 -54
  217. package/dist/styles/recipes/chat-message.css +78 -5
  218. package/dist/styles/recipes/choice.css +21 -2
  219. package/dist/styles/recipes/code-diff.css +9 -1
  220. package/dist/styles/recipes/code.css +64 -17
  221. package/dist/styles/recipes/collapsible.css +0 -3
  222. package/dist/styles/recipes/color-picker-details.css +1 -2
  223. package/dist/styles/recipes/color-picker-values.css +0 -4
  224. package/dist/styles/recipes/context.css +30 -18
  225. package/dist/styles/recipes/dockable-panel.css +8 -1
  226. package/dist/styles/recipes/dropzone.css +9 -2
  227. package/dist/styles/recipes/dynamic-notification-input.css +6 -0
  228. package/dist/styles/recipes/dynamic-notification.css +1 -0
  229. package/dist/styles/recipes/empty.css +118 -17
  230. package/dist/styles/recipes/environment-variables.css +9 -1
  231. package/dist/styles/recipes/field-parts.css +3 -6
  232. package/dist/styles/recipes/field.css +15 -5
  233. package/dist/styles/recipes/gradient-editor.css +33 -5
  234. package/dist/styles/recipes/inline-attachment.css +68 -20
  235. package/dist/styles/recipes/inline-citation.css +52 -10
  236. package/dist/styles/recipes/item.css +4 -2
  237. package/dist/styles/recipes/kbd.css +8 -0
  238. package/dist/styles/recipes/markdown-block.css +17 -2
  239. package/dist/styles/recipes/markdown.css +19 -0
  240. package/dist/styles/recipes/morphing-panel.css +1 -1
  241. package/dist/styles/recipes/page-layout.css +203 -0
  242. package/dist/styles/recipes/pagination.css +16 -4
  243. package/dist/styles/recipes/phone-input.css +8 -4
  244. package/dist/styles/recipes/popup-drawer.css +3 -1
  245. package/dist/styles/recipes/popup-lists.css +11 -0
  246. package/dist/styles/recipes/popup-toast.css +3 -29
  247. package/dist/styles/recipes/popup.css +10 -14
  248. package/dist/styles/recipes/progressive-blur.css +28 -7
  249. package/dist/styles/recipes/range.css +74 -3
  250. package/dist/styles/recipes/resizable.css +8 -10
  251. package/dist/styles/recipes/rich-tooltip.css +1 -4
  252. package/dist/styles/recipes/scroll-area.css +8 -2
  253. package/dist/styles/recipes/sidebar-menu.css +0 -6
  254. package/dist/styles/recipes/sidebar.css +56 -17
  255. package/dist/styles/recipes/skeleton.css +85 -3
  256. package/dist/styles/recipes/source-badge.css +20 -3
  257. package/dist/styles/recipes/stepper.css +8 -1
  258. package/dist/styles/recipes/switch.css +89 -17
  259. package/dist/styles/recipes/table-of-contents.css +211 -45
  260. package/dist/styles/recipes/table.css +0 -1
  261. package/dist/styles/recipes/tabs.css +35 -2
  262. package/dist/styles/recipes/task-list.css +68 -9
  263. package/dist/styles/recipes/thread-rail.css +19 -17
  264. package/dist/styles/recipes/toolbar.css +39 -4
  265. package/dist/styles/recipes/track-highlight.css +63 -5
  266. package/dist/styles/recipes/transcript-divider.css +1 -0
  267. package/dist/styles/recipes/tree.css +2 -0
  268. package/dist/styles/recipes/user-ask.css +65 -18
  269. package/dist/styles/theme.css +164 -138
  270. package/dist/surface-variants.d.ts +4 -5
  271. package/dist/task-list.d.ts +16 -17
  272. package/dist/thread-rail.d.ts +21 -22
  273. package/dist/thread-rail.js +1 -1
  274. package/dist/transcript-divider.d.ts +6 -7
  275. package/dist/ui/accordion.d.ts +10 -11
  276. package/dist/ui/alert-dialog.d.ts +11 -12
  277. package/dist/ui/alert-dialog.js +9 -7
  278. package/dist/ui/alert.d.ts +9 -10
  279. package/dist/ui/alert.js +3 -3
  280. package/dist/ui/aspect-ratio.d.ts +3 -4
  281. package/dist/ui/autocomplete.d.ts +19 -20
  282. package/dist/ui/autocomplete.js +6 -4
  283. package/dist/ui/avatar.d.ts +9 -10
  284. package/dist/ui/badge.d.ts +9 -10
  285. package/dist/ui/button-group.d.ts +7 -8
  286. package/dist/ui/button-group.js +3 -2
  287. package/dist/ui/button.d.ts +17 -18
  288. package/dist/ui/button.js +20 -5
  289. package/dist/ui/calendar.d.ts +3 -4
  290. package/dist/ui/card.d.ts +16 -17
  291. package/dist/ui/checkbox-group.d.ts +4 -5
  292. package/dist/ui/checkbox-group.js +3 -2
  293. package/dist/ui/checkbox.d.ts +3 -4
  294. package/dist/ui/code-diff.d.ts +8 -9
  295. package/dist/ui/code.d.ts +32 -23
  296. package/dist/ui/code.js +41 -20
  297. package/dist/ui/collapsible.d.ts +7 -8
  298. package/dist/ui/color-picker.d.ts +40 -41
  299. package/dist/ui/color-picker.js +8 -6
  300. package/dist/ui/combobox-disabled-selection.d.ts +3 -4
  301. package/dist/ui/combobox.d.ts +19 -20
  302. package/dist/ui/combobox.js +6 -4
  303. package/dist/ui/command.d.ts +22 -19
  304. package/dist/ui/command.js +63 -13
  305. package/dist/ui/context-menu.d.ts +30 -31
  306. package/dist/ui/context-menu.js +10 -7
  307. package/dist/ui/dialog.d.ts +13 -13
  308. package/dist/ui/dialog.js +11 -9
  309. package/dist/ui/dockable-panel-geometry.d.ts +7 -8
  310. package/dist/ui/dockable-panel.d.ts +21 -22
  311. package/dist/ui/drawer.d.ts +17 -18
  312. package/dist/ui/drawer.js +9 -8
  313. package/dist/ui/dropdown-menu.d.ts +32 -33
  314. package/dist/ui/dropdown-menu.js +6 -4
  315. package/dist/ui/dropzone.d.ts +24 -24
  316. package/dist/ui/dropzone.js +4 -1
  317. package/dist/ui/empty.d.ts +14 -14
  318. package/dist/ui/empty.js +3 -3
  319. package/dist/ui/field.d.ts +26 -27
  320. package/dist/ui/form.d.ts +4 -5
  321. package/dist/ui/gradient-editor.d.ts +16 -17
  322. package/dist/ui/gradient-editor.js +2 -2
  323. package/dist/ui/hover-card.d.ts +6 -7
  324. package/dist/ui/hover-card.js +6 -4
  325. package/dist/ui/infinite-canvas.d.ts +11 -12
  326. package/dist/ui/infinite-canvas.js +1 -0
  327. package/dist/ui/input-group.d.ts +6 -7
  328. package/dist/ui/input-otp.d.ts +7 -8
  329. package/dist/ui/input.d.ts +3 -4
  330. package/dist/ui/item.d.ts +20 -21
  331. package/dist/ui/kbd.d.ts +7 -5
  332. package/dist/ui/kbd.js +4 -2
  333. package/dist/ui/markdown-elements.d.ts +20 -21
  334. package/dist/ui/markdown.d.ts +5 -6
  335. package/dist/ui/menubar.d.ts +25 -26
  336. package/dist/ui/menubar.js +10 -7
  337. package/dist/ui/meter.d.ts +11 -12
  338. package/dist/ui/morphing-panel.d.ts +8 -9
  339. package/dist/ui/native-select.d.ts +3 -4
  340. package/dist/ui/native-select.js +1 -1
  341. package/dist/ui/navigation-menu.d.ts +17 -18
  342. package/dist/ui/navigation-menu.js +6 -4
  343. package/dist/ui/number-field.d.ts +15 -16
  344. package/dist/ui/number-field.js +1 -1
  345. package/dist/ui/page-layout.d.ts +44 -0
  346. package/dist/ui/page-layout.js +108 -0
  347. package/dist/ui/pagination.d.ts +10 -11
  348. package/dist/ui/phone-input.d.ts +5 -6
  349. package/dist/ui/phone-input.js +39 -36
  350. package/dist/ui/popover.d.ts +11 -12
  351. package/dist/ui/popover.js +6 -4
  352. package/dist/ui/progress.d.ts +11 -12
  353. package/dist/ui/progressive-blur.d.ts +4 -5
  354. package/dist/ui/radio-group.d.ts +5 -6
  355. package/dist/ui/resizable.d.ts +12 -13
  356. package/dist/ui/resizable.js +1 -1
  357. package/dist/ui/responsive-dialog.d.ts +11 -12
  358. package/dist/ui/rich-tooltip-tour.d.ts +5 -6
  359. package/dist/ui/rich-tooltip.d.ts +21 -23
  360. package/dist/ui/rich-tooltip.js +6 -6
  361. package/dist/ui/scroll-area.d.ts +7 -8
  362. package/dist/ui/scroll-area.js +9 -6
  363. package/dist/ui/select.d.ts +21 -14
  364. package/dist/ui/select.js +8 -5
  365. package/dist/ui/separator.d.ts +2 -3
  366. package/dist/ui/sheet.d.ts +8 -9
  367. package/dist/ui/sheet.js +9 -7
  368. package/dist/ui/sidebar-menu.d.ts +18 -19
  369. package/dist/ui/sidebar-menu.js +4 -3
  370. package/dist/ui/sidebar-provider.d.ts +32 -7
  371. package/dist/ui/sidebar-provider.js +82 -22
  372. package/dist/ui/sidebar-resize-rail.d.ts +8 -0
  373. package/dist/ui/sidebar-resize-rail.js +192 -0
  374. package/dist/ui/sidebar.d.ts +19 -13
  375. package/dist/ui/sidebar.js +120 -55
  376. package/dist/ui/skeleton.d.ts +7 -4
  377. package/dist/ui/skeleton.js +9 -2
  378. package/dist/ui/slider.d.ts +6 -5
  379. package/dist/ui/slider.js +16 -13
  380. package/dist/ui/spinner.d.ts +3 -4
  381. package/dist/ui/stepper.d.ts +22 -23
  382. package/dist/ui/switch.d.ts +3 -4
  383. package/dist/ui/switch.js +12 -1
  384. package/dist/ui/table-of-contents.d.ts +7 -8
  385. package/dist/ui/table-of-contents.js +4 -2
  386. package/dist/ui/table.d.ts +17 -18
  387. package/dist/ui/tabs.d.ts +14 -11
  388. package/dist/ui/textarea.d.ts +3 -4
  389. package/dist/ui/timeline.d.ts +18 -19
  390. package/dist/ui/toast.d.ts +9 -9
  391. package/dist/ui/toast.js +23 -16
  392. package/dist/ui/toggle.d.ts +5 -6
  393. package/dist/ui/toggle.js +3 -2
  394. package/dist/ui/toolbar.d.ts +15 -16
  395. package/dist/ui/toolbar.js +15 -4
  396. package/dist/ui/tooltip.d.ts +6 -13
  397. package/dist/ui/tooltip.js +8 -9
  398. package/dist/ui/tree.d.ts +18 -19
  399. package/dist/ui/tree.js +3 -2
  400. package/dist/ui/trigger-menu.d.ts +15 -16
  401. package/dist/ui/trigger-menu.js +6 -4
  402. package/dist/ui/use-switch-drag.d.ts +7 -0
  403. package/dist/ui/use-switch-drag.js +104 -0
  404. package/dist/user-ask.d.ts +28 -27
  405. package/dist/user-ask.js +38 -13
  406. package/package.json +17 -16
  407. package/dist/code-block-editor.d.ts +0 -59
  408. package/dist/code-block-editor.js +0 -250
  409. package/dist/knob-contracts/code-block-editor-knobs.d.ts +0 -5
  410. package/dist/knob-contracts/code-block-editor-knobs.js +0 -11
  411. package/dist/lib/code-block-shiki.d.ts +0 -9
  412. package/dist/lib/code-block-shiki.js +0 -6
  413. package/dist/skin.config.d.ts +0 -5
  414. package/dist/skin.config.js +0 -12
  415. package/dist/styles/recipes/code-block-editor.css +0 -136
  416. package/dist/styles/skin-theme.css +0 -137
  417. package/dist/styles/skin.css +0 -143
@@ -2,7 +2,7 @@ import { OpenChangeEventDetails } from "../control-props.js";
2
2
  import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
3
3
  import { CSSProperties, ComponentProps, ReactNode } from "react";
4
4
  //#region src/ui/trigger-menu.d.ts
5
- type TriggerMenuProps = {
5
+ export type TriggerMenuProps = {
6
6
  open: boolean;
7
7
  onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
8
8
  anchorRect: DOMRect | null;
@@ -14,33 +14,32 @@ type TriggerMenuProps = {
14
14
  } & {
15
15
  style?: CSSProperties & PopupKnobStyle;
16
16
  };
17
- type TriggerMenuListProps = ComponentProps<"div"> & {
17
+ export type TriggerMenuListProps = ComponentProps<"div"> & {
18
18
  style?: CSSProperties & PopupKnobStyle;
19
19
  };
20
- type TriggerMenuItemProps = Omit<Omit<ComponentProps<"div">, "onSelect"> & {
20
+ export type TriggerMenuItemProps = Omit<Omit<ComponentProps<"div">, "onSelect"> & {
21
21
  active?: boolean;
22
22
  disabled?: boolean;
23
23
  }, "style"> & {
24
24
  style?: CSSProperties & PopupKnobStyle;
25
25
  };
26
- type TriggerMenuEmptyProps = Omit<ComponentProps<"div">, "style"> & {
26
+ export type TriggerMenuEmptyProps = Omit<ComponentProps<"div">, "style"> & {
27
27
  style?: CSSProperties & PopupKnobStyle;
28
28
  };
29
- type TriggerMenuGroupProps = ComponentProps<"div"> & {
29
+ export type TriggerMenuGroupProps = ComponentProps<"div"> & {
30
30
  style?: CSSProperties & PopupKnobStyle;
31
31
  };
32
- type TriggerMenuGroupLabelProps = Omit<ComponentProps<"div">, "style"> & {
32
+ export type TriggerMenuGroupLabelProps = Omit<ComponentProps<"div">, "style"> & {
33
33
  style?: CSSProperties & PopupKnobStyle;
34
34
  };
35
- type TriggerMenuIconProps = Omit<ComponentProps<"span">, "style"> & {
35
+ export type TriggerMenuIconProps = Omit<ComponentProps<"span">, "style"> & {
36
36
  style?: CSSProperties & PopupKnobStyle;
37
37
  };
38
- declare function TriggerMenu({ open, onOpenChange, anchorRect, side, align, sideOffset, className, children }: TriggerMenuProps): import("react").JSX.Element;
39
- declare function TriggerMenuList({ className, ...props }: TriggerMenuListProps): import("react").JSX.Element;
40
- declare function TriggerMenuItem({ className, active, disabled, onMouseDown, ...props }: TriggerMenuItemProps): import("react").JSX.Element;
41
- declare function TriggerMenuIcon({ className, ...props }: TriggerMenuIconProps): import("react").JSX.Element;
42
- declare function TriggerMenuEmpty({ className, ...props }: TriggerMenuEmptyProps): import("react").JSX.Element;
43
- declare function TriggerMenuGroup({ className, ...props }: TriggerMenuGroupProps): import("react").JSX.Element;
44
- declare function TriggerMenuGroupLabel({ className, ...props }: TriggerMenuGroupLabelProps): import("react").JSX.Element;
45
- //#endregion
46
- export { TriggerMenu, TriggerMenuEmpty, TriggerMenuEmptyProps, TriggerMenuGroup, TriggerMenuGroupLabel, TriggerMenuGroupLabelProps, TriggerMenuGroupProps, TriggerMenuIcon, TriggerMenuIconProps, TriggerMenuItem, TriggerMenuItemProps, TriggerMenuList, TriggerMenuListProps, TriggerMenuProps };
38
+ export declare function TriggerMenu({ open, onOpenChange, anchorRect, side, align, sideOffset, className, children }: TriggerMenuProps): import("react").JSX.Element;
39
+ export declare function TriggerMenuList({ className, ...props }: TriggerMenuListProps): import("react").JSX.Element;
40
+ export declare function TriggerMenuItem({ className, active, disabled, onMouseDown, ...props }: TriggerMenuItemProps): import("react").JSX.Element;
41
+ export declare function TriggerMenuIcon({ className, ...props }: TriggerMenuIconProps): import("react").JSX.Element;
42
+ export declare function TriggerMenuEmpty({ className, ...props }: TriggerMenuEmptyProps): import("react").JSX.Element;
43
+ export declare function TriggerMenuGroup({ className, ...props }: TriggerMenuGroupProps): import("react").JSX.Element;
44
+ export declare function TriggerMenuGroupLabel({ className, ...props }: TriggerMenuGroupLabelProps): import("react").JSX.Element;
45
+ //#endregion
@@ -1,11 +1,13 @@
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 { popupItemStructureClasses } from "../surface-variants.js";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { Popover } from "@base-ui/react/popover";
7
8
  //#region src/ui/trigger-menu.tsx
8
9
  function TriggerMenu({ open, onOpenChange, anchorRect, side = "top", align = "start", sideOffset = 8, className, children }) {
10
+ const skin = useSkin();
9
11
  return /* @__PURE__ */ jsx(Popover.Root, {
10
12
  open,
11
13
  onOpenChange: (next, eventDetails) => onOpenChange?.(next, eventDetails),
@@ -15,13 +17,13 @@ function TriggerMenu({ open, onOpenChange, anchorRect, side = "top", align = "st
15
17
  "data-popup-kind": "trigger-menu",
16
18
  "data-control-family": "popup",
17
19
  "data-slot": "positioner",
18
- "data-skin": skinId(),
19
- "data-effects": skinEffects(),
20
+ "data-skin": skin.id,
21
+ "data-effects": controlEffectsAttribute(skin.effects),
20
22
  anchor: anchorRect === null ? void 0 : () => ({ getBoundingClientRect: () => anchorRect }),
21
23
  side,
22
24
  align,
23
25
  sideOffset,
24
- className: "z-[80]",
26
+ className: "z-(--z-popup)",
25
27
  children: /* @__PURE__ */ jsx(Popover.Popup, {
26
28
  "data-control-ui": "trigger-menu",
27
29
  "data-popup-kind": "trigger-menu",
@@ -0,0 +1,7 @@
1
+ //#region src/ui/use-switch-drag.d.ts
2
+ export declare function useSwitchDrag(): {
3
+ thumbRef: import("react").RefObject<HTMLSpanElement | null>;
4
+ dragProps: Pick<import("@base-ui/react").SwitchRootProps, "onClick" | "onKeyDown" | "onLostPointerCapture" | "onPointerCancel" | "onPointerDown" | "onPointerMove" | "onPointerUp">;
5
+ dragProgress: number | null;
6
+ };
7
+ //#endregion
@@ -0,0 +1,104 @@
1
+ "use client";
2
+ import { useRef, useState } from "react";
3
+ //#region src/ui/use-switch-drag.ts
4
+ const dragThresholdPx = 3;
5
+ function switchDragProgress(gesture, clientX) {
6
+ const deltaX = (clientX - gesture.startX) * gesture.direction;
7
+ return Math.max(0, Math.min(1, gesture.startProgress + deltaX / gesture.travel));
8
+ }
9
+ function isSwitchLocked(root) {
10
+ return root.hasAttribute("data-disabled") || root.hasAttribute("data-readonly");
11
+ }
12
+ function useSwitchDrag() {
13
+ const thumbRef = useRef(null);
14
+ const [dragProgress, setDragProgress] = useState(null);
15
+ const gestureRef = useRef(null);
16
+ function cancelDrag(gesture) {
17
+ gesture.canceled = true;
18
+ setDragProgress(null);
19
+ }
20
+ return {
21
+ thumbRef,
22
+ dragProps: {
23
+ onPointerDown(event) {
24
+ const root = event.currentTarget;
25
+ if (!(event.isPrimary && event.button === 0 && !isSwitchLocked(root)) || !thumbRef.current) return;
26
+ setDragProgress(null);
27
+ const styles = getComputedStyle(root);
28
+ const travel = root.clientWidth - Number.parseFloat(styles.paddingLeft) - Number.parseFloat(styles.paddingRight) - thumbRef.current.offsetWidth;
29
+ if (travel <= 0) return;
30
+ const progress = root.hasAttribute("data-checked") ? 1 : 0;
31
+ gestureRef.current = {
32
+ pointerId: event.pointerId,
33
+ startX: event.clientX,
34
+ startY: event.clientY,
35
+ startProgress: progress,
36
+ travel,
37
+ direction: styles.direction === "rtl" ? -1 : 1,
38
+ dragged: false,
39
+ released: false,
40
+ canceled: false
41
+ };
42
+ root.setPointerCapture(event.pointerId);
43
+ },
44
+ onPointerMove(event) {
45
+ const gesture = gestureRef.current;
46
+ if (!gesture || gesture.pointerId !== event.pointerId || gesture.released) return;
47
+ const root = event.currentTarget;
48
+ if (gesture.canceled || isSwitchLocked(root)) {
49
+ cancelDrag(gesture);
50
+ return;
51
+ }
52
+ const deltaX = event.clientX - gesture.startX;
53
+ const deltaY = event.clientY - gesture.startY;
54
+ if (!gesture.dragged) {
55
+ if (Math.abs(deltaY) > Math.max(dragThresholdPx, Math.abs(deltaX))) {
56
+ cancelDrag(gesture);
57
+ return;
58
+ }
59
+ if (Math.abs(deltaX) < dragThresholdPx) return;
60
+ gesture.dragged = true;
61
+ }
62
+ setDragProgress(switchDragProgress(gesture, event.clientX));
63
+ },
64
+ onPointerUp(event) {
65
+ const gesture = gestureRef.current;
66
+ if (!gesture || gesture.pointerId !== event.pointerId) return;
67
+ gesture.released = true;
68
+ setDragProgress(null);
69
+ if (!gesture.dragged || gesture.canceled) return;
70
+ const root = event.currentTarget;
71
+ const shouldToggle = switchDragProgress(gesture, event.clientX) >= .5 !== root.hasAttribute("data-checked") && !isSwitchLocked(root);
72
+ gesture.canceled = true;
73
+ if (shouldToggle) root.click();
74
+ },
75
+ onPointerCancel(event) {
76
+ const gesture = gestureRef.current;
77
+ if (!gesture || gesture.pointerId !== event.pointerId) return;
78
+ cancelDrag(gesture);
79
+ },
80
+ onLostPointerCapture(event) {
81
+ const gesture = gestureRef.current;
82
+ if (!gesture || gesture.pointerId !== event.pointerId || gesture.released) return;
83
+ cancelDrag(gesture);
84
+ },
85
+ onKeyDown(event) {
86
+ if (event.key !== "Escape" || !gestureRef.current) return;
87
+ cancelDrag(gestureRef.current);
88
+ },
89
+ onClick(event) {
90
+ if (event.detail === 0) return;
91
+ const gesture = gestureRef.current;
92
+ gestureRef.current = null;
93
+ if (gesture?.canceled) {
94
+ event.preventDefault();
95
+ event.stopPropagation();
96
+ event.preventBaseUIHandler();
97
+ }
98
+ }
99
+ },
100
+ dragProgress
101
+ };
102
+ }
103
+ //#endregion
104
+ export { useSwitchDrag };
@@ -6,45 +6,46 @@ import { CSSProperties, ComponentProps } from "react";
6
6
  type UserAskStyleProps<Props, Style> = Omit<Props, "style"> & {
7
7
  style?: CSSProperties & Style;
8
8
  };
9
- declare function UserAsk({ onComplete, onDismiss, autoFocus, className, children, ...props }: UserAskProps): import("react").JSX.Element;
10
- type UserAskHeaderProps = ComponentProps<"header"> & {
9
+ export declare function UserAsk({ onComplete, onDismiss, autoFocus, className, children, ...props }: UserAskProps): import("react").JSX.Element;
10
+ export type UserAskHeaderProps = ComponentProps<"header"> & {
11
11
  style?: CSSProperties & UserAskKnobStyle;
12
12
  };
13
- declare function UserAskHeader({ className, ...props }: UserAskHeaderProps): import("react").JSX.Element;
14
- type UserAskTitleProps = UserAskStyleProps<ComponentProps<"h3">, UserAskKnobStyle>;
15
- declare function UserAskTitle({ className, children, ...props }: UserAskTitleProps): import("react").JSX.Element;
16
- type UserAskPaginationProps = UserAskStyleProps<ComponentProps<"div">, UserAskKnobStyle>;
17
- declare function UserAskPagination({ className, ...props }: UserAskPaginationProps): import("react").JSX.Element | null;
18
- type UserAskQuestionProps = Omit<ComponentProps<"div">, "title"> & {
13
+ export declare function UserAskHeader({ className, ...props }: UserAskHeaderProps): import("react").JSX.Element;
14
+ export type UserAskTitleProps = UserAskStyleProps<ComponentProps<"h3">, UserAskKnobStyle>;
15
+ export declare function UserAskTitle({ className, children, ...props }: UserAskTitleProps): import("react").JSX.Element;
16
+ export type UserAskPaginationProps = UserAskStyleProps<ComponentProps<"div">, UserAskKnobStyle>;
17
+ export declare function UserAskPagination({ className, ...props }: UserAskPaginationProps): import("react").JSX.Element | null;
18
+ export type UserAskQuestionProps = Omit<ComponentProps<"div">, "title"> & {
19
19
  id: string;
20
20
  title: string;
21
- /** Pre-selects option carrying this value (e.g. recommended one) until user picks another. */
22
- defaultValue?: string;
21
+ /** Lets the question keep several answers; resolves to a string array. */
22
+ multiple?: boolean;
23
+ /** Pre-selects options carrying these values (e.g. recommended one) until user picks another. */
24
+ defaultValue?: string | string[];
23
25
  } & {
24
26
  style?: CSSProperties & UserAskKnobStyle;
25
27
  };
26
- declare function UserAskQuestion({ id, title, defaultValue, className, children, ...props }: UserAskQuestionProps): import("react").JSX.Element;
27
- type UserAskOptionProps = UserAskStyleProps<Omit<ComponentProps<"button">, "value">, UserAskKnobStyle> & {
28
+ export declare function UserAskQuestion({ id, title, multiple, defaultValue, className, children, ...props }: UserAskQuestionProps): import("react").JSX.Element;
29
+ export type UserAskOptionProps = UserAskStyleProps<Omit<ComponentProps<"button">, "value">, UserAskKnobStyle> & {
28
30
  value: string;
29
31
  recommended?: boolean;
30
32
  };
31
- declare function UserAskOption({ value, recommended, disabled, className, children, onClick, ...props }: UserAskOptionProps): import("react").JSX.Element;
32
- type UserAskOptionLabelProps = UserAskStyleProps<ComponentProps<"span">, UserAskKnobStyle>;
33
- declare function UserAskOptionLabel({ className, children, ...props }: UserAskOptionLabelProps): import("react").JSX.Element;
34
- type UserAskOptionDescriptionProps = UserAskStyleProps<ComponentProps<"span">, UserAskKnobStyle>;
35
- declare function UserAskOptionDescription({ className, ...props }: UserAskOptionDescriptionProps): import("react").JSX.Element;
36
- type UserAskOptionInputProps = UserAskStyleProps<Omit<ComponentProps<"input">, "value">, UserAskKnobStyle> & {
33
+ export declare function UserAskOption({ value, recommended, disabled, className, children, onClick, ...props }: UserAskOptionProps): import("react").JSX.Element;
34
+ export type UserAskOptionLabelProps = UserAskStyleProps<ComponentProps<"span">, UserAskKnobStyle>;
35
+ export declare function UserAskOptionLabel({ className, children, ...props }: UserAskOptionLabelProps): import("react").JSX.Element;
36
+ export type UserAskOptionDescriptionProps = UserAskStyleProps<ComponentProps<"span">, UserAskKnobStyle>;
37
+ export declare function UserAskOptionDescription({ className, ...props }: UserAskOptionDescriptionProps): import("react").JSX.Element;
38
+ export type UserAskOptionInputProps = UserAskStyleProps<Omit<ComponentProps<"input">, "value">, UserAskKnobStyle> & {
37
39
  /** Row label while unselected (option's "Other" affordance). */
38
40
  label?: string;
39
41
  };
40
- declare function UserAskOptionInput({ label, placeholder, disabled, className, onChange, style, ...props }: UserAskOptionInputProps): import("react").JSX.Element;
41
- type UserAskFooterProps = ComponentProps<"footer"> & {
42
+ export declare function UserAskOptionInput({ label, placeholder, disabled, className, onChange, style, ...props }: UserAskOptionInputProps): import("react").JSX.Element;
43
+ export type UserAskFooterProps = ComponentProps<"footer"> & {
42
44
  style?: CSSProperties & UserAskKnobStyle;
43
45
  };
44
- declare function UserAskFooter({ className, ...props }: UserAskFooterProps): import("react").JSX.Element;
45
- type UserAskDismissProps = ComponentProps<typeof Button>;
46
- declare function UserAskDismiss({ className, children, onClick, ...props }: UserAskDismissProps): import("react").JSX.Element;
47
- type UserAskSubmitProps = ComponentProps<typeof Button>;
48
- declare function UserAskSubmit({ className, children, disabled, onClick, ...props }: UserAskSubmitProps): import("react").JSX.Element;
49
- //#endregion
50
- export { UserAsk, UserAskDismiss, UserAskDismissProps, UserAskFooter, UserAskFooterProps, UserAskHeader, UserAskHeaderProps, UserAskOption, UserAskOptionDescription, UserAskOptionDescriptionProps, UserAskOptionInput, UserAskOptionInputProps, UserAskOptionLabel, UserAskOptionLabelProps, UserAskOptionProps, UserAskPagination, UserAskPaginationProps, UserAskQuestion, UserAskQuestionProps, UserAskSubmit, UserAskSubmitProps, UserAskTitle, UserAskTitleProps };
46
+ export declare function UserAskFooter({ className, ...props }: UserAskFooterProps): import("react").JSX.Element;
47
+ export type UserAskDismissProps = ComponentProps<typeof Button>;
48
+ export declare function UserAskDismiss({ className, children, onClick, ...props }: UserAskDismissProps): import("react").JSX.Element;
49
+ export type UserAskSubmitProps = ComponentProps<typeof Button>;
50
+ export declare function UserAskSubmit({ className, children, disabled, onClick, ...props }: UserAskSubmitProps): import("react").JSX.Element;
51
+ //#endregion
package/dist/user-ask.js CHANGED
@@ -126,30 +126,37 @@ function UserAskPagination({ className, ...props }) {
126
126
  ]
127
127
  });
128
128
  }
129
- function UserAskQuestion({ id, title, defaultValue, className, children, ...props }) {
129
+ function UserAskQuestion({ id, title, multiple = false, defaultValue, className, children, ...props }) {
130
130
  const ask = useUserAskContext();
131
131
  const key = useId();
132
132
  const active = ask.activeQuestion?.key === key;
133
- useEffect(() => ask.registerQuestion({
134
- key,
135
- id,
136
- title,
137
- defaultValue
138
- }), [
133
+ const defaultKey = Array.isArray(defaultValue) ? defaultValue.join("\0") : defaultValue;
134
+ useEffect(() => {
135
+ const defaultValues = defaultKey === void 0 ? void 0 : defaultKey.split("\0");
136
+ return ask.registerQuestion({
137
+ key,
138
+ id,
139
+ title,
140
+ multiple,
141
+ defaultValues
142
+ });
143
+ }, [
139
144
  ask.registerQuestion,
140
145
  key,
141
146
  id,
142
147
  title,
143
- defaultValue
148
+ multiple,
149
+ defaultKey
144
150
  ]);
145
151
  useEffect(() => () => ask.unregisterQuestion(key), [ask.unregisterQuestion, key]);
146
152
  return /* @__PURE__ */ jsx(UserAskQuestionContext.Provider, {
147
153
  value: {
148
154
  id,
149
- active
155
+ active,
156
+ multiple
150
157
  },
151
158
  children: /* @__PURE__ */ jsx("div", {
152
- role: "radiogroup",
159
+ role: multiple ? "group" : "radiogroup",
153
160
  "aria-labelledby": active ? ask.titleId : void 0,
154
161
  hidden: !active,
155
162
  "data-control-ui": "user-ask",
@@ -202,12 +209,13 @@ function UserAskOption({ value, recommended = false, disabled = false, className
202
209
  },
203
210
  children: /* @__PURE__ */ jsxs("button", {
204
211
  type: "button",
205
- role: "radio",
212
+ role: question.multiple ? "checkbox" : "radio",
206
213
  "aria-checked": selected,
207
214
  disabled,
208
215
  "data-control-ui": "user-ask",
209
216
  "data-control-family": "user-ask",
210
217
  "data-slot": "option",
218
+ "data-multiple": question.multiple ? "" : void 0,
211
219
  "data-selected": selected ? "" : void 0,
212
220
  "data-recommended": recommended ? "" : void 0,
213
221
  onClick: handleClick,
@@ -218,6 +226,7 @@ function UserAskOption({ value, recommended = false, disabled = false, className
218
226
  "data-control-ui": "user-ask",
219
227
  "data-control-family": "user-ask",
220
228
  "data-slot": "option-indicator",
229
+ "data-multiple": question.multiple ? "" : void 0,
221
230
  "data-selected": selected ? "" : void 0,
222
231
  className: "inline-flex shrink-0 items-center justify-center",
223
232
  children: selected ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : index + 1
@@ -285,12 +294,13 @@ function UserAskOptionInput({ label = "Other", placeholder = "Type your own answ
285
294
  }
286
295
  if (!selected) return /* @__PURE__ */ jsxs("button", {
287
296
  type: "button",
288
- role: "radio",
297
+ role: question.multiple ? "checkbox" : "radio",
289
298
  "aria-checked": false,
290
299
  disabled,
291
300
  "data-control-ui": "user-ask",
292
301
  "data-control-family": "user-ask",
293
302
  "data-slot": "option",
303
+ "data-multiple": question.multiple ? "" : void 0,
294
304
  "data-freeform": "",
295
305
  onClick: () => ask.select(question.id, key),
296
306
  className: cn(optionRowClasses, "disabled:cursor-not-allowed", className),
@@ -300,6 +310,7 @@ function UserAskOptionInput({ label = "Other", placeholder = "Type your own answ
300
310
  "data-control-ui": "user-ask",
301
311
  "data-control-family": "user-ask",
302
312
  "data-slot": "option-indicator",
313
+ "data-multiple": question.multiple ? "" : void 0,
303
314
  className: "inline-flex shrink-0 items-center justify-center",
304
315
  children: index + 1
305
316
  }), /* @__PURE__ */ jsx("span", {
@@ -314,11 +325,25 @@ function UserAskOptionInput({ label = "Other", placeholder = "Type your own answ
314
325
  "data-control-ui": "user-ask",
315
326
  "data-control-family": "user-ask",
316
327
  "data-slot": "option",
328
+ "data-multiple": question.multiple ? "" : void 0,
317
329
  "data-selected": "",
318
330
  "data-freeform": "",
319
331
  className: cn(optionRowClasses, className),
320
332
  style,
321
- children: [/* @__PURE__ */ jsx("span", {
333
+ children: [question.multiple ? /* @__PURE__ */ jsx("button", {
334
+ type: "button",
335
+ role: "checkbox",
336
+ "aria-checked": true,
337
+ "aria-label": `Clear ${label}`,
338
+ "data-control-ui": "user-ask",
339
+ "data-control-family": "user-ask",
340
+ "data-slot": "option-indicator",
341
+ "data-multiple": "",
342
+ "data-selected": "",
343
+ onClick: () => ask.select(question.id, key),
344
+ className: "inline-flex shrink-0 items-center justify-center",
345
+ children: /* @__PURE__ */ jsx(Check, { className: "size-3" })
346
+ }) : /* @__PURE__ */ jsx("span", {
322
347
  "aria-hidden": "true",
323
348
  "data-control-ui": "user-ask",
324
349
  "data-control-family": "user-ask",
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ctrl-ui/react",
3
- "version": "0.8.2",
4
- "description": "Control UI components, blocks, and primitives with the Refined skin, as a versioned package.",
3
+ "version": "0.8.5",
4
+ "description": "Control UI components, blocks, and primitives with neutral defaults and consumer-owned themes.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/damien-schneider/control-ui.git",
8
+ "url": "git+https://github.com/damien-schneider/control-ui.git",
9
9
  "directory": "packages/components"
10
10
  },
11
11
  "homepage": "https://control-ui.dev",
@@ -34,29 +34,30 @@
34
34
  "lint": "biome lint ."
35
35
  },
36
36
  "peerDependencies": {
37
- "@base-ui/react": "^1.7.0",
38
- "@tanstack/react-virtual": "^3.14.9",
37
+ "@base-ui/react": "^1.8.0",
38
+ "@tanstack/react-virtual": "^3.14.13",
39
39
  "class-variance-authority": "^0.7.1",
40
40
  "clsx": "^2.1.1",
41
41
  "cmdk": "^1.1.1",
42
42
  "diff": "^9.0.0",
43
- "libphonenumber-js": "^1.13.10",
44
- "lucide-react": "^1.31.0",
43
+ "libphonenumber-js": "^1.13.13",
44
+ "lucide-react": "^1.47.0",
45
45
  "prosemirror-commands": "^1.7.2",
46
46
  "prosemirror-history": "^1.5.0",
47
47
  "prosemirror-keymap": "^1.2.3",
48
48
  "prosemirror-model": "^1.25.11",
49
49
  "prosemirror-state": "^1.4.4",
50
- "prosemirror-view": "^1.42.2",
50
+ "prosemirror-view": "^1.42.3",
51
51
  "react": "^19.2.8",
52
52
  "react-day-picker": "^10.0.1",
53
+ "react-dom": "^19.2.8",
53
54
  "react-email": "^6.9.5",
54
- "react-phone-number-input": "^3.4.17",
55
- "react-resizable-panels": "^4.12.2",
55
+ "react-phone-number-input": "^3.4.18",
56
+ "react-resizable-panels": "^4.12.4",
56
57
  "shiki": "^4.4.3",
57
- "streamdown": "^2.5.0",
58
- "tailwind-merge": "^3.6.0",
59
- "zod": "^4.4.3"
58
+ "streamdown": "^2.6.0",
59
+ "tailwind-merge": "^3.7.0",
60
+ "zod": "^4.6.5"
60
61
  },
61
62
  "peerDependenciesMeta": {
62
63
  "@tanstack/react-virtual": {
@@ -112,8 +113,8 @@
112
113
  }
113
114
  },
114
115
  "devDependencies": {
115
- "@types/bun": "^1.3.14",
116
- "@types/react": "^19.2.18",
117
- "tsdown": "0.22.14"
116
+ "@types/bun": "^1.4.2",
117
+ "@types/react": "^19.3.0",
118
+ "tsdown": "0.23.0"
118
119
  }
119
120
  }
@@ -1,59 +0,0 @@
1
- import { ButtonKnobStyle } from "./knob-contracts/button-knobs.js";
2
- import { Button } from "./ui/button.js";
3
- import { CodeBlockEditorKnobStyle } from "./knob-contracts/code-block-editor-knobs.js";
4
- import { CodeKnobStyle } from "./knob-contracts/code-knobs.js";
5
- import { CodeBlockEditorTokenLines } from "./lib/code-block-shiki.js";
6
- import { CSSProperties, ComponentProps, ReactNode } from "react";
7
- //#region src/code-block-editor.d.ts
8
- type CodeBlockEditorStyleProps<Props, Style> = Omit<Props, "style"> & {
9
- style?: CSSProperties & Style;
10
- };
11
- type CodeBlockEditorOverflow = "wrap" | "scroll";
12
- type CodeBlockEditorHighlight = "auto" | "none";
13
- type CodeBlockEditorChrome = "standalone" | "embedded";
14
- type CodeBlockEditorDensity = "default" | "compact";
15
- type CodeBlockEditorVariant = "default" | "command";
16
- type CodeBlockEditorProps = CodeBlockEditorStyleProps<ComponentProps<"figure">, CodeBlockEditorKnobStyle> & {
17
- overflow?: CodeBlockEditorOverflow;
18
- chrome?: CodeBlockEditorChrome;
19
- density?: CodeBlockEditorDensity;
20
- variant?: CodeBlockEditorVariant;
21
- };
22
- type CodeBlockEditorHeaderProps = CodeBlockEditorStyleProps<ComponentProps<"figcaption">, CodeBlockEditorKnobStyle>;
23
- type CodeBlockEditorTitleProps = CodeBlockEditorStyleProps<ComponentProps<"span">, CodeBlockEditorKnobStyle>;
24
- type CodeBlockEditorActionsProps = ComponentProps<"div"> & {
25
- style?: CSSProperties & CodeBlockEditorKnobStyle;
26
- };
27
- type CodeBlockEditorCopyProps = Omit<ComponentProps<typeof Button>, "children" | "onClick"> & {
28
- value: string;
29
- children?: ReactNode;
30
- copiedLabel?: ReactNode;
31
- copiedAriaLabel?: string;
32
- };
33
- type CodeBlockEditorContentProps = CodeBlockEditorStyleProps<Omit<ComponentProps<"pre">, "children">, CodeBlockEditorKnobStyle> & {
34
- code: string;
35
- lang?: string;
36
- tokens?: CodeBlockEditorTokenLines | null;
37
- highlight?: CodeBlockEditorHighlight;
38
- maxHeight?: string;
39
- scrollAreaClassName?: string;
40
- };
41
- type CodeBlockEditorTextareaProps = CodeBlockEditorStyleProps<Omit<ComponentProps<"textarea">, "defaultValue" | "value">, CodeBlockEditorKnobStyle> & {
42
- value?: string;
43
- defaultValue?: string;
44
- onValueChange?: (value: string) => void;
45
- fileName?: string;
46
- };
47
- declare function CodeBlockEditor({ overflow, chrome, density, variant, className, children, ...props }: CodeBlockEditorProps): import("react").JSX.Element;
48
- declare function CodeBlockEditorHeader({ className, ...props }: CodeBlockEditorHeaderProps): import("react").JSX.Element;
49
- declare function CodeBlockEditorTitle({ className, ...props }: CodeBlockEditorTitleProps): import("react").JSX.Element;
50
- declare function CodeBlockEditorActions({ className, ...props }: CodeBlockEditorActionsProps): import("react").JSX.Element;
51
- declare function CodeBlockEditorCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeBlockEditorCopyProps): import("react").JSX.Element;
52
- type CodeBlockEditorFloatingCopyProps = Omit<CodeBlockEditorCopyProps, "children" | "copiedLabel" | "style"> & {
53
- style?: CSSProperties & ButtonKnobStyle & CodeKnobStyle;
54
- };
55
- declare function CodeBlockEditorFloatingCopy({ className, ...props }: CodeBlockEditorFloatingCopyProps): import("react").JSX.Element;
56
- declare function CodeBlockEditorContent({ code, lang, tokens, highlight, maxHeight, scrollAreaClassName, className, ...props }: CodeBlockEditorContentProps): import("react").JSX.Element;
57
- declare function CodeBlockEditorTextarea({ value, defaultValue, onValueChange, onChange, fileName, className, "aria-label": ariaLabel, ...props }: CodeBlockEditorTextareaProps): import("react").JSX.Element;
58
- //#endregion
59
- export { CodeBlockEditor, CodeBlockEditorActions, CodeBlockEditorActionsProps, CodeBlockEditorChrome, CodeBlockEditorContent, CodeBlockEditorContentProps, CodeBlockEditorCopy, CodeBlockEditorCopyProps, CodeBlockEditorDensity, CodeBlockEditorFloatingCopy, CodeBlockEditorFloatingCopyProps, CodeBlockEditorHeader, CodeBlockEditorHeaderProps, CodeBlockEditorHighlight, CodeBlockEditorOverflow, CodeBlockEditorProps, CodeBlockEditorTextarea, CodeBlockEditorTextareaProps, CodeBlockEditorTitle, CodeBlockEditorTitleProps, CodeBlockEditorVariant };