@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,1065 +0,0 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-c325dcb | Cube Dev Team */
2
- import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
3
- import { useEvent } from "../../../_internal/hooks/use-event.js";
4
- import { isDevEnv } from "../../../utils/is-dev-env.js";
5
- import { useI18n } from "../../../i18n/useI18n.js";
6
- import { BoardHostContext, useBoardHost } from "./board-context.js";
7
- import { calcGridColWidth, calcGridItemPosition } from "./grid-core/calculate.js";
8
- import { c } from "react/compiler-runtime";
9
- import { tasty } from "@tenphi/tasty";
10
- import { useEffect, useMemo, useRef, useState } from "react";
11
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
- import { useFocusRing, useFocusWithin, useHover, useMove } from "react-aria";
13
- import { createPortal } from "react-dom";
14
-
15
- //#region src/components/layout/Board/WidgetHost.tsx
16
- /**
17
- * Slack (px) absorbed when converting an auto-height widget's content height to
18
- * whole rows, so sub-pixel measurement/rounding noise never bumps an extra row.
19
- */
20
- const AUTO_HEIGHT_TOLERANCE = 4;
21
- /**
22
- * Corner grip size in px, and therefore how far a `corner`-placed grip hangs
23
- * outside the widget: exactly half of it, since it is centred on the corner. The
24
- * hit-zone reads the same number so what you see is what you can grab.
25
- */
26
- const GRIP_SIZE = 10;
27
- /**
28
- * How far a `corner`-placed hit-zone may reach *inward*: exactly the half of the
29
- * dot that is painted inside the widget, and no further. Reaching deeper would
30
- * park an invisible resize target over the widget's own content — and when that
31
- * content is a nested `Board`, the child in the bottom-right cell loses its own
32
- * corner handle to it and cannot be resized at all (CUB-4166).
33
- */
34
- const CORNER_HIT_INWARD = GRIP_SIZE / 2;
35
- /**
36
- * Ceiling on how far the same hit-zone reaches *outward*, where there is only
37
- * grid gutter to cover. Past a whole grip size the target stops reading as "that
38
- * dot" and starts reading as "somewhere near the corner".
39
- */
40
- const CORNER_HIT_OUTWARD_MAX = GRIP_SIZE;
41
- /**
42
- * Thickness of an `outside` grip: the band, measured out from the widget's edge,
43
- * that the affordance owns. It is the grid gutter where the gutter is big enough
44
- * to hold it, and this floor where it is not — an affordance thinner than this
45
- * stops being reliably clickable, so it overhangs the neighbour instead and the
46
- * board says so in development.
47
- */
48
- const OUTSIDE_GRIP_MIN_BAND = 8;
49
- /** Length of an `outside` edge grip along the edge it belongs to. */
50
- const OUTSIDE_GRIP_LENGTH = 24;
51
- /**
52
- * Painted thickness of an `outside` edge grip, which is deliberately less than
53
- * the band it sits in: the rest becomes a gap, so the control reads as a thing
54
- * lying in the gutter rather than as an extension of the widget's own edge.
55
- *
56
- * Only the PAINT is inset. The element keeps the whole band, so the target does
57
- * not shrink with the visual and the two still cannot drift apart.
58
- */
59
- const OUTSIDE_GRIP_THICKNESS = 4;
60
- /** Gap between a widget's corner and its `outside` corner grip. */
61
- const OUTSIDE_CORNER_GAP = 2;
62
- /**
63
- * How far an `outside` corner angle reaches out from the widget, given the gutter
64
- * it has to reach into: the full `GRIP_SIZE` where the gutter can take it, and
65
- * whatever is left over where it cannot.
66
- *
67
- * A corner grip sits in the square where the two gutters cross, which is empty —
68
- * but only as far as the gutters go. At `GRIP_SIZE` stepped `OUTSIDE_CORNER_GAP`
69
- * off the corner it reached 12px out, past the 8px gutter the defaults give it
70
- * and onto the diagonal neighbour, swallowing that widget's own corner. Shrinking
71
- * rather than warning because the angle still reads at 6px, and a grip that is a
72
- * little small is not the same order of problem as one covering someone else's
73
- * widget.
74
- *
75
- * `band` arrives floored at `OUTSIDE_GRIP_MIN_BAND`, so the result is never below
76
- * `OUTSIDE_GRIP_MIN_BAND - OUTSIDE_CORNER_GAP`.
77
- */
78
- function cornerGripExtent(band) {
79
- return Math.min(GRIP_SIZE, band - OUTSIDE_CORNER_GAP);
80
- }
81
- const WidgetElement = tasty({
82
- qa: "BoardWidget",
83
- styles: {
84
- position: "absolute",
85
- top: 0,
86
- left: 0,
87
- fill: "#surface-2",
88
- radius: "1cr",
89
- border: {
90
- "": false,
91
- card: true,
92
- "pre-selected": "#primary-border",
93
- selected: "#primary-border"
94
- },
95
- shadow: {
96
- "": false,
97
- "hovered & !card & !no-hover-ring & (draggable | resizing)": "0 0 0 1bw #border",
98
- "pre-selected": "0 0 0 1bw #primary.40",
99
- selected: "0 0 0 1bw #primary",
100
- "drag | resizing": "$dialog-shadow"
101
- },
102
- outline: {
103
- "": "1bw #primary-text.0",
104
- "focus-visible": "1bw #primary-text"
105
- },
106
- outlineOffset: "1bw",
107
- zIndex: {
108
- "": 1,
109
- "drag | resizing": 10
110
- },
111
- opacity: {
112
- "": 1,
113
- floating: .8
114
- },
115
- transition: {
116
- "": "theme, shadow, opacity",
117
- settled: "theme, shadow, opacity, inset, width, height",
118
- "drag | floating | resizing": "theme, shadow, opacity"
119
- },
120
- boxSizing: "border-box",
121
- userSelect: {
122
- "": "auto",
123
- "drag | resizing": "none"
124
- },
125
- cursor: {
126
- "": "auto",
127
- draggable: "grab",
128
- drag: "grabbing"
129
- },
130
- touchAction: "none",
131
- overflow: "hidden"
132
- }
133
- });
134
- const HandleElement = tasty({
135
- qa: "BoardResizeHandle",
136
- styles: {
137
- position: "absolute",
138
- zIndex: 20,
139
- fill: "#clear",
140
- pointerEvents: "auto",
141
- "--handle-size": "3x",
142
- "--handle-inset": "1x",
143
- "--edge-overhang": "-8px",
144
- "--corner-overhang": {
145
- "": "-8px",
146
- "placement=corner": "$corner-hit-overhang"
147
- },
148
- "--corner-size": {
149
- "": "$handle-size",
150
- "placement=corner": "$corner-hit-size"
151
- },
152
- width: {
153
- "": "$corner-size",
154
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "$handle-size",
155
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "auto"
156
- },
157
- height: {
158
- "": "$corner-size",
159
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "$handle-size",
160
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "auto"
161
- },
162
- top: {
163
- "": "auto",
164
- "[data-axis=\"ne\"] | [data-axis=\"nw\"]": "$corner-overhang",
165
- "[data-axis=\"n\"]": "$edge-overhang",
166
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "$handle-inset"
167
- },
168
- bottom: {
169
- "": "auto",
170
- "[data-axis=\"se\"] | [data-axis=\"sw\"]": "$corner-overhang",
171
- "[data-axis=\"s\"]": "$edge-overhang",
172
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "$handle-inset"
173
- },
174
- left: {
175
- "": "auto",
176
- "[data-axis=\"nw\"] | [data-axis=\"sw\"]": "$corner-overhang",
177
- "[data-axis=\"w\"]": "$edge-overhang",
178
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "$handle-inset"
179
- },
180
- right: {
181
- "": "auto",
182
- "[data-axis=\"ne\"] | [data-axis=\"se\"]": "$corner-overhang",
183
- "[data-axis=\"e\"]": "$edge-overhang",
184
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "$handle-inset"
185
- },
186
- cursor: {
187
- "": "default",
188
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "ns-resize",
189
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "ew-resize",
190
- "[data-axis=\"ne\"] | [data-axis=\"sw\"]": "nesw-resize",
191
- "[data-axis=\"nw\"] | [data-axis=\"se\"]": "nwse-resize"
192
- },
193
- touchAction: "none"
194
- }
195
- });
196
- const GripElement = tasty({
197
- qa: "BoardResizeGrip",
198
- styles: {
199
- position: "absolute",
200
- "--grip-size": `${GRIP_SIZE}px`,
201
- "--grip-inset": "4px",
202
- "--grip-offset": {
203
- "": "$grip-inset",
204
- "placement=corner": "($grip-size / -2)"
205
- },
206
- width: "$grip-size",
207
- height: "$grip-size",
208
- boxSizing: "border-box",
209
- pointerEvents: "none",
210
- opacity: {
211
- "": 0,
212
- revealed: 1
213
- },
214
- transition: "opacity $disclosure-transition ease-in-out",
215
- borderTop: {
216
- "": "0",
217
- "[data-axis=\"ne\"] | [data-axis=\"nw\"]": "2px solid #dark.40"
218
- },
219
- borderBottom: {
220
- "": "0",
221
- "[data-axis=\"se\"] | [data-axis=\"sw\"]": "2px solid #dark.40"
222
- },
223
- borderLeft: {
224
- "": "0",
225
- "[data-axis=\"nw\"] | [data-axis=\"sw\"]": "2px solid #dark.40"
226
- },
227
- borderRight: {
228
- "": "0",
229
- "[data-axis=\"ne\"] | [data-axis=\"se\"]": "2px solid #dark.40"
230
- },
231
- radius: {
232
- "": "0",
233
- "[data-axis=\"se\"]": "4px bottom-right",
234
- "[data-axis=\"sw\"]": "4px bottom-left",
235
- "[data-axis=\"ne\"]": "4px top-right",
236
- "[data-axis=\"nw\"]": "4px top-left"
237
- },
238
- top: {
239
- "": "auto",
240
- "[data-axis=\"ne\"] | [data-axis=\"nw\"]": "$grip-offset"
241
- },
242
- bottom: {
243
- "": "auto",
244
- "[data-axis=\"se\"] | [data-axis=\"sw\"]": "$grip-offset"
245
- },
246
- left: {
247
- "": "auto",
248
- "[data-axis=\"nw\"] | [data-axis=\"sw\"]": "$grip-offset"
249
- },
250
- right: {
251
- "": "auto",
252
- "[data-axis=\"ne\"] | [data-axis=\"se\"]": "$grip-offset"
253
- }
254
- }
255
- });
256
- /**
257
- * An `outside` grip: the visible control and the hit-zone in one element.
258
- *
259
- * The two used to be separate boxes of different sizes, aligned by hand, which is
260
- * how a 10px dot came to stand for a 24px target reaching back over the widget's
261
- * own content (CUB-4166). Here they cannot drift apart, because there is only one
262
- * box: what is painted is exactly what is grabbed.
263
- *
264
- * It lives in the grid gutter, beyond the widget's edge — never over the widget's
265
- * content, so a nested board's children keep every pixel of their own. The band
266
- * it occupies (`--grip-band-x` / `--grip-band-y`) is the gutter, floored at
267
- * `OUTSIDE_GRIP_MIN_BAND`. Rendered in `GripLayerElement`, which nothing clips.
268
- *
269
- * Always hit-testable, painted only once revealed: you have to be able to hover
270
- * it to reveal it, and `opacity` leaves hit-testing alone.
271
- */
272
- const OutsideGripElement = tasty({
273
- qa: "BoardResizeHandle",
274
- styles: {
275
- position: "absolute",
276
- boxSizing: "border-box",
277
- pointerEvents: "auto",
278
- touchAction: "none",
279
- zIndex: 20,
280
- opacity: {
281
- "": 0,
282
- revealed: 1
283
- },
284
- transition: "opacity $disclosure-transition ease-in-out, theme",
285
- left: {
286
- "": "auto",
287
- "[data-axis=\"e\"] | [data-axis=\"ne\"] | [data-axis=\"se\"]": "100%",
288
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "50%"
289
- },
290
- right: {
291
- "": "auto",
292
- "[data-axis=\"w\"] | [data-axis=\"nw\"] | [data-axis=\"sw\"]": "100%"
293
- },
294
- top: {
295
- "": "auto",
296
- "[data-axis=\"s\"] | [data-axis=\"se\"] | [data-axis=\"sw\"]": "100%",
297
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "50%"
298
- },
299
- bottom: {
300
- "": "auto",
301
- "[data-axis=\"n\"] | [data-axis=\"ne\"] | [data-axis=\"nw\"]": "100%"
302
- },
303
- transform: {
304
- "": "translate(0, 0)",
305
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "translate(0, -50%)",
306
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "translate(-50%, 0)",
307
- "[data-axis=\"se\"]": `translate(${OUTSIDE_CORNER_GAP}px, ${OUTSIDE_CORNER_GAP}px)`,
308
- "[data-axis=\"sw\"]": `translate(${-OUTSIDE_CORNER_GAP}px, ${OUTSIDE_CORNER_GAP}px)`,
309
- "[data-axis=\"ne\"]": `translate(${OUTSIDE_CORNER_GAP}px, ${-OUTSIDE_CORNER_GAP}px)`,
310
- "[data-axis=\"nw\"]": `translate(${-OUTSIDE_CORNER_GAP}px, ${-OUTSIDE_CORNER_GAP}px)`
311
- },
312
- width: {
313
- "": "$outside-corner-w",
314
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "$grip-band-x",
315
- "[data-axis=\"n\"] | [data-axis=\"s\"]": `${OUTSIDE_GRIP_LENGTH}px`
316
- },
317
- height: {
318
- "": "$outside-corner-h",
319
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "$grip-band-y",
320
- "[data-axis=\"e\"] | [data-axis=\"w\"]": `${OUTSIDE_GRIP_LENGTH}px`
321
- },
322
- padding: {
323
- "": 0,
324
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "0 $grip-pad-x",
325
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "$grip-pad-y 0"
326
- },
327
- backgroundClip: "content-box",
328
- fill: {
329
- "": "#clear",
330
- "[data-axis=\"n\"] | [data-axis=\"s\"] | [data-axis=\"e\"] | [data-axis=\"w\"]": "#dark.30",
331
- "([data-axis=\"n\"] | [data-axis=\"s\"] | [data-axis=\"e\"] | [data-axis=\"w\"]) & resizing": "#dark.50"
332
- },
333
- borderTop: {
334
- "": "0",
335
- "[data-axis=\"ne\"] | [data-axis=\"nw\"]": "2px solid #dark.40"
336
- },
337
- borderBottom: {
338
- "": "0",
339
- "[data-axis=\"se\"] | [data-axis=\"sw\"]": "2px solid #dark.40"
340
- },
341
- borderLeft: {
342
- "": "0",
343
- "[data-axis=\"nw\"] | [data-axis=\"sw\"]": "2px solid #dark.40"
344
- },
345
- borderRight: {
346
- "": "0",
347
- "[data-axis=\"ne\"] | [data-axis=\"se\"]": "2px solid #dark.40"
348
- },
349
- radius: {
350
- "": "round",
351
- "[data-axis=\"se\"]": "4px bottom-right",
352
- "[data-axis=\"sw\"]": "4px bottom-left",
353
- "[data-axis=\"ne\"]": "4px top-right",
354
- "[data-axis=\"nw\"]": "4px top-left"
355
- },
356
- cursor: {
357
- "": "default",
358
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "ns-resize",
359
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "ew-resize",
360
- "[data-axis=\"ne\"] | [data-axis=\"sw\"]": "nesw-resize",
361
- "[data-axis=\"nw\"] | [data-axis=\"se\"]": "nwse-resize"
362
- }
363
- }
364
- });
365
- /**
366
- * Where the corner grips are drawn when `resizeGripPlacement` is `'corner'`.
367
- *
368
- * `WidgetElement` clips its children (`overflow: hidden`, and that clipping is
369
- * load-bearing - see its own note), so a grip centred on the widget's corner
370
- * would be cut in half if it stayed inside. This layer mirrors the widget's grid
371
- * rect as a *sibling* of it, clips nothing, and never takes pointer events: the
372
- * transparent `HandleElement` inside the widget still owns the gesture, so
373
- * escaping the clip costs no hit-testing behaviour.
374
- *
375
- * It sits above a resting widget (`zIndex: 1`) so a grip is never hidden by the
376
- * neighbour it overhangs, and below a dragged or resized one (`zIndex: 10`) so a
377
- * lifted widget still paints over its neighbours' grips.
378
- *
379
- * Nothing clips this layer — `BoardElement` sets no `overflow` — so a grip on a
380
- * widget flush against its board's edge (`containerPadding: [0, 0]`, which
381
- * `isAligned` sets) is painted *outside* the board's content box rather than
382
- * cropped to fit inside it. Inside a nested board that puts it exactly on the
383
- * host widget's own corner: the two corners are the same point, so the two hit
384
- * zones cannot be separated by geometry, and `z-index` cannot arbitrate either
385
- * (this layer is a sibling of the host, so it outranks the whole nested subtree
386
- * whatever the inner handle asks for). `ResizeHandle` settles it by depth
387
- * instead.
388
- */
389
- const GripLayerElement = tasty({
390
- qa: "BoardResizeGripLayer",
391
- styles: {
392
- position: "absolute",
393
- overflow: "visible",
394
- pointerEvents: "none",
395
- zIndex: 5
396
- }
397
- });
398
- /**
399
- * A control anchored to one corner of a widget, centred on it.
400
- *
401
- * Lives in the same layer as the corner resize grips, which is the layer that
402
- * exists precisely because a widget clips its own content: a control an app
403
- * hangs off the corner itself is cropped in half by that clip, or by an
404
- * ancestor's scroll container when the widget sits in the first row. Here it is
405
- * a sibling of the widget rather than a descendant, so neither can reach it.
406
- *
407
- * Being outside the widget host also means `useMove` is not attached, so a press
408
- * on the chrome cannot start a drag — no `dragCancel` entry required.
409
- */
410
- const CornerChromeElement = tasty({
411
- qa: "BoardWidgetCornerChrome",
412
- styles: {
413
- position: "absolute",
414
- pointerEvents: "auto",
415
- zIndex: 1,
416
- top: {
417
- "": "auto",
418
- "corner=ne | corner=nw": 0
419
- },
420
- bottom: {
421
- "": "auto",
422
- "corner=se | corner=sw": 0
423
- },
424
- left: {
425
- "": "auto",
426
- "corner=nw | corner=sw": 0
427
- },
428
- right: {
429
- "": "auto",
430
- "corner=ne | corner=se": 0
431
- },
432
- transform: {
433
- "": "translate(50%, -50%)",
434
- "corner=nw": "translate(-50%, -50%)",
435
- "corner=se": "translate(50%, 50%)",
436
- "corner=sw": "translate(-50%, 50%)"
437
- }
438
- }
439
- });
440
- const EdgeGripElement = tasty({
441
- qa: "BoardResizeEdgeGrip",
442
- styles: {
443
- position: "absolute",
444
- display: "grid",
445
- gap: "2bw",
446
- boxSizing: "border-box",
447
- pointerEvents: "none",
448
- opacity: {
449
- "": 0,
450
- revealed: 1
451
- },
452
- transition: "opacity $disclosure-transition ease-in-out",
453
- gridColumns: {
454
- "": "3px",
455
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "3px 3px 3px 3px 3px"
456
- },
457
- gridRows: {
458
- "": "3px 3px 3px 3px 3px",
459
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "3px"
460
- },
461
- top: {
462
- "": "50%",
463
- "[data-axis=\"n\"]": "3px",
464
- "[data-axis=\"s\"]": "auto"
465
- },
466
- bottom: {
467
- "": "auto",
468
- "[data-axis=\"s\"]": "3px"
469
- },
470
- left: {
471
- "": "auto",
472
- "[data-axis=\"w\"]": "3px",
473
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "50%"
474
- },
475
- right: {
476
- "": "auto",
477
- "[data-axis=\"e\"]": "3px"
478
- },
479
- transform: {
480
- "": "translate(0, 0)",
481
- "[data-axis=\"e\"] | [data-axis=\"w\"]": "translate(0, -50%)",
482
- "[data-axis=\"n\"] | [data-axis=\"s\"]": "translate(-50%, 0)"
483
- },
484
- Dot: {
485
- width: "3px",
486
- height: "3px",
487
- radius: "round",
488
- fill: {
489
- "": "#dark-03",
490
- resizing: "#dark-02"
491
- }
492
- }
493
- }
494
- });
495
- /** Corner axes get a visible grip affordance on hover/focus/resize. */
496
- function isCornerAxis(axis) {
497
- return axis.length === 2;
498
- }
499
- /** Edge axes (n/s/e/w) get a dotted grip affordance. */
500
- function isEdgeAxis(axis) {
501
- return axis.length === 1;
502
- }
503
- /** `data-qa` of a resize hit-zone, as published by `HandleElement`. */
504
- const HANDLE_QA = "BoardResizeHandle";
505
- /**
506
- * The deepest resize hit-zone under `point` belonging to a board nested deeper
507
- * than `depth`, or `null` when the caller is already the innermost one there.
508
- *
509
- * Asked of the document rather than of a registry, deliberately: the two handles
510
- * belong to different boards, which share no owner below the app root, and "what
511
- * is under this pixel" is the browser's own question to answer.
512
- * `elementsFromPoint` skips `pointer-events: none` nodes, so everything it hands
513
- * back is something the pointer could genuinely have landed on.
514
- */
515
- function findDeeperHandle(point, depth) {
516
- let stack;
517
- try {
518
- if (typeof document.elementsFromPoint !== "function") return null;
519
- stack = document.elementsFromPoint(point.x, point.y);
520
- } catch {
521
- return null;
522
- }
523
- let deepest = null;
524
- let deepestDepth = depth;
525
- for (const node of stack) {
526
- if (!(node instanceof HTMLElement)) continue;
527
- if (node.dataset.qa !== HANDLE_QA) continue;
528
- const nodeDepth = Number(node.dataset.boardDepth);
529
- if (!Number.isFinite(nodeDepth) || nodeDepth <= deepestDepth) continue;
530
- deepest = node;
531
- deepestDepth = nodeDepth;
532
- }
533
- return deepest;
534
- }
535
- /**
536
- * Hand a press to `target` unchanged.
537
- *
538
- * Safe because of how `useMove` (which owns the resize gesture) tracks a
539
- * pointer: through `window` listeners matched on `pointerId`, never through
540
- * `setPointerCapture`. So only the opening `pointerdown` is re-dispatched — every
541
- * real `pointermove`/`pointerup` that follows drives the forwarded gesture just
542
- * as it would drive a direct one.
543
- */
544
- function forwardPointerDown(e, target) {
545
- const forwarded = new PointerEvent("pointerdown", {
546
- bubbles: true,
547
- cancelable: true,
548
- composed: true,
549
- pointerId: e.pointerId,
550
- pointerType: e.pointerType,
551
- isPrimary: e.isPrimary,
552
- button: e.button,
553
- buttons: e.buttons,
554
- clientX: e.clientX,
555
- clientY: e.clientY,
556
- screenX: e.screenX,
557
- screenY: e.screenY,
558
- shiftKey: e.shiftKey,
559
- ctrlKey: e.ctrlKey,
560
- altKey: e.altKey,
561
- metaKey: e.metaKey
562
- });
563
- Object.defineProperty(forwarded, "pageX", {
564
- value: e.pageX,
565
- configurable: true
566
- });
567
- Object.defineProperty(forwarded, "pageY", {
568
- value: e.pageY,
569
- configurable: true
570
- });
571
- target.dispatchEvent(forwarded);
572
- }
573
- /**
574
- * Warnings already emitted, keyed by their own text. A widget that yields its
575
- * only resize affordance is a layout mistake, not an event: it is the same
576
- * mistake every single time the user reaches for that corner, so it is worth
577
- * saying exactly once.
578
- */
579
- const yieldWarnings = /* @__PURE__ */ new Set();
580
- function warnOnce(message) {
581
- if (!message || yieldWarnings.has(message)) return;
582
- yieldWarnings.add(message);
583
- console.warn(message);
584
- }
585
- function ResizeHandle(t0) {
586
- const $ = c(20);
587
- const { axis, placement, boardDepth, yieldWarning, isRevealed, isResizing, onResize } = t0;
588
- let t1;
589
- if ($[0] !== axis || $[1] !== onResize) {
590
- t1 = {
591
- onMoveStart() {
592
- onResize(axis, "start", 0, 0);
593
- },
594
- onMove(e) {
595
- onResize(axis, "move", e.deltaX, e.deltaY);
596
- },
597
- onMoveEnd() {
598
- onResize(axis, "end", 0, 0);
599
- }
600
- };
601
- $[0] = axis;
602
- $[1] = onResize;
603
- $[2] = t1;
604
- } else t1 = $[2];
605
- const { moveProps } = useMove(t1);
606
- let t2;
607
- if ($[3] !== moveProps) {
608
- t2 = mergeProps$1({
609
- onPointerDown: _temp,
610
- onMouseDown: _temp2,
611
- onTouchStart: _temp3
612
- }, moveProps);
613
- $[3] = moveProps;
614
- $[4] = t2;
615
- } else t2 = $[4];
616
- const handleProps = t2;
617
- let t3;
618
- if ($[5] !== boardDepth || $[6] !== handleProps || $[7] !== yieldWarning) {
619
- t3 = (e_3) => {
620
- const deeper = findDeeperHandle({
621
- x: e_3.clientX,
622
- y: e_3.clientY
623
- }, boardDepth);
624
- if (deeper) {
625
- e_3.stopPropagation();
626
- e_3.preventDefault();
627
- warnOnce(yieldWarning);
628
- forwardPointerDown(e_3, deeper);
629
- return;
630
- }
631
- handleProps.onPointerDown?.(e_3);
632
- };
633
- $[5] = boardDepth;
634
- $[6] = handleProps;
635
- $[7] = yieldWarning;
636
- $[8] = t3;
637
- } else t3 = $[8];
638
- const onPointerDown = t3;
639
- const Element = placement === "outside" ? OutsideGripElement : HandleElement;
640
- let t4;
641
- if ($[9] !== isResizing || $[10] !== isRevealed || $[11] !== placement) {
642
- t4 = {
643
- placement,
644
- revealed: isRevealed,
645
- resizing: isResizing
646
- };
647
- $[9] = isResizing;
648
- $[10] = isRevealed;
649
- $[11] = placement;
650
- $[12] = t4;
651
- } else t4 = $[12];
652
- let t5;
653
- if ($[13] !== Element || $[14] !== axis || $[15] !== boardDepth || $[16] !== handleProps || $[17] !== onPointerDown || $[18] !== t4) {
654
- t5 = /* @__PURE__ */ jsx(Element, {
655
- "data-axis": axis,
656
- "data-board-depth": boardDepth,
657
- mods: t4,
658
- ...handleProps,
659
- onPointerDown,
660
- "aria-hidden": "true"
661
- });
662
- $[13] = Element;
663
- $[14] = axis;
664
- $[15] = boardDepth;
665
- $[16] = handleProps;
666
- $[17] = onPointerDown;
667
- $[18] = t4;
668
- $[19] = t5;
669
- } else t5 = $[19];
670
- return t5;
671
- }
672
- function _temp3(e_2) {
673
- return e_2.stopPropagation();
674
- }
675
- function _temp2(e_1) {
676
- return e_1.stopPropagation();
677
- }
678
- function _temp(e_0) {
679
- return e_0.stopPropagation();
680
- }
681
- /**
682
- * The positioned, interactive wrapper a board renders for each layout item it
683
- * owns. Content is pulled from the shared store (by id), so any board can host
684
- * any widget. Dragging uses React Aria `useMove`; during a drag the widget
685
- * renders into the shared overlay portal so it can float outside its board.
686
- */
687
- function WidgetHost(props) {
688
- const { boardId, item, positionParams, registration, isCard, hoverRing, cornerChrome, cornerChromePlacement = "ne", mods: customMods, styles: widgetStyles, isDraggable, isResizable, resizeHandles, resizeGripPlacement, boardDepth, isAutoHeight, qa, dragCancel, dragHandle, registry, dragState, settled, onResize, onAutoHeight, onDragLifecycle, isSelectable = false, isSelected = false, isPreSelected = false, selectionCancel, selectedHintId, onSelect, onSelectionReset, selectModifierKey = "metaKey" } = props;
689
- const { t } = useI18n();
690
- const ariaLabel = registration?.["aria-label"];
691
- const hostRef = useRef(null);
692
- const isActiveDrag = dragState?.itemId === item.i;
693
- const isDragMember = !!dragState?.itemIds.includes(item.i);
694
- const requestHeightDeficit = useEvent((deficitPx) => {
695
- if (!isAutoHeight || isActiveDrag) return;
696
- const step = positionParams.rowHeight + positionParams.margin[1];
697
- if (step <= 0) return;
698
- const neededPx = calcGridItemPosition(positionParams, item.x, item.y, item.w, item.h).height + deficitPx;
699
- const neededRows = Math.max(1, Math.ceil((neededPx + positionParams.margin[1] - AUTO_HEIGHT_TOLERANCE) / step));
700
- onAutoHeight(item.i, neededRows);
701
- });
702
- const [nestedBoardCount, setNestedBoardCount] = useState(0);
703
- const registerNestedBoard = useEvent(() => {
704
- setNestedBoardCount((count) => count + 1);
705
- return () => setNestedBoardCount((count_0) => Math.max(0, count_0 - 1));
706
- });
707
- const [descendantHoverCount, setDescendantHoverCount] = useState(0);
708
- const setDescendantHovered = useEvent((hovered) => {
709
- setDescendantHoverCount((count_1) => Math.max(0, count_1 + (hovered ? 1 : -1)));
710
- });
711
- const hostValue = useMemo(() => ({
712
- isAutoHeight,
713
- requestHeightDeficit,
714
- registerNestedBoard,
715
- setDescendantHovered
716
- }), [
717
- isAutoHeight,
718
- requestHeightDeficit,
719
- registerNestedBoard,
720
- setDescendantHovered
721
- ]);
722
- const useOverlay = isActiveDrag && dragState?.pointerType !== "keyboard";
723
- const [isResizing, setIsResizing] = useState(false);
724
- const [isFocusWithin, setIsFocusWithin] = useState(false);
725
- const { hoverProps, isHovered } = useHover({ isDisabled: isActiveDrag });
726
- const { hoverProps: layerHoverProps, isHovered: isLayerHovered } = useHover({ isDisabled: isActiveDrag });
727
- const { focusProps, isFocusVisible } = useFocusRing();
728
- const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocusWithin });
729
- const placement = resizeGripPlacement ?? (nestedBoardCount > 0 ? "outside" : "inside");
730
- const reportHoverToHost = useBoardHost()?.setDescendantHovered;
731
- const isSelfHovered = isHovered || isLayerHovered;
732
- useEffect(() => {
733
- if (!reportHoverToHost || !isSelfHovered) return;
734
- reportHoverToHost(true);
735
- return () => reportHoverToHost(false);
736
- }, [reportHoverToHost, isSelfHovered]);
737
- const gripsRevealed = isResizable && !item.static && !isActiveDrag && !descendantHoverCount && (isSelfHovered || isFocusWithin || isResizing);
738
- const { moveProps } = useMove({
739
- onMoveStart(e) {
740
- if (!isDraggable) return;
741
- const rect = hostRef.current?.getBoundingClientRect();
742
- const pos = calcGridItemPosition(positionParams, item.x, item.y, item.w, item.h);
743
- const vr = rect ? {
744
- left: rect.left,
745
- top: rect.top,
746
- width: rect.width,
747
- height: rect.height
748
- } : {
749
- left: pos.left,
750
- top: pos.top,
751
- width: pos.width,
752
- height: pos.height
753
- };
754
- registry.onDragStart(boardId, item.i, vr, e.pointerType, hostRef.current);
755
- onDragLifecycle?.(item.i, "start");
756
- },
757
- onMove(e_0) {
758
- if (!isDraggable) return;
759
- if (e_0.pointerType === "keyboard") {
760
- const stepX = calcGridColWidth(positionParams) + positionParams.margin[0];
761
- const stepY = positionParams.rowHeight + positionParams.margin[1];
762
- registry.onDragMove(Math.sign(e_0.deltaX) * stepX, Math.sign(e_0.deltaY) * stepY, e_0.pointerType);
763
- onDragLifecycle?.(item.i, "move");
764
- return;
765
- }
766
- registry.onDragMove(e_0.deltaX, e_0.deltaY, e_0.pointerType);
767
- onDragLifecycle?.(item.i, "move");
768
- },
769
- onMoveEnd() {
770
- if (!isDraggable) return;
771
- registry.onDragEnd();
772
- onDragLifecycle?.(item.i, "end");
773
- }
774
- });
775
- const a11yProps = {
776
- role: "group",
777
- tabIndex: isDraggable || isSelectable ? 0 : void 0,
778
- "aria-roledescription": isDraggable ? t("board.draggableWidget", "Draggable widget") : t("board.widget", "Widget"),
779
- "aria-label": ariaLabel ?? qa ?? item.i,
780
- "aria-describedby": isSelected ? selectedHintId : void 0,
781
- "aria-keyshortcuts": isSelectable ? "Space" : void 0
782
- };
783
- const isInteractiveTarget = (target) => {
784
- return !!(selectionCancel && target?.closest?.(selectionCancel));
785
- };
786
- /**
787
- * Pressing something interactive means the user has moved on from the
788
- * selection, so the selection is dropped — always, whatever the control is and
789
- * whatever it does with the event.
790
- *
791
- * That "always" is why this is a *capture*-phase handler and not part of
792
- * `handleSelectPointerDown` below. A bubble-phase handler only sees the
793
- * presses that reach the host, and a control is free to call
794
- * `stopPropagation()` before that happens — React Aria's `usePress` does it by
795
- * default, which is why some in-widget buttons dropped the selection and
796
- * others silently did not. Capture runs top-down, so it lands before any
797
- * descendant can speak. Portaled controls (a menu opened from a widget's
798
- * toolbar) are covered too: React propagates events along the React tree, so a
799
- * portal declared inside this widget still passes through here.
800
- *
801
- * Nothing is stopped or prevented here — the handler only reads the target, so
802
- * the control keeps its press, its focus and its default behaviour intact.
803
- */
804
- const handleSelectPointerDownCapture = (e_1) => {
805
- if (!isSelectable || e_1.button !== 0) return;
806
- if (isInteractiveTarget(e_1.target)) onSelectionReset?.();
807
- };
808
- useEffect(() => {
809
- const node = hostRef.current;
810
- if (!node || !isSelectable || !selectionCancel || !onSelectionReset) return;
811
- const handleCapture = (event) => {
812
- if (event.button !== 0) return;
813
- if (event.target?.closest?.(selectionCancel)) onSelectionReset();
814
- };
815
- node.addEventListener("pointerdown", handleCapture, true);
816
- return () => node.removeEventListener("pointerdown", handleCapture, true);
817
- }, [
818
- isSelectable,
819
- selectionCancel,
820
- onSelectionReset
821
- ]);
822
- /**
823
- * Selecting and starting a drag are the *same* gesture: you grab the thing you
824
- * are about to move. So the press selects immediately and the drag arms behind
825
- * it — move and it drags, stay still and it was only a selection. This is what
826
- * every canvas tool does, and it is why there is no ambiguity to resolve with a
827
- * modifier.
828
- *
829
- * - a press on an interactive descendant belongs to that control, so the
830
- * press is left alone (the selection was already dropped in the capture
831
- * phase above);
832
- * - <kbd>Shift</kbd> or the platform modifier toggles membership;
833
- * - a press on an unselected widget makes it the selection, so the drag that
834
- * follows moves exactly what was grabbed;
835
- * - a press on an already-selected widget changes nothing, so the drag moves
836
- * the whole group.
837
- *
838
- * Runs before the drag handler (see the `mergeProps` order below), so the
839
- * registry resolves the group against the selection this press just made.
840
- */
841
- const handleSelectPointerDown = (e_2) => {
842
- if (!isSelectable || !onSelect || e_2.button !== 0) return;
843
- if (isInteractiveTarget(e_2.target)) return;
844
- e_2.stopPropagation();
845
- if (e_2.shiftKey || e_2[selectModifierKey]) {
846
- onSelect(item.i, true);
847
- return;
848
- }
849
- if (!isSelected) onSelect(item.i, false);
850
- };
851
- const handleSelectKeyDown = (e_3) => {
852
- if (e_3.target !== e_3.currentTarget) return;
853
- if (!isSelectable || !onSelect) return;
854
- if (e_3.key !== " " && e_3.key !== "Spacebar") return;
855
- e_3.preventDefault();
856
- e_3.stopPropagation();
857
- onSelect(item.i, true);
858
- };
859
- const stopBubbleProps = isDraggable ? {
860
- onPointerDown: (e_4) => e_4.stopPropagation(),
861
- onMouseDown: (e_5) => e_5.stopPropagation(),
862
- onTouchStart: (e_6) => e_6.stopPropagation()
863
- } : {};
864
- const shouldGateDrag = (target_1) => {
865
- if (!(target_1 instanceof Element)) return false;
866
- if (dragHandle && !target_1.closest(dragHandle)) return true;
867
- if (dragCancel && target_1.closest(dragCancel)) return true;
868
- return !!(isSelectable && selectionCancel && target_1.closest(selectionCancel));
869
- };
870
- const gatedMoveProps = !isDraggable ? {} : {
871
- ...moveProps,
872
- ...moveProps.onPointerDown && { onPointerDown: (e_7) => {
873
- if (shouldGateDrag(e_7.target)) return;
874
- hostRef.current?.focus({ preventScroll: true });
875
- moveProps.onPointerDown(e_7);
876
- } },
877
- ...moveProps.onMouseDown && { onMouseDown: (e_8) => {
878
- if (shouldGateDrag(e_8.target)) return;
879
- hostRef.current?.focus({ preventScroll: true });
880
- moveProps.onMouseDown(e_8);
881
- } },
882
- ...moveProps.onTouchStart && { onTouchStart: (e_9) => {
883
- if (shouldGateDrag(e_9.target)) return;
884
- moveProps.onTouchStart(e_9);
885
- } },
886
- ...moveProps.onKeyDown && { onKeyDown: (e_10) => {
887
- if (e_10.target !== e_10.currentTarget) return;
888
- handleSelectKeyDown(e_10);
889
- if (e_10.defaultPrevented) return;
890
- moveProps.onKeyDown(e_10);
891
- } }
892
- };
893
- const selectionProps = isSelectable ? {
894
- onPointerDownCapture: handleSelectPointerDownCapture,
895
- onPointerDown: handleSelectPointerDown,
896
- ...isDraggable ? {} : { onKeyDown: handleSelectKeyDown }
897
- } : {};
898
- const handleResize = (axis, phase, dx, dy) => {
899
- if (phase === "start") setIsResizing(true);
900
- else if (phase === "end") setIsResizing(false);
901
- onResize(item.i, axis, phase, dx, dy);
902
- };
903
- const mods = {
904
- drag: isActiveDrag,
905
- draggable: isDraggable && !isActiveDrag,
906
- static: !!item.static,
907
- resizing: isResizing,
908
- card: isCard,
909
- "no-hover-ring": !hoverRing,
910
- hovered: isHovered,
911
- "focus-visible": isFocusVisible,
912
- selected: isSelected,
913
- "pre-selected": isPreSelected && !isSelected
914
- };
915
- const cornerYieldWarning = isDevEnv() && !resizeHandles.some(isEdgeAxis) ? `Board: widget "${item.i}" yielded a resize press to a handle of a board nested inside it, because their handles sit on the same point (a nested board with no \`containerPadding\` puts its last child's corner exactly on its host's). The innermost handle wins, and this widget has only corner \`resizeHandles\`, so it can no longer be resized there. Give it an edge axis to fall back on (e.g. \`resizeHandles={['se', 'e', 's']}\`), or give the nested board some \`containerPadding\` so the two corners stop coinciding.` : void 0;
916
- if (isDevEnv() && placement === "outside") {
917
- const [marginX, marginY] = positionParams.margin;
918
- if (marginX < OUTSIDE_GRIP_MIN_BAND || marginY < OUTSIDE_GRIP_MIN_BAND) warnOnce(`Board: widget "${item.i}" holds a nested board, so its resize grips are drawn outside its box - but this board's \`margin\` is [${marginX}, ${marginY}] and a grip needs ${OUTSIDE_GRIP_MIN_BAND}px of gutter to sit in. The grips keep their size and overhang the neighbouring widgets. Raise \`margin\` to at least ${OUTSIDE_GRIP_MIN_BAND}px on both axes, or set \`resizeGripPlacement\` explicitly to put them back inside.`);
919
- }
920
- const content = /* @__PURE__ */ jsxs(BoardHostContext.Provider, {
921
- value: hostValue,
922
- children: [registration?.content, isResizable && !item.static && placement !== "outside" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
923
- (placement === "corner" ? resizeHandles.filter((axis_0) => !isCornerAxis(axis_0)) : resizeHandles).map((axis_1) => /* @__PURE__ */ jsx(ResizeHandle, {
924
- axis: axis_1,
925
- placement,
926
- boardDepth,
927
- yieldWarning: cornerYieldWarning,
928
- onResize: handleResize
929
- }, axis_1)),
930
- placement === "corner" ? null : resizeHandles.filter(isCornerAxis).map((axis_2) => /* @__PURE__ */ jsx(GripElement, {
931
- "data-axis": axis_2,
932
- mods: {
933
- revealed: gripsRevealed,
934
- placement: "inside"
935
- },
936
- "aria-hidden": "true"
937
- }, `grip-${axis_2}`)),
938
- resizeHandles.filter(isEdgeAxis).map((axis_3) => /* @__PURE__ */ jsxs(EdgeGripElement, {
939
- "data-axis": axis_3,
940
- mods: {
941
- revealed: gripsRevealed,
942
- resizing: isResizing
943
- },
944
- "aria-hidden": "true",
945
- children: [
946
- /* @__PURE__ */ jsx("div", { "data-element": "Dot" }),
947
- /* @__PURE__ */ jsx("div", { "data-element": "Dot" }),
948
- /* @__PURE__ */ jsx("div", { "data-element": "Dot" }),
949
- /* @__PURE__ */ jsx("div", { "data-element": "Dot" }),
950
- /* @__PURE__ */ jsx("div", { "data-element": "Dot" })
951
- ]
952
- }, `edge-grip-${axis_3}`))
953
- ] }) : null]
954
- });
955
- const pos_0 = calcGridItemPosition(positionParams, item.x, item.y, item.w, item.h);
956
- const overlayNode = registry.overlayRef.current;
957
- const memberRect = isDragMember ? dragState.memberRects.get(item.i) : void 0;
958
- const floatInOverlay = !!overlayNode && !!dragState && dragState.pointerType !== "keyboard" && (useOverlay || isDragMember && !!memberRect);
959
- const floatRect = floatInOverlay && dragState ? isActiveDrag || !memberRect ? dragState.rect : {
960
- left: memberRect.left + (dragState.rect.left - dragState.startRect.left),
961
- top: memberRect.top + (dragState.rect.top - dragState.startRect.top),
962
- width: memberRect.width,
963
- height: memberRect.height
964
- } : null;
965
- const cornerHitOutward = Math.min(CORNER_HIT_OUTWARD_MAX, Math.max(CORNER_HIT_INWARD, Math.min(positionParams.margin[0], positionParams.margin[1]) / 2));
966
- const gripBand = [Math.max(OUTSIDE_GRIP_MIN_BAND, positionParams.margin[0]), Math.max(OUTSIDE_GRIP_MIN_BAND, positionParams.margin[1])];
967
- const cornerHitVars = {
968
- "--corner-hit-size": `${CORNER_HIT_INWARD + cornerHitOutward}px`,
969
- "--corner-hit-overhang": `${-cornerHitOutward}px`,
970
- "--grip-band-x": `${gripBand[0]}px`,
971
- "--grip-band-y": `${gripBand[1]}px`,
972
- "--grip-pad-x": `${Math.max(0, (gripBand[0] - OUTSIDE_GRIP_THICKNESS) / 2)}px`,
973
- "--grip-pad-y": `${Math.max(0, (gripBand[1] - OUTSIDE_GRIP_THICKNESS) / 2)}px`,
974
- "--outside-corner-w": `${cornerGripExtent(gripBand[0])}px`,
975
- "--outside-corner-h": `${cornerGripExtent(gripBand[1])}px`
976
- };
977
- const hostStyle = {
978
- ...cornerHitVars,
979
- left: `${pos_0.left}px`,
980
- top: `${pos_0.top}px`,
981
- width: `${pos_0.width}px`,
982
- height: `${pos_0.height}px`,
983
- ...floatInOverlay ? {
984
- opacity: 0,
985
- pointerEvents: "none"
986
- } : null
987
- };
988
- const hostMods = {
989
- ...customMods,
990
- ...mods,
991
- drag: isActiveDrag && !floatInOverlay,
992
- settled
993
- };
994
- const host = /* @__PURE__ */ jsx(WidgetElement, {
995
- ref: hostRef,
996
- "data-board-widget-host": "",
997
- "data-board-widget-id": item.i,
998
- ...mergeProps$1(selectionProps, gatedMoveProps, stopBubbleProps, hoverProps, focusProps, focusWithinProps, a11yProps, { style: hostStyle }),
999
- qa,
1000
- mods: hostMods,
1001
- styles: widgetStyles,
1002
- children: floatInOverlay ? null : content
1003
- });
1004
- const overlayClone = floatInOverlay ? createPortal(/* @__PURE__ */ jsx(WidgetElement, {
1005
- style: {
1006
- position: "absolute",
1007
- left: `${floatRect.left}px`,
1008
- top: `${floatRect.top}px`,
1009
- width: `${floatRect.width}px`,
1010
- height: `${floatRect.height}px`,
1011
- pointerEvents: "none"
1012
- },
1013
- mods: {
1014
- ...hostMods,
1015
- drag: true,
1016
- floating: true
1017
- },
1018
- styles: widgetStyles,
1019
- "aria-hidden": "true",
1020
- children: content
1021
- }), overlayNode) : null;
1022
- const layerAxes = isResizable && !item.static ? placement === "outside" ? resizeHandles : placement === "corner" ? resizeHandles.filter(isCornerAxis) : [] : [];
1023
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1024
- host,
1025
- (layerAxes.length || cornerChrome) && !floatInOverlay ? /* @__PURE__ */ jsxs(GripLayerElement, {
1026
- ...layerHoverProps,
1027
- style: {
1028
- ...cornerHitVars,
1029
- left: `${pos_0.left}px`,
1030
- top: `${pos_0.top}px`,
1031
- width: `${pos_0.width}px`,
1032
- height: `${pos_0.height}px`
1033
- },
1034
- "aria-hidden": cornerChrome ? void 0 : "true",
1035
- children: [
1036
- layerAxes.map((axis_4) => /* @__PURE__ */ jsx(ResizeHandle, {
1037
- axis: axis_4,
1038
- placement,
1039
- boardDepth,
1040
- yieldWarning: cornerYieldWarning,
1041
- isRevealed: gripsRevealed,
1042
- isResizing,
1043
- onResize: handleResize
1044
- }, `handle-${axis_4}`)),
1045
- placement === "outside" ? null : layerAxes.map((axis_5) => /* @__PURE__ */ jsx(GripElement, {
1046
- "data-axis": axis_5,
1047
- mods: {
1048
- revealed: gripsRevealed,
1049
- placement: "corner"
1050
- },
1051
- "aria-hidden": "true"
1052
- }, `grip-${axis_5}`)),
1053
- cornerChrome ? /* @__PURE__ */ jsx(CornerChromeElement, {
1054
- mods: { corner: cornerChromePlacement },
1055
- children: cornerChrome
1056
- }) : null
1057
- ]
1058
- }) : null,
1059
- overlayClone
1060
- ] });
1061
- }
1062
-
1063
- //#endregion
1064
- export { WidgetHost };
1065
- //# sourceMappingURL=WidgetHost.js.map