@ctrl-ui/react 0.8.0

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 (500) hide show
  1. package/README.md +70 -0
  2. package/dist/action-bar.d.ts +44 -0
  3. package/dist/action-bar.js +89 -0
  4. package/dist/activity.d.ts +53 -0
  5. package/dist/activity.js +188 -0
  6. package/dist/audio-recorder.d.ts +32 -0
  7. package/dist/audio-recorder.js +235 -0
  8. package/dist/audio-visualizer.d.ts +12 -0
  9. package/dist/audio-visualizer.js +58 -0
  10. package/dist/blocks/chat.d.ts +10 -0
  11. package/dist/blocks/chat.js +12 -0
  12. package/dist/blocks/coding-agent.d.ts +61 -0
  13. package/dist/blocks/coding-agent.js +255 -0
  14. package/dist/blocks/file-explorer-data.d.ts +57 -0
  15. package/dist/blocks/file-explorer-data.js +74 -0
  16. package/dist/blocks/file-explorer.d.ts +24 -0
  17. package/dist/blocks/file-explorer.js +427 -0
  18. package/dist/blocks/settings-data.d.ts +36 -0
  19. package/dist/blocks/settings-data.js +66 -0
  20. package/dist/blocks/settings.d.ts +19 -0
  21. package/dist/blocks/settings.js +282 -0
  22. package/dist/blocks/theme-toggle.d.ts +43 -0
  23. package/dist/blocks/theme-toggle.js +180 -0
  24. package/dist/chat-composer-attachment.d.ts +55 -0
  25. package/dist/chat-composer-attachment.js +267 -0
  26. package/dist/chat-composer-editor/extensions/mention.d.ts +14 -0
  27. package/dist/chat-composer-editor/extensions/mention.js +278 -0
  28. package/dist/chat-composer-editor/ghost.d.ts +5 -0
  29. package/dist/chat-composer-editor/ghost.js +55 -0
  30. package/dist/chat-composer-editor/schema.d.ts +6 -0
  31. package/dist/chat-composer-editor/schema.js +25 -0
  32. package/dist/chat-composer-editor/serialize.d.ts +6 -0
  33. package/dist/chat-composer-editor/serialize.js +16 -0
  34. package/dist/chat-composer-editor/types.d.ts +29 -0
  35. package/dist/chat-composer-editor/types.js +0 -0
  36. package/dist/chat-composer-editor.d.ts +9 -0
  37. package/dist/chat-composer-editor.js +154 -0
  38. package/dist/chat-composer.d.ts +60 -0
  39. package/dist/chat-composer.js +134 -0
  40. package/dist/chat-layout.d.ts +27 -0
  41. package/dist/chat-layout.js +114 -0
  42. package/dist/chat-message.d.ts +31 -0
  43. package/dist/chat-message.js +95 -0
  44. package/dist/code-block-editor.d.ts +59 -0
  45. package/dist/code-block-editor.js +250 -0
  46. package/dist/context-model.d.ts +33 -0
  47. package/dist/context-model.js +52 -0
  48. package/dist/context.d.ts +47 -0
  49. package/dist/context.js +335 -0
  50. package/dist/control-props.d.ts +28 -0
  51. package/dist/control-props.js +4 -0
  52. package/dist/control-variants.d.ts +8 -0
  53. package/dist/control-variants.js +14 -0
  54. package/dist/dynamic-notification-glass.d.ts +10 -0
  55. package/dist/dynamic-notification-glass.js +311 -0
  56. package/dist/dynamic-notification-liquid.d.ts +24 -0
  57. package/dist/dynamic-notification-liquid.js +682 -0
  58. package/dist/dynamic-notification-siri-wave.d.ts +4 -0
  59. package/dist/dynamic-notification-siri-wave.js +82 -0
  60. package/dist/dynamic-notification.d.ts +74 -0
  61. package/dist/dynamic-notification.js +342 -0
  62. package/dist/environment-variables.d.ts +124 -0
  63. package/dist/environment-variables.js +492 -0
  64. package/dist/extensions/create-track-highlight.d.ts +12 -0
  65. package/dist/extensions/create-track-highlight.js +147 -0
  66. package/dist/extensions/track-highlight.d.ts +22 -0
  67. package/dist/extensions/track-highlight.js +52 -0
  68. package/dist/hooks/use-audio-recorder.d.ts +107 -0
  69. package/dist/hooks/use-audio-recorder.js +577 -0
  70. package/dist/hooks/use-chat-composer.d.ts +56 -0
  71. package/dist/hooks/use-chat-composer.js +63 -0
  72. package/dist/hooks/use-chat-message.d.ts +28 -0
  73. package/dist/hooks/use-chat-message.js +24 -0
  74. package/dist/hooks/use-color-area.d.ts +18 -0
  75. package/dist/hooks/use-color-area.js +60 -0
  76. package/dist/hooks/use-copy-to-clipboard.d.ts +22 -0
  77. package/dist/hooks/use-copy-to-clipboard.js +90 -0
  78. package/dist/hooks/use-dropzone.d.ts +59 -0
  79. package/dist/hooks/use-dropzone.js +372 -0
  80. package/dist/hooks/use-dynamic-notification.d.ts +37 -0
  81. package/dist/hooks/use-dynamic-notification.js +87 -0
  82. package/dist/hooks/use-environment-variables.d.ts +51 -0
  83. package/dist/hooks/use-environment-variables.js +188 -0
  84. package/dist/hooks/use-mobile.d.ts +5 -0
  85. package/dist/hooks/use-mobile.js +29 -0
  86. package/dist/hooks/use-textarea-trigger-menu.d.ts +8 -0
  87. package/dist/hooks/use-textarea-trigger-menu.js +69 -0
  88. package/dist/hooks/use-trigger-menu.d.ts +49 -0
  89. package/dist/hooks/use-trigger-menu.js +102 -0
  90. package/dist/hooks/use-user-ask.d.ts +48 -0
  91. package/dist/hooks/use-user-ask.js +167 -0
  92. package/dist/inline-attachment.d.ts +37 -0
  93. package/dist/inline-attachment.js +192 -0
  94. package/dist/inline-citation.d.ts +56 -0
  95. package/dist/inline-citation.js +319 -0
  96. package/dist/knob-contracts/accordion-knobs.d.ts +5 -0
  97. package/dist/knob-contracts/accordion-knobs.js +9 -0
  98. package/dist/knob-contracts/action-bar-knobs.d.ts +5 -0
  99. package/dist/knob-contracts/action-bar-knobs.js +4 -0
  100. package/dist/knob-contracts/activity-knobs.d.ts +5 -0
  101. package/dist/knob-contracts/activity-knobs.js +9 -0
  102. package/dist/knob-contracts/alert-knobs.d.ts +5 -0
  103. package/dist/knob-contracts/alert-knobs.js +9 -0
  104. package/dist/knob-contracts/audio-recorder-knobs.d.ts +5 -0
  105. package/dist/knob-contracts/audio-recorder-knobs.js +9 -0
  106. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +5 -0
  107. package/dist/knob-contracts/audio-visualizer-knobs.js +9 -0
  108. package/dist/knob-contracts/avatar-knobs.d.ts +5 -0
  109. package/dist/knob-contracts/avatar-knobs.js +9 -0
  110. package/dist/knob-contracts/badge-knobs.d.ts +5 -0
  111. package/dist/knob-contracts/badge-knobs.js +9 -0
  112. package/dist/knob-contracts/button-group-knobs.d.ts +5 -0
  113. package/dist/knob-contracts/button-group-knobs.js +9 -0
  114. package/dist/knob-contracts/button-knobs.d.ts +5 -0
  115. package/dist/knob-contracts/button-knobs.js +25 -0
  116. package/dist/knob-contracts/calendar-knobs.d.ts +5 -0
  117. package/dist/knob-contracts/calendar-knobs.js +10 -0
  118. package/dist/knob-contracts/card-knobs.d.ts +5 -0
  119. package/dist/knob-contracts/card-knobs.js +11 -0
  120. package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +5 -0
  121. package/dist/knob-contracts/chat-composer-attachment-knobs.js +11 -0
  122. package/dist/knob-contracts/chat-composer-knobs.d.ts +5 -0
  123. package/dist/knob-contracts/chat-composer-knobs.js +18 -0
  124. package/dist/knob-contracts/chat-layout-knobs.d.ts +5 -0
  125. package/dist/knob-contracts/chat-layout-knobs.js +11 -0
  126. package/dist/knob-contracts/chat-message-knobs.d.ts +5 -0
  127. package/dist/knob-contracts/chat-message-knobs.js +17 -0
  128. package/dist/knob-contracts/choice-knobs.d.ts +5 -0
  129. package/dist/knob-contracts/choice-knobs.js +9 -0
  130. package/dist/knob-contracts/code-block-editor-knobs.d.ts +5 -0
  131. package/dist/knob-contracts/code-block-editor-knobs.js +11 -0
  132. package/dist/knob-contracts/code-diff-knobs.d.ts +5 -0
  133. package/dist/knob-contracts/code-diff-knobs.js +18 -0
  134. package/dist/knob-contracts/code-knobs.d.ts +5 -0
  135. package/dist/knob-contracts/code-knobs.js +11 -0
  136. package/dist/knob-contracts/collapsible-knobs.d.ts +5 -0
  137. package/dist/knob-contracts/collapsible-knobs.js +4 -0
  138. package/dist/knob-contracts/color-picker-knobs.d.ts +5 -0
  139. package/dist/knob-contracts/color-picker-knobs.js +12 -0
  140. package/dist/knob-contracts/context-knobs.d.ts +5 -0
  141. package/dist/knob-contracts/context-knobs.js +13 -0
  142. package/dist/knob-contracts/dockable-panel-knobs.d.ts +5 -0
  143. package/dist/knob-contracts/dockable-panel-knobs.js +12 -0
  144. package/dist/knob-contracts/dropzone-knobs.d.ts +5 -0
  145. package/dist/knob-contracts/dropzone-knobs.js +11 -0
  146. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +5 -0
  147. package/dist/knob-contracts/dynamic-notification-knobs.js +18 -0
  148. package/dist/knob-contracts/empty-knobs.d.ts +5 -0
  149. package/dist/knob-contracts/empty-knobs.js +12 -0
  150. package/dist/knob-contracts/environment-variables-knobs.d.ts +5 -0
  151. package/dist/knob-contracts/environment-variables-knobs.js +11 -0
  152. package/dist/knob-contracts/field-knobs.d.ts +5 -0
  153. package/dist/knob-contracts/field-knobs.js +16 -0
  154. package/dist/knob-contracts/gradient-editor-knobs.d.ts +5 -0
  155. package/dist/knob-contracts/gradient-editor-knobs.js +13 -0
  156. package/dist/knob-contracts/infinite-canvas-knobs.d.ts +5 -0
  157. package/dist/knob-contracts/infinite-canvas-knobs.js +13 -0
  158. package/dist/knob-contracts/inline-attachment-knobs.d.ts +5 -0
  159. package/dist/knob-contracts/inline-attachment-knobs.js +14 -0
  160. package/dist/knob-contracts/inline-citation-knobs.d.ts +5 -0
  161. package/dist/knob-contracts/inline-citation-knobs.js +14 -0
  162. package/dist/knob-contracts/item-knobs.d.ts +5 -0
  163. package/dist/knob-contracts/item-knobs.js +10 -0
  164. package/dist/knob-contracts/kbd-knobs.d.ts +5 -0
  165. package/dist/knob-contracts/kbd-knobs.js +10 -0
  166. package/dist/knob-contracts/markdown-block-knobs.d.ts +5 -0
  167. package/dist/knob-contracts/markdown-block-knobs.js +11 -0
  168. package/dist/knob-contracts/markdown-knobs.d.ts +5 -0
  169. package/dist/knob-contracts/markdown-knobs.js +14 -0
  170. package/dist/knob-contracts/morphing-panel-knobs.d.ts +5 -0
  171. package/dist/knob-contracts/morphing-panel-knobs.js +11 -0
  172. package/dist/knob-contracts/pagination-knobs.d.ts +5 -0
  173. package/dist/knob-contracts/pagination-knobs.js +10 -0
  174. package/dist/knob-contracts/phone-input-knobs.d.ts +5 -0
  175. package/dist/knob-contracts/phone-input-knobs.js +10 -0
  176. package/dist/knob-contracts/popup-knobs.d.ts +5 -0
  177. package/dist/knob-contracts/popup-knobs.js +21 -0
  178. package/dist/knob-contracts/range-knobs.d.ts +5 -0
  179. package/dist/knob-contracts/range-knobs.js +13 -0
  180. package/dist/knob-contracts/resizable-knobs.d.ts +5 -0
  181. package/dist/knob-contracts/resizable-knobs.js +14 -0
  182. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +5 -0
  183. package/dist/knob-contracts/rich-tooltip-knobs.js +13 -0
  184. package/dist/knob-contracts/scroll-area-knobs.d.ts +5 -0
  185. package/dist/knob-contracts/scroll-area-knobs.js +8 -0
  186. package/dist/knob-contracts/separator-knobs.d.ts +5 -0
  187. package/dist/knob-contracts/separator-knobs.js +4 -0
  188. package/dist/knob-contracts/sidebar-knobs.d.ts +5 -0
  189. package/dist/knob-contracts/sidebar-knobs.js +26 -0
  190. package/dist/knob-contracts/skeleton-knobs.d.ts +5 -0
  191. package/dist/knob-contracts/skeleton-knobs.js +4 -0
  192. package/dist/knob-contracts/source-badge-knobs.d.ts +5 -0
  193. package/dist/knob-contracts/source-badge-knobs.js +11 -0
  194. package/dist/knob-contracts/spinner-knobs.d.ts +5 -0
  195. package/dist/knob-contracts/spinner-knobs.js +4 -0
  196. package/dist/knob-contracts/stepper-knobs.d.ts +5 -0
  197. package/dist/knob-contracts/stepper-knobs.js +11 -0
  198. package/dist/knob-contracts/switch-knobs.d.ts +5 -0
  199. package/dist/knob-contracts/switch-knobs.js +12 -0
  200. package/dist/knob-contracts/table-knobs.d.ts +5 -0
  201. package/dist/knob-contracts/table-knobs.js +12 -0
  202. package/dist/knob-contracts/table-of-contents-knobs.d.ts +5 -0
  203. package/dist/knob-contracts/table-of-contents-knobs.js +8 -0
  204. package/dist/knob-contracts/tabs-knobs.d.ts +5 -0
  205. package/dist/knob-contracts/tabs-knobs.js +16 -0
  206. package/dist/knob-contracts/task-list-knobs.d.ts +5 -0
  207. package/dist/knob-contracts/task-list-knobs.js +14 -0
  208. package/dist/knob-contracts/thread-rail-knobs.d.ts +5 -0
  209. package/dist/knob-contracts/thread-rail-knobs.js +14 -0
  210. package/dist/knob-contracts/timeline-knobs.d.ts +5 -0
  211. package/dist/knob-contracts/timeline-knobs.js +12 -0
  212. package/dist/knob-contracts/toolbar-knobs.d.ts +5 -0
  213. package/dist/knob-contracts/toolbar-knobs.js +20 -0
  214. package/dist/knob-contracts/track-highlight-knobs.d.ts +5 -0
  215. package/dist/knob-contracts/track-highlight-knobs.js +11 -0
  216. package/dist/knob-contracts/transcript-divider-knobs.d.ts +5 -0
  217. package/dist/knob-contracts/transcript-divider-knobs.js +10 -0
  218. package/dist/knob-contracts/tree-knobs.d.ts +5 -0
  219. package/dist/knob-contracts/tree-knobs.js +13 -0
  220. package/dist/knob-contracts/user-ask-knobs.d.ts +5 -0
  221. package/dist/knob-contracts/user-ask-knobs.js +17 -0
  222. package/dist/lib/cn.d.ts +5 -0
  223. package/dist/lib/cn.js +34 -0
  224. package/dist/lib/code-block-shiki.d.ts +9 -0
  225. package/dist/lib/code-block-shiki.js +6 -0
  226. package/dist/lib/code-tokens.d.ts +28 -0
  227. package/dist/lib/code-tokens.js +160 -0
  228. package/dist/lib/color.d.ts +72 -0
  229. package/dist/lib/color.js +490 -0
  230. package/dist/lib/contrast.d.ts +30 -0
  231. package/dist/lib/contrast.js +64 -0
  232. package/dist/lib/diff.d.ts +50 -0
  233. package/dist/lib/diff.js +315 -0
  234. package/dist/lib/dropzone-validation.d.ts +66 -0
  235. package/dist/lib/dropzone-validation.js +228 -0
  236. package/dist/lib/env-file.d.ts +28 -0
  237. package/dist/lib/env-file.js +218 -0
  238. package/dist/lib/format-audio-recorder-duration.d.ts +4 -0
  239. package/dist/lib/format-audio-recorder-duration.js +7 -0
  240. package/dist/lib/liquid-glass-optics.d.ts +4 -0
  241. package/dist/lib/liquid-glass-optics.js +96 -0
  242. package/dist/lib/phone-input-format.d.ts +6 -0
  243. package/dist/lib/phone-input-format.js +26 -0
  244. package/dist/lib/phone-number.d.ts +18 -0
  245. package/dist/lib/phone-number.js +28 -0
  246. package/dist/lib/trigger-detect.d.ts +15 -0
  247. package/dist/lib/trigger-detect.js +77 -0
  248. package/dist/markdown-block.d.ts +25 -0
  249. package/dist/markdown-block.js +77 -0
  250. package/dist/skin.config.d.ts +5 -0
  251. package/dist/skin.config.js +4 -0
  252. package/dist/skin.d.ts +69 -0
  253. package/dist/skin.js +62 -0
  254. package/dist/source-badge.d.ts +23 -0
  255. package/dist/source-badge.js +72 -0
  256. package/dist/styles/chat-composer-editor.css +44 -0
  257. package/dist/styles/code.css +57 -0
  258. package/dist/styles/effects.css +126 -0
  259. package/dist/styles/index.css +81 -0
  260. package/dist/styles/recipes/accordion.css +87 -0
  261. package/dist/styles/recipes/action-bar.css +19 -0
  262. package/dist/styles/recipes/activity.css +129 -0
  263. package/dist/styles/recipes/alert.css +75 -0
  264. package/dist/styles/recipes/audio-recorder.css +102 -0
  265. package/dist/styles/recipes/audio-visualizer.css +90 -0
  266. package/dist/styles/recipes/avatar.css +52 -0
  267. package/dist/styles/recipes/badge.css +110 -0
  268. package/dist/styles/recipes/button-group.css +64 -0
  269. package/dist/styles/recipes/button.css +305 -0
  270. package/dist/styles/recipes/calendar.css +152 -0
  271. package/dist/styles/recipes/card.css +93 -0
  272. package/dist/styles/recipes/chat-composer-attachment.css +177 -0
  273. package/dist/styles/recipes/chat-composer.css +195 -0
  274. package/dist/styles/recipes/chat-layout.css +108 -0
  275. package/dist/styles/recipes/chat-message.css +160 -0
  276. package/dist/styles/recipes/choice.css +108 -0
  277. package/dist/styles/recipes/code-block-editor.css +136 -0
  278. package/dist/styles/recipes/code-diff.css +256 -0
  279. package/dist/styles/recipes/code.css +136 -0
  280. package/dist/styles/recipes/collapsible.css +27 -0
  281. package/dist/styles/recipes/color-picker-details.css +61 -0
  282. package/dist/styles/recipes/color-picker-values.css +117 -0
  283. package/dist/styles/recipes/color-picker.css +158 -0
  284. package/dist/styles/recipes/context.css +237 -0
  285. package/dist/styles/recipes/dockable-panel.css +106 -0
  286. package/dist/styles/recipes/dropzone.css +149 -0
  287. package/dist/styles/recipes/dynamic-notification-input.css +29 -0
  288. package/dist/styles/recipes/dynamic-notification-motion.css +298 -0
  289. package/dist/styles/recipes/dynamic-notification.css +241 -0
  290. package/dist/styles/recipes/empty.css +96 -0
  291. package/dist/styles/recipes/environment-variables.css +173 -0
  292. package/dist/styles/recipes/field-parts.css +148 -0
  293. package/dist/styles/recipes/field.css +234 -0
  294. package/dist/styles/recipes/gradient-editor.css +109 -0
  295. package/dist/styles/recipes/infinite-canvas.css +78 -0
  296. package/dist/styles/recipes/inline-attachment.css +182 -0
  297. package/dist/styles/recipes/inline-citation.css +174 -0
  298. package/dist/styles/recipes/item.css +107 -0
  299. package/dist/styles/recipes/kbd.css +55 -0
  300. package/dist/styles/recipes/markdown-block.css +75 -0
  301. package/dist/styles/recipes/markdown.css +204 -0
  302. package/dist/styles/recipes/morphing-panel.css +123 -0
  303. package/dist/styles/recipes/pagination.css +86 -0
  304. package/dist/styles/recipes/phone-input.css +105 -0
  305. package/dist/styles/recipes/popup-controls.css +59 -0
  306. package/dist/styles/recipes/popup-drawer.css +162 -0
  307. package/dist/styles/recipes/popup-lists.css +198 -0
  308. package/dist/styles/recipes/popup-motion.css +94 -0
  309. package/dist/styles/recipes/popup-toast.css +126 -0
  310. package/dist/styles/recipes/popup.css +396 -0
  311. package/dist/styles/recipes/range.css +259 -0
  312. package/dist/styles/recipes/resizable.css +170 -0
  313. package/dist/styles/recipes/rich-tooltip.css +272 -0
  314. package/dist/styles/recipes/scroll-area.css +59 -0
  315. package/dist/styles/recipes/separator.css +12 -0
  316. package/dist/styles/recipes/sidebar.css +345 -0
  317. package/dist/styles/recipes/skeleton.css +23 -0
  318. package/dist/styles/recipes/source-badge.css +77 -0
  319. package/dist/styles/recipes/spinner.css +33 -0
  320. package/dist/styles/recipes/stepper.css +178 -0
  321. package/dist/styles/recipes/switch.css +149 -0
  322. package/dist/styles/recipes/table-of-contents.css +107 -0
  323. package/dist/styles/recipes/table.css +124 -0
  324. package/dist/styles/recipes/tabs.css +235 -0
  325. package/dist/styles/recipes/task-list.css +146 -0
  326. package/dist/styles/recipes/thread-rail.css +247 -0
  327. package/dist/styles/recipes/timeline.css +107 -0
  328. package/dist/styles/recipes/toolbar.css +260 -0
  329. package/dist/styles/recipes/track-highlight.css +73 -0
  330. package/dist/styles/recipes/transcript-divider.css +64 -0
  331. package/dist/styles/recipes/tree.css +137 -0
  332. package/dist/styles/recipes/user-ask-details.css +45 -0
  333. package/dist/styles/recipes/user-ask.css +204 -0
  334. package/dist/styles/skin-theme.css +137 -0
  335. package/dist/styles/skin.css +143 -0
  336. package/dist/styles/theme.css +628 -0
  337. package/dist/styles/type-scale.css +45 -0
  338. package/dist/surface-variants.d.ts +6 -0
  339. package/dist/surface-variants.js +16 -0
  340. package/dist/task-list.d.ts +34 -0
  341. package/dist/task-list.js +177 -0
  342. package/dist/thread-rail.d.ts +52 -0
  343. package/dist/thread-rail.js +190 -0
  344. package/dist/transcript-divider.d.ts +15 -0
  345. package/dist/transcript-divider.js +25 -0
  346. package/dist/ui/accordion.d.ts +31 -0
  347. package/dist/ui/accordion.js +60 -0
  348. package/dist/ui/alert-dialog.d.ts +36 -0
  349. package/dist/ui/alert-dialog.js +100 -0
  350. package/dist/ui/alert.d.ts +21 -0
  351. package/dist/ui/alert.js +36 -0
  352. package/dist/ui/aspect-ratio.d.ts +8 -0
  353. package/dist/ui/aspect-ratio.js +17 -0
  354. package/dist/ui/autocomplete.d.ts +70 -0
  355. package/dist/ui/autocomplete.js +150 -0
  356. package/dist/ui/avatar.d.ts +24 -0
  357. package/dist/ui/avatar.js +44 -0
  358. package/dist/ui/badge.d.ts +20 -0
  359. package/dist/ui/badge.js +36 -0
  360. package/dist/ui/button-group.d.ts +24 -0
  361. package/dist/ui/button-group.js +45 -0
  362. package/dist/ui/button.d.ts +36 -0
  363. package/dist/ui/button.js +104 -0
  364. package/dist/ui/calendar.d.ts +11 -0
  365. package/dist/ui/calendar.js +160 -0
  366. package/dist/ui/card.d.ts +36 -0
  367. package/dist/ui/card.js +70 -0
  368. package/dist/ui/checkbox-group.d.ts +11 -0
  369. package/dist/ui/checkbox-group.js +16 -0
  370. package/dist/ui/checkbox.d.ts +23 -0
  371. package/dist/ui/checkbox.js +58 -0
  372. package/dist/ui/code-diff.d.ts +28 -0
  373. package/dist/ui/code-diff.js +561 -0
  374. package/dist/ui/code.d.ts +62 -0
  375. package/dist/ui/code.js +292 -0
  376. package/dist/ui/collapsible.d.ts +31 -0
  377. package/dist/ui/collapsible.js +72 -0
  378. package/dist/ui/color-picker.d.ts +137 -0
  379. package/dist/ui/color-picker.js +797 -0
  380. package/dist/ui/combobox-disabled-selection.d.ts +5 -0
  381. package/dist/ui/combobox-disabled-selection.js +11 -0
  382. package/dist/ui/combobox.d.ts +70 -0
  383. package/dist/ui/combobox.js +194 -0
  384. package/dist/ui/command.d.ts +44 -0
  385. package/dist/ui/command.js +166 -0
  386. package/dist/ui/context-menu.d.ts +86 -0
  387. package/dist/ui/context-menu.js +202 -0
  388. package/dist/ui/dialog.d.ts +38 -0
  389. package/dist/ui/dialog.js +124 -0
  390. package/dist/ui/dockable-panel-geometry.d.ts +18 -0
  391. package/dist/ui/dockable-panel-geometry.js +17 -0
  392. package/dist/ui/dockable-panel.d.ts +58 -0
  393. package/dist/ui/dockable-panel.js +366 -0
  394. package/dist/ui/drawer.d.ts +42 -0
  395. package/dist/ui/drawer.js +182 -0
  396. package/dist/ui/dropdown-menu.d.ts +46 -0
  397. package/dist/ui/dropdown-menu.js +89 -0
  398. package/dist/ui/dropzone.d.ts +66 -0
  399. package/dist/ui/dropzone.js +311 -0
  400. package/dist/ui/empty.d.ts +28 -0
  401. package/dist/ui/empty.js +59 -0
  402. package/dist/ui/field.d.ts +64 -0
  403. package/dist/ui/field.js +166 -0
  404. package/dist/ui/form.d.ts +10 -0
  405. package/dist/ui/form.js +17 -0
  406. package/dist/ui/gradient-editor.d.ts +47 -0
  407. package/dist/ui/gradient-editor.js +301 -0
  408. package/dist/ui/hover-card.d.ts +25 -0
  409. package/dist/ui/hover-card.js +46 -0
  410. package/dist/ui/infinite-canvas.d.ts +40 -0
  411. package/dist/ui/infinite-canvas.js +278 -0
  412. package/dist/ui/input-group.d.ts +21 -0
  413. package/dist/ui/input-group.js +44 -0
  414. package/dist/ui/input-otp.d.ts +38 -0
  415. package/dist/ui/input-otp.js +45 -0
  416. package/dist/ui/input.d.ts +12 -0
  417. package/dist/ui/input.js +18 -0
  418. package/dist/ui/item.d.ts +46 -0
  419. package/dist/ui/item.js +110 -0
  420. package/dist/ui/kbd.d.ts +12 -0
  421. package/dist/ui/kbd.js +23 -0
  422. package/dist/ui/markdown-elements.d.ts +52 -0
  423. package/dist/ui/markdown-elements.js +211 -0
  424. package/dist/ui/markdown.d.ts +14 -0
  425. package/dist/ui/markdown.js +31 -0
  426. package/dist/ui/menubar.d.ts +74 -0
  427. package/dist/ui/menubar.js +162 -0
  428. package/dist/ui/meter.d.ts +34 -0
  429. package/dist/ui/meter.js +57 -0
  430. package/dist/ui/morphing-panel.d.ts +24 -0
  431. package/dist/ui/morphing-panel.js +87 -0
  432. package/dist/ui/native-select.d.ts +12 -0
  433. package/dist/ui/native-select.js +41 -0
  434. package/dist/ui/navigation-menu.d.ts +51 -0
  435. package/dist/ui/navigation-menu.js +135 -0
  436. package/dist/ui/number-field.d.ts +72 -0
  437. package/dist/ui/number-field.js +124 -0
  438. package/dist/ui/pagination.d.ts +26 -0
  439. package/dist/ui/pagination.js +77 -0
  440. package/dist/ui/phone-input.d.ts +30 -0
  441. package/dist/ui/phone-input.js +263 -0
  442. package/dist/ui/popover.d.ts +34 -0
  443. package/dist/ui/popover.js +87 -0
  444. package/dist/ui/progress.d.ts +34 -0
  445. package/dist/ui/progress.js +57 -0
  446. package/dist/ui/radio-group.d.ts +29 -0
  447. package/dist/ui/radio-group.js +37 -0
  448. package/dist/ui/resizable.d.ts +56 -0
  449. package/dist/ui/resizable.js +82 -0
  450. package/dist/ui/responsive-dialog.d.ts +18 -0
  451. package/dist/ui/responsive-dialog.js +121 -0
  452. package/dist/ui/rich-tooltip-tour.d.ts +12 -0
  453. package/dist/ui/rich-tooltip-tour.js +20 -0
  454. package/dist/ui/rich-tooltip.d.ts +83 -0
  455. package/dist/ui/rich-tooltip.js +331 -0
  456. package/dist/ui/scroll-area.d.ts +25 -0
  457. package/dist/ui/scroll-area.js +93 -0
  458. package/dist/ui/select.d.ts +44 -0
  459. package/dist/ui/select.js +124 -0
  460. package/dist/ui/separator.d.ts +9 -0
  461. package/dist/ui/separator.js +16 -0
  462. package/dist/ui/sheet.d.ts +25 -0
  463. package/dist/ui/sheet.js +76 -0
  464. package/dist/ui/sidebar.d.ts +88 -0
  465. package/dist/ui/sidebar.js +362 -0
  466. package/dist/ui/skeleton.d.ts +8 -0
  467. package/dist/ui/skeleton.js +13 -0
  468. package/dist/ui/slider.d.ts +24 -0
  469. package/dist/ui/slider.js +114 -0
  470. package/dist/ui/spinner.d.ts +12 -0
  471. package/dist/ui/spinner.js +26 -0
  472. package/dist/ui/stepper.d.ts +58 -0
  473. package/dist/ui/stepper.js +232 -0
  474. package/dist/ui/switch.d.ts +26 -0
  475. package/dist/ui/switch.js +71 -0
  476. package/dist/ui/table-of-contents.d.ts +22 -0
  477. package/dist/ui/table-of-contents.js +181 -0
  478. package/dist/ui/table.d.ts +37 -0
  479. package/dist/ui/table.js +83 -0
  480. package/dist/ui/tabs.d.ts +36 -0
  481. package/dist/ui/tabs.js +127 -0
  482. package/dist/ui/textarea.d.ts +9 -0
  483. package/dist/ui/textarea.js +16 -0
  484. package/dist/ui/timeline.d.ts +40 -0
  485. package/dist/ui/timeline.js +80 -0
  486. package/dist/ui/toast.d.ts +28 -0
  487. package/dist/ui/toast.js +132 -0
  488. package/dist/ui/toggle.d.ts +20 -0
  489. package/dist/ui/toggle.js +71 -0
  490. package/dist/ui/toolbar.d.ts +40 -0
  491. package/dist/ui/toolbar.js +72 -0
  492. package/dist/ui/tooltip.d.ts +27 -0
  493. package/dist/ui/tooltip.js +93 -0
  494. package/dist/ui/tree.d.ts +56 -0
  495. package/dist/ui/tree.js +438 -0
  496. package/dist/ui/trigger-menu.d.ts +46 -0
  497. package/dist/ui/trigger-menu.js +116 -0
  498. package/dist/user-ask.d.ts +50 -0
  499. package/dist/user-ask.js +398 -0
  500. package/package.json +115 -0
@@ -0,0 +1,82 @@
1
+ //#region src/dynamic-notification-siri-wave.ts
2
+ const DYNAMIC_NOTIFICATION_SIRI_WAVE_GLSL = `
3
+ const float SIRI_PI = 3.14159265359;
4
+ const float SIRI_AMPLITUDE = 0.32;
5
+ const float SIRI_FREQUENCY = 1.1;
6
+ const float SIRI_ABERRATION_FREQUENCY = 1.0;
7
+ const float SIRI_SPEED = 2.4;
8
+ const float SIRI_WAVE_SCALE = 0.6;
9
+ const float SIRI_ABERRATION = 2.6;
10
+ const float SIRI_THICKNESS = 3.0;
11
+ const float SIRI_INTENSITY = 2.0;
12
+ const float SIRI_FALLOFF = 1.7;
13
+ const float SIRI_EDGE_MASK = 0.4;
14
+ const float SIRI_BAND_FILL = 30000.0;
15
+ const float SIRI_BAND_THICKNESS = 0.08;
16
+ const float SIRI_SOFTNESS = 2.5;
17
+ const float SIRI_LOW_AMPLITUDE = 6.0;
18
+ const float SIRI_LOW_INTENSITY = 1.5;
19
+ const float SIRI_MID_ABERRATION = 0.8;
20
+ const float SIRI_MID_ABERRATION_AMPLITUDE = 0.05;
21
+ const float SIRI_MID_SOFTNESS = 0.4;
22
+ const float SIRI_HIGH_ABERRATION = 0.5;
23
+ const float SIRI_HIGH_ABERRATION_AMPLITUDE = 0.06;
24
+
25
+ vec3 siriSpectrum(int strand) {
26
+ float x = float(strand);
27
+ return clamp(vec3(abs(x - 3.0) - 1.0, 2.0 - abs(x - 2.0), 2.0 - abs(x - 4.0)), 0.0, 1.0);
28
+ }
29
+
30
+ vec3 dynamicNotificationSiriWave(vec2 uv, vec2 resolution, float time, float horizon, float lift) {
31
+ float aspect = resolution.x / max(resolution.y, 1.0);
32
+ vec2 p = vec2((uv.x * 2.0 - 1.0) * aspect, (uv.y - horizon + lift * 0.55) * 2.0);
33
+ float screenY = p.y;
34
+ p /= max(SIRI_WAVE_SCALE, 0.1);
35
+
36
+ float low = clamp(0.45 + 0.45 * sin(time * 0.8) * sin(time * 0.37 + 1.0), 0.0, 1.0);
37
+ float mid = clamp(0.40 + 0.40 * sin(time * 1.7 + 2.0) * sin(time * 0.53), 0.0, 1.0);
38
+ float high = clamp(0.30 + 0.30 * sin(time * 2.9 + 4.0) * sin(time * 0.71 + 2.0), 0.0, 1.0);
39
+ float drift = mod(time, 20.0 * SIRI_PI) * SIRI_SPEED;
40
+
41
+ float horizontalPosition = uv.x * 2.0 - 1.0;
42
+ float envelope = cos(SIRI_PI * 0.5 * min(abs(0.9 * horizontalPosition), 1.0));
43
+ envelope *= envelope;
44
+
45
+ float primaryAmplitude = SIRI_AMPLITUDE + 0.01 * low * SIRI_LOW_AMPLITUDE;
46
+ float strandAmplitude = primaryAmplitude + mid * SIRI_MID_ABERRATION_AMPLITUDE + high * SIRI_HIGH_ABERRATION_AMPLITUDE;
47
+ float aberration = SIRI_ABERRATION + mid * SIRI_MID_ABERRATION + high * SIRI_HIGH_ABERRATION;
48
+ float thickness = 0.01 * SIRI_THICKNESS;
49
+ float intensity = 0.01 * (SIRI_INTENSITY + low * SIRI_LOW_INTENSITY);
50
+ float softness = 0.01 * max(0.0, SIRI_SOFTNESS + mid * SIRI_MID_SOFTNESS);
51
+ float primaryY = primaryAmplitude * envelope * sin(p.x * SIRI_FREQUENCY + drift);
52
+ float bandAmount = 1e-4 * SIRI_BAND_FILL * intensity;
53
+
54
+ vec3 numerator = vec3(0.0);
55
+ vec3 denominator = vec3(0.0);
56
+ for (int strand = 0; strand < 4; strand++) {
57
+ vec3 hue = siriSpectrum(strand);
58
+ denominator += hue;
59
+ float phase = mix(-aberration, aberration, float(strand) / 3.0);
60
+ float strandY = strandAmplitude * envelope * sin(p.x * SIRI_ABERRATION_FREQUENCY + drift + phase);
61
+ float distanceToStrand = abs(p.y - strandY);
62
+ float line = intensity / (sqrt(distanceToStrand * distanceToStrand + softness * softness) + thickness);
63
+ float bandLow = min(primaryY, strandY);
64
+ float bandHigh = max(primaryY, strandY);
65
+ float distanceToBand = max(0.0, max(p.y - bandHigh, bandLow - p.y));
66
+ float band = bandAmount / (distanceToBand + SIRI_BAND_THICKNESS);
67
+ numerator += hue * (line + band);
68
+ }
69
+
70
+ vec3 color = numerator / max(denominator, vec3(0.0001));
71
+ float primaryDistance = abs(p.y - primaryY);
72
+ color += 0.5 * intensity / (sqrt(primaryDistance * primaryDistance + softness * softness) + thickness);
73
+ color = pow(max(color, 0.0), vec3(1.5));
74
+
75
+ float edgeFadePosition = clamp((abs(screenY) - 1.0) / -SIRI_EDGE_MASK, 0.0, 1.0);
76
+ float edgeFade = edgeFadePosition * edgeFadePosition * (3.0 - 2.0 * edgeFadePosition);
77
+ color *= edgeFade * exp(-pow(horizontalPosition * SIRI_FALLOFF, 2.0));
78
+ return color;
79
+ }
80
+ `;
81
+ //#endregion
82
+ export { DYNAMIC_NOTIFICATION_SIRI_WAVE_GLSL };
@@ -0,0 +1,74 @@
1
+ import { FormSubmitEvent, OpenChangeReason } from "./control-props.js";
2
+ import { Button } from "./ui/button.js";
3
+ import { DynamicNotificationKnobStyle } from "./knob-contracts/dynamic-notification-knobs.js";
4
+ import { DynamicNotificationProps, DynamicNotificationVariant } from "./hooks/use-dynamic-notification.js";
5
+ import { CSSProperties, ComponentProps } from "react";
6
+ //#region src/dynamic-notification.d.ts
7
+ type DynamicNotificationState = "collapsed" | "thinking" | "expanded";
8
+ declare function useDynamicNotificationContext(): {
9
+ open: boolean;
10
+ disabled: boolean;
11
+ setOpen: (nextOpen: boolean, reason: OpenChangeReason, event: Event, trigger?: Element) => void;
12
+ reply: string;
13
+ setReply: (nextValue: string) => void;
14
+ normalizedReply: string;
15
+ canSubmit: boolean;
16
+ clear: () => void;
17
+ submitReply: () => void;
18
+ handleReplySubmit: (event: FormSubmitEvent) => void;
19
+ state: DynamicNotificationState;
20
+ variant: DynamicNotificationVariant;
21
+ contentId: string;
22
+ };
23
+ declare function DynamicNotification({ open, defaultOpen, onOpenChange, loading, replyValue, defaultReplyValue, onReplyValueChange, onReply, variant, disabled, className, children, ...props }: DynamicNotificationProps): import("react").JSX.Element;
24
+ type DynamicNotificationIslandProps = ComponentProps<"section"> & {
25
+ style?: CSSProperties & DynamicNotificationKnobStyle;
26
+ };
27
+ declare function DynamicNotificationIsland({ className, onKeyDown, ...props }: DynamicNotificationIslandProps): import("react").JSX.Element;
28
+ type DynamicNotificationGlassProps = ComponentProps<"canvas"> & {
29
+ style?: CSSProperties & DynamicNotificationKnobStyle;
30
+ };
31
+ /** Optional upgrade for variant="glass" — CSS fallback stays underneath. */
32
+ declare function DynamicNotificationGlass({ className, ...props }: DynamicNotificationGlassProps): import("react").JSX.Element;
33
+ type DynamicNotificationLiquidProps = ComponentProps<"canvas"> & {
34
+ style?: CSSProperties & DynamicNotificationKnobStyle;
35
+ };
36
+ /** WebGL transmits nearest scene through surface while keeping distortion concentrated at its edge. */
37
+ declare function DynamicNotificationLiquid({ className, ...props }: DynamicNotificationLiquidProps): import("react").JSX.Element;
38
+ type DynamicNotificationPillProps = ComponentProps<"button"> & {
39
+ style?: CSSProperties & DynamicNotificationKnobStyle;
40
+ };
41
+ declare function DynamicNotificationPill({ className, children, onClick, ...props }: DynamicNotificationPillProps): import("react").JSX.Element;
42
+ type DynamicNotificationIndicatorProps = ComponentProps<"span"> & {
43
+ style?: CSSProperties & DynamicNotificationKnobStyle;
44
+ };
45
+ /** Breathing orb marking assistant activity; dynamic-notification.css animates it. */
46
+ declare function DynamicNotificationIndicator({ className, ...props }: DynamicNotificationIndicatorProps): import("react").JSX.Element;
47
+ type DynamicNotificationContentProps = ComponentProps<"div"> & {
48
+ style?: CSSProperties & DynamicNotificationKnobStyle;
49
+ };
50
+ declare function DynamicNotificationContent({ className, id, ...props }: DynamicNotificationContentProps): import("react").JSX.Element;
51
+ type DynamicNotificationTitleProps = ComponentProps<"div"> & {
52
+ style?: CSSProperties & DynamicNotificationKnobStyle;
53
+ };
54
+ declare function DynamicNotificationTitle({ className, ...props }: DynamicNotificationTitleProps): import("react").JSX.Element;
55
+ type DynamicNotificationMessageProps = Omit<ComponentProps<"p">, "children"> & {
56
+ children: string;
57
+ } & {
58
+ style?: CSSProperties & DynamicNotificationKnobStyle;
59
+ };
60
+ declare function DynamicNotificationMessage({ className, children, ...props }: DynamicNotificationMessageProps): import("react").JSX.Element;
61
+ type DynamicNotificationReplyProps = ComponentProps<"form"> & {
62
+ style?: CSSProperties & DynamicNotificationKnobStyle;
63
+ };
64
+ declare function DynamicNotificationReply({ className, onSubmit, ...props }: DynamicNotificationReplyProps): import("react").JSX.Element;
65
+ type DynamicNotificationReplyInputProps = ComponentProps<"input"> & {
66
+ style?: CSSProperties & DynamicNotificationKnobStyle;
67
+ };
68
+ declare function DynamicNotificationReplyInput({ className, onChange, disabled, ...props }: DynamicNotificationReplyInputProps): import("react").JSX.Element;
69
+ type DynamicNotificationReplySubmitProps = ComponentProps<typeof Button>;
70
+ declare function DynamicNotificationReplySubmit({ className, disabled, children, ...props }: DynamicNotificationReplySubmitProps): import("react").JSX.Element;
71
+ type DynamicNotificationCloseProps = ComponentProps<typeof Button>;
72
+ declare function DynamicNotificationClose({ className, children, onClick, ...props }: DynamicNotificationCloseProps): import("react").JSX.Element;
73
+ //#endregion
74
+ export { DynamicNotification, DynamicNotificationClose, DynamicNotificationCloseProps, DynamicNotificationContent, DynamicNotificationContentProps, DynamicNotificationGlass, DynamicNotificationGlassProps, DynamicNotificationIndicator, DynamicNotificationIndicatorProps, DynamicNotificationIsland, DynamicNotificationIslandProps, DynamicNotificationLiquid, DynamicNotificationLiquidProps, DynamicNotificationMessage, DynamicNotificationMessageProps, DynamicNotificationPill, DynamicNotificationPillProps, DynamicNotificationReply, DynamicNotificationReplyInput, DynamicNotificationReplyInputProps, DynamicNotificationReplyProps, DynamicNotificationReplySubmit, DynamicNotificationReplySubmitProps, DynamicNotificationState, DynamicNotificationTitle, DynamicNotificationTitleProps, useDynamicNotificationContext };
@@ -0,0 +1,342 @@
1
+ "use client";
2
+ import { cn } from "./lib/cn.js";
3
+ import { Button } from "./ui/button.js";
4
+ import { createDynamicNotificationGlass } from "./dynamic-notification-glass.js";
5
+ import { createDynamicNotificationLiquid } from "./dynamic-notification-liquid.js";
6
+ import { useDynamicNotification } from "./hooks/use-dynamic-notification.js";
7
+ import { createContext, useContext, useEffect, useId, useMemo, useRef } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ //#region src/dynamic-notification.tsx
10
+ const DynamicNotificationShellContext = createContext(null);
11
+ const DynamicNotificationReplyContext = createContext(null);
12
+ function resolveNotificationState(open, loading) {
13
+ if (!open) return "collapsed";
14
+ if (loading) return "thinking";
15
+ return "expanded";
16
+ }
17
+ function useDynamicNotificationShellContext() {
18
+ const context = useContext(DynamicNotificationShellContext);
19
+ if (!context) throw new Error("DynamicNotification compound components must be rendered inside <DynamicNotification>.");
20
+ return context;
21
+ }
22
+ function useDynamicNotificationReplyContext() {
23
+ const context = useContext(DynamicNotificationReplyContext);
24
+ if (!context) throw new Error("DynamicNotification reply components must be rendered inside <DynamicNotification>.");
25
+ return context;
26
+ }
27
+ function useDynamicNotificationContext() {
28
+ const shell = useDynamicNotificationShellContext();
29
+ const reply = useDynamicNotificationReplyContext();
30
+ return {
31
+ ...shell,
32
+ ...reply
33
+ };
34
+ }
35
+ function DynamicNotification({ open, defaultOpen, onOpenChange, loading = false, replyValue, defaultReplyValue, onReplyValueChange, onReply, variant = "surface", disabled = false, className, children, ...props }) {
36
+ const notification = useDynamicNotification({
37
+ open,
38
+ defaultOpen,
39
+ onOpenChange,
40
+ replyValue,
41
+ defaultReplyValue,
42
+ onReplyValueChange,
43
+ onReply,
44
+ disabled
45
+ });
46
+ const contentId = useId();
47
+ const state = resolveNotificationState(notification.open, loading);
48
+ const shellContext = useMemo(() => ({
49
+ open: notification.open,
50
+ disabled: notification.disabled,
51
+ setOpen: notification.setOpen,
52
+ state,
53
+ variant,
54
+ contentId
55
+ }), [
56
+ notification.open,
57
+ notification.disabled,
58
+ notification.setOpen,
59
+ state,
60
+ variant,
61
+ contentId
62
+ ]);
63
+ const replyContext = useMemo(() => ({
64
+ reply: notification.reply,
65
+ setReply: notification.setReply,
66
+ normalizedReply: notification.normalizedReply,
67
+ canSubmit: notification.canSubmit,
68
+ clear: notification.clear,
69
+ submitReply: notification.submitReply,
70
+ handleReplySubmit: notification.handleReplySubmit
71
+ }), [
72
+ notification.reply,
73
+ notification.setReply,
74
+ notification.normalizedReply,
75
+ notification.canSubmit,
76
+ notification.clear,
77
+ notification.submitReply,
78
+ notification.handleReplySubmit
79
+ ]);
80
+ return /* @__PURE__ */ jsx(DynamicNotificationShellContext.Provider, {
81
+ value: shellContext,
82
+ children: /* @__PURE__ */ jsx(DynamicNotificationReplyContext.Provider, {
83
+ value: replyContext,
84
+ children: /* @__PURE__ */ jsx("div", {
85
+ "data-control-ui": "dynamic-notification",
86
+ "data-control-family": "dynamic-notification",
87
+ "data-slot": "root",
88
+ "data-state": state,
89
+ "data-variant": variant,
90
+ className: cn("relative flex w-full justify-center", className),
91
+ ...props,
92
+ children
93
+ })
94
+ })
95
+ });
96
+ }
97
+ function DynamicNotificationIsland({ className, onKeyDown, ...props }) {
98
+ const { open, setOpen, state, variant } = useDynamicNotificationShellContext();
99
+ function handleKeyDown(event) {
100
+ onKeyDown?.(event);
101
+ if (event.defaultPrevented) return;
102
+ if (event.key === "Escape" && open) setOpen(false, "escape-key", event.nativeEvent, event.currentTarget);
103
+ }
104
+ return /* @__PURE__ */ jsx("section", {
105
+ "aria-label": "Assistant notification",
106
+ "aria-busy": state === "thinking" || void 0,
107
+ "data-control-ui": "dynamic-notification",
108
+ "data-control-family": "dynamic-notification",
109
+ "data-slot": "island",
110
+ "data-state": state,
111
+ "data-variant": variant,
112
+ onKeyDown: handleKeyDown,
113
+ className: cn("relative isolate overflow-hidden", className),
114
+ ...props
115
+ });
116
+ }
117
+ /** Optional upgrade for variant="glass" — CSS fallback stays underneath. */
118
+ function DynamicNotificationGlass({ className, ...props }) {
119
+ const canvasRef = useRef(null);
120
+ useEffect(() => {
121
+ const canvas = canvasRef.current;
122
+ if (!canvas) return;
123
+ return createDynamicNotificationGlass(canvas);
124
+ }, []);
125
+ return /* @__PURE__ */ jsx("canvas", {
126
+ ref: canvasRef,
127
+ "aria-hidden": "true",
128
+ tabIndex: -1,
129
+ "data-control-ui": "dynamic-notification",
130
+ "data-control-family": "dynamic-notification",
131
+ "data-slot": "glass",
132
+ className: cn("pointer-events-none absolute inset-0 -z-10 size-full", className),
133
+ ...props
134
+ });
135
+ }
136
+ /** WebGL transmits nearest scene through surface while keeping distortion concentrated at its edge. */
137
+ function DynamicNotificationLiquid({ className, ...props }) {
138
+ const canvasRef = useRef(null);
139
+ useEffect(() => {
140
+ const canvas = canvasRef.current;
141
+ if (!canvas) return;
142
+ return createDynamicNotificationLiquid(canvas);
143
+ }, []);
144
+ return /* @__PURE__ */ jsx("canvas", {
145
+ ref: canvasRef,
146
+ "aria-hidden": "true",
147
+ tabIndex: -1,
148
+ "data-control-ui": "dynamic-notification",
149
+ "data-control-family": "dynamic-notification",
150
+ "data-slot": "liquid",
151
+ className: cn("pointer-events-none absolute inset-0 -z-10 size-full", className),
152
+ ...props
153
+ });
154
+ }
155
+ function DynamicNotificationPill({ className, children, onClick, ...props }) {
156
+ const { contentId, disabled, open, setOpen } = useDynamicNotificationShellContext();
157
+ function handleClick(event) {
158
+ onClick?.(event);
159
+ if (event.defaultPrevented) return;
160
+ setOpen(true, "trigger-press", event.nativeEvent, event.currentTarget);
161
+ }
162
+ return /* @__PURE__ */ jsx("button", {
163
+ type: "button",
164
+ "aria-expanded": open,
165
+ "aria-controls": contentId,
166
+ inert: open,
167
+ "data-control-ui": "dynamic-notification",
168
+ "data-control-family": "dynamic-notification",
169
+ "data-slot": "pill",
170
+ onClick: handleClick,
171
+ disabled,
172
+ className: cn("absolute inset-0 flex cursor-pointer items-center justify-center", className),
173
+ ...props,
174
+ children
175
+ });
176
+ }
177
+ /** Breathing orb marking assistant activity; dynamic-notification.css animates it. */
178
+ function DynamicNotificationIndicator({ className, ...props }) {
179
+ return /* @__PURE__ */ jsx("span", {
180
+ "aria-hidden": "true",
181
+ "data-control-ui": "dynamic-notification",
182
+ "data-control-family": "dynamic-notification",
183
+ "data-slot": "indicator",
184
+ className: cn("shrink-0", className),
185
+ ...props
186
+ });
187
+ }
188
+ function DynamicNotificationContent({ className, id, ...props }) {
189
+ const { contentId, state } = useDynamicNotificationShellContext();
190
+ return /* @__PURE__ */ jsx("div", {
191
+ id: id ?? contentId,
192
+ inert: state !== "expanded",
193
+ "data-control-ui": "dynamic-notification",
194
+ "data-control-family": "dynamic-notification",
195
+ "data-slot": "content",
196
+ className: cn("flex flex-col", className),
197
+ ...props
198
+ });
199
+ }
200
+ function DynamicNotificationTitle({ className, ...props }) {
201
+ return /* @__PURE__ */ jsx("div", {
202
+ "data-control-ui": "dynamic-notification",
203
+ "data-control-family": "dynamic-notification",
204
+ "data-slot": "title",
205
+ className: cn("flex-1", className),
206
+ ...props
207
+ });
208
+ }
209
+ function DynamicNotificationMessage({ className, children, ...props }) {
210
+ return /* @__PURE__ */ jsx("p", {
211
+ "aria-live": "polite",
212
+ "data-control-ui": "dynamic-notification",
213
+ "data-control-family": "dynamic-notification",
214
+ "data-slot": "message",
215
+ className,
216
+ ...props,
217
+ children: /* @__PURE__ */ jsx(DynamicNotificationWords, { text: children }, children)
218
+ });
219
+ }
220
+ function DynamicNotificationWords({ text }) {
221
+ let wordIndex = 0;
222
+ return text.split(/(\s+)/).map((part, position) => {
223
+ if (part.length === 0 || /^\s+$/.test(part)) return part;
224
+ const style = { "--_dynamic-notification-word-index": `${wordIndex}` };
225
+ wordIndex += 1;
226
+ return /* @__PURE__ */ jsx("span", {
227
+ "data-control-ui": "dynamic-notification",
228
+ "data-control-family": "dynamic-notification",
229
+ "data-slot": "word",
230
+ style,
231
+ children: part
232
+ }, position);
233
+ });
234
+ }
235
+ function DynamicNotificationReply({ className, onSubmit, ...props }) {
236
+ const { handleReplySubmit } = useDynamicNotificationReplyContext();
237
+ function handleSubmit(event) {
238
+ onSubmit?.(event);
239
+ if (event.defaultPrevented) return;
240
+ handleReplySubmit(event);
241
+ }
242
+ return /* @__PURE__ */ jsx("form", {
243
+ "data-control-ui": "dynamic-notification",
244
+ "data-control-family": "dynamic-notification",
245
+ "data-slot": "reply",
246
+ onSubmit: handleSubmit,
247
+ className: cn("flex items-center", className),
248
+ ...props
249
+ });
250
+ }
251
+ function DynamicNotificationReplyInput({ className, onChange, disabled, ...props }) {
252
+ const { disabled: contextDisabled, state } = useDynamicNotificationShellContext();
253
+ const { reply, setReply } = useDynamicNotificationReplyContext();
254
+ const inputRef = useRef(null);
255
+ useEffect(() => {
256
+ if (state !== "expanded") return;
257
+ const frame = requestAnimationFrame(() => inputRef.current?.focus({ preventScroll: true }));
258
+ return () => cancelAnimationFrame(frame);
259
+ }, [state]);
260
+ function handleChange(event) {
261
+ onChange?.(event);
262
+ if (!event.defaultPrevented) setReply(event.currentTarget.value);
263
+ }
264
+ return /* @__PURE__ */ jsx("input", {
265
+ ref: inputRef,
266
+ type: "text",
267
+ "aria-label": "Reply",
268
+ "data-control-ui": "dynamic-notification",
269
+ "data-control-family": "dynamic-notification",
270
+ "data-slot": "reply-input",
271
+ value: reply,
272
+ onChange: handleChange,
273
+ disabled: disabled ?? contextDisabled,
274
+ className: cn("min-w-0 flex-1 disabled:cursor-not-allowed", className),
275
+ ...props
276
+ });
277
+ }
278
+ function DynamicNotificationReplySubmit({ className, disabled, children, ...props }) {
279
+ const { canSubmit } = useDynamicNotificationReplyContext();
280
+ return /* @__PURE__ */ jsx(Button, {
281
+ "data-control-ui": "dynamic-notification",
282
+ "data-dynamic-notification-submit": "true",
283
+ "data-slot": "reply-submit",
284
+ type: "submit",
285
+ variant: "solid",
286
+ size: "lg",
287
+ iconOnly: true,
288
+ shape: "circle",
289
+ "aria-label": "Send reply",
290
+ disabled: disabled ?? !canSubmit,
291
+ className: cn("shrink-0", className),
292
+ ...props,
293
+ children: children ?? /* @__PURE__ */ jsx("svg", {
294
+ viewBox: "0 0 16 16",
295
+ className: "size-4",
296
+ "aria-hidden": "true",
297
+ fill: "none",
298
+ children: /* @__PURE__ */ jsx("path", {
299
+ d: "M8 12.5v-9M4 7l4-3.5L12 7",
300
+ stroke: "currentColor",
301
+ strokeWidth: "1.6",
302
+ strokeLinecap: "round",
303
+ strokeLinejoin: "round"
304
+ })
305
+ })
306
+ });
307
+ }
308
+ function DynamicNotificationClose({ className, children, onClick, ...props }) {
309
+ const { setOpen } = useDynamicNotificationShellContext();
310
+ function handleClick(event) {
311
+ onClick?.(event);
312
+ if (event.defaultPrevented) return;
313
+ setOpen(false, "close-press", event.nativeEvent, event.currentTarget);
314
+ }
315
+ return /* @__PURE__ */ jsx(Button, {
316
+ "data-control-ui": "dynamic-notification",
317
+ "data-dynamic-notification-close": "true",
318
+ "data-slot": "close",
319
+ variant: "quiet",
320
+ size: "sm",
321
+ iconOnly: true,
322
+ shape: "circle",
323
+ "aria-label": "Dismiss",
324
+ onClick: handleClick,
325
+ className: cn("shrink-0", className),
326
+ ...props,
327
+ children: children ?? /* @__PURE__ */ jsx("svg", {
328
+ viewBox: "0 0 16 16",
329
+ className: "size-3.5",
330
+ "aria-hidden": "true",
331
+ fill: "none",
332
+ children: /* @__PURE__ */ jsx("path", {
333
+ d: "M4 4 12 12M12 4 4 12",
334
+ stroke: "currentColor",
335
+ strokeWidth: "1.4",
336
+ strokeLinecap: "round"
337
+ })
338
+ })
339
+ });
340
+ }
341
+ //#endregion
342
+ export { DynamicNotification, DynamicNotificationClose, DynamicNotificationContent, DynamicNotificationGlass, DynamicNotificationIndicator, DynamicNotificationIsland, DynamicNotificationLiquid, DynamicNotificationMessage, DynamicNotificationPill, DynamicNotificationReply, DynamicNotificationReplyInput, DynamicNotificationReplySubmit, DynamicNotificationTitle, useDynamicNotificationContext };
@@ -0,0 +1,124 @@
1
+ import { Button } from "./ui/button.js";
2
+ import { EnvironmentVariableRow, EnvironmentVariablesController, UseEnvironmentVariablesOptions } from "./hooks/use-environment-variables.js";
3
+ import { EnvironmentVariablesKnobStyle } from "./knob-contracts/environment-variables-knobs.js";
4
+ import { CSSProperties, ComponentProps, ReactNode } from "react";
5
+ //#region src/environment-variables.d.ts
6
+ type EnvironmentVariablesRowErrors = Record<number, {
7
+ key?: ReactNode;
8
+ value?: ReactNode;
9
+ }>;
10
+ type EnvironmentVariablesSubmitPayload<TRow extends EnvironmentVariableRow = EnvironmentVariableRow> = {
11
+ rows: TRow[];
12
+ variables: Record<string, string>;
13
+ envFileText: string;
14
+ reset: () => void;
15
+ };
16
+ type EnvironmentVariablesRootProps<TRow extends EnvironmentVariableRow = EnvironmentVariableRow> = Omit<ComponentProps<"form">, "onSubmit"> & {
17
+ editor: EnvironmentVariablesController<TRow>;
18
+ disabled?: boolean;
19
+ readOnly?: boolean;
20
+ rowErrors?: EnvironmentVariablesRowErrors;
21
+ keyLabel?: ReactNode;
22
+ valueLabel?: ReactNode;
23
+ keyPlaceholder?: string;
24
+ valuePlaceholder?: string;
25
+ duplicateKeyMessage?: ReactNode;
26
+ onSubmit?: (payload: EnvironmentVariablesSubmitPayload<TRow>) => void | Promise<void>;
27
+ } & {
28
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
29
+ };
30
+ declare function EnvironmentVariablesRoot<TRow extends EnvironmentVariableRow = EnvironmentVariableRow>({ editor, disabled, readOnly, rowErrors, keyLabel, valueLabel, keyPlaceholder, valuePlaceholder, duplicateKeyMessage, onSubmit, className, children, ...props }: EnvironmentVariablesRootProps<TRow>): import("react").JSX.Element;
31
+ type EnvironmentVariablesProps<TRow extends EnvironmentVariableRow = EnvironmentVariableRow> = Omit<EnvironmentVariablesRootProps<TRow>, "editor"> & UseEnvironmentVariablesOptions<TRow> & {
32
+ editor?: EnvironmentVariablesController<TRow>;
33
+ title?: ReactNode;
34
+ description?: ReactNode;
35
+ error?: ReactNode;
36
+ submitLabel?: ReactNode;
37
+ resetLabel?: ReactNode;
38
+ addLabel?: ReactNode;
39
+ hideDefaultActions?: boolean;
40
+ };
41
+ declare function EnvironmentVariablesComponent<TRow extends EnvironmentVariableRow = EnvironmentVariableRow>({ editor: providedEditor, initialRows, rows, onRowsChange, createDefaultRow, createRow, getEditableRows, getPreservedRows, maxUploadSize, title, description, error, submitLabel, resetLabel, addLabel, hideDefaultActions, children, onSubmit, ...props }: EnvironmentVariablesProps<TRow>): import("react").JSX.Element;
42
+ type EnvironmentVariablesHeaderProps = ComponentProps<"div"> & {
43
+ title?: ReactNode;
44
+ description?: ReactNode;
45
+ } & {
46
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
47
+ };
48
+ declare function EnvironmentVariablesHeader({ title, description, className, children, ...props }: EnvironmentVariablesHeaderProps): import("react").JSX.Element | null;
49
+ type EnvironmentVariablesToolbarProps = ComponentProps<"div"> & {
50
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
51
+ };
52
+ declare function EnvironmentVariablesToolbar({ className, children, ...props }: EnvironmentVariablesToolbarProps): import("react").JSX.Element | null;
53
+ type EnvironmentVariablesUploadButtonProps = ComponentProps<typeof Button> & {
54
+ inputLabel?: string;
55
+ };
56
+ declare function EnvironmentVariablesUploadButton({ inputLabel, children, variant, size, disabled, onClick, ...props }: EnvironmentVariablesUploadButtonProps): import("react").JSX.Element;
57
+ type EnvironmentVariablesRowsProps = ComponentProps<"div"> & {
58
+ rowErrors?: EnvironmentVariablesRowErrors;
59
+ } & {
60
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
61
+ };
62
+ declare function EnvironmentVariablesRows({ rowErrors, className, children, ...props }: EnvironmentVariablesRowsProps): import("react").JSX.Element;
63
+ type EnvironmentVariablesRowProps = Omit<ComponentProps<"div">, "children"> & {
64
+ row: EnvironmentVariableRow;
65
+ index: number;
66
+ rowErrors?: EnvironmentVariablesRowErrors;
67
+ } & {
68
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
69
+ };
70
+ declare function EnvironmentVariablesRow({ row, index, rowErrors, className, ...props }: EnvironmentVariablesRowProps): import("react").JSX.Element;
71
+ type EnvironmentVariablesAddButtonProps = ComponentProps<typeof Button>;
72
+ declare function EnvironmentVariablesAddButton({ children, variant, size, disabled, onClick, ...props }: EnvironmentVariablesAddButtonProps): import("react").JSX.Element | null;
73
+ type EnvironmentVariablesResetButtonProps = ComponentProps<typeof Button>;
74
+ declare function EnvironmentVariablesResetButton({ children, variant, size, disabled, onClick, ...props }: EnvironmentVariablesResetButtonProps): import("react").JSX.Element | null;
75
+ type EnvironmentVariablesSubmitButtonProps = ComponentProps<typeof Button>;
76
+ declare function EnvironmentVariablesSubmitButton({ children, variant, tone, size, disabled, ...props }: EnvironmentVariablesSubmitButtonProps): import("react").JSX.Element | null;
77
+ type EnvironmentVariablesActionsProps = ComponentProps<"div"> & {
78
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
79
+ };
80
+ declare function EnvironmentVariablesActions({ className, ...props }: EnvironmentVariablesActionsProps): import("react").JSX.Element;
81
+ type EnvironmentVariablesMessageProps = Omit<ComponentProps<"div">, "style"> & {
82
+ error?: ReactNode;
83
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
84
+ };
85
+ declare function EnvironmentVariablesMessage({ error, className, children, ...props }: EnvironmentVariablesMessageProps): import("react").JSX.Element | null;
86
+ type EnvironmentVariablesDuplicateKeysErrorProps = Omit<EnvironmentVariablesMessageProps, "error"> & {
87
+ message?: ReactNode;
88
+ };
89
+ declare function EnvironmentVariablesDuplicateKeysError({ message, ...props }: EnvironmentVariablesDuplicateKeysErrorProps): import("react").JSX.Element | null;
90
+ type EnvironmentVariablesUploadErrorProps = Omit<EnvironmentVariablesMessageProps, "error">;
91
+ declare function EnvironmentVariablesUploadError(props: EnvironmentVariablesUploadErrorProps): import("react").JSX.Element;
92
+ type EnvironmentVariablesReadOnlyListProps = ComponentProps<"div"> & {
93
+ rows?: readonly EnvironmentVariableRow[];
94
+ emptyMessage?: ReactNode;
95
+ } & {
96
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
97
+ };
98
+ declare function EnvironmentVariablesReadOnlyList({ rows, emptyMessage, className, children, ...props }: EnvironmentVariablesReadOnlyListProps): import("react").JSX.Element;
99
+ type EnvironmentVariablesReadOnlyItemProps = Omit<ComponentProps<"div">, "style"> & {
100
+ name: ReactNode;
101
+ value?: ReactNode;
102
+ revealed?: boolean;
103
+ style?: CSSProperties & EnvironmentVariablesKnobStyle;
104
+ };
105
+ declare function EnvironmentVariablesReadOnlyItem({ name, value, revealed, className, ...props }: EnvironmentVariablesReadOnlyItemProps): import("react").JSX.Element;
106
+ declare const EnvironmentVariables: typeof EnvironmentVariablesComponent & {
107
+ Root: typeof EnvironmentVariablesRoot;
108
+ Header: typeof EnvironmentVariablesHeader;
109
+ Toolbar: typeof EnvironmentVariablesToolbar;
110
+ UploadButton: typeof EnvironmentVariablesUploadButton;
111
+ UploadError: typeof EnvironmentVariablesUploadError;
112
+ Rows: typeof EnvironmentVariablesRows;
113
+ Row: typeof EnvironmentVariablesRow;
114
+ AddButton: typeof EnvironmentVariablesAddButton;
115
+ ResetButton: typeof EnvironmentVariablesResetButton;
116
+ SubmitButton: typeof EnvironmentVariablesSubmitButton;
117
+ Actions: typeof EnvironmentVariablesActions;
118
+ Message: typeof EnvironmentVariablesMessage;
119
+ DuplicateKeysError: typeof EnvironmentVariablesDuplicateKeysError;
120
+ ReadOnlyList: typeof EnvironmentVariablesReadOnlyList;
121
+ ReadOnlyItem: typeof EnvironmentVariablesReadOnlyItem;
122
+ };
123
+ //#endregion
124
+ export { EnvironmentVariables, EnvironmentVariablesActions, EnvironmentVariablesActionsProps, EnvironmentVariablesAddButton, EnvironmentVariablesAddButtonProps, EnvironmentVariablesDuplicateKeysError, EnvironmentVariablesDuplicateKeysErrorProps, EnvironmentVariablesHeader, EnvironmentVariablesHeaderProps, EnvironmentVariablesMessage, EnvironmentVariablesMessageProps, EnvironmentVariablesProps, EnvironmentVariablesReadOnlyItem, EnvironmentVariablesReadOnlyItemProps, EnvironmentVariablesReadOnlyList, EnvironmentVariablesReadOnlyListProps, EnvironmentVariablesResetButton, EnvironmentVariablesResetButtonProps, EnvironmentVariablesRoot, EnvironmentVariablesRootProps, EnvironmentVariablesRow, EnvironmentVariablesRowErrors, EnvironmentVariablesRowProps, EnvironmentVariablesRows, EnvironmentVariablesRowsProps, EnvironmentVariablesSubmitButton, EnvironmentVariablesSubmitButtonProps, EnvironmentVariablesSubmitPayload, EnvironmentVariablesToolbar, EnvironmentVariablesToolbarProps, EnvironmentVariablesUploadButton, EnvironmentVariablesUploadButtonProps, EnvironmentVariablesUploadError, EnvironmentVariablesUploadErrorProps };