@vritti/quantum-ui 0.3.8 → 0.3.11

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 (455) hide show
  1. package/dist/Avatar.js +5 -5
  2. package/dist/BarChart.js +1 -9
  3. package/dist/BarChart.js.map +1 -1
  4. package/dist/Breadcrumb.js +1 -1
  5. package/dist/Breadcrumb.js.map +1 -1
  6. package/dist/Button.js +14 -6
  7. package/dist/Button.js.map +1 -1
  8. package/dist/Checkbox2.js +5 -5
  9. package/dist/CheckboxGroup.js +64 -6
  10. package/dist/CheckboxGroup.js.map +1 -1
  11. package/dist/Collapsible.js +1 -1
  12. package/dist/Collapsible.js.map +1 -1
  13. package/dist/ConfirmHost.js +5 -17
  14. package/dist/ConfirmHost.js.map +1 -1
  15. package/dist/CurrencyField.js +1 -1
  16. package/dist/CurrencyFilter.js.map +1 -1
  17. package/dist/DateRangePicker.js +4 -2
  18. package/dist/DateRangePicker.js.map +1 -1
  19. package/dist/DateTimePicker.js +1 -1
  20. package/dist/DateTimeRangePicker.js +4 -2
  21. package/dist/DateTimeRangePicker.js.map +1 -1
  22. package/dist/DetailSectionSkeleton.js +14 -1
  23. package/dist/DetailSectionSkeleton.js.map +1 -1
  24. package/dist/Dialog.js +1 -1
  25. package/dist/Dialog.js.map +1 -1
  26. package/dist/ErrorBoundary.js +1 -108
  27. package/dist/ErrorBoundary.js.map +1 -1
  28. package/dist/FilePreview.js +1 -145
  29. package/dist/FilePreview.js.map +1 -1
  30. package/dist/HierarchyGraph.js +12 -8
  31. package/dist/HierarchyGraph.js.map +1 -1
  32. package/dist/IconSelect.js +31393 -0
  33. package/dist/IconSelect.js.map +1 -0
  34. package/dist/Kbd.js +11 -19
  35. package/dist/Kbd.js.map +1 -1
  36. package/dist/LocationSelector.js +13 -15
  37. package/dist/LocationSelector.js.map +1 -1
  38. package/dist/OTPField.js +1 -12
  39. package/dist/OTPField.js.map +1 -1
  40. package/dist/PageContent.js.map +1 -1
  41. package/dist/PageHeaderSkeleton.js +1 -1
  42. package/dist/PageHeaderSkeleton.js.map +1 -1
  43. package/dist/PermissionGate.js +31 -0
  44. package/dist/PermissionGate.js.map +1 -0
  45. package/dist/PieChart.js.map +1 -1
  46. package/dist/Progress.js +2 -2
  47. package/dist/QuantSelector.js.map +1 -1
  48. package/dist/RadialChart.js.map +1 -1
  49. package/dist/RadioGroup.js +7 -7
  50. package/dist/Select.js +32 -188
  51. package/dist/Select.js.map +1 -1
  52. package/dist/SerialSelector.js +13 -15
  53. package/dist/SerialSelector.js.map +1 -1
  54. package/dist/Sidebar.js +8 -19
  55. package/dist/Sidebar.js.map +1 -1
  56. package/dist/Sonner.js +2 -17
  57. package/dist/Sonner.js.map +1 -1
  58. package/dist/SupplierItemSelector.js.map +1 -1
  59. package/dist/Switch.js +7 -5
  60. package/dist/Switch.js.map +1 -1
  61. package/dist/TabsSkeleton.js +49 -23
  62. package/dist/TabsSkeleton.js.map +1 -1
  63. package/dist/ThemeToggle.js +1 -41
  64. package/dist/ThemeToggle.js.map +1 -1
  65. package/dist/Toggle.js +1 -1
  66. package/dist/Tooltip.js +19 -0
  67. package/dist/Tooltip.js.map +1 -0
  68. package/dist/UomSelector.js +6 -1
  69. package/dist/UomSelector.js.map +1 -1
  70. package/dist/UploadFile.js +1 -35
  71. package/dist/UploadFile.js.map +1 -1
  72. package/dist/ValueFilter.js.map +1 -1
  73. package/dist/ViewTabs.js +1 -16
  74. package/dist/ViewTabs.js.map +1 -1
  75. package/dist/assets/quantum-ui.css +109 -4
  76. package/dist/calendar2.js +2 -13
  77. package/dist/calendar2.js.map +1 -1
  78. package/dist/check-check.js +18 -0
  79. package/dist/check-check.js.map +1 -0
  80. package/dist/chevron-left.js +15 -0
  81. package/dist/chevron-left.js.map +1 -0
  82. package/dist/circle-question-mark.js +19 -0
  83. package/dist/circle-question-mark.js.map +1 -0
  84. package/dist/circle-x.js +19 -0
  85. package/dist/circle-x.js.map +1 -0
  86. package/dist/circle.js +15 -0
  87. package/dist/circle.js.map +1 -0
  88. package/dist/components/DataTable.js +1 -1
  89. package/dist/components/DetailField.js +1 -1
  90. package/dist/components/FormattedDate.js.map +1 -1
  91. package/dist/components/PermissionGate.js +2 -0
  92. package/dist/components/PermissionGate.js.map +1 -0
  93. package/dist/components/RichTextEditor.js +1 -1
  94. package/dist/components/ScanBarcodeButton.js +1 -20
  95. package/dist/components/ScanBarcodeButton.js.map +1 -1
  96. package/dist/components/Switch.js +1 -1
  97. package/dist/components/Tooltip.js +2 -0
  98. package/dist/components/Tooltip.js.map +1 -0
  99. package/dist/components/TreeView.js +4 -4
  100. package/dist/dot.js +15 -0
  101. package/dist/dot.js.map +1 -0
  102. package/dist/dropdown-menu.js +11 -22
  103. package/dist/dropdown-menu.js.map +1 -1
  104. package/dist/file.js +148 -0
  105. package/dist/file.js.map +1 -0
  106. package/dist/globe.js +19 -0
  107. package/dist/globe.js.map +1 -0
  108. package/dist/icons.js +21 -0
  109. package/dist/icons.js.map +1 -0
  110. package/dist/image-component.js +37 -96
  111. package/dist/image-component.js.map +1 -1
  112. package/dist/index.js +7 -4
  113. package/dist/index.js.map +1 -1
  114. package/dist/index12.js +7 -7
  115. package/dist/index13.js +7 -7
  116. package/dist/index14.js +11 -11
  117. package/dist/index15.js +1 -1
  118. package/dist/index16.js +1 -1
  119. package/dist/index17.js +168 -175
  120. package/dist/index17.js.map +1 -1
  121. package/dist/index18.js +173 -201
  122. package/dist/index18.js.map +1 -1
  123. package/dist/index19.js +203 -69
  124. package/dist/index19.js.map +1 -1
  125. package/dist/index20.js +70 -211
  126. package/dist/index20.js.map +1 -1
  127. package/dist/index21.js +206 -116
  128. package/dist/index21.js.map +1 -1
  129. package/dist/index22.js +122 -70
  130. package/dist/index22.js.map +1 -1
  131. package/dist/index23.js +74 -11
  132. package/dist/index23.js.map +1 -1
  133. package/dist/index24.js +13 -1134
  134. package/dist/index24.js.map +1 -1
  135. package/dist/index25.js +1120 -219
  136. package/dist/index25.js.map +1 -1
  137. package/dist/index26.js +202 -2506
  138. package/dist/index26.js.map +1 -1
  139. package/dist/index27.js +2527 -23
  140. package/dist/index27.js.map +1 -1
  141. package/dist/index28.js +32 -4
  142. package/dist/index28.js.map +1 -1
  143. package/dist/index29.js +3 -1124
  144. package/dist/index29.js.map +1 -1
  145. package/dist/index30.js +1123 -35
  146. package/dist/index30.js.map +1 -1
  147. package/dist/index31.js +36 -310
  148. package/dist/index31.js.map +1 -1
  149. package/dist/index32.js +309 -7
  150. package/dist/index32.js.map +1 -1
  151. package/dist/index33.js +8 -30
  152. package/dist/index33.js.map +1 -1
  153. package/dist/index34.js +29 -59
  154. package/dist/index34.js.map +1 -1
  155. package/dist/index35.js +59 -10
  156. package/dist/index35.js.map +1 -1
  157. package/dist/index36.js +10 -35
  158. package/dist/index36.js.map +1 -1
  159. package/dist/index37.js +27 -36809
  160. package/dist/index37.js.map +1 -1
  161. package/dist/index38.js +35362 -70
  162. package/dist/index38.js.map +1 -1
  163. package/dist/index39.js +72 -187
  164. package/dist/index39.js.map +1 -1
  165. package/dist/index4.js +5 -5
  166. package/dist/index40.js +199 -0
  167. package/dist/index40.js.map +1 -0
  168. package/dist/lib/components/BarChart/BarChart.d.ts.map +1 -1
  169. package/dist/lib/components/Button/Button.d.ts +1 -0
  170. package/dist/lib/components/Button/Button.d.ts.map +1 -1
  171. package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts +1 -0
  172. package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  173. package/dist/lib/components/Collapsible/Collapsible.d.ts.map +1 -1
  174. package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts +3 -0
  175. package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts.map +1 -1
  176. package/dist/lib/components/DataTable/components/RowActions.d.ts +1 -0
  177. package/dist/lib/components/DataTable/components/RowActions.d.ts.map +1 -1
  178. package/dist/lib/components/DataTable/index.d.ts +2 -2
  179. package/dist/lib/components/DataTable/index.d.ts.map +1 -1
  180. package/dist/lib/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  181. package/dist/lib/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  182. package/dist/lib/components/DetailField/DetailHeader.d.ts +10 -0
  183. package/dist/lib/components/DetailField/DetailHeader.d.ts.map +1 -0
  184. package/dist/lib/components/DetailField/index.d.ts +1 -0
  185. package/dist/lib/components/DetailField/index.d.ts.map +1 -1
  186. package/dist/lib/components/Dialog/Dialog.d.ts.map +1 -1
  187. package/dist/lib/components/Editor/context/editor-config-context.d.ts +2 -2
  188. package/dist/lib/components/Editor/context/editor-config-context.d.ts.map +1 -1
  189. package/dist/lib/components/Editor/context/toolbar-context.d.ts +1 -1
  190. package/dist/lib/components/Editor/context/toolbar-context.d.ts.map +1 -1
  191. package/dist/lib/components/Editor/editor-hooks/use-debounce.d.ts.map +1 -1
  192. package/dist/lib/components/Editor/editor-hooks/use-modal.d.ts.map +1 -1
  193. package/dist/lib/components/Editor/editor-hooks/use-update-toolbar.d.ts.map +1 -1
  194. package/dist/lib/components/Editor/editor-ui/button-group.d.ts +3 -3
  195. package/dist/lib/components/Editor/editor-ui/button-group.d.ts.map +1 -1
  196. package/dist/lib/components/Editor/editor-ui/button.d.ts +2 -2
  197. package/dist/lib/components/Editor/editor-ui/button.d.ts.map +1 -1
  198. package/dist/lib/components/Editor/editor-ui/code-button.d.ts.map +1 -1
  199. package/dist/lib/components/Editor/editor-ui/color-picker.d.ts +8 -8
  200. package/dist/lib/components/Editor/editor-ui/color-picker.d.ts.map +1 -1
  201. package/dist/lib/components/Editor/editor-ui/command.d.ts +2 -2
  202. package/dist/lib/components/Editor/editor-ui/command.d.ts.map +1 -1
  203. package/dist/lib/components/Editor/editor-ui/content-editable.d.ts +1 -1
  204. package/dist/lib/components/Editor/editor-ui/content-editable.d.ts.map +1 -1
  205. package/dist/lib/components/Editor/editor-ui/dialog.d.ts +4 -4
  206. package/dist/lib/components/Editor/editor-ui/dialog.d.ts.map +1 -1
  207. package/dist/lib/components/Editor/editor-ui/image-component.d.ts +3 -3
  208. package/dist/lib/components/Editor/editor-ui/image-component.d.ts.map +1 -1
  209. package/dist/lib/components/Editor/editor-ui/image-resizer.d.ts +2 -2
  210. package/dist/lib/components/Editor/editor-ui/image-resizer.d.ts.map +1 -1
  211. package/dist/lib/components/Editor/editor-ui/input.d.ts +2 -2
  212. package/dist/lib/components/Editor/editor-ui/input.d.ts.map +1 -1
  213. package/dist/lib/components/Editor/editor-ui/label.d.ts +2 -2
  214. package/dist/lib/components/Editor/editor-ui/label.d.ts.map +1 -1
  215. package/dist/lib/components/Editor/editor-ui/popover.d.ts +2 -2
  216. package/dist/lib/components/Editor/editor-ui/popover.d.ts.map +1 -1
  217. package/dist/lib/components/Editor/editor-ui/scroll-area.d.ts +2 -2
  218. package/dist/lib/components/Editor/editor-ui/scroll-area.d.ts.map +1 -1
  219. package/dist/lib/components/Editor/editor-ui/select.d.ts +3 -3
  220. package/dist/lib/components/Editor/editor-ui/select.d.ts.map +1 -1
  221. package/dist/lib/components/Editor/editor-ui/separator.d.ts +2 -2
  222. package/dist/lib/components/Editor/editor-ui/separator.d.ts.map +1 -1
  223. package/dist/lib/components/Editor/editor-ui/tabs.d.ts +2 -2
  224. package/dist/lib/components/Editor/editor-ui/tabs.d.ts.map +1 -1
  225. package/dist/lib/components/Editor/editor-ui/toggle-group.d.ts +2 -2
  226. package/dist/lib/components/Editor/editor-ui/toggle-group.d.ts.map +1 -1
  227. package/dist/lib/components/Editor/editor-ui/toggle.d.ts +2 -2
  228. package/dist/lib/components/Editor/editor-ui/toggle.d.ts.map +1 -1
  229. package/dist/lib/components/Editor/editor-ui/tooltip.d.ts +2 -2
  230. package/dist/lib/components/Editor/editor-ui/tooltip.d.ts.map +1 -1
  231. package/dist/lib/components/Editor/index.d.ts.map +1 -1
  232. package/dist/lib/components/Editor/nodes/autocomplete-node.d.ts +2 -2
  233. package/dist/lib/components/Editor/nodes/autocomplete-node.d.ts.map +1 -1
  234. package/dist/lib/components/Editor/nodes/embeds/tweet-node.d.ts +2 -2
  235. package/dist/lib/components/Editor/nodes/embeds/tweet-node.d.ts.map +1 -1
  236. package/dist/lib/components/Editor/nodes/embeds/youtube-node.d.ts +1 -1
  237. package/dist/lib/components/Editor/nodes/embeds/youtube-node.d.ts.map +1 -1
  238. package/dist/lib/components/Editor/nodes/emoji-node.d.ts.map +1 -1
  239. package/dist/lib/components/Editor/nodes/image-node.d.ts +5 -5
  240. package/dist/lib/components/Editor/nodes/image-node.d.ts.map +1 -1
  241. package/dist/lib/components/Editor/nodes/keyword-node.d.ts.map +1 -1
  242. package/dist/lib/components/Editor/nodes/layout-container-node.d.ts.map +1 -1
  243. package/dist/lib/components/Editor/nodes/layout-item-node.d.ts.map +1 -1
  244. package/dist/lib/components/Editor/nodes/mention-node.d.ts +1 -1
  245. package/dist/lib/components/Editor/nodes/mention-node.d.ts.map +1 -1
  246. package/dist/lib/components/Editor/nodes/nodes.d.ts.map +1 -1
  247. package/dist/lib/components/Editor/nodes.d.ts.map +1 -1
  248. package/dist/lib/components/Editor/plugins/actions/character-limit-plugin.d.ts +2 -2
  249. package/dist/lib/components/Editor/plugins/actions/character-limit-plugin.d.ts.map +1 -1
  250. package/dist/lib/components/Editor/plugins/actions/clear-editor-plugin.d.ts.map +1 -1
  251. package/dist/lib/components/Editor/plugins/actions/counter-character-plugin.d.ts +2 -2
  252. package/dist/lib/components/Editor/plugins/actions/counter-character-plugin.d.ts.map +1 -1
  253. package/dist/lib/components/Editor/plugins/actions/edit-mode-toggle-plugin.d.ts.map +1 -1
  254. package/dist/lib/components/Editor/plugins/actions/import-export-plugin.d.ts.map +1 -1
  255. package/dist/lib/components/Editor/plugins/actions/markdown-toggle-plugin.d.ts.map +1 -1
  256. package/dist/lib/components/Editor/plugins/actions/max-length-plugin.d.ts.map +1 -1
  257. package/dist/lib/components/Editor/plugins/actions/share-content-plugin.d.ts.map +1 -1
  258. package/dist/lib/components/Editor/plugins/actions/speech-to-text-plugin.d.ts.map +1 -1
  259. package/dist/lib/components/Editor/plugins/actions/tree-view-plugin.d.ts.map +1 -1
  260. package/dist/lib/components/Editor/plugins/auto-link-plugin.d.ts.map +1 -1
  261. package/dist/lib/components/Editor/plugins/autocomplete-plugin.d.ts.map +1 -1
  262. package/dist/lib/components/Editor/plugins/code-action-menu-plugin.d.ts.map +1 -1
  263. package/dist/lib/components/Editor/plugins/code-highlight-plugin.d.ts.map +1 -1
  264. package/dist/lib/components/Editor/plugins/component-picker-menu-plugin.d.ts +1 -1
  265. package/dist/lib/components/Editor/plugins/component-picker-menu-plugin.d.ts.map +1 -1
  266. package/dist/lib/components/Editor/plugins/context-menu-plugin.d.ts.map +1 -1
  267. package/dist/lib/components/Editor/plugins/drag-drop-paste-plugin.d.ts.map +1 -1
  268. package/dist/lib/components/Editor/plugins/draggable-block-plugin.d.ts +1 -1
  269. package/dist/lib/components/Editor/plugins/draggable-block-plugin.d.ts.map +1 -1
  270. package/dist/lib/components/Editor/plugins/embeds/auto-embed-plugin.d.ts +1 -1
  271. package/dist/lib/components/Editor/plugins/embeds/auto-embed-plugin.d.ts.map +1 -1
  272. package/dist/lib/components/Editor/plugins/embeds/twitter-plugin.d.ts +1 -1
  273. package/dist/lib/components/Editor/plugins/embeds/twitter-plugin.d.ts.map +1 -1
  274. package/dist/lib/components/Editor/plugins/embeds/youtube-plugin.d.ts +1 -1
  275. package/dist/lib/components/Editor/plugins/embeds/youtube-plugin.d.ts.map +1 -1
  276. package/dist/lib/components/Editor/plugins/emoji-picker-plugin.d.ts.map +1 -1
  277. package/dist/lib/components/Editor/plugins/emojis-plugin.d.ts.map +1 -1
  278. package/dist/lib/components/Editor/plugins/floating-link-editor-plugin.d.ts.map +1 -1
  279. package/dist/lib/components/Editor/plugins/floating-text-format-plugin.d.ts.map +1 -1
  280. package/dist/lib/components/Editor/plugins/images-plugin.d.ts +4 -4
  281. package/dist/lib/components/Editor/plugins/images-plugin.d.ts.map +1 -1
  282. package/dist/lib/components/Editor/plugins/keywords-plugin.d.ts.map +1 -1
  283. package/dist/lib/components/Editor/plugins/layout-plugin.d.ts +1 -1
  284. package/dist/lib/components/Editor/plugins/layout-plugin.d.ts.map +1 -1
  285. package/dist/lib/components/Editor/plugins/link-plugin.d.ts.map +1 -1
  286. package/dist/lib/components/Editor/plugins/list-max-indent-level-plugin.d.ts +1 -1
  287. package/dist/lib/components/Editor/plugins/list-max-indent-level-plugin.d.ts.map +1 -1
  288. package/dist/lib/components/Editor/plugins/mentions-plugin.d.ts.map +1 -1
  289. package/dist/lib/components/Editor/plugins/picker/alignment-picker-plugin.d.ts +2 -2
  290. package/dist/lib/components/Editor/plugins/picker/alignment-picker-plugin.d.ts.map +1 -1
  291. package/dist/lib/components/Editor/plugins/picker/bulleted-list-picker-plugin.d.ts.map +1 -1
  292. package/dist/lib/components/Editor/plugins/picker/check-list-picker-plugin.d.ts.map +1 -1
  293. package/dist/lib/components/Editor/plugins/picker/code-picker-plugin.d.ts.map +1 -1
  294. package/dist/lib/components/Editor/plugins/picker/columns-layout-picker-plugin.d.ts.map +1 -1
  295. package/dist/lib/components/Editor/plugins/picker/component-picker-menu-plugin.d.ts.map +1 -1
  296. package/dist/lib/components/Editor/plugins/picker/component-picker-option.d.ts +1 -1
  297. package/dist/lib/components/Editor/plugins/picker/component-picker-option.d.ts.map +1 -1
  298. package/dist/lib/components/Editor/plugins/picker/divider-picker-plugin.d.ts.map +1 -1
  299. package/dist/lib/components/Editor/plugins/picker/embeds-picker-plugin.d.ts +2 -2
  300. package/dist/lib/components/Editor/plugins/picker/embeds-picker-plugin.d.ts.map +1 -1
  301. package/dist/lib/components/Editor/plugins/picker/heading-picker-plugin.d.ts.map +1 -1
  302. package/dist/lib/components/Editor/plugins/picker/image-picker-plugin.d.ts.map +1 -1
  303. package/dist/lib/components/Editor/plugins/picker/numbered-list-picker-plugin.d.ts.map +1 -1
  304. package/dist/lib/components/Editor/plugins/picker/paragraph-picker-plugin.d.ts.map +1 -1
  305. package/dist/lib/components/Editor/plugins/picker/quote-picker-plugin.d.ts.map +1 -1
  306. package/dist/lib/components/Editor/plugins/picker/table-picker-plugin.d.ts +1 -1
  307. package/dist/lib/components/Editor/plugins/picker/table-picker-plugin.d.ts.map +1 -1
  308. package/dist/lib/components/Editor/plugins/plugins.d.ts +1 -1
  309. package/dist/lib/components/Editor/plugins/plugins.d.ts.map +1 -1
  310. package/dist/lib/components/Editor/plugins/tab-focus-plugin.d.ts.map +1 -1
  311. package/dist/lib/components/Editor/plugins/table-plugin.d.ts +2 -3
  312. package/dist/lib/components/Editor/plugins/table-plugin.d.ts.map +1 -1
  313. package/dist/lib/components/Editor/plugins/toolbar/block-format/block-format-data.d.ts.map +1 -1
  314. package/dist/lib/components/Editor/plugins/toolbar/block-format/format-heading.d.ts.map +1 -1
  315. package/dist/lib/components/Editor/plugins/toolbar/block-format-toolbar-plugin.d.ts +1 -1
  316. package/dist/lib/components/Editor/plugins/toolbar/block-format-toolbar-plugin.d.ts.map +1 -1
  317. package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-horizontal-rule.d.ts.map +1 -1
  318. package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-image.d.ts.map +1 -1
  319. package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-table.d.ts.map +1 -1
  320. package/dist/lib/components/Editor/plugins/toolbar/block-insert-plugin.d.ts.map +1 -1
  321. package/dist/lib/components/Editor/plugins/toolbar/clear-formatting-toolbar-plugin.d.ts.map +1 -1
  322. package/dist/lib/components/Editor/plugins/toolbar/code-language-toolbar-plugin.d.ts.map +1 -1
  323. package/dist/lib/components/Editor/plugins/toolbar/element-format-toolbar-plugin.d.ts +1 -1
  324. package/dist/lib/components/Editor/plugins/toolbar/element-format-toolbar-plugin.d.ts.map +1 -1
  325. package/dist/lib/components/Editor/plugins/toolbar/font-background-toolbar-plugin.d.ts.map +1 -1
  326. package/dist/lib/components/Editor/plugins/toolbar/font-color-toolbar-plugin.d.ts.map +1 -1
  327. package/dist/lib/components/Editor/plugins/toolbar/font-family-toolbar-plugin.d.ts.map +1 -1
  328. package/dist/lib/components/Editor/plugins/toolbar/font-format-toolbar-plugin.d.ts.map +1 -1
  329. package/dist/lib/components/Editor/plugins/toolbar/font-size-toolbar-plugin.d.ts.map +1 -1
  330. package/dist/lib/components/Editor/plugins/toolbar/history-toolbar-plugin.d.ts.map +1 -1
  331. package/dist/lib/components/Editor/plugins/toolbar/horizontal-rule-toolbar-plugin.d.ts.map +1 -1
  332. package/dist/lib/components/Editor/plugins/toolbar/image-toolbar-plugin.d.ts.map +1 -1
  333. package/dist/lib/components/Editor/plugins/toolbar/link-toolbar-plugin.d.ts +1 -1
  334. package/dist/lib/components/Editor/plugins/toolbar/link-toolbar-plugin.d.ts.map +1 -1
  335. package/dist/lib/components/Editor/plugins/toolbar/subsuper-toolbar-plugin.d.ts.map +1 -1
  336. package/dist/lib/components/Editor/plugins/toolbar/table-toolbar-plugin.d.ts.map +1 -1
  337. package/dist/lib/components/Editor/plugins/toolbar/toolbar-plugin.d.ts +1 -1
  338. package/dist/lib/components/Editor/plugins/toolbar/toolbar-plugin.d.ts.map +1 -1
  339. package/dist/lib/components/Editor/plugins/typing-pref-plugin.d.ts.map +1 -1
  340. package/dist/lib/components/Editor/plugins.d.ts.map +1 -1
  341. package/dist/lib/components/Editor/shared/can-use-dom.d.ts.map +1 -1
  342. package/dist/lib/components/Editor/shared/caret-from-point.d.ts.map +1 -1
  343. package/dist/lib/components/Editor/shared/environment.d.ts.map +1 -1
  344. package/dist/lib/components/Editor/shared/invariant.d.ts +1 -1
  345. package/dist/lib/components/Editor/shared/invariant.d.ts.map +1 -1
  346. package/dist/lib/components/Editor/shared/react-test-utils.d.ts +1 -1
  347. package/dist/lib/components/Editor/shared/react-test-utils.d.ts.map +1 -1
  348. package/dist/lib/components/Editor/shared/simple-diff-with-cursor.d.ts.map +1 -1
  349. package/dist/lib/components/Editor/shared/use-layout-effect.d.ts.map +1 -1
  350. package/dist/lib/components/Editor/themes/editor-theme.d.ts.map +1 -1
  351. package/dist/lib/components/Editor/transformers/index.d.ts +6 -6
  352. package/dist/lib/components/Editor/transformers/index.d.ts.map +1 -1
  353. package/dist/lib/components/Editor/transformers/markdown-emoji-transformer.d.ts.map +1 -1
  354. package/dist/lib/components/Editor/transformers/markdown-hr-transformer.d.ts.map +1 -1
  355. package/dist/lib/components/Editor/transformers/markdown-image-transformer.d.ts.map +1 -1
  356. package/dist/lib/components/Editor/transformers/markdown-table-transformer.d.ts.map +1 -1
  357. package/dist/lib/components/Editor/transformers/markdown-tweet-transformer.d.ts.map +1 -1
  358. package/dist/lib/components/Editor/types.d.ts.map +1 -1
  359. package/dist/lib/components/Editor/utils/can-use-dom.d.ts.map +1 -1
  360. package/dist/lib/components/Editor/utils/doc-serialization.d.ts.map +1 -1
  361. package/dist/lib/components/Editor/utils/emoji-list.d.ts.map +1 -1
  362. package/dist/lib/components/Editor/utils/get-dom-range-rect.d.ts.map +1 -1
  363. package/dist/lib/components/Editor/utils/get-selected-node.d.ts.map +1 -1
  364. package/dist/lib/components/Editor/utils/set-floating-elem-position.d.ts.map +1 -1
  365. package/dist/lib/components/Editor/utils/swipe.d.ts.map +1 -1
  366. package/dist/lib/components/Editor/utils/url.d.ts.map +1 -1
  367. package/dist/lib/components/FormattedDate/FormattedDate.d.ts.map +1 -1
  368. package/dist/lib/components/FormattedDate/index.d.ts +1 -1
  369. package/dist/lib/components/FormattedDate/index.d.ts.map +1 -1
  370. package/dist/lib/components/HierarchyGraph/HierarchyGraph.d.ts.map +1 -1
  371. package/dist/lib/components/Kbd/Kbd.d.ts.map +1 -1
  372. package/dist/lib/components/Kbd/index.d.ts +1 -1
  373. package/dist/lib/components/Kbd/index.d.ts.map +1 -1
  374. package/dist/lib/components/PageContent/PageContent.d.ts.map +1 -1
  375. package/dist/lib/components/PermissionGate/PermissionGate.d.ts +18 -0
  376. package/dist/lib/components/PermissionGate/PermissionGate.d.ts.map +1 -0
  377. package/dist/lib/components/PermissionGate/index.d.ts +2 -0
  378. package/dist/lib/components/PermissionGate/index.d.ts.map +1 -0
  379. package/dist/lib/components/PieChart/PieChart.d.ts.map +1 -1
  380. package/dist/lib/components/RadialChart/RadialChart.d.ts.map +1 -1
  381. package/dist/lib/components/Select/Select.d.ts.map +1 -1
  382. package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  383. package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
  384. package/dist/lib/components/Select/hooks/useSelect.d.ts.map +1 -1
  385. package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -0
  386. package/dist/lib/components/Sidebar/Sidebar.d.ts.map +1 -1
  387. package/dist/lib/components/Switch/Switch.d.ts +2 -0
  388. package/dist/lib/components/Switch/Switch.d.ts.map +1 -1
  389. package/dist/lib/components/Switch/index.d.ts +2 -2
  390. package/dist/lib/components/Switch/index.d.ts.map +1 -1
  391. package/dist/lib/components/Tabs/Tabs.d.ts +2 -1
  392. package/dist/lib/components/Tabs/Tabs.d.ts.map +1 -1
  393. package/dist/lib/components/Tooltip/Tooltip.d.ts +12 -0
  394. package/dist/lib/components/Tooltip/Tooltip.d.ts.map +1 -0
  395. package/dist/lib/components/Tooltip/index.d.ts +3 -0
  396. package/dist/lib/components/Tooltip/index.d.ts.map +1 -0
  397. package/dist/lib/components/ValueFilter/ValueFilter.d.ts.map +1 -1
  398. package/dist/lib/components/index.d.ts +5 -3
  399. package/dist/lib/components/index.d.ts.map +1 -1
  400. package/dist/lib/hooks/useFormatters.d.ts.map +1 -1
  401. package/dist/lib/icons/icon-names.json.d.ts +13731 -0
  402. package/dist/lib/icons/index.d.ts +4 -0
  403. package/dist/lib/icons/index.d.ts.map +1 -0
  404. package/dist/lib/selects/currency/CurrencyFilter.d.ts.map +1 -1
  405. package/dist/lib/selects/icon/IconSelect.d.ts +20 -0
  406. package/dist/lib/selects/icon/IconSelect.d.ts.map +1 -0
  407. package/dist/lib/selects/icon/index.d.ts +2 -0
  408. package/dist/lib/selects/icon/index.d.ts.map +1 -0
  409. package/dist/lib/selects/index.d.ts +3 -2
  410. package/dist/lib/selects/index.d.ts.map +1 -1
  411. package/dist/lib/selects/location/LocationSelector.d.ts.map +1 -1
  412. package/dist/lib/selects/location/index.d.ts +1 -1
  413. package/dist/lib/selects/location/index.d.ts.map +1 -1
  414. package/dist/lib/selects/purchase-order-item/PurchaseOrderItemSelector.d.ts.map +1 -1
  415. package/dist/lib/selects/quant/QuantSelector.d.ts.map +1 -1
  416. package/dist/lib/selects/serial/SerialSelector.d.ts.map +1 -1
  417. package/dist/lib/selects/supplier-item/SupplierItemSelector.d.ts.map +1 -1
  418. package/dist/lib/selects/uom/UomSelector.d.ts.map +1 -1
  419. package/dist/lib/utils/format.d.ts.map +1 -1
  420. package/dist/lib/utils/hotkeys.d.ts +1 -1
  421. package/dist/lib/utils/hotkeys.d.ts.map +1 -1
  422. package/dist/lib/utils/zod.d.ts.map +1 -1
  423. package/dist/lock-keyhole.js +19 -0
  424. package/dist/lock-keyhole.js.map +1 -0
  425. package/dist/panel-left.js +18 -0
  426. package/dist/panel-left.js.map +1 -0
  427. package/dist/scan-barcode.js +23 -0
  428. package/dist/scan-barcode.js.map +1 -0
  429. package/dist/selects/icon.js +2 -0
  430. package/dist/selects/icon.js.map +1 -0
  431. package/dist/selects/purchase-order-item.js.map +1 -1
  432. package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts.map +1 -1
  433. package/dist/sun.js +44 -0
  434. package/dist/sun.js.map +1 -0
  435. package/dist/table-properties.js +351 -0
  436. package/dist/table-properties.js.map +1 -0
  437. package/dist/{tooltip.js → tooltip2.js} +1 -1
  438. package/dist/tooltip2.js.map +1 -0
  439. package/dist/{cells.js → useDataTable.js} +45 -381
  440. package/dist/useDataTable.js.map +1 -0
  441. package/dist/useFormatters.js.map +1 -1
  442. package/dist/user.js +38 -0
  443. package/dist/user.js.map +1 -0
  444. package/dist/utils/format.js +1 -0
  445. package/dist/utils/format.js.map +1 -1
  446. package/dist/utils/motion.js +2 -2
  447. package/dist/utils/zod.js.map +1 -1
  448. package/dist/value.js +1 -1
  449. package/dist/wifi-off.js +111 -0
  450. package/dist/wifi-off.js.map +1 -0
  451. package/dist/youtube.js +737 -0
  452. package/dist/youtube.js.map +1 -0
  453. package/package.json +19 -1
  454. package/dist/cells.js.map +0 -1
  455. package/dist/tooltip.js.map +0 -1
package/dist/index19.js CHANGED
@@ -1,80 +1,214 @@
1
1
  import * as React from 'react';
2
- import { jsx } from 'react/jsx-runtime';
2
+ import * as ReactDOM from 'react-dom';
3
+ import { c as composeRefs } from './index11.js';
4
+ import { jsx, Fragment } from 'react/jsx-runtime';
5
+ import { u as useLayoutEffect2 } from './index29.js';
3
6
 
4
- // packages/react/context/src/create-context.tsx
5
- function createContext2(rootComponentName, defaultContext) {
6
- const Context = React.createContext(defaultContext);
7
- const Provider = (props) => {
8
- const { children, ...context } = props;
9
- const value = React.useMemo(() => context, Object.values(context));
10
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
7
+ // src/primitive.tsx
8
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9
+ return function handleEvent(event) {
10
+ originalEventHandler?.(event);
11
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
12
+ return ourEventHandler?.(event);
13
+ }
11
14
  };
12
- Provider.displayName = rootComponentName + "Provider";
13
- function useContext2(consumerName) {
14
- const context = React.useContext(Context);
15
- if (context) return context;
16
- if (defaultContext !== void 0) return defaultContext;
17
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
15
+ }
16
+
17
+ // src/slot.tsx
18
+ // @__NO_SIDE_EFFECTS__
19
+ function createSlot(ownerName) {
20
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
21
+ const Slot2 = React.forwardRef((props, forwardedRef) => {
22
+ const { children, ...slotProps } = props;
23
+ const childrenArray = React.Children.toArray(children);
24
+ const slottable = childrenArray.find(isSlottable);
25
+ if (slottable) {
26
+ const newElement = slottable.props.children;
27
+ const newChildren = childrenArray.map((child) => {
28
+ if (child === slottable) {
29
+ if (React.Children.count(newElement) > 1) return React.Children.only(null);
30
+ return React.isValidElement(newElement) ? newElement.props.children : null;
31
+ } else {
32
+ return child;
33
+ }
34
+ });
35
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
36
+ }
37
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
38
+ });
39
+ Slot2.displayName = `${ownerName}.Slot`;
40
+ return Slot2;
41
+ }
42
+ // @__NO_SIDE_EFFECTS__
43
+ function createSlotClone(ownerName) {
44
+ const SlotClone = React.forwardRef((props, forwardedRef) => {
45
+ const { children, ...slotProps } = props;
46
+ if (React.isValidElement(children)) {
47
+ const childrenRef = getElementRef(children);
48
+ const props2 = mergeProps(slotProps, children.props);
49
+ if (children.type !== React.Fragment) {
50
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
51
+ }
52
+ return React.cloneElement(children, props2);
53
+ }
54
+ return React.Children.count(children) > 1 ? React.Children.only(null) : null;
55
+ });
56
+ SlotClone.displayName = `${ownerName}.SlotClone`;
57
+ return SlotClone;
58
+ }
59
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
60
+ // @__NO_SIDE_EFFECTS__
61
+ function createSlottable(ownerName) {
62
+ const Slottable2 = ({ children }) => {
63
+ return /* @__PURE__ */ jsx(Fragment, { children });
64
+ };
65
+ Slottable2.displayName = `${ownerName}.Slottable`;
66
+ Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
67
+ return Slottable2;
68
+ }
69
+ function isSlottable(child) {
70
+ return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
71
+ }
72
+ function mergeProps(slotProps, childProps) {
73
+ const overrideProps = { ...childProps };
74
+ for (const propName in childProps) {
75
+ const slotPropValue = slotProps[propName];
76
+ const childPropValue = childProps[propName];
77
+ const isHandler = /^on[A-Z]/.test(propName);
78
+ if (isHandler) {
79
+ if (slotPropValue && childPropValue) {
80
+ overrideProps[propName] = (...args) => {
81
+ const result = childPropValue(...args);
82
+ slotPropValue(...args);
83
+ return result;
84
+ };
85
+ } else if (slotPropValue) {
86
+ overrideProps[propName] = slotPropValue;
87
+ }
88
+ } else if (propName === "style") {
89
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
90
+ } else if (propName === "className") {
91
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
92
+ }
18
93
  }
19
- return [Provider, useContext2];
94
+ return { ...slotProps, ...overrideProps };
20
95
  }
21
- function createContextScope(scopeName, createContextScopeDeps = []) {
22
- let defaultContexts = [];
23
- function createContext3(rootComponentName, defaultContext) {
24
- const BaseContext = React.createContext(defaultContext);
25
- const index = defaultContexts.length;
26
- defaultContexts = [...defaultContexts, defaultContext];
27
- const Provider = (props) => {
28
- const { scope, children, ...context } = props;
29
- const Context = scope?.[scopeName]?.[index] || BaseContext;
30
- const value = React.useMemo(() => context, Object.values(context));
31
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
32
- };
33
- Provider.displayName = rootComponentName + "Provider";
34
- function useContext2(consumerName, scope) {
35
- const Context = scope?.[scopeName]?.[index] || BaseContext;
36
- const context = React.useContext(Context);
37
- if (context) return context;
38
- if (defaultContext !== void 0) return defaultContext;
39
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
96
+ function getElementRef(element) {
97
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
98
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
99
+ if (mayWarn) {
100
+ return element.ref;
101
+ }
102
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
103
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
104
+ if (mayWarn) {
105
+ return element.props.ref;
106
+ }
107
+ return element.props.ref || element.ref;
108
+ }
109
+
110
+ // src/primitive.tsx
111
+ var NODES = [
112
+ "a",
113
+ "button",
114
+ "div",
115
+ "form",
116
+ "h2",
117
+ "h3",
118
+ "img",
119
+ "input",
120
+ "label",
121
+ "li",
122
+ "nav",
123
+ "ol",
124
+ "p",
125
+ "select",
126
+ "span",
127
+ "svg",
128
+ "ul"
129
+ ];
130
+ var Primitive = NODES.reduce((primitive, node) => {
131
+ const Slot = createSlot(`Primitive.${node}`);
132
+ const Node = React.forwardRef((props, forwardedRef) => {
133
+ const { asChild, ...primitiveProps } = props;
134
+ const Comp = asChild ? Slot : node;
135
+ if (typeof window !== "undefined") {
136
+ window[Symbol.for("radix-ui")] = true;
40
137
  }
41
- return [Provider, useContext2];
138
+ return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
139
+ });
140
+ Node.displayName = `Primitive.${node}`;
141
+ return { ...primitive, [node]: Node };
142
+ }, {});
143
+ function dispatchDiscreteCustomEvent(target, event) {
144
+ if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
145
+ }
146
+
147
+ // src/use-controllable-state.tsx
148
+ var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
149
+ function useControllableState({
150
+ prop,
151
+ defaultProp,
152
+ onChange = () => {
153
+ },
154
+ caller
155
+ }) {
156
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
157
+ defaultProp,
158
+ onChange
159
+ });
160
+ const isControlled = prop !== void 0;
161
+ const value = isControlled ? prop : uncontrolledProp;
162
+ {
163
+ const isControlledRef = React.useRef(prop !== void 0);
164
+ React.useEffect(() => {
165
+ const wasControlled = isControlledRef.current;
166
+ if (wasControlled !== isControlled) {
167
+ const from = wasControlled ? "controlled" : "uncontrolled";
168
+ const to = isControlled ? "controlled" : "uncontrolled";
169
+ console.warn(
170
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
171
+ );
172
+ }
173
+ isControlledRef.current = isControlled;
174
+ }, [isControlled, caller]);
42
175
  }
43
- const createScope = () => {
44
- const scopeContexts = defaultContexts.map((defaultContext) => {
45
- return React.createContext(defaultContext);
46
- });
47
- return function useScope(scope) {
48
- const contexts = scope?.[scopeName] || scopeContexts;
49
- return React.useMemo(
50
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
51
- [scope, contexts]
52
- );
53
- };
54
- };
55
- createScope.scopeName = scopeName;
56
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
176
+ const setValue = React.useCallback(
177
+ (nextValue) => {
178
+ if (isControlled) {
179
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
180
+ if (value2 !== prop) {
181
+ onChangeRef.current?.(value2);
182
+ }
183
+ } else {
184
+ setUncontrolledProp(nextValue);
185
+ }
186
+ },
187
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
188
+ );
189
+ return [value, setValue];
57
190
  }
58
- function composeContextScopes(...scopes) {
59
- const baseScope = scopes[0];
60
- if (scopes.length === 1) return baseScope;
61
- const createScope = () => {
62
- const scopeHooks = scopes.map((createScope2) => ({
63
- useScope: createScope2(),
64
- scopeName: createScope2.scopeName
65
- }));
66
- return function useComposedScopes(overrideScopes) {
67
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
68
- const scopeProps = useScope(overrideScopes);
69
- const currentScope = scopeProps[`__scope${scopeName}`];
70
- return { ...nextScopes2, ...currentScope };
71
- }, {});
72
- return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
73
- };
74
- };
75
- createScope.scopeName = baseScope.scopeName;
76
- return createScope;
191
+ function useUncontrolledState({
192
+ defaultProp,
193
+ onChange
194
+ }) {
195
+ const [value, setValue] = React.useState(defaultProp);
196
+ const prevValueRef = React.useRef(value);
197
+ const onChangeRef = React.useRef(onChange);
198
+ useInsertionEffect(() => {
199
+ onChangeRef.current = onChange;
200
+ }, [onChange]);
201
+ React.useEffect(() => {
202
+ if (prevValueRef.current !== value) {
203
+ onChangeRef.current?.(value);
204
+ prevValueRef.current = value;
205
+ }
206
+ }, [value, prevValueRef]);
207
+ return [value, setValue, onChangeRef];
208
+ }
209
+ function isFunction(value) {
210
+ return typeof value === "function";
77
211
  }
78
212
 
79
- export { createContext2 as a, createContextScope as c };
213
+ export { Primitive as P, createSlottable as a, createSlot as b, composeEventHandlers as c, dispatchDiscreteCustomEvent as d, useControllableState as u };
80
214
  //# sourceMappingURL=index19.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index19.js","sources":["../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;AAAA;AAGA,SAAS,cAAc,CAAC,iBAAiB,EAAE,cAAc,EAAE;AAC3D,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;AACrD,EAAE,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK;AAC1C,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO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sources":["../node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_412fca877c3e29a339aeb07f39bb1abf/node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Fragment2","useLayoutEffect"],"mappings":";;;;;;AAAA;AAEA,SAAS,oBAAoB,CAAC,oBAAoB,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE;AAC/G,EAAE,OAAO,SAAS,WAAW,CAAC,KAAK,EAAE;AACrC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACvE,MAAM,OAAO,eAAe,GAAG,KAAK,CAAC;AACrC,IAAI;AACJ,EAAE,CAAC;AACH;;ACTA;AAIA;AACA,SAAS,UAAU,CAAC,SAAS,EAAE;AAC/B,EAAE,MAAM,SAAS,mBAAmB,eAAe,CAAC,SAAS,CAAC;AAC9D,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK;AAC1D,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAC5C,IAAI,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC1D,IAAI,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;AACrD,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,UAAU,GAA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,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAC1C,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5C,EAAE,kBAAkB,CAAC,MAAM;AAC3B,IAAI,WAAW,CAAC,OAAO,GAAG,QAAQ;AAClC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAChB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,IAAI,YAAY,CAAC,OAAO,KAAK,KAAK,EAAE;AACxC,MAAM,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;AAClC,MAAM,YAAY,CAAC,OAAO,GAAG,KAAK;AAClC,IAAI;AACJ,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC3B,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC;AACvC;AACA,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,EAAE,OAAO,OAAO,KAAK,KAAK,UAAU;AACpC;;;;","x_google_ignoreList":[0,1,2,3]}
package/dist/index20.js CHANGED
@@ -1,221 +1,80 @@
1
1
  import * as React from 'react';
2
- import { P as Primitive, c as composeEventHandlers, u as useControllableState } from './index18.js';
3
- import { c as createCollection, u as useDirection } from './index22.js';
4
- import { u as useComposedRefs } from './index11.js';
5
- import { c as createContextScope } from './index19.js';
6
- import { u as useId } from './index23.js';
7
- import { u as useCallbackRef } from './index32.js';
8
2
  import { jsx } from 'react/jsx-runtime';
9
3
 
10
- var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
11
- var EVENT_OPTIONS = { bubbles: false, cancelable: true };
12
- var GROUP_NAME = "RovingFocusGroup";
13
- var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
14
- var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
15
- GROUP_NAME,
16
- [createCollectionScope]
17
- );
18
- var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
19
- var RovingFocusGroup = React.forwardRef(
20
- (props, forwardedRef) => {
21
- return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
4
+ // packages/react/context/src/create-context.tsx
5
+ function createContext2(rootComponentName, defaultContext) {
6
+ const Context = React.createContext(defaultContext);
7
+ const Provider = (props) => {
8
+ const { children, ...context } = props;
9
+ const value = React.useMemo(() => context, Object.values(context));
10
+ return /* @__PURE__ */ jsx(Context.Provider, { value, children });
11
+ };
12
+ Provider.displayName = rootComponentName + "Provider";
13
+ function useContext2(consumerName) {
14
+ const context = React.useContext(Context);
15
+ if (context) return context;
16
+ if (defaultContext !== void 0) return defaultContext;
17
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
22
18
  }
23
- );
24
- RovingFocusGroup.displayName = GROUP_NAME;
25
- var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
26
- const {
27
- __scopeRovingFocusGroup,
28
- orientation,
29
- loop = false,
30
- dir,
31
- currentTabStopId: currentTabStopIdProp,
32
- defaultCurrentTabStopId,
33
- onCurrentTabStopIdChange,
34
- onEntryFocus,
35
- preventScrollOnEntryFocus = false,
36
- ...groupProps
37
- } = props;
38
- const ref = React.useRef(null);
39
- const composedRefs = useComposedRefs(forwardedRef, ref);
40
- const direction = useDirection(dir);
41
- const [currentTabStopId, setCurrentTabStopId] = useControllableState({
42
- prop: currentTabStopIdProp,
43
- defaultProp: defaultCurrentTabStopId ?? null,
44
- onChange: onCurrentTabStopIdChange,
45
- caller: GROUP_NAME
46
- });
47
- const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
48
- const handleEntryFocus = useCallbackRef(onEntryFocus);
49
- const getItems = useCollection(__scopeRovingFocusGroup);
50
- const isClickFocusRef = React.useRef(false);
51
- const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
52
- React.useEffect(() => {
53
- const node = ref.current;
54
- if (node) {
55
- node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
56
- return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
57
- }
58
- }, [handleEntryFocus]);
59
- return /* @__PURE__ */ jsx(
60
- RovingFocusProvider,
61
- {
62
- scope: __scopeRovingFocusGroup,
63
- orientation,
64
- dir: direction,
65
- loop,
66
- currentTabStopId,
67
- onItemFocus: React.useCallback(
68
- (tabStopId) => setCurrentTabStopId(tabStopId),
69
- [setCurrentTabStopId]
70
- ),
71
- onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
72
- onFocusableItemAdd: React.useCallback(
73
- () => setFocusableItemsCount((prevCount) => prevCount + 1),
74
- []
75
- ),
76
- onFocusableItemRemove: React.useCallback(
77
- () => setFocusableItemsCount((prevCount) => prevCount - 1),
78
- []
79
- ),
80
- children: /* @__PURE__ */ jsx(
81
- Primitive.div,
82
- {
83
- tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
84
- "data-orientation": orientation,
85
- ...groupProps,
86
- ref: composedRefs,
87
- style: { outline: "none", ...props.style },
88
- onMouseDown: composeEventHandlers(props.onMouseDown, () => {
89
- isClickFocusRef.current = true;
90
- }),
91
- onFocus: composeEventHandlers(props.onFocus, (event) => {
92
- const isKeyboardFocus = !isClickFocusRef.current;
93
- if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
94
- const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
95
- event.currentTarget.dispatchEvent(entryFocusEvent);
96
- if (!entryFocusEvent.defaultPrevented) {
97
- const items = getItems().filter((item) => item.focusable);
98
- const activeItem = items.find((item) => item.active);
99
- const currentItem = items.find((item) => item.id === currentTabStopId);
100
- const candidateItems = [activeItem, currentItem, ...items].filter(
101
- Boolean
102
- );
103
- const candidateNodes = candidateItems.map((item) => item.ref.current);
104
- focusFirst(candidateNodes, preventScrollOnEntryFocus);
105
- }
106
- }
107
- isClickFocusRef.current = false;
108
- }),
109
- onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
110
- }
111
- )
112
- }
113
- );
114
- });
115
- var ITEM_NAME = "RovingFocusGroupItem";
116
- var RovingFocusGroupItem = React.forwardRef(
117
- (props, forwardedRef) => {
118
- const {
119
- __scopeRovingFocusGroup,
120
- focusable = true,
121
- active = false,
122
- tabStopId,
123
- children,
124
- ...itemProps
125
- } = props;
126
- const autoId = useId();
127
- const id = tabStopId || autoId;
128
- const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
129
- const isCurrentTabStop = context.currentTabStopId === id;
130
- const getItems = useCollection(__scopeRovingFocusGroup);
131
- const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
132
- React.useEffect(() => {
133
- if (focusable) {
134
- onFocusableItemAdd();
135
- return () => onFocusableItemRemove();
136
- }
137
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
138
- return /* @__PURE__ */ jsx(
139
- Collection.ItemSlot,
140
- {
141
- scope: __scopeRovingFocusGroup,
142
- id,
143
- focusable,
144
- active,
145
- children: /* @__PURE__ */ jsx(
146
- Primitive.span,
147
- {
148
- tabIndex: isCurrentTabStop ? 0 : -1,
149
- "data-orientation": context.orientation,
150
- ...itemProps,
151
- ref: forwardedRef,
152
- onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
153
- if (!focusable) event.preventDefault();
154
- else context.onItemFocus(id);
155
- }),
156
- onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
157
- onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
158
- if (event.key === "Tab" && event.shiftKey) {
159
- context.onItemShiftTab();
160
- return;
161
- }
162
- if (event.target !== event.currentTarget) return;
163
- const focusIntent = getFocusIntent(event, context.orientation, context.dir);
164
- if (focusIntent !== void 0) {
165
- if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
166
- event.preventDefault();
167
- const items = getItems().filter((item) => item.focusable);
168
- let candidateNodes = items.map((item) => item.ref.current);
169
- if (focusIntent === "last") candidateNodes.reverse();
170
- else if (focusIntent === "prev" || focusIntent === "next") {
171
- if (focusIntent === "prev") candidateNodes.reverse();
172
- const currentIndex = candidateNodes.indexOf(event.currentTarget);
173
- candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
174
- }
175
- setTimeout(() => focusFirst(candidateNodes));
176
- }
177
- }),
178
- children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
179
- }
180
- )
181
- }
182
- );
183
- }
184
- );
185
- RovingFocusGroupItem.displayName = ITEM_NAME;
186
- var MAP_KEY_TO_FOCUS_INTENT = {
187
- ArrowLeft: "prev",
188
- ArrowUp: "prev",
189
- ArrowRight: "next",
190
- ArrowDown: "next",
191
- PageUp: "first",
192
- Home: "first",
193
- PageDown: "last",
194
- End: "last"
195
- };
196
- function getDirectionAwareKey(key, dir) {
197
- if (dir !== "rtl") return key;
198
- return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
19
+ return [Provider, useContext2];
199
20
  }
200
- function getFocusIntent(event, orientation, dir) {
201
- const key = getDirectionAwareKey(event.key, dir);
202
- if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
203
- if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
204
- return MAP_KEY_TO_FOCUS_INTENT[key];
205
- }
206
- function focusFirst(candidates, preventScroll = false) {
207
- const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
208
- for (const candidate of candidates) {
209
- if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
210
- candidate.focus({ preventScroll });
211
- if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
21
+ function createContextScope(scopeName, createContextScopeDeps = []) {
22
+ let defaultContexts = [];
23
+ function createContext3(rootComponentName, defaultContext) {
24
+ const BaseContext = React.createContext(defaultContext);
25
+ const index = defaultContexts.length;
26
+ defaultContexts = [...defaultContexts, defaultContext];
27
+ const Provider = (props) => {
28
+ const { scope, children, ...context } = props;
29
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
30
+ const value = React.useMemo(() => context, Object.values(context));
31
+ return /* @__PURE__ */ jsx(Context.Provider, { value, children });
32
+ };
33
+ Provider.displayName = rootComponentName + "Provider";
34
+ function useContext2(consumerName, scope) {
35
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
36
+ const context = React.useContext(Context);
37
+ if (context) return context;
38
+ if (defaultContext !== void 0) return defaultContext;
39
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
40
+ }
41
+ return [Provider, useContext2];
212
42
  }
43
+ const createScope = () => {
44
+ const scopeContexts = defaultContexts.map((defaultContext) => {
45
+ return React.createContext(defaultContext);
46
+ });
47
+ return function useScope(scope) {
48
+ const contexts = scope?.[scopeName] || scopeContexts;
49
+ return React.useMemo(
50
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
51
+ [scope, contexts]
52
+ );
53
+ };
54
+ };
55
+ createScope.scopeName = scopeName;
56
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
213
57
  }
214
- function wrapArray(array, startIndex) {
215
- return array.map((_, index) => array[(startIndex + index) % array.length]);
58
+ function composeContextScopes(...scopes) {
59
+ const baseScope = scopes[0];
60
+ if (scopes.length === 1) return baseScope;
61
+ const createScope = () => {
62
+ const scopeHooks = scopes.map((createScope2) => ({
63
+ useScope: createScope2(),
64
+ scopeName: createScope2.scopeName
65
+ }));
66
+ return function useComposedScopes(overrideScopes) {
67
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
68
+ const scopeProps = useScope(overrideScopes);
69
+ const currentScope = scopeProps[`__scope${scopeName}`];
70
+ return { ...nextScopes2, ...currentScope };
71
+ }, {});
72
+ return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
73
+ };
74
+ };
75
+ createScope.scopeName = baseScope.scopeName;
76
+ return createScope;
216
77
  }
217
- var Root = RovingFocusGroup;
218
- var Item = RovingFocusGroupItem;
219
78
 
220
- export { Item as I, Root as R, createRovingFocusGroupScope as c };
79
+ export { createContext2 as a, createContextScope as c };
221
80
  //# sourceMappingURL=index20.js.map