@cube-dev/ui-kit 0.0.0-canary-c325dcb → 0.0.0-canary-162cdb3

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 (638) hide show
  1. package/dist/CHANGELOG.md +8 -0
  2. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  3. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  4. package/dist/_internal/hooks/use-event.js +1 -1
  5. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  6. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  7. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  8. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  9. package/dist/_internal/hooks/use-warn.js +1 -1
  10. package/dist/components/Block.js +1 -1
  11. package/dist/components/CollectionItem.js +1 -1
  12. package/dist/components/GlobalStyles.js +1 -1
  13. package/dist/components/GridProvider.js +1 -1
  14. package/dist/components/HiddenInput.js +1 -1
  15. package/dist/components/Root.js +1 -1
  16. package/dist/components/actions/Action/Action.js +1 -1
  17. package/dist/components/actions/Banner/Banner.js +1 -1
  18. package/dist/components/actions/Button/Button.js +1 -1
  19. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  20. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  21. package/dist/components/actions/ButtonSplit/context.js +1 -1
  22. package/dist/components/actions/CommandMenu/CommandMenu.js +201 -201
  23. package/dist/components/actions/CommandMenu/CommandMenu.js.map +1 -1
  24. package/dist/components/actions/CommandMenu/styled.js +1 -1
  25. package/dist/components/actions/ItemAction/ItemAction.js +1 -1
  26. package/dist/components/actions/ItemActionContext.js +1 -1
  27. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  28. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  29. package/dist/components/actions/Link/Link.js +1 -1
  30. package/dist/components/actions/Menu/Menu.js +1 -1
  31. package/dist/components/actions/Menu/MenuItem.js +1 -1
  32. package/dist/components/actions/Menu/MenuSection.js +1 -1
  33. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  34. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  35. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  36. package/dist/components/actions/Menu/context.js +1 -1
  37. package/dist/components/actions/Menu/styled.js +1 -1
  38. package/dist/components/actions/actions-run.js +1 -1
  39. package/dist/components/actions/index.js +1 -1
  40. package/dist/components/actions/use-action.js +1 -1
  41. package/dist/components/actions/use-anchored-menu.js +1 -1
  42. package/dist/components/actions/use-context-menu.js +1 -1
  43. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  44. package/dist/components/content/Alert/Alert.js +1 -1
  45. package/dist/components/content/Alert/use-alert.js +1 -1
  46. package/dist/components/content/Avatar/Avatar.js +1 -1
  47. package/dist/components/content/Badge/Badge.js +1 -1
  48. package/dist/components/content/Card/Card.js +1 -1
  49. package/dist/components/content/Content.js +1 -1
  50. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  51. package/dist/components/content/CopySnippet/CopySnippet.d.ts +6 -6
  52. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  53. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  54. package/dist/components/content/Divider.js +1 -1
  55. package/dist/components/content/Footer.js +1 -1
  56. package/dist/components/content/Header.js +1 -1
  57. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  58. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  59. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  60. package/dist/components/content/Item/Item.js +1 -1
  61. package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
  62. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  63. package/dist/components/content/Layout/GridLayout.js +1 -1
  64. package/dist/components/content/Layout/Layout.js +1 -1
  65. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  66. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  67. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  68. package/dist/components/content/Layout/LayoutContent.js +1 -1
  69. package/dist/components/content/Layout/LayoutContext.js +1 -1
  70. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  71. package/dist/components/content/Layout/LayoutFooter.js +1 -1
  72. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  73. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  74. package/dist/components/content/Layout/LayoutPane.js +1 -1
  75. package/dist/components/content/Layout/LayoutPanel.js +1 -1
  76. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  77. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  78. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  79. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  80. package/dist/components/content/Layout/index.js +1 -1
  81. package/dist/components/content/Layout/utils.js +1 -1
  82. package/dist/components/content/Paragraph.js +1 -1
  83. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  84. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  85. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  86. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  87. package/dist/components/content/Result/Result.js +1 -1
  88. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  89. package/dist/components/content/Tag/Tag.js +1 -1
  90. package/dist/components/content/Text.js +1 -1
  91. package/dist/components/content/TextItem/TextItem.js +1 -1
  92. package/dist/components/content/Title.js +1 -1
  93. package/dist/components/content/Tree/Tree.js +1 -1
  94. package/dist/components/content/Tree/TreeNode.js +1 -1
  95. package/dist/components/content/Tree/styled.js +1 -1
  96. package/dist/components/content/Tree/tree-index.js +1 -1
  97. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  98. package/dist/components/content/Tree/use-load-data.js +1 -1
  99. package/dist/components/content/highlightText.js +1 -1
  100. package/dist/components/content/use-auto-tooltip.js +1 -1
  101. package/dist/components/data/DataTable/DataTable.js +1 -1
  102. package/dist/components/data/ItemTable/ItemTable.js +1 -1
  103. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  104. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  105. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  106. package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
  107. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  108. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  109. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  110. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  111. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  112. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  113. package/dist/components/data/TableBase/ColumnResizer.js +3 -3
  114. package/dist/components/data/TableBase/ColumnResizer.js.map +1 -1
  115. package/dist/components/data/TableBase/RowCollection.js +1 -1
  116. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  117. package/dist/components/data/TableBase/TableRow.js +1 -1
  118. package/dist/components/data/TableBase/TableView.js +1 -1
  119. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  120. package/dist/components/data/TableBase/column-header.js +1 -1
  121. package/dist/components/data/TableBase/column-menu.js +1 -1
  122. package/dist/components/data/TableBase/column-styles.js +1 -1
  123. package/dist/components/data/TableBase/column-tint.js +1 -1
  124. package/dist/components/data/TableBase/row-menu.js +1 -1
  125. package/dist/components/data/TableBase/styled.js +1 -1
  126. package/dist/components/data/TableBase/table-tree.js +1 -1
  127. package/dist/components/data/TableBase/types.js +1 -1
  128. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  129. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  130. package/dist/components/data/TableBase/use-column-order.js +1 -1
  131. package/dist/components/data/TableBase/use-container-width.js +1 -1
  132. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  133. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  134. package/dist/components/data/TableBase/use-table-columns.js +154 -166
  135. package/dist/components/data/TableBase/use-table-columns.js.map +1 -1
  136. package/dist/components/data/TableBase/use-table-search.js +1 -1
  137. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  138. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  139. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  140. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  141. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  142. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  143. package/dist/components/fields/Checkbox/Checkbox.js +1 -1
  144. package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
  145. package/dist/components/fields/Checkbox/context.js +1 -1
  146. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  147. package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
  148. package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
  149. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
  150. package/dist/components/fields/ComboBox/ComboBox.js +194 -160
  151. package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
  152. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  153. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  154. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  155. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  156. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  157. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  158. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  159. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  160. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  161. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  162. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  163. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  164. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  165. package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
  166. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  167. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  168. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  169. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  170. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  171. package/dist/components/fields/DatePicker/period.js +1 -1
  172. package/dist/components/fields/DatePicker/props.js +1 -1
  173. package/dist/components/fields/DatePicker/utils.js +1 -1
  174. package/dist/components/fields/FileInput/FileInput.js +1 -1
  175. package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
  176. package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
  177. package/dist/components/fields/Input/Input.js +1 -1
  178. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  179. package/dist/components/fields/ListBox/ListBox.js +15 -8
  180. package/dist/components/fields/ListBox/ListBox.js.map +1 -1
  181. package/dist/components/fields/ListBox/optionId.js +1 -1
  182. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
  183. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  184. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  185. package/dist/components/fields/NumberInput/NumberInput.js +1 -1
  186. package/dist/components/fields/NumberInput/StepButton.js +1 -1
  187. package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
  188. package/dist/components/fields/Picker/Picker.js +1 -1
  189. package/dist/components/fields/RadioGroup/Radio.d.ts +4 -4
  190. package/dist/components/fields/RadioGroup/Radio.js +1 -1
  191. package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
  192. package/dist/components/fields/RadioGroup/context.js +1 -1
  193. package/dist/components/fields/SearchComboBox/SearchComboBox.js +71 -67
  194. package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
  195. package/dist/components/fields/SearchInput/SearchInput.js +1 -1
  196. package/dist/components/fields/Select/Select.js +1 -1
  197. package/dist/components/fields/Slider/Gradation.js +1 -1
  198. package/dist/components/fields/Slider/HueSlider.js +1 -1
  199. package/dist/components/fields/Slider/RangeSlider.js +1 -1
  200. package/dist/components/fields/Slider/Slider.js +1 -1
  201. package/dist/components/fields/Slider/SliderBase.js +1 -1
  202. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  203. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  204. package/dist/components/fields/Slider/elements.js +1 -1
  205. package/dist/components/fields/Slider/index.js +1 -1
  206. package/dist/components/fields/Switch/Switch.js +1 -1
  207. package/dist/components/fields/TagInput/TagInput.js +1 -1
  208. package/dist/components/fields/TagInput/TagList.js +1 -1
  209. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  210. package/dist/components/fields/TagInput/useTagError.js +1 -1
  211. package/dist/components/fields/TextArea/TextArea.js +1 -1
  212. package/dist/components/fields/TextInput/TextInput.js +1 -1
  213. package/dist/components/fields/TextInput/TextInputBase.js +1 -1
  214. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  215. package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
  216. package/dist/components/fields/TriggerActions.js +1 -1
  217. package/dist/components/fields/color/ColorPanel.js +1 -1
  218. package/dist/components/fields/color/channels.js +1 -1
  219. package/dist/components/fields/color/color.js +1 -1
  220. package/dist/components/fields/color/context.js +1 -1
  221. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  222. package/dist/components/form/Form/Field.js +1 -1
  223. package/dist/components/form/Form/Form.js +1 -1
  224. package/dist/components/form/Form/ModernFormRoot.js +1 -1
  225. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  226. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  227. package/dist/components/form/Form/SubmitError.js +1 -1
  228. package/dist/components/form/Form/backend.js +1 -1
  229. package/dist/components/form/Form/index.js +1 -1
  230. package/dist/components/form/Form/modern/actions.js +1 -1
  231. package/dist/components/form/Form/modern/context.js +1 -1
  232. package/dist/components/form/Form/modern/controller.js +1 -1
  233. package/dist/components/form/Form/modern/field-binding.js +1 -1
  234. package/dist/components/form/Form/modern/field.js +1 -1
  235. package/dist/components/form/Form/modern/react.js +1 -1
  236. package/dist/components/form/Form/modern/store.js +1 -1
  237. package/dist/components/form/Form/modern/validation.js +1 -1
  238. package/dist/components/form/Form/modern/values.js +1 -1
  239. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  240. package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
  241. package/dist/components/form/Form/use-field/use-field-props.js +1 -1
  242. package/dist/components/form/Form/use-field/use-field.js +1 -1
  243. package/dist/components/form/Form/use-form.js +1 -1
  244. package/dist/components/form/Form/validation.js +1 -1
  245. package/dist/components/form/Label.js +1 -1
  246. package/dist/components/form/legacy-tooltip.js +1 -1
  247. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  248. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  249. package/dist/components/form/validation/use-validation-props.js +1 -1
  250. package/dist/components/form/wrapper.js +1 -1
  251. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  252. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  253. package/dist/components/layout/Flex.js +1 -1
  254. package/dist/components/layout/Flow.js +1 -1
  255. package/dist/components/layout/Grid.js +1 -1
  256. package/dist/components/layout/Panel.js +1 -1
  257. package/dist/components/layout/Prefix.js +1 -1
  258. package/dist/components/layout/ResizablePanel.js +1 -1
  259. package/dist/components/layout/Space.js +1 -1
  260. package/dist/components/layout/Suffix.js +1 -1
  261. package/dist/components/navigation/Pagination/Pagination.js +1 -1
  262. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  263. package/dist/components/navigation/Tabs/BoardDragActiveProvider.d.ts +36 -0
  264. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +57 -0
  265. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js.map +1 -0
  266. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  267. package/dist/components/navigation/Tabs/TabButton.js +2 -2
  268. package/dist/components/navigation/Tabs/TabButton.js.map +1 -1
  269. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  270. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  271. package/dist/components/navigation/Tabs/TabPicker.js +1 -1
  272. package/dist/components/navigation/Tabs/Tabs.js +2 -2
  273. package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
  274. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  275. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  276. package/dist/components/navigation/Tabs/index.d.ts +2 -1
  277. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  278. package/dist/components/navigation/Tabs/styled.js +1 -1
  279. package/dist/components/navigation/Tabs/types.js +1 -1
  280. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  281. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  282. package/dist/components/navigation/index.d.ts +1 -0
  283. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  284. package/dist/components/other/Calendar/Calendar.js +1 -1
  285. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  286. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  287. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  288. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  289. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  290. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  291. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  292. package/dist/components/other/Calendar/styled.js +1 -1
  293. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  294. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  295. package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
  296. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
  297. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  298. package/dist/components/overlays/Dialog/Dialog.js +1 -1
  299. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  300. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  301. package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
  302. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  303. package/dist/components/overlays/Dialog/context.js +1 -1
  304. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  305. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  306. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  307. package/dist/components/overlays/Modal/Modal.js +1 -1
  308. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  309. package/dist/components/overlays/Modal/Overlay.js +1 -1
  310. package/dist/components/overlays/Modal/Popover.js +1 -1
  311. package/dist/components/overlays/Modal/Tray.js +1 -1
  312. package/dist/components/overlays/Modal/Underlay.js +1 -1
  313. package/dist/components/overlays/Notifications/Notification.js +1 -1
  314. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  315. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  316. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  317. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  318. package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
  319. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  320. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  321. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  322. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  323. package/dist/components/overlays/Notifications/index.js +1 -1
  324. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  325. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  326. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  327. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  328. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  329. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  330. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  331. package/dist/components/overlays/Toast/index.js +1 -1
  332. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  333. package/dist/components/overlays/Toast/useToast.js +1 -1
  334. package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
  335. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  336. package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
  337. package/dist/components/overlays/Tooltip/context.js +1 -1
  338. package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
  339. package/dist/components/portal/Portal.js +1 -1
  340. package/dist/components/portal/PortalProvider.js +1 -1
  341. package/dist/components/portal/usePortal.js +1 -1
  342. package/dist/components/shared/DraggableCollection.js +1 -1
  343. package/dist/components/shared/InvalidIcon.js +1 -1
  344. package/dist/components/shared/ValidIcon.js +1 -1
  345. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  346. package/dist/components/status/Spin/Cube.js +1 -1
  347. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  348. package/dist/components/status/Spin/Spin.js +1 -1
  349. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  350. package/dist/data/item-themes.js +1 -1
  351. package/dist/data/themes.js +1 -1
  352. package/dist/eslint-plugin/defaults.generated.js +1 -83
  353. package/dist/eslint-plugin/defaults.generated.js.map +1 -1
  354. package/dist/eslint-plugin/index.js +1 -1
  355. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  356. package/dist/i18n/I18nProvider.js +1 -1
  357. package/dist/i18n/createFormatter.js +1 -1
  358. package/dist/i18n/index.js +1 -1
  359. package/dist/i18n/instance.js +1 -1
  360. package/dist/i18n/locales/de-DE/uikit.js +1 -9
  361. package/dist/i18n/locales/en-US/uikit.js +1 -9
  362. package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -9
  363. package/dist/i18n/locales/es-ES/uikit.js +1 -9
  364. package/dist/i18n/locales/es-MX/uikit.js +1 -9
  365. package/dist/i18n/locales/fr-FR/uikit.js +1 -9
  366. package/dist/i18n/locales/it-IT/uikit.js +1 -9
  367. package/dist/i18n/locales/ja-JP/uikit.js +1 -9
  368. package/dist/i18n/locales/nb-NO/uikit.js +1 -9
  369. package/dist/i18n/locales/pt-BR/uikit.js +1 -9
  370. package/dist/i18n/locales/pt-PT/uikit.js +1 -9
  371. package/dist/i18n/locales/sv-SE/uikit.js +1 -9
  372. package/dist/i18n/locales/vi-VN/uikit.js +1 -9
  373. package/dist/i18n/locales.js +1 -1
  374. package/dist/i18n/useFormatter.js +1 -1
  375. package/dist/i18n/useI18n.js +1 -1
  376. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  377. package/dist/icons/AdjustmentsIcon.js +1 -1
  378. package/dist/icons/AiIcon.js +1 -1
  379. package/dist/icons/AreaChartIcon.js +1 -1
  380. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  381. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  382. package/dist/icons/BackwardIcon.js +1 -1
  383. package/dist/icons/BarChartIcon.js +1 -1
  384. package/dist/icons/BellFilledIcon.js +1 -1
  385. package/dist/icons/BellIcon.js +1 -1
  386. package/dist/icons/BooleanIcon.js +1 -1
  387. package/dist/icons/CalendarEditIcon.js +1 -1
  388. package/dist/icons/CalendarIcon.js +1 -1
  389. package/dist/icons/CaretDownIcon.js +1 -1
  390. package/dist/icons/CaretUpIcon.js +1 -1
  391. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  392. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  393. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  394. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  395. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  396. package/dist/icons/ChartBarLineIcon.js +1 -1
  397. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  398. package/dist/icons/ChartBarStackedIcon.js +1 -1
  399. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  400. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  401. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  402. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  403. package/dist/icons/ChartBubbleIcon.js +1 -1
  404. package/dist/icons/ChartDonut2Icon.js +1 -1
  405. package/dist/icons/ChartFunnelIcon.js +1 -1
  406. package/dist/icons/ChartHeatmapIcon.js +1 -1
  407. package/dist/icons/ChartKPIIcon.js +1 -1
  408. package/dist/icons/ChartPie2Icon.js +1 -1
  409. package/dist/icons/ChartScatterIcon.js +1 -1
  410. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  411. package/dist/icons/CheckCircleIcon.js +1 -1
  412. package/dist/icons/CheckIcon.js +1 -1
  413. package/dist/icons/CircleFilledIcon.js +1 -1
  414. package/dist/icons/ClearIcon.js +1 -1
  415. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  416. package/dist/icons/CloseCircleIcon.js +1 -1
  417. package/dist/icons/CloseIcon.js +1 -1
  418. package/dist/icons/CodeIcon.js +1 -1
  419. package/dist/icons/ColumnTotalIcon.js +1 -1
  420. package/dist/icons/CopyIcon.js +1 -1
  421. package/dist/icons/CountIcon.js +1 -1
  422. package/dist/icons/CubeIcon.js +1 -1
  423. package/dist/icons/CubePauseIcon.js +1 -1
  424. package/dist/icons/CubePlayIcon.js +1 -1
  425. package/dist/icons/CurrencyDollarIcon.js +1 -1
  426. package/dist/icons/DangerIcon.js +1 -1
  427. package/dist/icons/DashboardIcon.js +1 -1
  428. package/dist/icons/DatabaseIcon.js +1 -1
  429. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  430. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  431. package/dist/icons/DirectionIcon.js +1 -1
  432. package/dist/icons/DonutIcon.js +1 -1
  433. package/dist/icons/DownIcon.js +1 -1
  434. package/dist/icons/EditIcon.js +1 -1
  435. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  436. package/dist/icons/ExclamationCircleIcon.js +1 -1
  437. package/dist/icons/ExclamationIcon.js +1 -1
  438. package/dist/icons/EyeIcon.js +1 -1
  439. package/dist/icons/EyeInvisibleIcon.js +1 -1
  440. package/dist/icons/FilterIcon.js +1 -1
  441. package/dist/icons/FolderFilledIcon.js +1 -1
  442. package/dist/icons/FolderIcon.js +1 -1
  443. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  444. package/dist/icons/FolderOpenIcon.js +1 -1
  445. package/dist/icons/ForwardIcon.js +1 -1
  446. package/dist/icons/GripVerticalIcon.js +1 -1
  447. package/dist/icons/HierarchyIcon.js +1 -1
  448. package/dist/icons/HierarchyOpenIcon.js +1 -1
  449. package/dist/icons/Icon.js +1 -1
  450. package/dist/icons/InfoCircleIcon.js +1 -1
  451. package/dist/icons/InfoIcon.js +1 -1
  452. package/dist/icons/KeyIcon.js +1 -1
  453. package/dist/icons/LeftIcon.js +1 -1
  454. package/dist/icons/LineChartIcon.js +1 -1
  455. package/dist/icons/LoadingIcon.js +1 -1
  456. package/dist/icons/LockFilledIcon.js +1 -1
  457. package/dist/icons/LockIcon.js +1 -1
  458. package/dist/icons/MoreIcon.js +1 -1
  459. package/dist/icons/NotAllowedIcon.js +1 -1
  460. package/dist/icons/Number123Icon.js +1 -1
  461. package/dist/icons/NumberIcon.js +1 -1
  462. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  463. package/dist/icons/PauseCircleIcon.js +1 -1
  464. package/dist/icons/PauseIcon.js +1 -1
  465. package/dist/icons/PercentageIcon.js +1 -1
  466. package/dist/icons/PieChartIcon.js +1 -1
  467. package/dist/icons/PipetteIcon.js +1 -1
  468. package/dist/icons/PlayCircleIcon.js +1 -1
  469. package/dist/icons/PlayIcon.js +1 -1
  470. package/dist/icons/PlusIcon.js +1 -1
  471. package/dist/icons/ProgressBarIcon.js +1 -1
  472. package/dist/icons/ReloadIcon.js +1 -1
  473. package/dist/icons/ReportIcon.js +1 -1
  474. package/dist/icons/ReturnIcon.js +1 -1
  475. package/dist/icons/RightIcon.js +1 -1
  476. package/dist/icons/RowTotalsIcon.js +1 -1
  477. package/dist/icons/SchemeIcon.js +1 -1
  478. package/dist/icons/SearchIcon.js +1 -1
  479. package/dist/icons/SemanticQueryIcon.js +1 -1
  480. package/dist/icons/SettingsIcon.js +1 -1
  481. package/dist/icons/ShieldFilledIcon.js +1 -1
  482. package/dist/icons/ShieldIcon.js +1 -1
  483. package/dist/icons/SlashIcon.js +1 -1
  484. package/dist/icons/SparklesIcon.js +1 -1
  485. package/dist/icons/SqlIcon.js +1 -1
  486. package/dist/icons/StatsIcon.js +1 -1
  487. package/dist/icons/StopIcon.js +1 -1
  488. package/dist/icons/StringIcon.js +1 -1
  489. package/dist/icons/SubtotalsIcon.js +1 -1
  490. package/dist/icons/SwitchIcon.js +1 -1
  491. package/dist/icons/TableIcon.js +1 -1
  492. package/dist/icons/ThumbsDownIcon.js +1 -1
  493. package/dist/icons/ThumbsUpIcon.js +1 -1
  494. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  495. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  496. package/dist/icons/ThunderboltIcon.js +1 -1
  497. package/dist/icons/TimeIcon.js +1 -1
  498. package/dist/icons/TrashIcon.js +1 -1
  499. package/dist/icons/UnlockIcon.js +1 -1
  500. package/dist/icons/UpIcon.js +1 -1
  501. package/dist/icons/UserGroupIcon.js +1 -1
  502. package/dist/icons/UserIcon.js +1 -1
  503. package/dist/icons/UserLockIcon.js +1 -1
  504. package/dist/icons/ViewIcon.js +1 -1
  505. package/dist/icons/WarningFilledIcon.js +1 -1
  506. package/dist/icons/WarningIcon.js +1 -1
  507. package/dist/icons/wrap-icon.js +1 -1
  508. package/dist/index.d.ts +3 -15
  509. package/dist/index.js +3 -11
  510. package/dist/index.js.map +1 -1
  511. package/dist/probe/canonicalize.js +1 -1
  512. package/dist/probe/css.js +1 -1
  513. package/dist/probe/index.js +1 -1
  514. package/dist/provider.js +1 -1
  515. package/dist/providers/TrackingProvider.js +1 -1
  516. package/dist/providers/navigationAdapter.default.js +1 -1
  517. package/dist/tokens/all-tokens.js +1 -1
  518. package/dist/tokens/base.js +1 -1
  519. package/dist/tokens/color-seed.js +1 -1
  520. package/dist/tokens/color-theme.js +1 -1
  521. package/dist/tokens/colors.js +1 -1
  522. package/dist/tokens/layout.js +1 -1
  523. package/dist/tokens/lazy-styles.js +1 -1
  524. package/dist/tokens/legacy-color.js +1 -1
  525. package/dist/tokens/palette-config.js +1 -1
  526. package/dist/tokens/palette.js +1 -1
  527. package/dist/tokens/resolve.js +1 -1
  528. package/dist/tokens/shadows.js +1 -1
  529. package/dist/tokens/sizes.js +1 -1
  530. package/dist/tokens/spacing.js +1 -1
  531. package/dist/tokens/typography.js +1 -1
  532. package/dist/utils/ResizeSensor.js +1 -1
  533. package/dist/utils/colors.js +1 -1
  534. package/dist/utils/dotize.js +1 -1
  535. package/dist/utils/is-dev-env.js +1 -1
  536. package/dist/utils/modules.js +1 -1
  537. package/dist/utils/promise.js +1 -1
  538. package/dist/utils/raf.js +1 -1
  539. package/dist/utils/random.js +1 -1
  540. package/dist/utils/range.js +1 -1
  541. package/dist/utils/react/RenderCache.js +1 -1
  542. package/dist/utils/react/Slots.js +1 -1
  543. package/dist/utils/react/chain.js +1 -1
  544. package/dist/utils/react/disabledProps.js +1 -1
  545. package/dist/utils/react/escapePropagation.js +1 -1
  546. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  547. package/dist/utils/react/index.js +1 -1
  548. package/dist/utils/react/interactions.js +1 -1
  549. package/dist/utils/react/isTextOnly.js +1 -1
  550. package/dist/utils/react/mapProps.js +1 -1
  551. package/dist/utils/react/mergeProps.js +1 -1
  552. package/dist/utils/react/nullableValue.js +1 -1
  553. package/dist/utils/react/programmaticFocus.js +1 -1
  554. package/dist/utils/react/resolveIcon.js +1 -1
  555. package/dist/utils/react/sharedStore.js +1 -1
  556. package/dist/utils/react/useBufferedValue.js +1 -1
  557. package/dist/utils/react/useCombinedRefs.js +1 -1
  558. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  559. package/dist/utils/react/useEventBus.js +1 -1
  560. package/dist/utils/react/useId.js +1 -1
  561. package/dist/utils/react/useIsDarwin.js +1 -1
  562. package/dist/utils/react/useKeySymbols.js +1 -1
  563. package/dist/utils/react/useLayoutEffect.js +1 -1
  564. package/dist/utils/react/useLocalStorage.js +1 -1
  565. package/dist/utils/react/useMergeStyles.js +1 -1
  566. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  567. package/dist/utils/react/usePopoverSync.js +1 -1
  568. package/dist/utils/react/useQaProps.js +1 -1
  569. package/dist/utils/react/useScheme.js +1 -1
  570. package/dist/utils/react/useViewportSize.js +1 -1
  571. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  572. package/dist/utils/selection.js +1 -1
  573. package/dist/utils/styles.js +1 -1
  574. package/dist/utils/tree.js +1 -1
  575. package/dist/utils/warnings.js +1 -1
  576. package/dist/version.js +2 -2
  577. package/docs/components/data/ItemTable.md +1 -1
  578. package/docs/components/navigation/Tabs.md +8 -2
  579. package/package.json +1 -1
  580. package/dist/components/layout/Board/Board.d.ts +0 -253
  581. package/dist/components/layout/Board/Board.js +0 -771
  582. package/dist/components/layout/Board/Board.js.map +0 -1
  583. package/dist/components/layout/Board/BoardProvider.d.ts +0 -28
  584. package/dist/components/layout/Board/BoardProvider.js +0 -47
  585. package/dist/components/layout/Board/BoardProvider.js.map +0 -1
  586. package/dist/components/layout/Board/BoardResponsive.d.ts +0 -55
  587. package/dist/components/layout/Board/BoardResponsive.js +0 -101
  588. package/dist/components/layout/Board/BoardResponsive.js.map +0 -1
  589. package/dist/components/layout/Board/Widget.d.ts +0 -152
  590. package/dist/components/layout/Board/Widget.js +0 -76
  591. package/dist/components/layout/Board/Widget.js.map +0 -1
  592. package/dist/components/layout/Board/WidgetHost.js +0 -1065
  593. package/dist/components/layout/Board/WidgetHost.js.map +0 -1
  594. package/dist/components/layout/Board/board-context.d.ts +0 -43
  595. package/dist/components/layout/Board/board-context.js +0 -79
  596. package/dist/components/layout/Board/board-context.js.map +0 -1
  597. package/dist/components/layout/Board/board-store.d.ts +0 -4
  598. package/dist/components/layout/Board/board-store.js +0 -49
  599. package/dist/components/layout/Board/board-store.js.map +0 -1
  600. package/dist/components/layout/Board/grid-core/calculate.js +0 -90
  601. package/dist/components/layout/Board/grid-core/calculate.js.map +0 -1
  602. package/dist/components/layout/Board/grid-core/collision-modes.js +0 -254
  603. package/dist/components/layout/Board/grid-core/collision-modes.js.map +0 -1
  604. package/dist/components/layout/Board/grid-core/collision.js +0 -35
  605. package/dist/components/layout/Board/grid-core/collision.js.map +0 -1
  606. package/dist/components/layout/Board/grid-core/compactors.d.ts +0 -23
  607. package/dist/components/layout/Board/grid-core/compactors.js +0 -166
  608. package/dist/components/layout/Board/grid-core/compactors.js.map +0 -1
  609. package/dist/components/layout/Board/grid-core/constraints.d.ts +0 -35
  610. package/dist/components/layout/Board/grid-core/constraints.js +0 -155
  611. package/dist/components/layout/Board/grid-core/constraints.js.map +0 -1
  612. package/dist/components/layout/Board/grid-core/group-move.js +0 -317
  613. package/dist/components/layout/Board/grid-core/group-move.js.map +0 -1
  614. package/dist/components/layout/Board/grid-core/layout.js +0 -186
  615. package/dist/components/layout/Board/grid-core/layout.js.map +0 -1
  616. package/dist/components/layout/Board/grid-core/placement.d.ts +0 -58
  617. package/dist/components/layout/Board/grid-core/placement.js +0 -153
  618. package/dist/components/layout/Board/grid-core/placement.js.map +0 -1
  619. package/dist/components/layout/Board/grid-core/sort.js +0 -37
  620. package/dist/components/layout/Board/grid-core/sort.js.map +0 -1
  621. package/dist/components/layout/Board/grid-core/types.d.ts +0 -186
  622. package/dist/components/layout/Board/index.d.ts +0 -24
  623. package/dist/components/layout/Board/index.js +0 -20
  624. package/dist/components/layout/Board/index.js.map +0 -1
  625. package/dist/components/layout/Board/responsive-utils.d.ts +0 -13
  626. package/dist/components/layout/Board/responsive-utils.js +0 -55
  627. package/dist/components/layout/Board/responsive-utils.js.map +0 -1
  628. package/dist/components/layout/Board/use-board-layout.d.ts +0 -26
  629. package/dist/components/layout/Board/use-board-layout.js +0 -57
  630. package/dist/components/layout/Board/use-board-layout.js.map +0 -1
  631. package/dist/components/layout/Board/use-board-registry.js +0 -700
  632. package/dist/components/layout/Board/use-board-registry.js.map +0 -1
  633. package/dist/components/layout/Board/use-board-select-modifier-key.js +0 -24
  634. package/dist/components/layout/Board/use-board-select-modifier-key.js.map +0 -1
  635. package/dist/components/layout/Board/use-board-selection.d.ts +0 -8
  636. package/dist/components/layout/Board/use-board-selection.js +0 -113
  637. package/dist/components/layout/Board/use-board-selection.js.map +0 -1
  638. package/docs/components/layout/Board.md +0 -473
@@ -1,771 +0,0 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-c325dcb | Cube Dev Team */
2
- import { extractStyles } from "../../../utils/styles.js";
3
- import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
4
- import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
5
- import { useEvent } from "../../../_internal/hooks/use-event.js";
6
- import { useI18n } from "../../../i18n/useI18n.js";
7
- import { BoardGridLinesContext, BoardMetricsContext, useBoardGridLines, useBoardHost, useBoardMetrics, useBoardRegistry } from "./board-context.js";
8
- import { getAllCollisions } from "./grid-core/collision.js";
9
- import { bottom, cloneLayout, correctBounds, getLayoutItem, modifyLayout } from "./grid-core/layout.js";
10
- import { getCompactor } from "./grid-core/compactors.js";
11
- import { calcGridColWidth, calcGridItemPosition, calcWH } from "./grid-core/calculate.js";
12
- import { applySizeConstraints, defaultConstraints } from "./grid-core/constraints.js";
13
- import { BoardProvider } from "./BoardProvider.js";
14
- import { useBoardLayout } from "./use-board-layout.js";
15
- import { useBoardSelectModifierKey } from "./use-board-select-modifier-key.js";
16
- import { useBoardSelection } from "./use-board-selection.js";
17
- import { WidgetHost } from "./WidgetHost.js";
18
- import { c } from "react/compiler-runtime";
19
- import { CONTAINER_STYLES, filterBaseProps, mergeStyles, tasty } from "@tenphi/tasty";
20
- import { forwardRef, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
21
- import { jsx, jsxs } from "react/jsx-runtime";
22
- import { useFocusWithin } from "react-aria";
23
- import { useResizeObserver } from "@react-aria/utils";
24
-
25
- //#region src/components/layout/Board/Board.tsx
26
- const BoardElement = tasty({
27
- qa: "Board",
28
- styles: {
29
- position: "relative",
30
- display: "block",
31
- width: "100%",
32
- flexGrow: 1,
33
- height: "min 0",
34
- fill: "#surface",
35
- boxSizing: "border-box",
36
- outline: 0,
37
- userSelect: {
38
- "": "auto",
39
- marquee: "none"
40
- }
41
- }
42
- });
43
- const ContentLayer = tasty({ styles: {
44
- position: "absolute",
45
- inset: 0
46
- } });
47
- const PlaceholderElement = tasty({
48
- qa: "BoardPlaceholder",
49
- styles: {
50
- position: "absolute",
51
- top: 0,
52
- left: 0,
53
- fill: "#primary.10",
54
- radius: "1cr",
55
- border: "#primary.40",
56
- zIndex: 2,
57
- pointerEvents: "none",
58
- transition: "inset linear, width linear, height linear",
59
- boxSizing: "border-box"
60
- }
61
- });
62
- const MarqueeElement = tasty({
63
- qa: "BoardMarquee",
64
- styles: {
65
- position: "absolute",
66
- top: 0,
67
- left: 0,
68
- fill: "#primary-accent-surface.06",
69
- border: "1bw dashed #primary-border",
70
- radius: "1cr",
71
- zIndex: 3,
72
- pointerEvents: "none",
73
- boxSizing: "border-box"
74
- }
75
- });
76
- const A11yLayer = tasty({ styles: {
77
- position: "absolute",
78
- width: "1px",
79
- height: "1px",
80
- padding: 0,
81
- margin: "-1px",
82
- overflow: "hidden",
83
- clipPath: "inset(50%)",
84
- whiteSpace: "nowrap",
85
- border: 0
86
- } });
87
- const GridOverlayElement = tasty({
88
- qa: "BoardGridOverlay",
89
- styles: {
90
- position: "absolute",
91
- zIndex: 0,
92
- pointerEvents: "none",
93
- boxSizing: "border-box",
94
- opacity: ".5"
95
- }
96
- });
97
- /**
98
- * Descendants whose clicks never change the selection. A widget is a large
99
- * surface the user also clicks to *work with*, so anything interactive inside it
100
- * must keep its click. `[data-no-select]` is the escape hatch for an app's own
101
- * custom controls.
102
- */
103
- const BOARD_SELECTION_CANCEL = "input,textarea,select,button,a,[role=\"button\"],[role=\"menuitem\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"tab\"],[contenteditable=\"true\"],[data-no-select]";
104
- /**
105
- * Row height when none is given, and the fallback a `rowHeight="stretch"` board
106
- * uses until it has both a bounded row count and a measured height to divide.
107
- */
108
- const DEFAULT_ROW_HEIGHT = 100;
109
- /** Manhattan distance a pointer must travel before a press becomes a marquee. */
110
- const MARQUEE_THRESHOLD = 4;
111
- /** Shared empty set, so "no pre-selection" is a stable reference. */
112
- const NO_KEYS = /* @__PURE__ */ new Set();
113
- /**
114
- * Whether an event landed in a text-editing context. Checking the *event target*
115
- * beats `document.activeElement`: it stays correct for content rendered through
116
- * a portal, and it cannot be fooled by focus that moved between the keystroke
117
- * and the handler.
118
- */
119
- function isEditableTarget(target) {
120
- const el = target;
121
- if (!el || typeof el.closest !== "function") return false;
122
- return !!el.closest("input,textarea,select,[contenteditable=\"true\"]");
123
- }
124
- function compactTypeToCore(compact) {
125
- if (compact === "free") return null;
126
- return compact;
127
- }
128
- function BoardInner(props, ref) {
129
- const { id: providedId, layout: controlledLayout, defaultLayout, onLayoutChange, onDragStart, onDrag, onDragStop, onResizeStart, onResize: onResizeProp, onResizeStop, cols = 12, rows: fixedRows, rowHeight = DEFAULT_ROW_HEIGHT, margin = [8, 8], containerPadding, maxRows: maxRowsProp, extraRows = 0, compact = "vertical", allowOverlap = false, preventCollision = false, collisionMode = "revert", isDraggable = true, isResizable = true, isDroppable = true, resizeHandles = ["se"], resizeGripPlacement, dragCancel = BOARD_SELECTION_CANCEL, dragHandle, showGridLines, isAligned = false, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, selectionCancel = BOARD_SELECTION_CANCEL, allowMarqueeSelection = selectionMode === "multiple", onWidgetsDelete, constraints, width: providedWidth, widgetProps, children, ...otherProps } = props;
130
- const maxRows = maxRowsProp ?? (fixedRows != null ? Math.max(1, fixedRows) : Infinity);
131
- const registry = useBoardRegistry();
132
- const parentMetrics = useBoardMetrics();
133
- const host = useBoardHost();
134
- const inheritedGridLines = useBoardGridLines();
135
- const aligned = isAligned && !!parentMetrics;
136
- const boardDepth = (parentMetrics?.depth ?? -1) + 1;
137
- const widgetPropsStyles = useMemo(() => {
138
- if (!widgetProps) return void 0;
139
- const extracted = extractStyles(widgetProps, CONTAINER_STYLES);
140
- return Object.keys(extracted).length > 0 ? extracted : void 0;
141
- }, [widgetProps]);
142
- const effectiveShowGridLines = showGridLines ?? inheritedGridLines;
143
- const generatedId = useId();
144
- const boardId = providedId ?? generatedId;
145
- const selectedHintId = `${generatedId}-selected`;
146
- const { t } = useI18n();
147
- const containerRef = useCombinedRefs(ref);
148
- const contentRef = useRef(null);
149
- const [measuredWidth, setMeasuredWidth] = useState(0);
150
- const [measuredHeight, setMeasuredHeight] = useState(0);
151
- const width = providedWidth ?? measuredWidth;
152
- const onResizeContainer = useEvent(() => {
153
- const el = containerRef.current;
154
- if (!el) return;
155
- const nextWidth = el.offsetWidth;
156
- const nextHeight = el.offsetHeight;
157
- if (nextWidth > 0) setMeasuredWidth(nextWidth);
158
- if (nextHeight > 0) setMeasuredHeight(nextHeight);
159
- });
160
- useResizeObserver({
161
- ref: containerRef,
162
- onResize: onResizeContainer
163
- });
164
- useEffect(() => {
165
- if (providedWidth == null) onResizeContainer();
166
- }, [providedWidth]);
167
- const { layout, layoutRef, placeholders, placeholder, placeholdersRef, placeholderRef, setPlaceholders, applyLayout } = useBoardLayout({
168
- layout: controlledLayout,
169
- defaultLayout,
170
- onLayoutChange
171
- });
172
- const getWidgetLabel = useEvent((key) => {
173
- const registration = registry.store.get(key);
174
- return registration?.["aria-label"] ?? registration?.qa ?? key;
175
- });
176
- const isWidgetSelectable = (key) => (registry.store.get(key)?.isSelectable ?? widgetProps?.isSelectable) !== false;
177
- const { selectedKeySet, selectedKeysRef, setSelection, select, clearSelection, announcement } = useBoardSelection({
178
- selectionMode,
179
- selectedKeys,
180
- defaultSelectedKeys,
181
- onSelectionChange,
182
- layout,
183
- getLabel: getWidgetLabel
184
- });
185
- const selectModifierKey = useBoardSelectModifierKey();
186
- useSyncExternalStore(registry.store.subscribe, registry.store.getVersion);
187
- const effectiveMargin = aligned ? parentMetrics.margin : margin;
188
- const resolvedPadding = containerPadding ?? (aligned ? [0, 0] : effectiveMargin);
189
- const rows = Math.max(bottom(layout), ...placeholders.map((p) => p.y + p.h), 0);
190
- const renderedRows = fixedRows != null ? Math.max(1, fixedRows) : Math.min(rows + Math.max(0, extraRows), maxRows);
191
- const parentColWidth = aligned ? parentMetrics.colWidth : 0;
192
- const alignedCols = aligned && width > 0 ? Math.max(1, Math.floor((width - resolvedPadding[0] * 2 + effectiveMargin[0] + 2) / (parentColWidth + effectiveMargin[0]))) : cols;
193
- const effectiveCols = aligned ? alignedCols : cols;
194
- const effectiveContainerWidth = aligned ? parentColWidth * effectiveCols + effectiveMargin[0] * Math.max(0, effectiveCols - 1) + resolvedPadding[0] * 2 : width;
195
- const isStretching = rowHeight === "stretch" && fixedRows != null;
196
- const stretchedRowHeight = isStretching && measuredHeight > 0 ? Math.max(1, (measuredHeight - Math.max(0, renderedRows - 1) * effectiveMargin[1] - resolvedPadding[1] * 2) / renderedRows) : DEFAULT_ROW_HEIGHT;
197
- const effectiveRowHeight = aligned ? parentMetrics.rowHeight : rowHeight === "stretch" ? stretchedRowHeight : rowHeight;
198
- const positionParams = useMemo(() => ({
199
- margin: effectiveMargin,
200
- containerPadding: resolvedPadding,
201
- containerWidth: effectiveContainerWidth,
202
- cols: effectiveCols,
203
- rowHeight: effectiveRowHeight,
204
- maxRows
205
- }), [
206
- effectiveMargin[0],
207
- effectiveMargin[1],
208
- resolvedPadding[0],
209
- resolvedPadding[1],
210
- effectiveContainerWidth,
211
- effectiveCols,
212
- effectiveRowHeight,
213
- maxRows
214
- ]);
215
- const compactor = useMemo(() => getCompactor(compactTypeToCore(compact), allowOverlap, compact === "free" ? !allowOverlap : preventCollision), [
216
- compact,
217
- allowOverlap,
218
- preventCollision
219
- ]);
220
- const resolvedConstraints = constraints ?? defaultConstraints;
221
- const computedHeight = renderedRows > 0 ? renderedRows * effectiveRowHeight + Math.max(0, renderedRows - 1) * effectiveMargin[1] + resolvedPadding[1] * 2 : effectiveRowHeight;
222
- const containerHeight = (aligned || isStretching) && measuredHeight > 0 ? measuredHeight : computedHeight;
223
- const liveRef = useRef({
224
- positionParams,
225
- compactor,
226
- collisionMode,
227
- constraints: resolvedConstraints,
228
- maxRows,
229
- containerHeight,
230
- isDroppable
231
- });
232
- liveRef.current = {
233
- positionParams,
234
- compactor,
235
- collisionMode,
236
- constraints: resolvedConstraints,
237
- maxRows,
238
- containerHeight,
239
- isDroppable
240
- };
241
- const applyLayoutEvent = useEvent(applyLayout);
242
- const setPlaceholdersEvent = useEvent(setPlaceholders);
243
- const entryRef = useRef(null);
244
- if (!entryRef.current) entryRef.current = {
245
- id: boardId,
246
- getContentRect: () => contentRef.current?.getBoundingClientRect() ?? null,
247
- getContentNode: () => contentRef.current,
248
- getPositionParams: () => liveRef.current.positionParams,
249
- getConstraints: () => liveRef.current.constraints,
250
- getCompactor: () => liveRef.current.compactor,
251
- getCollisionMode: () => liveRef.current.collisionMode,
252
- getMaxRows: () => liveRef.current.maxRows,
253
- getContainerHeight: () => liveRef.current.containerHeight,
254
- getLayout: () => layoutRef.current,
255
- getSelectedKeys: () => selectedKeysRef.current.size > 0 ? selectedKeysRef.current : null,
256
- applyLayout: (next, commit, reason) => applyLayoutEvent(next, commit, reason),
257
- setPlaceholders: (items) => setPlaceholdersEvent(items),
258
- isDroppable: () => liveRef.current.isDroppable
259
- };
260
- useEffect(() => {
261
- const entry = entryRef.current;
262
- entry.id = boardId;
263
- return registry.registerBoard(entry);
264
- }, [boardId]);
265
- const recompactForCols = useEvent((nextCols) => {
266
- const corrected = correctBounds(cloneLayout(layoutRef.current), { cols: nextCols });
267
- applyLayoutEvent([...liveRef.current.compactor.compact(corrected, nextCols)], true, "normalize");
268
- });
269
- const prevAlignedColsRef = useRef(null);
270
- useEffect(() => {
271
- if (!aligned) {
272
- prevAlignedColsRef.current = null;
273
- return;
274
- }
275
- if (width <= 0) return;
276
- if (prevAlignedColsRef.current === null) {
277
- prevAlignedColsRef.current = effectiveCols;
278
- return;
279
- }
280
- if (prevAlignedColsRef.current === effectiveCols) return;
281
- prevAlignedColsRef.current = effectiveCols;
282
- recompactForCols(effectiveCols);
283
- }, [
284
- aligned,
285
- width,
286
- effectiveCols,
287
- recompactForCols
288
- ]);
289
- const naturalHeight = renderedRows > 0 ? renderedRows * effectiveRowHeight + Math.max(0, renderedRows - 1) * effectiveMargin[1] + resolvedPadding[1] * 2 : effectiveRowHeight;
290
- const registerNestedBoard = host?.registerNestedBoard;
291
- useEffect(() => registerNestedBoard?.(), [registerNestedBoard]);
292
- const requestHeightDeficit = host?.requestHeightDeficit;
293
- useEffect(() => {
294
- if (!aligned || !host?.isAutoHeight || !requestHeightDeficit) return;
295
- if (measuredHeight <= 0) return;
296
- requestHeightDeficit(naturalHeight - measuredHeight);
297
- }, [
298
- aligned,
299
- host?.isAutoHeight,
300
- requestHeightDeficit,
301
- naturalHeight,
302
- measuredHeight
303
- ]);
304
- const resizeStateRef = useRef(null);
305
- const autoHeightMinRowsRef = useRef({});
306
- const handleResize = useEvent((id, axis, phase, dx, dy) => {
307
- const pp = liveRef.current.positionParams;
308
- if (phase === "start") {
309
- const rawItem = getLayoutItem(layoutRef.current, id);
310
- if (!rawItem) return;
311
- const reg = registry.store.get(id);
312
- const item = {
313
- ...rawItem,
314
- minW: rawItem.minW ?? reg?.minW ?? widgetProps?.minW,
315
- maxW: rawItem.maxW ?? reg?.maxW ?? widgetProps?.maxW,
316
- minH: rawItem.minH ?? reg?.minH ?? widgetProps?.minH,
317
- maxH: rawItem.maxH ?? reg?.maxH ?? widgetProps?.maxH,
318
- constraints: rawItem.constraints ?? reg?.constraints ?? widgetProps?.constraints
319
- };
320
- resizeStateRef.current = {
321
- id,
322
- axis,
323
- item: { ...item },
324
- origin: calcGridItemPosition(pp, item.x, item.y, item.w, item.h),
325
- accX: 0,
326
- accY: 0
327
- };
328
- setPlaceholders([{ ...item }]);
329
- onResizeStart?.({
330
- layout: layoutRef.current,
331
- item: { ...item },
332
- oldItem: { ...item },
333
- placeholder: { ...item },
334
- items: [{ ...item }],
335
- oldItems: [{ ...item }],
336
- placeholders: [{ ...item }]
337
- });
338
- return;
339
- }
340
- const rs = resizeStateRef.current;
341
- if (!rs) return;
342
- if (phase === "end") {
343
- const finalLayout = [...layoutRef.current];
344
- applyLayout(finalLayout, true, "resize");
345
- setPlaceholders([]);
346
- const resizedItem = getLayoutItem(finalLayout, id) ?? rs.item;
347
- onResizeStop?.({
348
- layout: finalLayout,
349
- item: resizedItem,
350
- oldItem: rs.item,
351
- placeholder: null,
352
- items: [resizedItem],
353
- oldItems: [rs.item],
354
- placeholders: []
355
- });
356
- resizeStateRef.current = null;
357
- return;
358
- }
359
- rs.accX += dx;
360
- rs.accY += dy;
361
- const { origin, item, axis: handle } = rs;
362
- let newW = origin.width;
363
- let newH = origin.height;
364
- if (handle.includes("e")) newW = origin.width + rs.accX;
365
- if (handle.includes("w")) newW = origin.width - rs.accX;
366
- if (handle.includes("s")) newH = origin.height + rs.accY;
367
- if (handle.includes("n")) newH = origin.height - rs.accY;
368
- newW = Math.max(newW, 8);
369
- newH = Math.max(newH, 8);
370
- const raw = calcWH(pp, newW, newH, item.x, item.y, handle);
371
- const constrained = applySizeConstraints(liveRef.current.constraints, item, raw.w, raw.h, handle, {
372
- cols: pp.cols,
373
- maxRows: liveRef.current.maxRows,
374
- containerWidth: pp.containerWidth,
375
- containerHeight: liveRef.current.containerHeight,
376
- rowHeight: pp.rowHeight,
377
- margin: pp.margin,
378
- layout: layoutRef.current
379
- });
380
- const floorRows = autoHeightMinRowsRef.current[id] ?? 0;
381
- const finalW = constrained.w;
382
- const finalH = Math.max(constrained.h, floorRows);
383
- let x = item.x;
384
- let y = item.y;
385
- if (handle.includes("w")) x = item.x + item.w - finalW;
386
- if (handle.includes("n")) y = item.y + item.h - finalH;
387
- x = Math.max(0, x);
388
- y = Math.max(0, y);
389
- let newItem = {
390
- ...item,
391
- x,
392
- y,
393
- w: finalW,
394
- h: finalH
395
- };
396
- const compactor = liveRef.current.compactor;
397
- if (compactor.preventCollision && !compactor.allowOverlap) {
398
- if (getAllCollisions(layoutRef.current, newItem).some((other) => other.i !== id)) {
399
- const lastValid = getLayoutItem(layoutRef.current, id);
400
- if (lastValid) newItem = { ...lastValid };
401
- }
402
- }
403
- const working = modifyLayout(layoutRef.current, newItem);
404
- const compacted = [...compactor.compact(working, pp.cols)];
405
- applyLayout(compacted, false);
406
- const nextPlaceholder = getLayoutItem(compacted, id) ?? newItem;
407
- setPlaceholders([nextPlaceholder]);
408
- const resizedItem = getLayoutItem(compacted, id) ?? newItem;
409
- onResizeProp?.({
410
- layout: compacted,
411
- item: resizedItem,
412
- oldItem: rs.item,
413
- placeholder: nextPlaceholder,
414
- items: [resizedItem],
415
- oldItems: [rs.item],
416
- placeholders: [nextPlaceholder]
417
- });
418
- });
419
- const handleAutoHeight = useEvent((id, neededRows) => {
420
- autoHeightMinRowsRef.current[id] = neededRows;
421
- const current = getLayoutItem(layoutRef.current, id);
422
- if (!current || neededRows <= current.h) return;
423
- if (registry.dragState || resizeStateRef.current) return;
424
- const pp = liveRef.current.positionParams;
425
- const working = modifyLayout(layoutRef.current, {
426
- ...current,
427
- h: neededRows
428
- });
429
- applyLayout([...liveRef.current.compactor.compact(working, pp.cols)], true, "normalize");
430
- });
431
- const dragOldItemRef = useRef(null);
432
- const dragOldItemsRef = useRef([]);
433
- const handleDragLifecycle = useEvent((id, phase) => {
434
- const currentLayout = layoutRef.current;
435
- const liveItem = getLayoutItem(currentLayout, id);
436
- if (phase === "start") {
437
- dragOldItemRef.current = liveItem ? { ...liveItem } : null;
438
- const ds = registry.getDragState();
439
- dragOldItemsRef.current = ds && ds.itemId === id ? ds.items.map((it) => ({ ...it })) : [];
440
- }
441
- const oldItem = dragOldItemRef.current ?? liveItem;
442
- if (!oldItem) return;
443
- const item = liveItem ?? oldItem;
444
- const oldItems = dragOldItemsRef.current.length ? dragOldItemsRef.current : [oldItem];
445
- const items = oldItems.map((old) => getLayoutItem(currentLayout, old.i) ?? old);
446
- const info = {
447
- layout: currentLayout,
448
- item,
449
- oldItem,
450
- placeholder: placeholderRef.current,
451
- items,
452
- oldItems,
453
- placeholders: placeholdersRef.current
454
- };
455
- if (phase === "start") onDragStart?.(info);
456
- else if (phase === "move") onDrag?.(info);
457
- else {
458
- onDragStop?.(info);
459
- dragOldItemRef.current = null;
460
- dragOldItemsRef.current = [];
461
- }
462
- });
463
- const [marqueeRect, setMarqueeRect] = useState(null);
464
- const [preSelectedKeys, setPreSelectedKeys] = useState(NO_KEYS);
465
- const [isMarqueeActive, setIsMarqueeActive] = useState(false);
466
- const handleContentPointerDown = useEvent((event) => {
467
- if (selectionMode !== "multiple" || !allowMarqueeSelection || event.button !== 0 || registry.dragState) return;
468
- const target = event.target;
469
- if (target?.closest("[data-board-widget-host]")) return;
470
- if (selectionCancel && target?.closest(selectionCancel)) return;
471
- const content = contentRef.current;
472
- if (!content) return;
473
- if (target && !content.contains(target)) return;
474
- event.preventDefault();
475
- setIsMarqueeActive(true);
476
- const origin = content.getBoundingClientRect();
477
- const startX = event.clientX;
478
- const startY = event.clientY;
479
- const additive = event[selectModifierKey] || event.shiftKey;
480
- const base = additive ? [...selectedKeysRef.current] : [];
481
- let passedThreshold = false;
482
- const hitTest = (clientX, clientY) => {
483
- const left = Math.min(startX, clientX) - origin.left;
484
- const right = Math.max(startX, clientX) - origin.left;
485
- const top = Math.min(startY, clientY) - origin.top;
486
- const bottom = Math.max(startY, clientY) - origin.top;
487
- const next = new Set(base);
488
- for (const it of layoutRef.current) {
489
- if (!isWidgetSelectable(it.i)) continue;
490
- const pos = calcGridItemPosition(liveRef.current.positionParams, it.x, it.y, it.w, it.h);
491
- if (pos.left < right && pos.left + pos.width > left && pos.top < bottom && pos.top + pos.height > top) next.add(it.i);
492
- }
493
- return {
494
- next,
495
- box: {
496
- left,
497
- top,
498
- width: right - left,
499
- height: bottom - top
500
- }
501
- };
502
- };
503
- const blockSelectStart = (e) => e.preventDefault();
504
- const handleMove = (e) => {
505
- if (!passedThreshold && Math.abs(e.clientX - startX) + Math.abs(e.clientY - startY) < MARQUEE_THRESHOLD) return;
506
- if (!passedThreshold) {
507
- const selection = window.getSelection();
508
- const anchor = selection?.anchorNode;
509
- if (anchor && containerRef.current?.contains(anchor)) selection?.removeAllRanges();
510
- }
511
- passedThreshold = true;
512
- const { box, next } = hitTest(e.clientX, e.clientY);
513
- setMarqueeRect(box);
514
- setPreSelectedKeys(next);
515
- };
516
- const finish = (e) => {
517
- window.removeEventListener("pointermove", handleMove);
518
- window.removeEventListener("pointerup", finish);
519
- window.removeEventListener("pointercancel", finish);
520
- window.removeEventListener("selectstart", blockSelectStart);
521
- setMarqueeRect(null);
522
- setPreSelectedKeys(NO_KEYS);
523
- setIsMarqueeActive(false);
524
- if (passedThreshold) setSelection(hitTest(e.clientX, e.clientY).next);
525
- else if (!additive) clearSelection();
526
- containerRef.current?.focus({ preventScroll: true });
527
- };
528
- window.addEventListener("pointermove", handleMove);
529
- window.addEventListener("pointerup", finish);
530
- window.addEventListener("pointercancel", finish);
531
- window.addEventListener("selectstart", blockSelectStart);
532
- });
533
- const marqueeStyle = marqueeRect ? {
534
- left: `${marqueeRect.left}px`,
535
- top: `${marqueeRect.top}px`,
536
- width: `${marqueeRect.width}px`,
537
- height: `${marqueeRect.height}px`
538
- } : null;
539
- const { focusWithinProps: boardFocusWithinProps } = useFocusWithin({
540
- isDisabled: selectionMode === "none",
541
- onBlurWithin: () => clearSelection()
542
- });
543
- const handleBoardKeyDown = useEvent((event) => {
544
- if (selectionMode === "none") return;
545
- const selected = selectedKeysRef.current;
546
- if (selected.size === 0) return;
547
- if (event.key === "Escape") {
548
- event.preventDefault();
549
- event.stopPropagation();
550
- clearSelection();
551
- return;
552
- }
553
- if ((event.key === "Delete" || event.key === "Backspace") && onWidgetsDelete && !isEditableTarget(event.target)) {
554
- event.preventDefault();
555
- event.stopPropagation();
556
- const keys = [...selected];
557
- clearSelection();
558
- onWidgetsDelete(keys);
559
- containerRef.current?.focus({ preventScroll: true });
560
- }
561
- });
562
- const styles = extractStyles(otherProps, CONTAINER_STYLES);
563
- const dragState = registry.dragState;
564
- const ready = width > 0;
565
- const [settled, setSettled] = useState(false);
566
- useEffect(() => {
567
- if (!ready) {
568
- setSettled(false);
569
- return;
570
- }
571
- let id1 = 0;
572
- let id2 = 0;
573
- id1 = requestAnimationFrame(() => {
574
- id2 = requestAnimationFrame(() => setSettled(true));
575
- });
576
- return () => {
577
- cancelAnimationFrame(id1);
578
- if (id2) cancelAnimationFrame(id2);
579
- };
580
- }, [ready]);
581
- const hostWidgetIsDragging = !!dragState && dragState.nestedBoardIds.has(boardId);
582
- const placeholderStyles = useMemo(() => placeholders.map((p) => {
583
- const pos = calcGridItemPosition(positionParams, p.x, p.y, p.w, p.h);
584
- return {
585
- i: p.i,
586
- style: {
587
- left: `${pos.left}px`,
588
- top: `${pos.top}px`,
589
- width: `${pos.width}px`,
590
- height: `${pos.height}px`
591
- }
592
- };
593
- }), [placeholders, positionParams]);
594
- const ownsDrag = !!dragState && (dragState.sourceBoardId === boardId || dragState.currentBoardId === boardId);
595
- const gridOverlayStyle = !hostWidgetIsDragging && (effectiveShowGridLines === true || effectiveShowGridLines === "drag" && (ownsDrag || !!placeholder) || effectiveShowGridLines === "any-drag" && (!!dragState || !!placeholder)) ? (() => {
596
- const colWidth = calcGridColWidth(positionParams);
597
- const rowHeightPx = positionParams.rowHeight;
598
- const pitchX = colWidth + effectiveMargin[0];
599
- const pitchY = rowHeightPx + effectiveMargin[1];
600
- const padX = resolvedPadding[0];
601
- const padY = resolvedPadding[1];
602
- const gridWidth = Math.max(0, effectiveContainerWidth - padX * 2);
603
- const gridHeight = renderedRows > 0 ? renderedRows * rowHeightPx + (renderedRows - 1) * effectiveMargin[1] : 0;
604
- const fill = "var(--border-color)";
605
- const columns = `repeating-linear-gradient(to right, ${fill} 0, ${fill} ${colWidth}px, transparent ${colWidth}px, transparent ${pitchX}px)`;
606
- const rowsGrad = `repeating-linear-gradient(to bottom, #000 0, #000 ${rowHeightPx}px, transparent ${rowHeightPx}px, transparent ${pitchY}px)`;
607
- return {
608
- left: `${padX}px`,
609
- top: `${padY}px`,
610
- width: `${gridWidth}px`,
611
- height: `${gridHeight}px`,
612
- backgroundImage: columns,
613
- backgroundPosition: "0 0",
614
- backgroundRepeat: "repeat",
615
- maskImage: rowsGrad,
616
- WebkitMaskImage: rowsGrad,
617
- maskPosition: "0 0",
618
- WebkitMaskPosition: "0 0",
619
- maskRepeat: "repeat",
620
- WebkitMaskRepeat: "repeat"
621
- };
622
- })() : null;
623
- const boardMetrics = useMemo(() => ({
624
- colWidth: calcGridColWidth(positionParams),
625
- rowHeight: positionParams.rowHeight,
626
- margin: positionParams.margin,
627
- containerPadding: positionParams.containerPadding,
628
- depth: boardDepth
629
- }), [positionParams, boardDepth]);
630
- return /* @__PURE__ */ jsx(BoardMetricsContext.Provider, {
631
- value: boardMetrics,
632
- children: /* @__PURE__ */ jsx(BoardGridLinesContext.Provider, {
633
- value: effectiveShowGridLines === "any-drag" ? "any-drag" : effectiveShowGridLines ? "drag" : false,
634
- children: /* @__PURE__ */ jsxs(BoardElement, {
635
- ...mergeProps$1(filterBaseProps(otherProps, { eventProps: true }), boardFocusWithinProps, { onKeyDown: handleBoardKeyDown }),
636
- ref: containerRef,
637
- styles,
638
- tabIndex: selectionMode !== "none" ? -1 : void 0,
639
- "data-board-id": boardId,
640
- style: aligned ? void 0 : isStretching ? { height: "100%" } : { minHeight: `${containerHeight}px` },
641
- mods: {
642
- dragging: !!dragState,
643
- "drop-target": dragState?.currentBoardId === boardId,
644
- marquee: isMarqueeActive
645
- },
646
- children: [
647
- /* @__PURE__ */ jsxs(ContentLayer, {
648
- ref: contentRef,
649
- onPointerDown: handleContentPointerDown,
650
- children: [
651
- ready && gridOverlayStyle ? /* @__PURE__ */ jsx(GridOverlayElement, {
652
- "aria-hidden": "true",
653
- style: gridOverlayStyle
654
- }) : null,
655
- ready ? layout.map((item) => {
656
- const registration = registry.store.get(item.i);
657
- const widgetDraggable = isDraggable && (registration?.isDraggable ?? widgetProps?.isDraggable) !== false && item.isDraggable !== false && !item.static;
658
- const widgetResizable = isResizable && (registration?.isResizable ?? widgetProps?.isResizable) !== false && item.isResizable !== false && !item.static;
659
- const handles = item.resizeHandles ?? registration?.resizeHandles ?? widgetProps?.resizeHandles ?? resizeHandles;
660
- const gripPlacement = registration?.resizeGripPlacement ?? widgetProps?.resizeGripPlacement ?? resizeGripPlacement;
661
- const widgetDragCancel = registration?.dragCancel ?? widgetProps?.dragCancel ?? dragCancel;
662
- const widgetDragHandle = registration?.dragHandle ?? widgetProps?.dragHandle ?? dragHandle;
663
- const widgetIsCard = registration?.isCard ?? widgetProps?.isCard ?? false;
664
- const widgetHoverRing = registration?.hoverRing ?? widgetProps?.hoverRing ?? true;
665
- const widgetMods = registration?.mods && widgetProps?.mods ? {
666
- ...widgetProps.mods,
667
- ...registration.mods
668
- } : registration?.mods ?? widgetProps?.mods;
669
- const widgetIsAutoHeight = registration?.isAutoHeight ?? widgetProps?.isAutoHeight ?? false;
670
- const widgetQa = registration?.qa ?? widgetProps?.qa;
671
- const widgetSelectable = selectionMode !== "none" && isWidgetSelectable(item.i);
672
- const widgetSelectionCancel = registration?.selectionCancel ?? widgetProps?.selectionCancel ?? selectionCancel;
673
- const widgetStyles = registration?.styles && widgetPropsStyles ? mergeStyles(widgetPropsStyles, registration.styles) : registration?.styles ?? widgetPropsStyles;
674
- return /* @__PURE__ */ jsx(WidgetHost, {
675
- boardId,
676
- item,
677
- positionParams,
678
- registration,
679
- isCard: widgetIsCard,
680
- hoverRing: widgetHoverRing,
681
- cornerChrome: registration?.cornerChrome ?? widgetProps?.cornerChrome,
682
- cornerChromePlacement: registration?.cornerChromePlacement ?? widgetProps?.cornerChromePlacement,
683
- mods: widgetMods,
684
- styles: widgetStyles,
685
- isDraggable: widgetDraggable,
686
- isResizable: widgetResizable,
687
- resizeHandles: handles,
688
- resizeGripPlacement: gripPlacement,
689
- boardDepth,
690
- isAutoHeight: widgetIsAutoHeight,
691
- qa: widgetQa,
692
- dragCancel: widgetDragCancel,
693
- dragHandle: widgetDragHandle,
694
- isSelectable: widgetSelectable,
695
- isSelected: selectedKeySet.has(item.i),
696
- isPreSelected: preSelectedKeys.has(item.i),
697
- selectionCancel: widgetSelectionCancel,
698
- selectedHintId,
699
- onSelect: select,
700
- onSelectionReset: clearSelection,
701
- selectModifierKey,
702
- registry,
703
- dragState,
704
- settled,
705
- onResize: handleResize,
706
- onAutoHeight: handleAutoHeight,
707
- onDragLifecycle: handleDragLifecycle
708
- }, item.i);
709
- }) : null,
710
- placeholderStyles.map(({ i, style }) => /* @__PURE__ */ jsx(PlaceholderElement, {
711
- "aria-hidden": "true",
712
- style
713
- }, i)),
714
- marqueeStyle ? /* @__PURE__ */ jsx(MarqueeElement, {
715
- "aria-hidden": "true",
716
- style: marqueeStyle
717
- }) : null
718
- ]
719
- }),
720
- selectionMode !== "none" ? /* @__PURE__ */ jsxs(A11yLayer, { children: [/* @__PURE__ */ jsx("span", {
721
- id: selectedHintId,
722
- children: t("board.selected", "Selected")
723
- }), /* @__PURE__ */ jsx("span", {
724
- role: "status",
725
- "aria-live": "polite",
726
- "aria-atomic": "true",
727
- children: announcement
728
- })] }) : null,
729
- children
730
- ]
731
- })
732
- })
733
- });
734
- }
735
- const BoardInnerForwarded = forwardRef(BoardInner);
736
- /**
737
- * A draggable and resizable widget grid. Widgets are declared with
738
- * `Board.Widget` and positioned via a `layout`. Wrap multiple boards in a
739
- * `BoardProvider` to enable dragging widgets between them.
740
- */
741
- const Board = forwardRef(function Board(props, ref) {
742
- const $ = c(6);
743
- if (useBoardRegistry()) {
744
- let t0;
745
- if ($[0] !== props || $[1] !== ref) {
746
- t0 = /* @__PURE__ */ jsx(BoardInnerForwarded, {
747
- ...props,
748
- ref
749
- });
750
- $[0] = props;
751
- $[1] = ref;
752
- $[2] = t0;
753
- } else t0 = $[2];
754
- return t0;
755
- }
756
- let t0;
757
- if ($[3] !== props || $[4] !== ref) {
758
- t0 = /* @__PURE__ */ jsx(BoardProvider, { children: /* @__PURE__ */ jsx(BoardInnerForwarded, {
759
- ...props,
760
- ref
761
- }) });
762
- $[3] = props;
763
- $[4] = ref;
764
- $[5] = t0;
765
- } else t0 = $[5];
766
- return t0;
767
- });
768
-
769
- //#endregion
770
- export { BOARD_SELECTION_CANCEL, Board };
771
- //# sourceMappingURL=Board.js.map