@cube-dev/ui-kit 0.0.0-canary-0ef8dfe → 0.0.0-canary-dd6c409
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-chained-callback.js +1 -1
- 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.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/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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- 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.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 +11 -6
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +10 -3
- package/dist/components/content/Tree/styled.js.map +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/types.d.ts +9 -0
- 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/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.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 +1 -1
- 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 +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.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 +3 -5
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +2 -4
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +0 -11
- package/dist/components/fields/ListBox/ListBox.js +12 -247
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- 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 +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.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/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/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/Tabs/DraggableTabList.js +60 -11
- package/dist/components/navigation/Tabs/DraggableTabList.js.map +1 -1
- package/dist/components/navigation/Tabs/EditableTitle.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- 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 -4
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +2 -4
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.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/FileTabs/FileTabs.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/RangeCalendar.js +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- 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 +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- 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.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -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/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.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/usePortal.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/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/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/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/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 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -3
- package/dist/index.js.map +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/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.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/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/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/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/useQaProps.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/components/navigation/Tabs.md +50 -125
- package/package.json +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +0 -24
- package/dist/components/fields/ListBox/DraggableListBox.js.map +0 -1
- package/dist/components/shared/DraggableCollection.js +0 -102
- package/dist/components/shared/DraggableCollection.js.map +0 -1
- package/dist/icons/GripVerticalIcon.d.ts +0 -12
- package/dist/icons/GripVerticalIcon.js +0 -11
- package/dist/icons/GripVerticalIcon.js.map +0 -1
|
@@ -169,7 +169,9 @@ Optional wrapper for tabs when using explicit panel placement.
|
|
|
169
169
|
Explicit panel definition for advanced layout control.
|
|
170
170
|
|
|
171
171
|
```jsx
|
|
172
|
-
<Tabs.Panel key="tab1">
|
|
172
|
+
<Tabs.Panel key="tab1">
|
|
173
|
+
Panel 1 content
|
|
174
|
+
</Tabs.Panel>
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
### Tabs.Action
|
|
@@ -185,9 +187,7 @@ Action button designed for the Tabs prefix/suffix slots. Styled with sharp edges
|
|
|
185
187
|
</>
|
|
186
188
|
}
|
|
187
189
|
>
|
|
188
|
-
<Tab key="tab1" title="Tab 1">
|
|
189
|
-
Content
|
|
190
|
-
</Tab>
|
|
190
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
191
191
|
</Tabs>
|
|
192
192
|
```
|
|
193
193
|
|
|
@@ -243,22 +243,16 @@ Control the active tab externally with `activeKey` and `onChange`.
|
|
|
243
243
|
const [activeKey, setActiveKey] = useState('tab1');
|
|
244
244
|
|
|
245
245
|
<Tabs activeKey={activeKey} onChange={setActiveKey}>
|
|
246
|
-
<Tab key="tab1" title="Tab 1">
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<Tab key="tab2" title="Tab 2">
|
|
250
|
-
Content 2
|
|
251
|
-
</Tab>
|
|
252
|
-
</Tabs>;
|
|
246
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
247
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
248
|
+
</Tabs>
|
|
253
249
|
```
|
|
254
250
|
|
|
255
251
|
### Disabled Tab
|
|
256
252
|
|
|
257
253
|
```jsx
|
|
258
254
|
<Tabs defaultActiveKey="tab1">
|
|
259
|
-
<Tab key="tab1" title="Active Tab">
|
|
260
|
-
Content
|
|
261
|
-
</Tab>
|
|
255
|
+
<Tab key="tab1" title="Active Tab">Content</Tab>
|
|
262
256
|
<Tab key="tab2" title="Disabled Tab" isDisabled>
|
|
263
257
|
Inaccessible content
|
|
264
258
|
</Tab>
|
|
@@ -275,12 +269,8 @@ Add buttons or other elements before or after the tab list.
|
|
|
275
269
|
prefix={<Button size="small">Menu</Button>}
|
|
276
270
|
suffix={<Button size="small">Add New</Button>}
|
|
277
271
|
>
|
|
278
|
-
<Tab key="items" title="Items">
|
|
279
|
-
|
|
280
|
-
</Tab>
|
|
281
|
-
<Tab key="archived" title="Archived">
|
|
282
|
-
Archived items
|
|
283
|
-
</Tab>
|
|
272
|
+
<Tab key="items" title="Items">Item list</Tab>
|
|
273
|
+
<Tab key="archived" title="Archived">Archived items</Tab>
|
|
284
274
|
</Tabs>
|
|
285
275
|
```
|
|
286
276
|
|
|
@@ -296,17 +286,21 @@ const [tabs, setTabs] = useState([
|
|
|
296
286
|
|
|
297
287
|
<Tabs
|
|
298
288
|
defaultActiveKey="tab1"
|
|
299
|
-
onDelete={(key) => setTabs(tabs.filter(
|
|
289
|
+
onDelete={(key) => setTabs(tabs.filter(t => t.key !== key))}
|
|
300
290
|
suffix={
|
|
301
|
-
<Tabs.Action
|
|
291
|
+
<Tabs.Action
|
|
292
|
+
icon={<PlusIcon />}
|
|
293
|
+
aria-label="Add tab"
|
|
294
|
+
onPress={handleAdd}
|
|
295
|
+
/>
|
|
302
296
|
}
|
|
303
297
|
>
|
|
304
|
-
{tabs.map(
|
|
298
|
+
{tabs.map(tab => (
|
|
305
299
|
<Tab key={tab.key} title={tab.title}>
|
|
306
300
|
Content for {tab.title}
|
|
307
301
|
</Tab>
|
|
308
302
|
))}
|
|
309
|
-
</Tabs
|
|
303
|
+
</Tabs>
|
|
310
304
|
```
|
|
311
305
|
|
|
312
306
|
### Tab Menus
|
|
@@ -327,9 +321,7 @@ Add dropdown menus to tabs using the `menu` prop. This replaces the need for man
|
|
|
327
321
|
// 'delete' is handled automatically via onDelete
|
|
328
322
|
}}
|
|
329
323
|
>
|
|
330
|
-
<Tab key="tab1" title="Tab 1">
|
|
331
|
-
Content
|
|
332
|
-
</Tab>
|
|
324
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
333
325
|
</Tabs>
|
|
334
326
|
```
|
|
335
327
|
|
|
@@ -363,9 +355,7 @@ Combine editable tabs with a menu for rename, duplicate, and delete actions.
|
|
|
363
355
|
// 'delete' triggers onDelete automatically
|
|
364
356
|
}}
|
|
365
357
|
>
|
|
366
|
-
<Tab key="tab1" title="Tab 1">
|
|
367
|
-
Content
|
|
368
|
-
</Tab>
|
|
358
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
369
359
|
</Tabs>
|
|
370
360
|
```
|
|
371
361
|
|
|
@@ -383,9 +373,7 @@ Enable right-click context menus with the `contextMenu` prop. Uses the same menu
|
|
|
383
373
|
</>
|
|
384
374
|
}
|
|
385
375
|
>
|
|
386
|
-
<Tab key="tab1" title="Tab 1">
|
|
387
|
-
Content
|
|
388
|
-
</Tab>
|
|
376
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
389
377
|
</Tabs>
|
|
390
378
|
```
|
|
391
379
|
|
|
@@ -400,9 +388,7 @@ Enable right-click context menus with the `contextMenu` prop. Uses the same menu
|
|
|
400
388
|
</>
|
|
401
389
|
}
|
|
402
390
|
>
|
|
403
|
-
<Tab key="tab1" title="Tab 1">
|
|
404
|
-
Content
|
|
405
|
-
</Tab>
|
|
391
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
406
392
|
</Tabs>
|
|
407
393
|
```
|
|
408
394
|
|
|
@@ -419,11 +405,9 @@ Override or disable menus on individual tabs.
|
|
|
419
405
|
</>
|
|
420
406
|
}
|
|
421
407
|
>
|
|
422
|
-
<Tab key="tab1" title="Uses Default Menu">
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
<Tab
|
|
426
|
-
key="tab2"
|
|
408
|
+
<Tab key="tab1" title="Uses Default Menu">Content</Tab>
|
|
409
|
+
<Tab
|
|
410
|
+
key="tab2"
|
|
427
411
|
title="Custom Menu"
|
|
428
412
|
menu={
|
|
429
413
|
<>
|
|
@@ -433,9 +417,7 @@ Override or disable menus on individual tabs.
|
|
|
433
417
|
>
|
|
434
418
|
Content
|
|
435
419
|
</Tab>
|
|
436
|
-
<Tab key="tab3" title="No Menu" menu={null}>
|
|
437
|
-
Content
|
|
438
|
-
</Tab>
|
|
420
|
+
<Tab key="tab3" title="No Menu" menu={null}>Content</Tab>
|
|
439
421
|
</Tabs>
|
|
440
422
|
```
|
|
441
423
|
|
|
@@ -455,9 +437,7 @@ Use `Menu.Section` for organized menus.
|
|
|
455
437
|
</>
|
|
456
438
|
}
|
|
457
439
|
>
|
|
458
|
-
<Tab key="tab1" title="Tab 1">
|
|
459
|
-
Content
|
|
460
|
-
</Tab>
|
|
440
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
461
441
|
</Tabs>
|
|
462
442
|
```
|
|
463
443
|
|
|
@@ -473,16 +453,10 @@ const [keyOrder, setKeyOrder] = useState(['tab1', 'tab2', 'tab3']);
|
|
|
473
453
|
keyOrder={keyOrder}
|
|
474
454
|
onReorder={(newOrder) => setKeyOrder(newOrder)}
|
|
475
455
|
>
|
|
476
|
-
<Tab key="tab1" title="Tab 1">
|
|
477
|
-
|
|
478
|
-
</Tab>
|
|
479
|
-
|
|
480
|
-
Content 2
|
|
481
|
-
</Tab>
|
|
482
|
-
<Tab key="tab3" title="Tab 3">
|
|
483
|
-
Content 3
|
|
484
|
-
</Tab>
|
|
485
|
-
</Tabs>;
|
|
456
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
457
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
458
|
+
<Tab key="tab3" title="Tab 3">Content 3</Tab>
|
|
459
|
+
</Tabs>
|
|
486
460
|
```
|
|
487
461
|
|
|
488
462
|
**Key features:**
|
|
@@ -520,32 +494,6 @@ const [keyOrder, setKeyOrder] = useState(['tab1', 'tab2', 'tab3']);
|
|
|
520
494
|
</Tabs>
|
|
521
495
|
```
|
|
522
496
|
|
|
523
|
-
### Reorderable Tab Picker
|
|
524
|
-
|
|
525
|
-
When `isReorderable` and `showTabPicker` are both enabled, the tab picker dropdown also supports drag-and-drop reordering. Items in the dropdown display a grip handle and can be dragged to reorder. The same `onReorder` callback is shared between the horizontal tab bar and the vertical tab picker.
|
|
526
|
-
|
|
527
|
-
```jsx
|
|
528
|
-
const [keyOrder, setKeyOrder] = useState(['tab1', 'tab2', 'tab3']);
|
|
529
|
-
|
|
530
|
-
<Tabs
|
|
531
|
-
isReorderable
|
|
532
|
-
showTabPicker
|
|
533
|
-
type="file"
|
|
534
|
-
keyOrder={keyOrder}
|
|
535
|
-
onReorder={(newOrder) => setKeyOrder(newOrder)}
|
|
536
|
-
>
|
|
537
|
-
<Tab key="tab1" title="Tab 1">
|
|
538
|
-
Content 1
|
|
539
|
-
</Tab>
|
|
540
|
-
<Tab key="tab2" title="Tab 2">
|
|
541
|
-
Content 2
|
|
542
|
-
</Tab>
|
|
543
|
-
<Tab key="tab3" title="Tab 3">
|
|
544
|
-
Content 3
|
|
545
|
-
</Tab>
|
|
546
|
-
</Tabs>;
|
|
547
|
-
```
|
|
548
|
-
|
|
549
497
|
### Scroll Arrows
|
|
550
498
|
|
|
551
499
|
Add left/right navigation arrows to scroll overflowed tabs. Use `showScrollArrows` with `true`, `false`, or `'auto'` (shows only when tabs overflow).
|
|
@@ -556,7 +504,7 @@ Add left/right navigation arrows to scroll overflowed tabs. Use `showScrollArrow
|
|
|
556
504
|
showScrollArrows="auto"
|
|
557
505
|
styles={{ width: '500px' }}
|
|
558
506
|
>
|
|
559
|
-
{tabs.map(
|
|
507
|
+
{tabs.map(tab => (
|
|
560
508
|
<Tab key={tab.id} title={tab.title}>
|
|
561
509
|
{tab.content}
|
|
562
510
|
</Tab>
|
|
@@ -573,7 +521,7 @@ Combine with `showTabPicker` for both scroll arrows and a dropdown picker:
|
|
|
573
521
|
showTabPicker="auto"
|
|
574
522
|
type="file"
|
|
575
523
|
>
|
|
576
|
-
{tabs.map(
|
|
524
|
+
{tabs.map(tab => (
|
|
577
525
|
<Tab key={tab.id} title={tab.title}>
|
|
578
526
|
{tab.content}
|
|
579
527
|
</Tab>
|
|
@@ -595,7 +543,7 @@ By default, scroll arrows and the tab picker appear in the suffix (after the tab
|
|
|
595
543
|
type="file"
|
|
596
544
|
styles={{ width: '500px' }}
|
|
597
545
|
>
|
|
598
|
-
{tabs.map(
|
|
546
|
+
{tabs.map(tab => (
|
|
599
547
|
<Tab key={tab.id} title={tab.title}>
|
|
600
548
|
{tab.content}
|
|
601
549
|
</Tab>
|
|
@@ -604,7 +552,6 @@ By default, scroll arrows and the tab picker appear in the suffix (after the tab
|
|
|
604
552
|
```
|
|
605
553
|
|
|
606
554
|
When both are in the same slot:
|
|
607
|
-
|
|
608
555
|
- In **prefix**: TabPicker appears first (left), then scroll arrows (right)
|
|
609
556
|
- In **suffix**: Scroll arrows appear first (left), then TabPicker (right)
|
|
610
557
|
|
|
@@ -618,14 +565,10 @@ const [view, setView] = useState('overview');
|
|
|
618
565
|
<Tabs activeKey={view} onChange={setView}>
|
|
619
566
|
<Tab key="overview" title="Overview" />
|
|
620
567
|
<Tab key="settings" title="Settings" />
|
|
621
|
-
</Tabs
|
|
622
|
-
|
|
623
|
-
{
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
{
|
|
627
|
-
view === 'settings' && <SettingsPage />;
|
|
628
|
-
}
|
|
568
|
+
</Tabs>
|
|
569
|
+
|
|
570
|
+
{view === 'overview' && <OverviewPage />}
|
|
571
|
+
{view === 'settings' && <SettingsPage />}
|
|
629
572
|
```
|
|
630
573
|
|
|
631
574
|
### Explicit Panels
|
|
@@ -649,12 +592,8 @@ Render all panels immediately but keep inactive ones hidden.
|
|
|
649
592
|
|
|
650
593
|
```jsx
|
|
651
594
|
<Tabs defaultActiveKey="tab1" prerender>
|
|
652
|
-
<Tab key="tab1" title="Tab 1">
|
|
653
|
-
|
|
654
|
-
</Tab>
|
|
655
|
-
<Tab key="tab2" title="Tab 2">
|
|
656
|
-
Content 2
|
|
657
|
-
</Tab>
|
|
595
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
596
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
658
597
|
</Tabs>
|
|
659
598
|
```
|
|
660
599
|
|
|
@@ -683,12 +622,8 @@ Override per-tab/panel:
|
|
|
683
622
|
|
|
684
623
|
```jsx
|
|
685
624
|
<Tabs prerender>
|
|
686
|
-
<Tab key="tab1" title="Prerendered">
|
|
687
|
-
|
|
688
|
-
</Tab>
|
|
689
|
-
<Tab key="tab2" title="Lazy" prerender={false}>
|
|
690
|
-
Lazy loaded
|
|
691
|
-
</Tab>
|
|
625
|
+
<Tab key="tab1" title="Prerendered">Always in DOM</Tab>
|
|
626
|
+
<Tab key="tab2" title="Lazy" prerender={false}>Lazy loaded</Tab>
|
|
692
627
|
</Tabs>
|
|
693
628
|
```
|
|
694
629
|
|
|
@@ -703,14 +638,10 @@ content is computed, while inactive tabs use cached content.
|
|
|
703
638
|
defaultActiveKey="tab1"
|
|
704
639
|
renderPanel={(key) => {
|
|
705
640
|
switch (key) {
|
|
706
|
-
case 'tab1':
|
|
707
|
-
|
|
708
|
-
case '
|
|
709
|
-
|
|
710
|
-
case 'tab3':
|
|
711
|
-
return <ComplexForm fields={formFields} />;
|
|
712
|
-
default:
|
|
713
|
-
return null;
|
|
641
|
+
case 'tab1': return <ExpensiveChart data={chartData} />;
|
|
642
|
+
case 'tab2': return <LargeTable rows={tableRows} />;
|
|
643
|
+
case 'tab3': return <ComplexForm fields={formFields} />;
|
|
644
|
+
default: return null;
|
|
714
645
|
}
|
|
715
646
|
}}
|
|
716
647
|
>
|
|
@@ -731,8 +662,8 @@ content is computed, while inactive tabs use cached content.
|
|
|
731
662
|
<Tabs
|
|
732
663
|
renderPanel={(key) => <Panel data={data[key]} />}
|
|
733
664
|
panelCacheKeys={{
|
|
734
|
-
tab1: data.tab1.version,
|
|
735
|
-
tab2: data.tab2.version,
|
|
665
|
+
tab1: data.tab1.version, // Cached, re-renders when version changes
|
|
666
|
+
tab2: data.tab2.version, // Cached, re-renders when version changes
|
|
736
667
|
// tab3 has no cache key - re-renders on every Tabs render
|
|
737
668
|
}}
|
|
738
669
|
>
|
|
@@ -741,7 +672,6 @@ content is computed, while inactive tabs use cached content.
|
|
|
741
672
|
```
|
|
742
673
|
|
|
743
674
|
This approach is ideal for:
|
|
744
|
-
|
|
745
675
|
- Tabs with complex visualizations or charts
|
|
746
676
|
- Large data tables that are expensive to render
|
|
747
677
|
- Forms with many fields
|
|
@@ -776,7 +706,6 @@ Tabs work seamlessly inside Layout components. When placed in a `Layout` or `Lay
|
|
|
776
706
|
```
|
|
777
707
|
|
|
778
708
|
**How it works:**
|
|
779
|
-
|
|
780
709
|
- The tab bar has fixed height and doesn't grow
|
|
781
710
|
- Tab panels use `display: contents`, allowing children to participate in parent flex layout
|
|
782
711
|
- Nested Layout components with `flexGrow: 1` (default) stretch to fill remaining space
|
|
@@ -815,17 +744,13 @@ Tabs work seamlessly inside Layout components. When placed in a `Layout` or `Lay
|
|
|
815
744
|
1. **Do**: Use clear, descriptive tab titles
|
|
816
745
|
|
|
817
746
|
```jsx
|
|
818
|
-
<Tab key="billing" title="Billing & Payments">
|
|
819
|
-
...
|
|
820
|
-
</Tab>
|
|
747
|
+
<Tab key="billing" title="Billing & Payments">...</Tab>
|
|
821
748
|
```
|
|
822
749
|
|
|
823
750
|
2. **Don't**: Use vague or single-letter titles
|
|
824
751
|
|
|
825
752
|
```jsx
|
|
826
|
-
<Tab key="b" title="B">
|
|
827
|
-
...
|
|
828
|
-
</Tab>
|
|
753
|
+
<Tab key="b" title="B">...</Tab>
|
|
829
754
|
```
|
|
830
755
|
|
|
831
756
|
3. **Do**: Provide meaningful accessible labels
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-0ef8dfe | Cube Dev Team */
|
|
2
|
-
import { DraggableCollection } from "../../shared/DraggableCollection.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/components/fields/ListBox/DraggableListBox.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Wrapper that enables drag-and-drop reordering for a vertical ListBox.
|
|
8
|
-
*
|
|
9
|
-
* Thin wrapper around DraggableCollection with vertical orientation.
|
|
10
|
-
*/
|
|
11
|
-
function DraggableListBox({ state, listRef, orderedKeys, onReorder, children }) {
|
|
12
|
-
return /* @__PURE__ */ jsx(DraggableCollection, {
|
|
13
|
-
state,
|
|
14
|
-
listRef,
|
|
15
|
-
orderedKeys,
|
|
16
|
-
orientation: "vertical",
|
|
17
|
-
onReorder,
|
|
18
|
-
children
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { DraggableListBox };
|
|
24
|
-
//# sourceMappingURL=DraggableListBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableListBox.js","names":[],"sources":["../../../../src/components/fields/ListBox/DraggableListBox.tsx"],"sourcesContent":["import { ReactNode, RefObject } from 'react';\nimport {\n DraggableCollectionState,\n DroppableCollectionState,\n ListState,\n} from 'react-stately';\n\nimport { DraggableCollection } from '../../shared/DraggableCollection';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface DraggableListBoxProps {\n /** List state from React Stately (useListState) */\n state: Pick<\n ListState<any>,\n 'collection' | 'selectionManager' | 'disabledKeys'\n >;\n /** Ref to the list container element */\n listRef: RefObject<HTMLElement | null>;\n /** Current ordered keys */\n orderedKeys: string[];\n /** Callback when items are reordered */\n onReorder?: (newOrder: string[]) => void;\n /** Render function that receives drag/drop states */\n children: (\n dragState: DraggableCollectionState,\n dropState: DroppableCollectionState,\n collectionProps: Record<string, unknown>,\n ) => ReactNode;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\n/**\n * Wrapper that enables drag-and-drop reordering for a vertical ListBox.\n *\n * Thin wrapper around DraggableCollection with vertical orientation.\n */\nexport function DraggableListBox({\n state,\n listRef,\n orderedKeys,\n onReorder,\n children,\n}: DraggableListBoxProps) {\n return (\n <DraggableCollection\n state={state}\n listRef={listRef}\n orderedKeys={orderedKeys}\n orientation=\"vertical\"\n onReorder={onReorder}\n >\n {children}\n </DraggableCollection>\n );\n}\n"],"mappings":";;;;;;;;;;AA0CA,SAAgB,iBAAiB,EAC/B,OACA,SACA,aACA,WACA,YACwB;AACxB,QACE,oBAAC;EACQ;EACE;EACI;EACb,aAAY;EACD;EAEV;GACmB"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-0ef8dfe | Cube Dev Team */
|
|
2
|
-
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
3
|
-
import { useCallback, useMemo } from "react";
|
|
4
|
-
import { ListDropTargetDelegate, ListKeyboardDelegate, useDraggableCollection, useDroppableCollection } from "react-aria";
|
|
5
|
-
import { useDraggableCollectionState, useDroppableCollectionState } from "react-stately";
|
|
6
|
-
|
|
7
|
-
//#region src/components/shared/DraggableCollection.tsx
|
|
8
|
-
const getAllowedDropOperations = () => ["move"];
|
|
9
|
-
/**
|
|
10
|
-
* Generic wrapper that enables drag-and-drop reordering for a collection.
|
|
11
|
-
*
|
|
12
|
-
* Used by both DraggableTabList (horizontal) and DraggableListBox (vertical).
|
|
13
|
-
* Encapsulates all drag/drop hook calls so they are only invoked when
|
|
14
|
-
* reordering is actually enabled.
|
|
15
|
-
*/
|
|
16
|
-
function DraggableCollection({ state, listRef, orderedKeys, orientation, onReorder, children }) {
|
|
17
|
-
const handleReorder = useEvent((e) => {
|
|
18
|
-
if (!onReorder) return;
|
|
19
|
-
const { target, keys: movableKeys } = e;
|
|
20
|
-
const { dropPosition, key: targetKey } = target;
|
|
21
|
-
const movableKey = [...movableKeys][0];
|
|
22
|
-
const movableIndex = orderedKeys.indexOf(movableKey);
|
|
23
|
-
const targetIndex = orderedKeys.indexOf(String(targetKey));
|
|
24
|
-
if (movableIndex === -1 || targetIndex === -1) return;
|
|
25
|
-
onReorder(movableIndex !== targetIndex ? orderedKeys.reduce((arr, key, i) => {
|
|
26
|
-
if (i === movableIndex) return arr;
|
|
27
|
-
if (i === targetIndex) if (dropPosition === "before") {
|
|
28
|
-
arr.push(movableKey);
|
|
29
|
-
arr.push(key);
|
|
30
|
-
} else {
|
|
31
|
-
arr.push(key);
|
|
32
|
-
arr.push(movableKey);
|
|
33
|
-
}
|
|
34
|
-
else arr.push(key);
|
|
35
|
-
return arr;
|
|
36
|
-
}, []) : orderedKeys);
|
|
37
|
-
});
|
|
38
|
-
const getItems = useCallback((keys) => {
|
|
39
|
-
return [...keys].map((key) => {
|
|
40
|
-
const item = state.collection.getItem(key);
|
|
41
|
-
return { "text/plain": item?.textValue || String(key) };
|
|
42
|
-
});
|
|
43
|
-
}, [state.collection]);
|
|
44
|
-
const dragState = useDraggableCollectionState({
|
|
45
|
-
collection: state.collection,
|
|
46
|
-
selectionManager: state.selectionManager,
|
|
47
|
-
getItems,
|
|
48
|
-
getAllowedDropOperations
|
|
49
|
-
});
|
|
50
|
-
useDraggableCollection({
|
|
51
|
-
getItems,
|
|
52
|
-
getAllowedDropOperations
|
|
53
|
-
}, dragState, listRef);
|
|
54
|
-
const dropState = useDroppableCollectionState({
|
|
55
|
-
collection: state.collection,
|
|
56
|
-
selectionManager: state.selectionManager,
|
|
57
|
-
onReorder: handleReorder
|
|
58
|
-
});
|
|
59
|
-
const { collectionProps } = useDroppableCollection({
|
|
60
|
-
keyboardDelegate: useMemo(() => new ListKeyboardDelegate(state.collection, state.disabledKeys, listRef), [
|
|
61
|
-
state.collection,
|
|
62
|
-
state.disabledKeys,
|
|
63
|
-
listRef
|
|
64
|
-
]),
|
|
65
|
-
dropTargetDelegate: useMemo(() => new ListDropTargetDelegate(state.collection, listRef, { orientation }), [
|
|
66
|
-
state.collection,
|
|
67
|
-
listRef,
|
|
68
|
-
orientation
|
|
69
|
-
]),
|
|
70
|
-
onReorder: handleReorder
|
|
71
|
-
}, dropState, listRef);
|
|
72
|
-
const handleKeyDownCapture = useEvent((e) => {
|
|
73
|
-
if (!e.altKey || !onReorder) return;
|
|
74
|
-
const moveKeys = orientation === "vertical" ? {
|
|
75
|
-
backward: "ArrowUp",
|
|
76
|
-
forward: "ArrowDown"
|
|
77
|
-
} : {
|
|
78
|
-
backward: "ArrowLeft",
|
|
79
|
-
forward: "ArrowRight"
|
|
80
|
-
};
|
|
81
|
-
const direction = e.key === moveKeys.backward ? -1 : e.key === moveKeys.forward ? 1 : 0;
|
|
82
|
-
if (direction === 0) return;
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
e.stopPropagation();
|
|
85
|
-
const focusedKey = String(state.selectionManager.focusedKey);
|
|
86
|
-
const idx = orderedKeys.indexOf(focusedKey);
|
|
87
|
-
if (idx === -1) return;
|
|
88
|
-
const targetIdx = idx + direction;
|
|
89
|
-
if (targetIdx < 0 || targetIdx >= orderedKeys.length) return;
|
|
90
|
-
const newKeys = [...orderedKeys];
|
|
91
|
-
[newKeys[idx], newKeys[targetIdx]] = [newKeys[targetIdx], newKeys[idx]];
|
|
92
|
-
onReorder(newKeys);
|
|
93
|
-
});
|
|
94
|
-
return children(dragState, dropState, {
|
|
95
|
-
...collectionProps,
|
|
96
|
-
onKeyDownCapture: handleKeyDownCapture
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
//#endregion
|
|
101
|
-
export { DraggableCollection };
|
|
102
|
-
//# sourceMappingURL=DraggableCollection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableCollection.js","names":[],"sources":["../../../src/components/shared/DraggableCollection.tsx"],"sourcesContent":["import {\n KeyboardEvent,\n ReactNode,\n RefObject,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n DragItem,\n DroppableCollectionReorderEvent,\n ListDropTargetDelegate,\n ListKeyboardDelegate,\n useDraggableCollection,\n useDroppableCollection,\n} from 'react-aria';\nimport {\n DraggableCollectionState,\n DroppableCollectionState,\n useDraggableCollectionState,\n useDroppableCollectionState,\n} from 'react-stately';\n\nimport { useEvent } from '../../_internal/hooks';\n\nimport type { Collection, DropOperation, Key, Node } from '@react-types/shared';\n\nconst getAllowedDropOperations = (): DropOperation[] => ['move'];\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface DraggableCollectionProps {\n state: {\n collection: Collection<Node<any>>;\n selectionManager: { selectedKeys: Set<Key> } & Record<string, any>;\n disabledKeys: Set<Key>;\n };\n listRef: RefObject<HTMLElement | null>;\n orderedKeys: string[];\n orientation: 'horizontal' | 'vertical';\n onReorder?: (newOrder: string[]) => void;\n /** Render function receiving drag/drop states and merged collection+keyboard props */\n children: (\n dragState: DraggableCollectionState,\n dropState: DroppableCollectionState,\n collectionProps: Record<string, unknown>,\n ) => ReactNode;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\n/**\n * Generic wrapper that enables drag-and-drop reordering for a collection.\n *\n * Used by both DraggableTabList (horizontal) and DraggableListBox (vertical).\n * Encapsulates all drag/drop hook calls so they are only invoked when\n * reordering is actually enabled.\n */\nexport function DraggableCollection({\n state,\n listRef,\n orderedKeys,\n orientation,\n onReorder,\n children,\n}: DraggableCollectionProps) {\n const handleReorder = useEvent((e: DroppableCollectionReorderEvent) => {\n if (!onReorder) return;\n\n const { target, keys: movableKeys } = e;\n const { dropPosition, key: targetKey } = target;\n const movableKey = [...movableKeys][0] as string;\n\n const movableIndex = orderedKeys.indexOf(movableKey);\n const targetIndex = orderedKeys.indexOf(String(targetKey));\n\n if (movableIndex === -1 || targetIndex === -1) return;\n\n const newKeys =\n movableIndex !== targetIndex\n ? orderedKeys.reduce((arr, key, i) => {\n if (i === movableIndex) {\n return arr;\n }\n\n if (i === targetIndex) {\n if (dropPosition === 'before') {\n arr.push(movableKey);\n arr.push(key);\n } else {\n arr.push(key);\n arr.push(movableKey);\n }\n } else {\n arr.push(key);\n }\n\n return arr;\n }, [] as string[])\n : orderedKeys;\n\n onReorder(newKeys);\n });\n\n const getItems = useCallback(\n (keys: Set<Key>): DragItem[] => {\n return [...keys].map((key) => {\n const item = state.collection.getItem(key);\n return {\n 'text/plain': item?.textValue || String(key),\n };\n });\n },\n [state.collection],\n );\n\n const dragState = useDraggableCollectionState({\n collection: state.collection,\n selectionManager: state.selectionManager,\n getItems,\n getAllowedDropOperations,\n });\n\n useDraggableCollection(\n {\n getItems,\n getAllowedDropOperations,\n },\n dragState,\n listRef,\n );\n\n const dropState = useDroppableCollectionState({\n collection: state.collection,\n selectionManager: state.selectionManager,\n onReorder: handleReorder,\n });\n\n const keyboardDelegate = useMemo(\n () =>\n new ListKeyboardDelegate(state.collection, state.disabledKeys, listRef),\n [state.collection, state.disabledKeys, listRef],\n );\n\n const dropTargetDelegate = useMemo(\n () =>\n new ListDropTargetDelegate(state.collection, listRef, {\n orientation,\n }),\n [state.collection, listRef, orientation],\n );\n\n const { collectionProps } = useDroppableCollection(\n {\n keyboardDelegate,\n dropTargetDelegate,\n onReorder: handleReorder,\n },\n dropState,\n listRef,\n );\n\n // Alt+Arrow keyboard shortcut for reordering.\n // Uses capture phase so we read focusedKey BEFORE react-aria moves focus.\n const handleKeyDownCapture = useEvent((e: KeyboardEvent) => {\n if (!e.altKey || !onReorder) return;\n\n const moveKeys =\n orientation === 'vertical'\n ? { backward: 'ArrowUp', forward: 'ArrowDown' }\n : { backward: 'ArrowLeft', forward: 'ArrowRight' };\n\n const direction =\n e.key === moveKeys.backward ? -1 : e.key === moveKeys.forward ? 1 : 0;\n\n if (direction === 0) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusedKey = String(state.selectionManager.focusedKey);\n const idx = orderedKeys.indexOf(focusedKey);\n\n if (idx === -1) return;\n\n const targetIdx = idx + direction;\n\n if (targetIdx < 0 || targetIdx >= orderedKeys.length) return;\n\n const newKeys = [...orderedKeys];\n [newKeys[idx], newKeys[targetIdx]] = [newKeys[targetIdx], newKeys[idx]];\n onReorder(newKeys);\n });\n\n return children(dragState, dropState, {\n ...collectionProps,\n onKeyDownCapture: handleKeyDownCapture,\n });\n}\n"],"mappings":";;;;;;;AA0BA,MAAM,iCAAkD,CAAC,OAAO;;;;;;;;AAmChE,SAAgB,oBAAoB,EAClC,OACA,SACA,aACA,aACA,WACA,YAC2B;CAC3B,MAAM,gBAAgB,UAAU,MAAuC;AACrE,MAAI,CAAC,UAAW;EAEhB,MAAM,EAAE,QAAQ,MAAM,gBAAgB;EACtC,MAAM,EAAE,cAAc,KAAK,cAAc;EACzC,MAAM,aAAa,CAAC,GAAG,YAAY,CAAC;EAEpC,MAAM,eAAe,YAAY,QAAQ,WAAW;EACpD,MAAM,cAAc,YAAY,QAAQ,OAAO,UAAU,CAAC;AAE1D,MAAI,iBAAiB,MAAM,gBAAgB,GAAI;AAyB/C,YAtBE,iBAAiB,cACb,YAAY,QAAQ,KAAK,KAAK,MAAM;AAClC,OAAI,MAAM,aACR,QAAO;AAGT,OAAI,MAAM,YACR,KAAI,iBAAiB,UAAU;AAC7B,QAAI,KAAK,WAAW;AACpB,QAAI,KAAK,IAAI;UACR;AACL,QAAI,KAAK,IAAI;AACb,QAAI,KAAK,WAAW;;OAGtB,KAAI,KAAK,IAAI;AAGf,UAAO;KACN,EAAE,CAAa,GAClB,YAEY;GAClB;CAEF,MAAM,WAAW,aACd,SAA+B;AAC9B,SAAO,CAAC,GAAG,KAAK,CAAC,KAAK,QAAQ;GAC5B,MAAM,OAAO,MAAM,WAAW,QAAQ,IAAI;AAC1C,UAAO,EACL,cAAc,MAAM,aAAa,OAAO,IAAI,EAC7C;IACD;IAEJ,CAAC,MAAM,WAAW,CACnB;CAED,MAAM,YAAY,4BAA4B;EAC5C,YAAY,MAAM;EAClB,kBAAkB,MAAM;EACxB;EACA;EACD,CAAC;AAEF,wBACE;EACE;EACA;EACD,EACD,WACA,QACD;CAED,MAAM,YAAY,4BAA4B;EAC5C,YAAY,MAAM;EAClB,kBAAkB,MAAM;EACxB,WAAW;EACZ,CAAC;CAgBF,MAAM,EAAE,oBAAoB,uBAC1B;EACE,kBAhBqB,cAErB,IAAI,qBAAqB,MAAM,YAAY,MAAM,cAAc,QAAQ,EACzE;GAAC,MAAM;GAAY,MAAM;GAAc;GAAQ,CAChD;EAaG,oBAXuB,cAEvB,IAAI,uBAAuB,MAAM,YAAY,SAAS,EACpD,aACD,CAAC,EACJ;GAAC,MAAM;GAAY;GAAS;GAAY,CACzC;EAMG,WAAW;EACZ,EACD,WACA,QACD;CAID,MAAM,uBAAuB,UAAU,MAAqB;AAC1D,MAAI,CAAC,EAAE,UAAU,CAAC,UAAW;EAE7B,MAAM,WACJ,gBAAgB,aACZ;GAAE,UAAU;GAAW,SAAS;GAAa,GAC7C;GAAE,UAAU;GAAa,SAAS;GAAc;EAEtD,MAAM,YACJ,EAAE,QAAQ,SAAS,WAAW,KAAK,EAAE,QAAQ,SAAS,UAAU,IAAI;AAEtE,MAAI,cAAc,EAAG;AAErB,IAAE,gBAAgB;AAClB,IAAE,iBAAiB;EAEnB,MAAM,aAAa,OAAO,MAAM,iBAAiB,WAAW;EAC5D,MAAM,MAAM,YAAY,QAAQ,WAAW;AAE3C,MAAI,QAAQ,GAAI;EAEhB,MAAM,YAAY,MAAM;AAExB,MAAI,YAAY,KAAK,aAAa,YAAY,OAAQ;EAEtD,MAAM,UAAU,CAAC,GAAG,YAAY;AAChC,GAAC,QAAQ,MAAM,QAAQ,cAAc,CAAC,QAAQ,YAAY,QAAQ,KAAK;AACvE,YAAU,QAAQ;GAClB;AAEF,QAAO,SAAS,WAAW,WAAW;EACpC,GAAG;EACH,kBAAkB;EACnB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CubeIconProps } from "./Icon.js";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/icons/GripVerticalIcon.d.ts
|
|
6
|
-
declare const GripVerticalIcon: {
|
|
7
|
-
(props: CubeIconProps): react_jsx_runtime0.JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { GripVerticalIcon };
|
|
12
|
-
//# sourceMappingURL=GripVerticalIcon.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-0ef8dfe | Cube Dev Team */
|
|
2
|
-
import { wrapIcon } from "./wrap-icon.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { IconGripVertical } from "@tabler/icons-react";
|
|
5
|
-
|
|
6
|
-
//#region src/icons/GripVerticalIcon.tsx
|
|
7
|
-
const GripVerticalIcon = wrapIcon("GripVerticalIcon", /* @__PURE__ */ jsx(IconGripVertical, {}));
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { GripVerticalIcon };
|
|
11
|
-
//# sourceMappingURL=GripVerticalIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GripVerticalIcon.js","names":[],"sources":["../../src/icons/GripVerticalIcon.tsx"],"sourcesContent":["import { IconGripVertical } from '@tabler/icons-react';\n\nimport { wrapIcon } from './wrap-icon';\n\nexport const GripVerticalIcon = wrapIcon(\n 'GripVerticalIcon',\n <IconGripVertical />,\n);\n"],"mappings":";;;;;;AAIA,MAAa,mBAAmB,SAC9B,oBACA,oBAAC,qBAAmB,CACrB"}
|