@cube-dev/ui-kit 0.0.0-canary-e056095 → 0.0.0-canary-31f7f8e
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.
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.d.ts +0 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +2 -2
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +2 -2
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +2 -2
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +2 -2
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +28 -28
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +2 -2
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +2 -2
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.d.ts +1 -2
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.d.ts +0 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +2 -2
- package/dist/components/fields/Checkbox/CheckboxGroup.js +2 -2
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +2 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +2 -2
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +2 -2
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +2 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +2 -2
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +2 -2
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +3 -3
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +4 -4
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/index.d.ts +0 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +2 -2
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/fields/Picker/Picker.js +3 -3
- package/dist/components/fields/RadioGroup/Radio.js +2 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +2 -2
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +2 -2
- package/dist/components/fields/TextArea/TextArea.js +2 -2
- package/dist/components/fields/TextInput/TextInput.js +2 -2
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +7 -6
- package/dist/components/fields/color/channels.js.map +1 -1
- package/dist/components/fields/color/color.d.ts +1 -0
- package/dist/components/fields/color/color.js +22 -100
- package/dist/components/fields/color/color.js.map +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +3 -3
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +2 -2
- package/dist/components/navigation/Tabs/Tabs.js +2 -2
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +2 -2
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +4 -4
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +1 -2
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.d.ts +0 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/types.d.ts +0 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.d.ts +0 -2
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/index.d.ts +0 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -25
- package/dist/i18n/locales/en-US/uikit.js +1 -25
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -27
- package/dist/i18n/locales/es-ES/uikit.js +1 -25
- package/dist/i18n/locales/es-MX/uikit.js +1 -25
- package/dist/i18n/locales/fr-FR/uikit.js +1 -25
- package/dist/i18n/locales/it-IT/uikit.js +1 -25
- package/dist/i18n/locales/ja-JP/uikit.js +1 -25
- package/dist/i18n/locales/nb-NO/uikit.js +1 -25
- package/dist/i18n/locales/pt-BR/uikit.js +1 -25
- package/dist/i18n/locales/pt-PT/uikit.js +1 -25
- package/dist/i18n/locales/sv-SE/uikit.js +1 -25
- package/dist/i18n/locales/vi-VN/uikit.js +1 -25
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/index.d.ts +0 -8
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +2 -15
- package/dist/index.js +50 -61
- package/dist/index.js.map +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +2 -2
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +2 -2
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.d.ts +61 -0
- package/dist/tokens/legacy-color.js +58 -0
- package/dist/tokens/legacy-color.js.map +1 -0
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +2 -2
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.d.ts +2 -0
- package/dist/utils/colors.js +247 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Usage.md +18 -0
- package/package.json +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.d.ts +0 -2
- package/dist/components/layout/Dashboard/Dashboard.d.ts +0 -19
- package/dist/components/layout/Dashboard/Dashboard.js +0 -188
- package/dist/components/layout/Dashboard/Dashboard.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardContainer.d.ts +0 -13
- package/dist/components/layout/Dashboard/DashboardContainer.js +0 -272
- package/dist/components/layout/Dashboard/DashboardContainer.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardContainerContent.js +0 -405
- package/dist/components/layout/Dashboard/DashboardContainerContent.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardNodeActions.js +0 -228
- package/dist/components/layout/Dashboard/DashboardNodeActions.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardTabs.d.ts +0 -14
- package/dist/components/layout/Dashboard/DashboardTabs.js +0 -85
- package/dist/components/layout/Dashboard/DashboardTabs.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardWidget.d.ts +0 -9
- package/dist/components/layout/Dashboard/DashboardWidget.js +0 -196
- package/dist/components/layout/Dashboard/DashboardWidget.js.map +0 -1
- package/dist/components/layout/Dashboard/context.js +0 -37
- package/dist/components/layout/Dashboard/context.js.map +0 -1
- package/dist/components/layout/Dashboard/drag.js +0 -481
- package/dist/components/layout/Dashboard/drag.js.map +0 -1
- package/dist/components/layout/Dashboard/index.d.ts +0 -6
- package/dist/components/layout/Dashboard/occupancy.js +0 -240
- package/dist/components/layout/Dashboard/occupancy.js.map +0 -1
- package/dist/components/layout/Dashboard/placement.js +0 -94
- package/dist/components/layout/Dashboard/placement.js.map +0 -1
- package/dist/components/layout/Dashboard/styles.js +0 -344
- package/dist/components/layout/Dashboard/styles.js.map +0 -1
- package/dist/components/layout/Dashboard/types.d.ts +0 -220
- package/dist/components/layout/Dashboard/use-dashboard-gestures.js +0 -321
- package/dist/components/layout/Dashboard/use-dashboard-gestures.js.map +0 -1
- package/dist/components/layout/Dashboard/use-dashboard-node.js +0 -93
- package/dist/components/layout/Dashboard/use-dashboard-node.js.map +0 -1
- package/dist/components/portal/PortalProvider.d.ts +0 -2
- package/dist/icons/ArrowsHorizontalIcon.d.ts +0 -12
- package/dist/icons/ArrowsHorizontalIcon.js +0 -11
- package/dist/icons/ArrowsHorizontalIcon.js.map +0 -1
- package/dist/icons/ArrowsInHorizontalIcon.d.ts +0 -20
- package/dist/icons/ArrowsInHorizontalIcon.js +0 -31
- package/dist/icons/ArrowsInHorizontalIcon.js.map +0 -1
- package/dist/icons/ArrowsInVerticalIcon.d.ts +0 -13
- package/dist/icons/ArrowsInVerticalIcon.js +0 -24
- package/dist/icons/ArrowsInVerticalIcon.js.map +0 -1
- package/dist/icons/ArrowsMaximizeIcon.d.ts +0 -12
- package/dist/icons/ArrowsMaximizeIcon.js +0 -11
- package/dist/icons/ArrowsMaximizeIcon.js.map +0 -1
- package/dist/icons/ArrowsMinimizeIcon.d.ts +0 -12
- package/dist/icons/ArrowsMinimizeIcon.js +0 -11
- package/dist/icons/ArrowsMinimizeIcon.js.map +0 -1
- package/dist/icons/ArrowsVerticalIcon.d.ts +0 -12
- package/dist/icons/ArrowsVerticalIcon.js +0 -11
- package/dist/icons/ArrowsVerticalIcon.js.map +0 -1
- package/dist/icons/CirclePlusIcon.d.ts +0 -12
- package/dist/icons/CirclePlusIcon.js +0 -11
- package/dist/icons/CirclePlusIcon.js.map +0 -1
- package/dist/icons/MaximizeIcon.d.ts +0 -12
- package/dist/icons/MaximizeIcon.js +0 -11
- package/dist/icons/MaximizeIcon.js.map +0 -1
- package/docs/components/layout/Dashboard.md +0 -409
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-31f7f8e | Cube Dev Team */
|
|
2
2
|
import { EventBusContext, useEventBus } from "./useEventBus.js";
|
|
3
3
|
import { useCallback, useContext, useEffect, useRef } from "react";
|
|
4
4
|
|
package/dist/utils/selection.js
CHANGED
package/dist/utils/styles.js
CHANGED
package/dist/utils/tree.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-31f7f8e | Cube Dev Team */
|
|
2
2
|
//#region src/utils/tree.ts
|
|
3
3
|
function toFlatTree(tree, includingFolders) {
|
|
4
4
|
return tree.reduce((result, node) => {
|
package/dist/utils/warnings.js
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-31f7f8e | Cube Dev Team */
|
|
2
2
|
//#region src/version.ts
|
|
3
|
-
const VERSION = "0.0.0-canary-
|
|
3
|
+
const VERSION = "0.0.0-canary-31f7f8e";
|
|
4
4
|
const TASTY_VERSION = "3.7.0";
|
|
5
5
|
if (typeof window !== "undefined") {
|
|
6
6
|
const version = VERSION;
|
package/docs/Usage.md
CHANGED
|
@@ -342,6 +342,24 @@ resolvePresetValues('s3'); // { fontFamily: 'ui-monospace, …', fontSize: '14px
|
|
|
342
342
|
|
|
343
343
|
`useTokenValue()`, `useTokenValues()` and `usePresetValues()` are the same three readers as hooks, re-resolved whenever the palette is re-seeded or the scheme / contrast tier flips. The object `useTokenValues()` returns keeps its identity while the values do, so it is safe as a dependency of the theme object built from it.
|
|
344
344
|
|
|
345
|
+
### Colors a Legacy Parser Will Accept
|
|
346
|
+
|
|
347
|
+
Every color token computes to `oklch(...)`, and a large class of consumers validates colors against "HEX, `rgb()`, or `hsl()`" and **silently drops** anything else — Stripe's Appearance API falls back to its own light theme, `d3-color` (so Vega) throws, mapbox-gl rejects even an `#rrggbbaa` tail. Nothing warns, and a round trip through the DOM does not help: Chrome serializes `oklch` back as `oklch`. So `resolveTokenValue()` hands back a value that is correct and unusable at the same time, and `toLegacyColor()` is the step between them.
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
import { resolveTokenValue, toLegacyColor } from '@cube-dev/ui-kit';
|
|
351
|
+
|
|
352
|
+
toLegacyColor(resolveTokenValue('#purple')); // '#6b53e4'
|
|
353
|
+
toLegacyColor('oklch(0.55 0.21 285 / 0.4)'); // 'rgba(107, 83, 228, 0.4)'
|
|
354
|
+
toLegacyColor('oklch(0.55 0.21 285 / 0.4)', { alpha: 'hex' }); // '#6b53e466'
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
An opaque color is always `#rrggbb`, which everything accepts. Only the translucent case has a choice, and `alpha` picks it, because the acceptable form differs per consumer: `'rgba'` (the default) is the widest — Stripe, mapbox-gl and CSS all take it — while `'hex'` gives the shorter `#rrggbbaa` that Vega and plain CSS prefer and mapbox-gl drops.
|
|
358
|
+
|
|
359
|
+
It takes `null` so it composes with `resolveTokenValue()` directly, and reads every notation the kit emits or accepts: `oklch()`, `okhsl()`, `okhst()`, `rgb()`, `hsl()`, hex (3/4/6/8 digits) and `transparent`, in either the slash or the legacy comma alpha syntax, including the components a hand-rolled regex misses — a negative hue, any angle unit, scientific notation, a `none` component. A chroma outside the sRGB gamut is clipped to the gamut boundary rather than allowed to overflow a channel.
|
|
360
|
+
|
|
361
|
+
A value it cannot read returns `fallback ?? null` rather than the input, which is the whole point: `color-mix()`, relative syntax (`oklch(from …)`) and a bare `var()` reference only have a value inside a CSS engine, and handing one back unchanged is exactly what makes the consumer drop the color and revert to its own theme.
|
|
362
|
+
|
|
345
363
|
These resolve token _values_. For the ambient _conditions_ themselves — which scheme and contrast tier the document is in — see [Reading the scheme from JS](#reading-the-scheme-from-js).
|
|
346
364
|
|
|
347
365
|
So these helpers do not inspect the value. They read `$tokens-applied`, a marker the token block declares alongside the tokens, which answers the question that matters — _are the kit's tokens in effect on this element?_ Off that surface every read returns `null` (or `fallback`) and warns once in development; on it, the computed value is taken as the truth.
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CubeDashboardContainerProps, CubeDashboardProps, CubeDashboardTabProps, CubeDashboardTabsProps, CubeDashboardWidgetProps, DashboardAddItemDefinition, DashboardAddItemInfo, DashboardAddItemKind, DashboardContainerKind, DashboardNodeAction, DashboardParentKind, DashboardPlacement, DashboardPlacementChangeInfo, DashboardPlacementChangeInput, DashboardPlacementChangeItem, DashboardPlacementChangePhase, DashboardPlacementChangeReason, DashboardPlacementProps, DashboardSelectionMode } from "./types.js";
|
|
3
|
-
import { DashboardTab, DashboardTabs } from "./DashboardTabs.js";
|
|
4
|
-
import { DashboardGrid, DashboardHorizontalStack, DashboardVerticalStack } from "./DashboardContainer.js";
|
|
5
|
-
import { DashboardWidget } from "./DashboardWidget.js";
|
|
6
|
-
import * as react from "react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/layout/Dashboard/Dashboard.d.ts
|
|
9
|
-
declare const Dashboard: react.ForwardRefExoticComponent<CubeDashboardProps & react.RefAttributes<HTMLDivElement>> & {
|
|
10
|
-
HorizontalStack: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
VerticalStack: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
Grid: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
Tabs: react.ForwardRefExoticComponent<CubeDashboardTabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
Tab: typeof DashboardTab;
|
|
15
|
-
Widget: react.ForwardRefExoticComponent<CubeDashboardWidgetProps & react.RefAttributes<HTMLDivElement>>;
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { Dashboard };
|
|
19
|
-
//# sourceMappingURL=Dashboard.d.ts.map
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e056095 | Cube Dev Team */
|
|
2
|
-
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
-
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
4
|
-
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
5
|
-
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
6
|
-
import { DashboardAuthoringContext, DashboardEditingContext, DashboardMetricsContext, DashboardSelectionContext, DashboardTreeContext } from "./context.js";
|
|
7
|
-
import { normalizeGap } from "./placement.js";
|
|
8
|
-
import { DashboardElement } from "./styles.js";
|
|
9
|
-
import { DashboardRootAddControl } from "./DashboardContainerContent.js";
|
|
10
|
-
import { DashboardGrid, DashboardHorizontalStack, DashboardVerticalStack } from "./DashboardContainer.js";
|
|
11
|
-
import { DashboardTab, DashboardTabs } from "./DashboardTabs.js";
|
|
12
|
-
import { DashboardWidget } from "./DashboardWidget.js";
|
|
13
|
-
import { CONTAINER_STYLES, filterBaseProps } from "@tenphi/tasty";
|
|
14
|
-
import { Children, forwardRef, useMemo, useRef, useState } from "react";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
17
|
-
//#region src/components/layout/Dashboard/Dashboard.tsx
|
|
18
|
-
const DashboardRoot = forwardRef(function DashboardRoot(props, ref) {
|
|
19
|
-
const { children, rowHeight = 80, gap = 16, isEditing = false, selectionMode = "multiple", selectedKeys: controlledSelectedKeys, defaultSelectedKeys = [], onSelectionChange, addItems = [], onAddItem, styles: explicitStyles, style, ...otherProps } = props;
|
|
20
|
-
const [columnGap, rowGap] = normalizeGap(gap);
|
|
21
|
-
const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] = useState(defaultSelectedKeys);
|
|
22
|
-
const [movingId, setMovingId] = useState(null);
|
|
23
|
-
const [arrivingIds, setArrivingIds] = useState(() => /* @__PURE__ */ new Set());
|
|
24
|
-
const acceptsArrivalsRef = useRef(false);
|
|
25
|
-
const arrivalTimerRef = useRef(null);
|
|
26
|
-
const registrationsRef = useRef(/* @__PURE__ */ new Map());
|
|
27
|
-
const isControlled = controlledSelectedKeys !== void 0;
|
|
28
|
-
const selectedKeys = selectionMode === "none" ? [] : controlledSelectedKeys ?? uncontrolledSelectedKeys;
|
|
29
|
-
const selectedKeySet = useMemo(() => new Set(selectedKeys), [selectedKeys]);
|
|
30
|
-
const commitSelection = useEvent((next) => {
|
|
31
|
-
if (!isControlled) setUncontrolledSelectedKeys(next);
|
|
32
|
-
onSelectionChange?.(next);
|
|
33
|
-
});
|
|
34
|
-
const register = useEvent((id, registration) => {
|
|
35
|
-
registrationsRef.current.set(id, registration);
|
|
36
|
-
return () => {
|
|
37
|
-
if (registrationsRef.current.get(id) === registration) registrationsRef.current.delete(id);
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
const select = useEvent((id, additive) => {
|
|
41
|
-
if (selectionMode === "none") return;
|
|
42
|
-
const registration = registrationsRef.current.get(id);
|
|
43
|
-
if (!registration) return;
|
|
44
|
-
if (selectionMode === "single" || !additive) {
|
|
45
|
-
commitSelection([id]);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const current = new Set(selectedKeySet);
|
|
49
|
-
if (current.has(id)) {
|
|
50
|
-
current.delete(id);
|
|
51
|
-
commitSelection([...current]);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
for (const selectedId of current) {
|
|
55
|
-
const selected = registrationsRef.current.get(selectedId);
|
|
56
|
-
if (!selected) continue;
|
|
57
|
-
if (registration.ancestorIds.includes(selectedId)) return;
|
|
58
|
-
if (selected.parentId !== registration.parentId) return;
|
|
59
|
-
if (selected.ancestorIds.includes(id)) current.delete(selectedId);
|
|
60
|
-
}
|
|
61
|
-
current.add(id);
|
|
62
|
-
commitSelection([...current]);
|
|
63
|
-
});
|
|
64
|
-
const handleRootClick = useEvent((event) => {
|
|
65
|
-
if (event.target.closest("[data-dashboard-node]")) return;
|
|
66
|
-
if (selectedKeySet.size > 0) commitSelection([]);
|
|
67
|
-
});
|
|
68
|
-
const startMoving = useEvent((id) => setMovingId(id));
|
|
69
|
-
const stopMoving = useEvent((id) => {
|
|
70
|
-
setMovingId((current) => current === id ? null : current);
|
|
71
|
-
});
|
|
72
|
-
const markArriving = useEvent((id) => {
|
|
73
|
-
if (!acceptsArrivalsRef.current) return;
|
|
74
|
-
if (arrivalTimerRef.current !== null) clearTimeout(arrivalTimerRef.current);
|
|
75
|
-
setArrivingIds((current) => new Set(current).add(id));
|
|
76
|
-
arrivalTimerRef.current = setTimeout(() => {
|
|
77
|
-
setArrivingIds(/* @__PURE__ */ new Set());
|
|
78
|
-
arrivalTimerRef.current = null;
|
|
79
|
-
}, 1e3);
|
|
80
|
-
});
|
|
81
|
-
useLayoutEffect$1(() => {
|
|
82
|
-
acceptsArrivalsRef.current = true;
|
|
83
|
-
return () => {
|
|
84
|
-
acceptsArrivalsRef.current = false;
|
|
85
|
-
if (arrivalTimerRef.current !== null) clearTimeout(arrivalTimerRef.current);
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
const metrics = useMemo(() => ({
|
|
89
|
-
rowHeight: Math.max(1, rowHeight),
|
|
90
|
-
columnGap: Math.max(0, columnGap),
|
|
91
|
-
rowGap: Math.max(0, rowGap)
|
|
92
|
-
}), [
|
|
93
|
-
columnGap,
|
|
94
|
-
rowGap,
|
|
95
|
-
rowHeight
|
|
96
|
-
]);
|
|
97
|
-
const selection = useMemo(() => ({
|
|
98
|
-
selectionMode,
|
|
99
|
-
selectedKeys: selectedKeySet,
|
|
100
|
-
register,
|
|
101
|
-
select
|
|
102
|
-
}), [
|
|
103
|
-
register,
|
|
104
|
-
select,
|
|
105
|
-
selectedKeySet,
|
|
106
|
-
selectionMode
|
|
107
|
-
]);
|
|
108
|
-
const editing = useMemo(() => ({
|
|
109
|
-
isEditing,
|
|
110
|
-
movingId,
|
|
111
|
-
arrivingIds,
|
|
112
|
-
markArriving,
|
|
113
|
-
startMoving,
|
|
114
|
-
stopMoving
|
|
115
|
-
}), [
|
|
116
|
-
arrivingIds,
|
|
117
|
-
isEditing,
|
|
118
|
-
markArriving,
|
|
119
|
-
movingId,
|
|
120
|
-
startMoving,
|
|
121
|
-
stopMoving
|
|
122
|
-
]);
|
|
123
|
-
const authoring = useMemo(() => ({
|
|
124
|
-
addItems,
|
|
125
|
-
onAddItem
|
|
126
|
-
}), [addItems, onAddItem]);
|
|
127
|
-
const rootTree = useMemo(() => ({
|
|
128
|
-
containerDepth: 0,
|
|
129
|
-
parentKind: "root",
|
|
130
|
-
parentId: null,
|
|
131
|
-
layoutParentId: null,
|
|
132
|
-
parentColumns: 12,
|
|
133
|
-
parentRows: 1,
|
|
134
|
-
ancestorIds: []
|
|
135
|
-
}), []);
|
|
136
|
-
const styles = {
|
|
137
|
-
...extractStyles(otherProps, CONTAINER_STYLES),
|
|
138
|
-
...explicitStyles
|
|
139
|
-
};
|
|
140
|
-
const baseProps = filterBaseProps(otherProps, {
|
|
141
|
-
eventProps: true,
|
|
142
|
-
labelable: true
|
|
143
|
-
});
|
|
144
|
-
return /* @__PURE__ */ jsx(DashboardMetricsContext.Provider, {
|
|
145
|
-
value: metrics,
|
|
146
|
-
children: /* @__PURE__ */ jsx(DashboardSelectionContext.Provider, {
|
|
147
|
-
value: selection,
|
|
148
|
-
children: /* @__PURE__ */ jsx(DashboardEditingContext.Provider, {
|
|
149
|
-
value: editing,
|
|
150
|
-
children: /* @__PURE__ */ jsx(DashboardAuthoringContext.Provider, {
|
|
151
|
-
value: authoring,
|
|
152
|
-
children: /* @__PURE__ */ jsx(DashboardTreeContext.Provider, {
|
|
153
|
-
value: rootTree,
|
|
154
|
-
children: /* @__PURE__ */ jsxs(DashboardElement, {
|
|
155
|
-
...mergeProps(baseProps, { onClick: handleRootClick }),
|
|
156
|
-
ref,
|
|
157
|
-
styles,
|
|
158
|
-
style,
|
|
159
|
-
"data-editing": isEditing || void 0,
|
|
160
|
-
"data-dragging": movingId !== null || void 0,
|
|
161
|
-
"data-dashboard-root": "",
|
|
162
|
-
"data-dashboard-drop-target": "",
|
|
163
|
-
"data-dashboard-parent-id": "",
|
|
164
|
-
"data-dashboard-container-kind": "root",
|
|
165
|
-
"data-dashboard-columns": 12,
|
|
166
|
-
"data-dashboard-rows": Math.max(1, Children.count(children)),
|
|
167
|
-
"data-dashboard-depth": 0,
|
|
168
|
-
"data-dashboard-ancestor-ids": "[]",
|
|
169
|
-
children: [children, isEditing ? /* @__PURE__ */ jsx(DashboardRootAddControl, { row: Children.count(children) }) : null]
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
})
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
const Dashboard = Object.assign(DashboardRoot, {
|
|
178
|
-
HorizontalStack: DashboardHorizontalStack,
|
|
179
|
-
VerticalStack: DashboardVerticalStack,
|
|
180
|
-
Grid: DashboardGrid,
|
|
181
|
-
Tabs: DashboardTabs,
|
|
182
|
-
Tab: DashboardTab,
|
|
183
|
-
Widget: DashboardWidget
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
//#endregion
|
|
187
|
-
export { Dashboard };
|
|
188
|
-
//# sourceMappingURL=Dashboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","names":[],"sources":["../../../../src/components/layout/Dashboard/Dashboard.tsx"],"sourcesContent":["import { CONTAINER_STYLES, filterBaseProps, Styles } from '@tenphi/tasty';\nimport { Children, forwardRef, useMemo, useRef, useState } from 'react';\n\nimport { useEvent } from '../../../_internal/hooks';\nimport { mergeProps, useLayoutEffect } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\n\nimport {\n DashboardAuthoringContext,\n DashboardEditingContext,\n DashboardMetricsContext,\n DashboardSelectionContext,\n DashboardTreeContext,\n} from './context';\nimport {\n DashboardGrid,\n DashboardHorizontalStack,\n DashboardVerticalStack,\n} from './DashboardContainer';\nimport {\n DashboardContainerContent,\n DashboardRootAddControl,\n} from './DashboardContainerContent';\nimport { DashboardTab, DashboardTabs } from './DashboardTabs';\nimport { DashboardWidget } from './DashboardWidget';\nimport { normalizeGap } from './placement';\nimport { DashboardElement } from './styles';\n\nimport type { ForwardedRef, MouseEvent as ReactMouseEvent } from 'react';\nimport type {\n CubeDashboardProps,\n DashboardAuthoringContextValue,\n DashboardEditingContextValue,\n DashboardMetrics,\n DashboardNodeRegistration,\n DashboardSelectionContextValue,\n DashboardTreeContextValue,\n} from './types';\n\nexport const DashboardRoot = forwardRef(function DashboardRoot(\n props: CubeDashboardProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n children,\n rowHeight = 80,\n gap = 16,\n isEditing = false,\n selectionMode = 'multiple',\n selectedKeys: controlledSelectedKeys,\n defaultSelectedKeys = [],\n onSelectionChange,\n addItems = [],\n onAddItem,\n styles: explicitStyles,\n style,\n ...otherProps\n } = props;\n const [columnGap, rowGap] = normalizeGap(gap);\n const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] =\n useState<string[]>(defaultSelectedKeys);\n const [movingId, setMovingId] = useState<string | null>(null);\n const [arrivingIds, setArrivingIds] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const acceptsArrivalsRef = useRef(false);\n const arrivalTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const registrationsRef = useRef(new Map<string, DashboardNodeRegistration>());\n const isControlled = controlledSelectedKeys !== undefined;\n const selectedKeys =\n selectionMode === 'none'\n ? []\n : controlledSelectedKeys ?? uncontrolledSelectedKeys;\n const selectedKeySet = useMemo(() => new Set(selectedKeys), [selectedKeys]);\n\n const commitSelection = useEvent((next: string[]) => {\n if (!isControlled) setUncontrolledSelectedKeys(next);\n onSelectionChange?.(next);\n });\n\n const register = useEvent(\n (id: string, registration: DashboardNodeRegistration) => {\n registrationsRef.current.set(id, registration);\n return () => {\n const current = registrationsRef.current.get(id);\n if (current === registration) registrationsRef.current.delete(id);\n };\n },\n );\n\n const select = useEvent((id: string, additive: boolean) => {\n if (selectionMode === 'none') return;\n const registration = registrationsRef.current.get(id);\n if (!registration) return;\n\n if (selectionMode === 'single' || !additive) {\n commitSelection([id]);\n return;\n }\n\n const current = new Set(selectedKeySet);\n if (current.has(id)) {\n current.delete(id);\n commitSelection([...current]);\n return;\n }\n\n for (const selectedId of current) {\n const selected = registrationsRef.current.get(selectedId);\n if (!selected) continue;\n\n if (registration.ancestorIds.includes(selectedId)) {\n return;\n }\n\n if (selected.parentId !== registration.parentId) {\n return;\n }\n\n if (selected.ancestorIds.includes(id)) {\n current.delete(selectedId);\n }\n }\n\n current.add(id);\n commitSelection([...current]);\n });\n const handleRootClick = useEvent((event: ReactMouseEvent<HTMLElement>) => {\n const target = event.target as HTMLElement;\n if (target.closest('[data-dashboard-node]')) return;\n if (selectedKeySet.size > 0) commitSelection([]);\n });\n const startMoving = useEvent((id: string) => setMovingId(id));\n const stopMoving = useEvent((id: string) => {\n setMovingId((current) => (current === id ? null : current));\n });\n const markArriving = useEvent((id: string) => {\n if (!acceptsArrivalsRef.current) return;\n\n if (arrivalTimerRef.current !== null) {\n clearTimeout(arrivalTimerRef.current);\n }\n setArrivingIds((current) => new Set(current).add(id));\n arrivalTimerRef.current = setTimeout(() => {\n setArrivingIds(new Set());\n arrivalTimerRef.current = null;\n }, 1000);\n });\n\n useLayoutEffect(() => {\n acceptsArrivalsRef.current = true;\n\n return () => {\n acceptsArrivalsRef.current = false;\n if (arrivalTimerRef.current !== null) {\n clearTimeout(arrivalTimerRef.current);\n }\n };\n }, []);\n\n const metrics = useMemo<DashboardMetrics>(\n () => ({\n rowHeight: Math.max(1, rowHeight),\n columnGap: Math.max(0, columnGap),\n rowGap: Math.max(0, rowGap),\n }),\n [columnGap, rowGap, rowHeight],\n );\n const selection = useMemo<DashboardSelectionContextValue>(\n () => ({\n selectionMode,\n selectedKeys: selectedKeySet,\n register,\n select,\n }),\n [register, select, selectedKeySet, selectionMode],\n );\n const editing = useMemo<DashboardEditingContextValue>(\n () => ({\n isEditing,\n movingId,\n arrivingIds,\n markArriving,\n startMoving,\n stopMoving,\n }),\n [arrivingIds, isEditing, markArriving, movingId, startMoving, stopMoving],\n );\n const authoring = useMemo<DashboardAuthoringContextValue>(\n () => ({ addItems, onAddItem }),\n [addItems, onAddItem],\n );\n const rootTree = useMemo<DashboardTreeContextValue>(\n () => ({\n containerDepth: 0,\n parentKind: 'root',\n parentId: null,\n layoutParentId: null,\n parentColumns: 12,\n parentRows: 1,\n ancestorIds: [],\n }),\n [],\n );\n // `otherProps` rather than `props`: `gap` is a container style prop as well as\n // a Dashboard prop, and extracting it would write the in-container gap onto the\n // root grid, overriding the fixed `1x` top-level channel.\n const extractedStyles = extractStyles(otherProps, CONTAINER_STYLES);\n const styles: Styles = { ...extractedStyles, ...explicitStyles };\n const baseProps = filterBaseProps(otherProps, {\n eventProps: true,\n labelable: true,\n });\n\n return (\n <DashboardMetricsContext.Provider value={metrics}>\n <DashboardSelectionContext.Provider value={selection}>\n <DashboardEditingContext.Provider value={editing}>\n <DashboardAuthoringContext.Provider value={authoring}>\n <DashboardTreeContext.Provider value={rootTree}>\n <DashboardElement\n {...mergeProps(baseProps, { onClick: handleRootClick })}\n ref={ref}\n styles={styles}\n style={style}\n data-editing={isEditing || undefined}\n data-dragging={movingId !== null || undefined}\n data-dashboard-root=\"\"\n data-dashboard-drop-target=\"\"\n data-dashboard-parent-id=\"\"\n data-dashboard-container-kind=\"root\"\n data-dashboard-columns={12}\n data-dashboard-rows={Math.max(1, Children.count(children))}\n data-dashboard-depth={0}\n data-dashboard-ancestor-ids=\"[]\"\n >\n {children}\n {isEditing ? (\n <DashboardRootAddControl row={Children.count(children)} />\n ) : null}\n </DashboardElement>\n </DashboardTreeContext.Provider>\n </DashboardAuthoringContext.Provider>\n </DashboardEditingContext.Provider>\n </DashboardSelectionContext.Provider>\n </DashboardMetricsContext.Provider>\n );\n});\n\nexport const Dashboard = Object.assign(DashboardRoot, {\n HorizontalStack: DashboardHorizontalStack,\n VerticalStack: DashboardVerticalStack,\n Grid: DashboardGrid,\n Tabs: DashboardTabs,\n Tab: DashboardTab,\n Widget: DashboardWidget,\n});\n\nexport {\n DashboardGrid,\n DashboardHorizontalStack,\n DashboardVerticalStack,\n} from './DashboardContainer';\nexport { DashboardTab, DashboardTabs } from './DashboardTabs';\nexport { DashboardWidget } from './DashboardWidget';\n\nexport type {\n CubeDashboardContainerProps,\n CubeDashboardProps,\n CubeDashboardTabProps,\n CubeDashboardTabsProps,\n CubeDashboardWidgetProps,\n DashboardAddItemDefinition,\n DashboardAddItemInfo,\n DashboardAddItemKind,\n DashboardContainerKind,\n DashboardNodeAction,\n DashboardParentKind,\n DashboardPlacement,\n DashboardPlacementChangeInfo,\n DashboardPlacementChangeInput,\n DashboardPlacementChangeItem,\n DashboardPlacementChangePhase,\n DashboardPlacementChangeReason,\n DashboardPlacementProps,\n DashboardSelectionMode,\n} from './types';\n"],"mappings":"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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CubeDashboardContainerProps } from "./types.js";
|
|
3
|
-
import * as react from "react";
|
|
4
|
-
import { ForwardedRef, ReactNode } from "react";
|
|
5
|
-
import "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/layout/Dashboard/DashboardContainer.d.ts
|
|
8
|
-
declare const DashboardHorizontalStack: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const DashboardVerticalStack: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
declare const DashboardGrid: react.ForwardRefExoticComponent<CubeDashboardContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { DashboardGrid, DashboardHorizontalStack, DashboardVerticalStack };
|
|
13
|
-
//# sourceMappingURL=DashboardContainer.d.ts.map
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e056095 | Cube Dev Team */
|
|
2
|
-
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
-
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
4
|
-
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
5
|
-
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
6
|
-
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
7
|
-
import { useI18n } from "../../../i18n/useI18n.js";
|
|
8
|
-
import { DashboardMetricsContext, DashboardTreeContext } from "./context.js";
|
|
9
|
-
import { GripVerticalIcon } from "../../../icons/GripVerticalIcon.js";
|
|
10
|
-
import { clamp, clampRowOrigin, clampRows, clampSpan, getPlacementStyle, normalizePlacement } from "./placement.js";
|
|
11
|
-
import { getContainerChildMinimum, getDashboardDescendantContainerDepth, hasContainerLayoutChildren } from "./occupancy.js";
|
|
12
|
-
import { ContainerElement, ContainerHeaderElement, CornerResizeGripElement, ResizeHandleElement, TopLevelResizeHandleElement } from "./styles.js";
|
|
13
|
-
import { DashboardContainerContent } from "./DashboardContainerContent.js";
|
|
14
|
-
import { DashboardNodeActions } from "./DashboardNodeActions.js";
|
|
15
|
-
import { renderDashboardDropPreview } from "./drag.js";
|
|
16
|
-
import { useDashboardNodeInteraction } from "./use-dashboard-node.js";
|
|
17
|
-
import { useDashboardGestures } from "./use-dashboard-gestures.js";
|
|
18
|
-
import { CONTAINER_STYLES, filterBaseProps } from "@tenphi/tasty";
|
|
19
|
-
import { forwardRef, useContext, useMemo, useRef } from "react";
|
|
20
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
|
|
22
|
-
//#region src/components/layout/Dashboard/DashboardContainer.tsx
|
|
23
|
-
const DashboardContainerShell = forwardRef(function DashboardContainerShell(props, ref) {
|
|
24
|
-
const { id, title, kind, content, isSelectable, isMovable = false, isResizable = false, minColumns = 1, maxColumns = 12, minRows = 1, maxRows, onPlacementChange, moveLabel, resizeLabel, onSettingsPress, settingsLabel, onDeletePress, onDuplicatePress, duplicateLabel, actions, onMenuAction, deleteLabel, column, row, columns, rows = 1, children, mods, styles: explicitStyles, style, "aria-label": ariaLabel, ...otherProps } = props;
|
|
25
|
-
const { t } = useI18n();
|
|
26
|
-
const metrics = useContext(DashboardMetricsContext);
|
|
27
|
-
const localRef = useRef(null);
|
|
28
|
-
const combinedRef = useCombinedRefs(ref, localRef);
|
|
29
|
-
const node = useDashboardNodeInteraction({
|
|
30
|
-
id,
|
|
31
|
-
isContainer: true,
|
|
32
|
-
isSelectable
|
|
33
|
-
});
|
|
34
|
-
useLayoutEffect$1(() => {
|
|
35
|
-
node.editing.markArriving(id);
|
|
36
|
-
}, [id, node.editing.markArriving]);
|
|
37
|
-
if (node.containerDepth > 3) throw new Error(`Dashboard container "${id}" exceeds the maximum nesting depth of 3.`);
|
|
38
|
-
const styles = {
|
|
39
|
-
...extractStyles(props, CONTAINER_STYLES),
|
|
40
|
-
...explicitStyles
|
|
41
|
-
};
|
|
42
|
-
const normalizedPlacement = node.tree.parentKind === "root" ? {
|
|
43
|
-
column: 0,
|
|
44
|
-
row: clampRowOrigin(row),
|
|
45
|
-
columns: 12,
|
|
46
|
-
rows: clampRows(rows, 1)
|
|
47
|
-
} : normalizePlacement({
|
|
48
|
-
column,
|
|
49
|
-
row,
|
|
50
|
-
columns,
|
|
51
|
-
rows
|
|
52
|
-
}, node.tree.parentColumns, node.tree.parentRows);
|
|
53
|
-
const placementStyle = getPlacementStyle(node.tree, normalizedPlacement);
|
|
54
|
-
const childMinimum = getContainerChildMinimum(kind, children, normalizedPlacement.columns, normalizedPlacement.rows);
|
|
55
|
-
const descendantContainerDepth = getDashboardDescendantContainerDepth(children);
|
|
56
|
-
const isEmpty = !hasContainerLayoutChildren(kind, children);
|
|
57
|
-
const columnLimit = node.tree.parentColumns;
|
|
58
|
-
const rowLimit = node.tree.parentKind === "root" ? Math.max(childMinimum.rows, clampRows(maxRows, Math.max(12, normalizedPlacement.rows))) : node.tree.parentRows;
|
|
59
|
-
const resolvedMinColumns = clamp(Math.max(clampSpan(minColumns, 1), childMinimum.columns), 1, columnLimit);
|
|
60
|
-
const resolvedMaxColumns = clamp(clampSpan(maxColumns, columnLimit), resolvedMinColumns, columnLimit);
|
|
61
|
-
const resolvedMinRows = clamp(Math.max(clampRows(minRows, 1), childMinimum.rows), 1, rowLimit);
|
|
62
|
-
const resolvedMaxRows = clamp(clampRows(maxRows, rowLimit), resolvedMinRows, rowLimit);
|
|
63
|
-
const canMove = isMovable && !!onPlacementChange;
|
|
64
|
-
const canMoveColumns = canMove && node.tree.parentKind !== "root" && node.tree.parentKind !== "vertical-stack";
|
|
65
|
-
const canMoveRows = canMove && node.tree.parentKind !== "horizontal-stack";
|
|
66
|
-
const canResizeColumns = isResizable && !!onPlacementChange && node.tree.parentKind !== "root" && node.tree.parentKind !== "vertical-stack" && resolvedMaxColumns > resolvedMinColumns;
|
|
67
|
-
const canResizeRows = isResizable && !!onPlacementChange && node.tree.parentKind !== "horizontal-stack" && resolvedMaxRows > resolvedMinRows;
|
|
68
|
-
const canResize = canResizeColumns || canResizeRows;
|
|
69
|
-
const resizeAxis = canResizeColumns ? canResizeRows ? "both" : "x" : "y";
|
|
70
|
-
const shouldRenderTitle = kind === "tabs" && !!title;
|
|
71
|
-
const label = ariaLabel ?? (typeof title === "string" ? title : id);
|
|
72
|
-
const baseProps = filterBaseProps(otherProps, {
|
|
73
|
-
eventProps: true,
|
|
74
|
-
labelable: true
|
|
75
|
-
});
|
|
76
|
-
const gestures = useDashboardGestures({
|
|
77
|
-
id,
|
|
78
|
-
isContainer: true,
|
|
79
|
-
containerKind: kind,
|
|
80
|
-
nodeRef: localRef,
|
|
81
|
-
tree: node.tree,
|
|
82
|
-
editing: node.editing,
|
|
83
|
-
metrics,
|
|
84
|
-
placement: normalizedPlacement,
|
|
85
|
-
isSelected: node.isSelected,
|
|
86
|
-
selectSelf: node.selectSelf,
|
|
87
|
-
onPlacementChange,
|
|
88
|
-
canMove,
|
|
89
|
-
canMoveColumns,
|
|
90
|
-
canMoveRows,
|
|
91
|
-
canResize,
|
|
92
|
-
canResizeColumns,
|
|
93
|
-
canResizeRows,
|
|
94
|
-
minColumns: resolvedMinColumns,
|
|
95
|
-
maxColumns: resolvedMaxColumns,
|
|
96
|
-
minRows: resolvedMinRows,
|
|
97
|
-
maxRows: resolvedMaxRows,
|
|
98
|
-
isRootChild: node.tree.parentKind === "root",
|
|
99
|
-
maximumContainerParentDepth: Math.max(0, 2 - descendantContainerDepth)
|
|
100
|
-
});
|
|
101
|
-
const { isMoving, isResizing, dropPreview, surfaceMoveProps, resizeProps } = gestures;
|
|
102
|
-
const handleSettingsPress = useEvent(() => {
|
|
103
|
-
node.selectSelf(false);
|
|
104
|
-
onSettingsPress?.();
|
|
105
|
-
});
|
|
106
|
-
const handleDeletePress = useEvent(() => {
|
|
107
|
-
node.selectSelf(false);
|
|
108
|
-
onDeletePress?.();
|
|
109
|
-
});
|
|
110
|
-
const handleDuplicatePress = useEvent(() => {
|
|
111
|
-
node.selectSelf(false);
|
|
112
|
-
onDuplicatePress?.();
|
|
113
|
-
});
|
|
114
|
-
const handleMenuResize = useEvent((next) => {
|
|
115
|
-
gestures.reportPlacement(next, "resize", "commit", "command");
|
|
116
|
-
});
|
|
117
|
-
const resolvedMods = {
|
|
118
|
-
...mods,
|
|
119
|
-
depth: String(node.containerDepth),
|
|
120
|
-
titled: shouldRenderTitle,
|
|
121
|
-
selected: node.isSelected,
|
|
122
|
-
arriving: node.editing.arrivingIds.has(id),
|
|
123
|
-
hovered: node.isHovered,
|
|
124
|
-
"focus-within": node.isFocusWithin,
|
|
125
|
-
editing: node.editing.isEditing,
|
|
126
|
-
empty: isEmpty,
|
|
127
|
-
dragging: node.editing.movingId !== null,
|
|
128
|
-
movable: canMove,
|
|
129
|
-
moving: isMoving,
|
|
130
|
-
resizing: isResizing
|
|
131
|
-
};
|
|
132
|
-
const ContainerResizeHandleElement = node.tree.parentKind === "root" ? TopLevelResizeHandleElement : ResizeHandleElement;
|
|
133
|
-
return /* @__PURE__ */ jsxs(ContainerElement, {
|
|
134
|
-
...mergeProps(baseProps, node.interactionProps, surfaceMoveProps),
|
|
135
|
-
ref: combinedRef,
|
|
136
|
-
role: "group",
|
|
137
|
-
"aria-label": moveLabel ?? label,
|
|
138
|
-
"aria-roledescription": t("dashboard.container", "Dashboard container"),
|
|
139
|
-
tabIndex: node.canSelect || canMove ? 0 : void 0,
|
|
140
|
-
"data-dashboard-node": "container",
|
|
141
|
-
"data-dashboard-node-id": id,
|
|
142
|
-
"data-dashboard-depth": node.containerDepth,
|
|
143
|
-
"data-dashboard-column": normalizedPlacement.column,
|
|
144
|
-
"data-dashboard-row": normalizedPlacement.row,
|
|
145
|
-
"data-dashboard-columns": normalizedPlacement.columns,
|
|
146
|
-
"data-dashboard-rows": normalizedPlacement.rows,
|
|
147
|
-
"data-dashboard-min-columns": resolvedMinColumns,
|
|
148
|
-
"data-dashboard-max-columns": Math.max(resolvedMinColumns, clampSpan(maxColumns, 12)),
|
|
149
|
-
"data-dashboard-min-rows": resolvedMinRows,
|
|
150
|
-
"data-dashboard-max-rows": maxRows === void 0 ? Number.MAX_SAFE_INTEGER : Math.max(resolvedMinRows, clampRows(maxRows, resolvedMinRows)),
|
|
151
|
-
"data-selected": node.isSelected || void 0,
|
|
152
|
-
"data-arriving": node.editing.arrivingIds.has(id) || void 0,
|
|
153
|
-
"data-moving": isMoving || void 0,
|
|
154
|
-
"data-resizing": isResizing || void 0,
|
|
155
|
-
"data-dashboard-empty": isEmpty || void 0,
|
|
156
|
-
mods: resolvedMods,
|
|
157
|
-
styles,
|
|
158
|
-
style: {
|
|
159
|
-
...placementStyle,
|
|
160
|
-
...style
|
|
161
|
-
},
|
|
162
|
-
children: [
|
|
163
|
-
shouldRenderTitle ? /* @__PURE__ */ jsx(ContainerHeaderElement, { children: title }) : null,
|
|
164
|
-
content,
|
|
165
|
-
/* @__PURE__ */ jsx(DashboardNodeActions, {
|
|
166
|
-
label,
|
|
167
|
-
mods: resolvedMods,
|
|
168
|
-
qaAttribute: "data-dashboard-container-actions",
|
|
169
|
-
nodeId: id,
|
|
170
|
-
isSelected: node.isSelected,
|
|
171
|
-
placement: normalizedPlacement,
|
|
172
|
-
bounds: {
|
|
173
|
-
minColumns: resolvedMinColumns,
|
|
174
|
-
maxColumns: resolvedMaxColumns,
|
|
175
|
-
minRows: resolvedMinRows,
|
|
176
|
-
maxRows: resolvedMaxRows,
|
|
177
|
-
parentColumns: node.tree.parentColumns,
|
|
178
|
-
parentRows: rowLimit
|
|
179
|
-
},
|
|
180
|
-
canResizeColumns,
|
|
181
|
-
canResizeRows,
|
|
182
|
-
nodeRef: localRef,
|
|
183
|
-
actions,
|
|
184
|
-
settingsLabel,
|
|
185
|
-
duplicateLabel,
|
|
186
|
-
deleteLabel,
|
|
187
|
-
onResize: handleMenuResize,
|
|
188
|
-
onSettingsPress: onSettingsPress && handleSettingsPress,
|
|
189
|
-
onDuplicatePress: onDuplicatePress && handleDuplicatePress,
|
|
190
|
-
onDeletePress: onDeletePress && handleDeletePress,
|
|
191
|
-
onMenuAction
|
|
192
|
-
}),
|
|
193
|
-
canResize ? /* @__PURE__ */ jsx(ContainerResizeHandleElement, {
|
|
194
|
-
...resizeProps,
|
|
195
|
-
type: "button",
|
|
196
|
-
"aria-label": resizeLabel ?? t("dashboard.resizeContainer", "Resize dashboard container"),
|
|
197
|
-
"data-dashboard-container-resize-handle": "",
|
|
198
|
-
"data-dashboard-resize-axis": resizeAxis,
|
|
199
|
-
"data-dashboard-no-select": "",
|
|
200
|
-
"aria-hidden": !node.isSelected || void 0,
|
|
201
|
-
tabIndex: node.isSelected ? void 0 : -1,
|
|
202
|
-
mods: {
|
|
203
|
-
...resolvedMods,
|
|
204
|
-
axis: resizeAxis,
|
|
205
|
-
corner: resizeAxis === "both"
|
|
206
|
-
},
|
|
207
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
208
|
-
"data-element": "Icon",
|
|
209
|
-
children: resizeAxis === "both" ? /* @__PURE__ */ jsx(CornerResizeGripElement, {}) : /* @__PURE__ */ jsx(GripVerticalIcon, { size: "1.5x" })
|
|
210
|
-
})
|
|
211
|
-
}) : null,
|
|
212
|
-
renderDashboardDropPreview(dropPreview, t("dashboard.dropBlocked", "This position is already taken"))
|
|
213
|
-
]
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
function DashboardContainer(kind, props, ref) {
|
|
217
|
-
const { id, columns, rows = 1, children } = props;
|
|
218
|
-
const tree = useContext(DashboardTreeContext);
|
|
219
|
-
const containerDepth = tree.containerDepth + 1;
|
|
220
|
-
const resolvedColumns = tree.parentKind === "root" ? 12 : Math.min(clampSpan(columns, tree.parentColumns), tree.parentColumns);
|
|
221
|
-
const resolvedRows = tree.parentKind === "root" ? clampRows(rows, 1) : Math.min(clampRows(rows, 1), tree.parentRows);
|
|
222
|
-
const childTree = useMemo(() => ({
|
|
223
|
-
containerDepth,
|
|
224
|
-
parentKind: kind,
|
|
225
|
-
parentId: id,
|
|
226
|
-
layoutParentId: id,
|
|
227
|
-
parentColumns: resolvedColumns,
|
|
228
|
-
parentRows: resolvedRows,
|
|
229
|
-
ancestorIds: [...tree.ancestorIds, id]
|
|
230
|
-
}), [
|
|
231
|
-
containerDepth,
|
|
232
|
-
id,
|
|
233
|
-
kind,
|
|
234
|
-
resolvedColumns,
|
|
235
|
-
resolvedRows,
|
|
236
|
-
tree.ancestorIds
|
|
237
|
-
]);
|
|
238
|
-
const content = /* @__PURE__ */ jsx(DashboardTreeContext.Provider, {
|
|
239
|
-
value: childTree,
|
|
240
|
-
children: /* @__PURE__ */ jsx(DashboardContainerContent, {
|
|
241
|
-
id,
|
|
242
|
-
kind,
|
|
243
|
-
columns: resolvedColumns,
|
|
244
|
-
rows: resolvedRows,
|
|
245
|
-
depth: containerDepth,
|
|
246
|
-
ancestorIds: [...tree.ancestorIds, id],
|
|
247
|
-
children
|
|
248
|
-
})
|
|
249
|
-
});
|
|
250
|
-
return /* @__PURE__ */ jsx(DashboardContainerShell, {
|
|
251
|
-
...props,
|
|
252
|
-
ref,
|
|
253
|
-
kind,
|
|
254
|
-
content
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
const DashboardHorizontalStack = forwardRef(function DashboardHorizontalStack(props, ref) {
|
|
258
|
-
return DashboardContainer("horizontal-stack", props, ref);
|
|
259
|
-
});
|
|
260
|
-
DashboardHorizontalStack.displayName = "DashboardHorizontalStack";
|
|
261
|
-
const DashboardVerticalStack = forwardRef(function DashboardVerticalStack(props, ref) {
|
|
262
|
-
return DashboardContainer("vertical-stack", props, ref);
|
|
263
|
-
});
|
|
264
|
-
DashboardVerticalStack.displayName = "DashboardVerticalStack";
|
|
265
|
-
const DashboardGrid = forwardRef(function DashboardGrid(props, ref) {
|
|
266
|
-
return DashboardContainer("grid", props, ref);
|
|
267
|
-
});
|
|
268
|
-
DashboardGrid.displayName = "DashboardGrid";
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
|
-
export { DashboardContainerShell, DashboardGrid, DashboardHorizontalStack, DashboardVerticalStack };
|
|
272
|
-
//# sourceMappingURL=DashboardContainer.js.map
|