@cube-dev/ui-kit 0.120.1 → 0.121.1
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/CHANGELOG.md +20 -0
- 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.d.ts +1 -0
- package/dist/components/actions/Button/Button.js +34 -14
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +47 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +105 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -0
- package/dist/components/actions/ButtonSplit/context.d.ts +18 -0
- package/dist/components/actions/ButtonSplit/context.js +12 -0
- package/dist/components/actions/ButtonSplit/context.js.map +1 -0
- package/dist/components/actions/ButtonSplit/index.d.ts +3 -0
- 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.d.ts +2 -2
- 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.d.ts +8 -3
- package/dist/components/actions/index.js +10 -5
- package/dist/components/actions/index.js.map +1 -1
- package/dist/components/actions/use-action.d.ts +1 -0
- package/dist/components/actions/use-action.js +21 -18
- package/dist/components/actions/use-action.js.map +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 +2 -1
- package/dist/components/content/Badge/Badge.js.map +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 +5 -2
- package/dist/components/content/Disclosure/Disclosure.js.map +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 +3 -2
- package/dist/components/content/ItemBadge/ItemBadge.js.map +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 +2 -1
- package/dist/components/content/Tag/Tag.js.map +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/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 +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +2 -2
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +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 +2 -2
- package/dist/components/fields/RadioGroup/Radio.js +3 -1
- package/dist/components/fields/RadioGroup/Radio.js.map +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.d.ts +8 -2
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Select/Select.js.map +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 +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 -1
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +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 +3 -1
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +2 -2
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/types.js.map +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 +2 -2
- 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/OpenTransition.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 +6 -6
- package/dist/data/item-themes.js.map +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/wrap-icon.js +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +7 -5
- 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/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/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/BaseProperties.md +78 -0
- package/docs/ComplexLayout.md +459 -0
- package/docs/CreateComponent.md +410 -0
- package/docs/FieldProperties.md +117 -0
- package/docs/Introduction.md +122 -0
- package/docs/RenderCache.md +177 -0
- package/docs/Result.md +42 -0
- package/docs/SimpleLayout.md +26 -0
- package/docs/Typography.md +38 -0
- package/docs/components/Block.md +33 -0
- package/docs/components/CollectionItem.md +293 -0
- package/docs/components/GridProvider.md +38 -0
- package/docs/components/Root.md +50 -0
- package/docs/components/actions/Action.md +47 -0
- package/docs/components/actions/Banner.md +195 -0
- package/docs/components/actions/Button.md +209 -0
- package/docs/components/actions/ButtonGroup.md +46 -0
- package/docs/components/actions/ButtonSplit.md +199 -0
- package/docs/components/actions/CommandMenu.md +422 -0
- package/docs/components/actions/ItemAction.md +60 -0
- package/docs/components/actions/ItemButton.md +316 -0
- package/docs/components/actions/Link.md +325 -0
- package/docs/components/actions/Menu.md +485 -0
- package/docs/components/actions/MenuTrigger.md +47 -0
- package/docs/components/actions/SubMenuTrigger.md +38 -0
- package/docs/components/actions/use-anchored-menu.md +209 -0
- package/docs/components/actions/use-context-menu.md +218 -0
- package/docs/components/content/ActiveZone.md +37 -0
- package/docs/components/content/Alert.md +40 -0
- package/docs/components/content/Avatar.md +37 -0
- package/docs/components/content/Badge.md +194 -0
- package/docs/components/content/Card.md +40 -0
- package/docs/components/content/Content.md +44 -0
- package/docs/components/content/CopyPasteBlock.md +36 -0
- package/docs/components/content/CopySnippet.md +43 -0
- package/docs/components/content/Disclosure.md +181 -0
- package/docs/components/content/Divider.md +39 -0
- package/docs/components/content/Footer.md +35 -0
- package/docs/components/content/Header.md +35 -0
- package/docs/components/content/HotKeys.md +352 -0
- package/docs/components/content/Item.md +499 -0
- package/docs/components/content/ItemBadge.md +31 -0
- package/docs/components/content/ItemCard.md +131 -0
- package/docs/components/content/Layout.md +843 -0
- package/docs/components/content/Paragraph.md +32 -0
- package/docs/components/content/Placeholder.md +37 -0
- package/docs/components/content/PrismCode.md +36 -0
- package/docs/components/content/PrismDiffCode.md +29 -0
- package/docs/components/content/Result.md +46 -0
- package/docs/components/content/Skeleton.md +35 -0
- package/docs/components/content/Tag.md +165 -0
- package/docs/components/content/Text.md +54 -0
- package/docs/components/content/TextItem.md +217 -0
- package/docs/components/content/Title.md +45 -0
- package/docs/components/fields/Checkbox.md +176 -0
- package/docs/components/fields/ComboBox.md +651 -0
- package/docs/components/fields/DatePicker.md +227 -0
- package/docs/components/fields/FileInput.md +194 -0
- package/docs/components/fields/FilterListBox.md +726 -0
- package/docs/components/fields/FilterPicker.md +776 -0
- package/docs/components/fields/HueSlider.md +175 -0
- package/docs/components/fields/ListBox.md +714 -0
- package/docs/components/fields/NumberInput.md +180 -0
- package/docs/components/fields/PasswordInput.md +214 -0
- package/docs/components/fields/Picker.md +906 -0
- package/docs/components/fields/RadioGroup.md +310 -0
- package/docs/components/fields/SearchInput.md +224 -0
- package/docs/components/fields/Select.md +576 -0
- package/docs/components/fields/Slider.md +53 -0
- package/docs/components/fields/Switch.md +169 -0
- package/docs/components/fields/TextArea.md +61 -0
- package/docs/components/fields/TextInput.md +205 -0
- package/docs/components/fields/TextInputMapper.md +34 -0
- package/docs/components/form/Field.md +333 -0
- package/docs/components/form/Form.md +644 -0
- package/docs/components/form/FormInstance.md +307 -0
- package/docs/components/helpers/DisplayTransition.md +268 -0
- package/docs/components/helpers/IconSwitch.md +160 -0
- package/docs/components/layout/Flex.md +51 -0
- package/docs/components/layout/Flow.md +32 -0
- package/docs/components/layout/Grid.md +46 -0
- package/docs/components/layout/Panel.md +65 -0
- package/docs/components/layout/Prefix.md +37 -0
- package/docs/components/layout/ResizablePanel.md +69 -0
- package/docs/components/layout/Space.md +44 -0
- package/docs/components/layout/Suffix.md +39 -0
- package/docs/components/navigation/Tabs.md +726 -0
- package/docs/components/organisms/FileTabs.md +39 -0
- package/docs/components/organisms/StatsCard.md +40 -0
- package/docs/components/other/CloudLogo.md +33 -0
- package/docs/components/overlays/AlertDialog.md +51 -0
- package/docs/components/overlays/Dialog.md +200 -0
- package/docs/components/overlays/DialogContainer.md +201 -0
- package/docs/components/overlays/DialogForm.md +295 -0
- package/docs/components/overlays/DialogTrigger.md +191 -0
- package/docs/components/overlays/Notifications.md +402 -0
- package/docs/components/overlays/Toast.md +289 -0
- package/docs/components/overlays/Tooltip.md +400 -0
- package/docs/components/overlays/TooltipProvider.md +42 -0
- package/docs/components/overlays/TooltipTrigger.md +42 -0
- package/docs/components/overlays/UseDialogContainer.md +597 -0
- package/docs/components/portal/Portal.md +29 -0
- package/docs/components/status/LoadingAnimation.md +27 -0
- package/docs/components/status/Spin.md +35 -0
- package/docs/tasty/configuration.md +211 -0
- package/docs/tasty/debug.md +505 -0
- package/docs/tasty/injector.md +528 -0
- package/docs/tasty/styles.md +567 -0
- package/docs/tasty/tasty-static.md +376 -0
- package/docs/tasty/usage.md +643 -0
- package/package.json +5 -9
|
@@ -0,0 +1,726 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
An accessible tabbed interface for organizing content into multiple panels, showing one section at a time. Built with React Aria hooks for full keyboard navigation, screen reader support, and proper ARIA semantics.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- To organize related content into distinct sections within a single page
|
|
8
|
+
- For settings panels with multiple categories
|
|
9
|
+
- For navigation between different views without page reload
|
|
10
|
+
- When content is mutually exclusive and only one section should be visible at a time
|
|
11
|
+
- For file-like interfaces where multiple documents can be open
|
|
12
|
+
|
|
13
|
+
## Component
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- **`activeKey`** `Key` — Controlled active tab key
|
|
20
|
+
- **`defaultActiveKey`** `Key` — Initial active tab key for uncontrolled mode
|
|
21
|
+
- **`type`** `'default' | 'narrow' | 'file' | 'radio'` (default: `'default'`) — Visual style variant
|
|
22
|
+
- **`size`** `'xsmall' | 'small' | 'medium' | 'large'` (default: `'small'`) — Tab size
|
|
23
|
+
- **`prerender`** `boolean` (default: `false`) — If true, all tab panels are rendered but hidden
|
|
24
|
+
- **`keepMounted`** `boolean` (default: `false`) — If true, visited tab panels stay in DOM
|
|
25
|
+
- **`label`** `string` (default: `'Tabs'`) — Accessible label for the tab list
|
|
26
|
+
- **`prefix`** `ReactNode` — Content rendered before the tab list
|
|
27
|
+
- **`suffix`** `ReactNode` — Content rendered after the tab list
|
|
28
|
+
- **`onChange`** `(key: Key) => void` — Callback when active tab changes
|
|
29
|
+
- **`onDelete`** `(key: Key) => void` — Callback when tab delete button is clicked. Presence enables delete buttons
|
|
30
|
+
- **`isEditable`** `boolean` (default: `false`) — Whether tab titles can be inline-edited
|
|
31
|
+
- **`onTitleChange`** `(key: Key, newTitle: string) => void` — Callback when a tab title is edited
|
|
32
|
+
- **`autoHideActions`** `boolean` — Show tab actions only on hover
|
|
33
|
+
- **`menu`** `ReactNode` — Menu items for all tabs (use `Menu.Item` children)
|
|
34
|
+
- **`menuTriggerProps`** `Partial<CubeItemActionProps>` — Props for the menu trigger button
|
|
35
|
+
- **`menuProps`** `Partial<CubeMenuProps>` — Props for the Menu component
|
|
36
|
+
- **`contextMenu`** `boolean` (default: `false`) — Enable right-click context menu on tabs
|
|
37
|
+
- **`onAction`** `(action: string, tabKey: string) => void` — Callback when a menu action is triggered
|
|
38
|
+
- **`renderPanel`** `(key: string) => ReactNode` — Render function for lazy panel content
|
|
39
|
+
- **`panelCacheKeys`** `Record<string, any>` — Cache keys for `renderPanel` content
|
|
40
|
+
- **`isReorderable`** `boolean` (default: `false`) — Enable drag-and-drop tab reordering
|
|
41
|
+
- **`keyOrder`** `string[]` — Controlled tab display order
|
|
42
|
+
- **`onReorder`** `(newOrder: string[]) => void` — Callback when tabs are reordered
|
|
43
|
+
- **`showTabPicker`** `boolean | 'auto'` (default: `false`) — Show dropdown tab picker
|
|
44
|
+
- **`showScrollArrows`** `boolean | 'auto'` (default: `false`) — Show scroll navigation arrows
|
|
45
|
+
- **`tabPickerPosition`** `'prefix' | 'suffix'` (default: `suffix`) — Position of the tab picker
|
|
46
|
+
- **`scrollArrowsPosition`** `'prefix' | 'suffix'` (default: `suffix`) — Position of the scroll arrows
|
|
47
|
+
- **`tabListStyles`** `Styles` — Custom styles for the tab list container
|
|
48
|
+
- **`prefixStyles`** `Styles` — Custom styles for the prefix slot
|
|
49
|
+
- **`suffixStyles`** `Styles` — Custom styles for the suffix slot
|
|
50
|
+
|
|
51
|
+
### Base Properties
|
|
52
|
+
|
|
53
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
54
|
+
|
|
55
|
+
### Styling Properties
|
|
56
|
+
|
|
57
|
+
#### styles
|
|
58
|
+
|
|
59
|
+
Customizes the root element of the Tabs component.
|
|
60
|
+
|
|
61
|
+
**Sub-elements:**
|
|
62
|
+
|
|
63
|
+
- `TabList` - The container holding the tab buttons
|
|
64
|
+
- `Prefix` - Content rendered before the tab list
|
|
65
|
+
- `Suffix` - Content rendered after the tab list
|
|
66
|
+
- `ScrollWrapper` - Wrapper for scroll area and scrollbar positioning
|
|
67
|
+
- `Scroll` - Scrollable area containing the tab container
|
|
68
|
+
- `ScrollbarH` - Custom horizontal scrollbar indicator
|
|
69
|
+
|
|
70
|
+
### Style Properties
|
|
71
|
+
|
|
72
|
+
These properties allow direct style application without using the `styles` prop: `width`, `height`.
|
|
73
|
+
|
|
74
|
+
### Modifiers
|
|
75
|
+
|
|
76
|
+
The `mods` property accepts the following modifiers:
|
|
77
|
+
|
|
78
|
+
- **`type`** `'default' \| 'narrow' \| 'file' \| 'radio'` — Current tab type
|
|
79
|
+
- **`deletable`** `boolean` — True when onDelete callback is provided
|
|
80
|
+
- **`scrolling`** `boolean` — True when tabs are being scrolled
|
|
81
|
+
- **`fade-left`** `boolean` — True when content is scrolled (left fade visible)
|
|
82
|
+
- **`fade-right`** `boolean` — True when more content exists to the right
|
|
83
|
+
- **`has-panels`** `boolean` — True when tabs have panel content
|
|
84
|
+
|
|
85
|
+
For individual tabs:
|
|
86
|
+
|
|
87
|
+
- **`type`** `'default' \| 'narrow' \| 'file' \| 'radio'` — Current tab type
|
|
88
|
+
- **`active`** `boolean` — True when the tab is selected
|
|
89
|
+
- **`deletable`** `boolean` — True when delete button is visible
|
|
90
|
+
- **`disabled`** `boolean` — True when tab is disabled
|
|
91
|
+
- **`editing`** `boolean` — True when tab title is being edited
|
|
92
|
+
- **`hovered`** `boolean` — True when tab is hovered
|
|
93
|
+
- **`focused`** `boolean` — True when tab has focus
|
|
94
|
+
- **`focus-visible`** `boolean` — True when tab has keyboard focus
|
|
95
|
+
- **`draggable`** `boolean` — True when tab can be dragged (reorderable)
|
|
96
|
+
- **`dragging`** `boolean` — True when tab is being dragged
|
|
97
|
+
|
|
98
|
+
## Variants
|
|
99
|
+
|
|
100
|
+
### Types
|
|
101
|
+
|
|
102
|
+
- `default` - Standard tabs with selection indicator below (default)
|
|
103
|
+
- `narrow` - Same as default but with collapsed horizontal label padding for compact layouts
|
|
104
|
+
- `file` - File-style tabs with border bottom highlight on selection, delimiter between tabs
|
|
105
|
+
- `radio` - Radio button style for tab selection
|
|
106
|
+
|
|
107
|
+
### Sizes
|
|
108
|
+
|
|
109
|
+
- `xsmall` - Extra small size with t4 typography (radio type only)
|
|
110
|
+
- `small` - Small size with t3m typography (default)
|
|
111
|
+
- `medium` - Default size with t3m typography
|
|
112
|
+
- `large` - Larger tabs with t3m typography
|
|
113
|
+
|
|
114
|
+
**Note:** Radio type only supports `medium` and `large` sizes, which are mapped to smaller Item sizes internally.
|
|
115
|
+
|
|
116
|
+
## Compound Components
|
|
117
|
+
|
|
118
|
+
### Tab
|
|
119
|
+
|
|
120
|
+
Individual tab definition with title and optional content.
|
|
121
|
+
|
|
122
|
+
```jsx
|
|
123
|
+
<Tab key="unique-id" title="Tab Title">
|
|
124
|
+
Panel content here
|
|
125
|
+
</Tab>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Tabs.List
|
|
129
|
+
|
|
130
|
+
Optional wrapper for tabs when using explicit panel placement.
|
|
131
|
+
|
|
132
|
+
```jsx
|
|
133
|
+
<Tabs.List>
|
|
134
|
+
<Tab key="tab1" title="Tab 1" />
|
|
135
|
+
<Tab key="tab2" title="Tab 2" />
|
|
136
|
+
</Tabs.List>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Tabs.Panel
|
|
140
|
+
|
|
141
|
+
Explicit panel definition for advanced layout control.
|
|
142
|
+
|
|
143
|
+
```jsx
|
|
144
|
+
<Tabs.Panel key="tab1">
|
|
145
|
+
Panel 1 content
|
|
146
|
+
</Tabs.Panel>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Tabs.Action
|
|
150
|
+
|
|
151
|
+
Action button designed for the Tabs prefix/suffix slots. Styled with sharp edges and no border to match the TabPicker trigger. When multiple `Tabs.Action` components are placed together, they automatically display dividers between them.
|
|
152
|
+
|
|
153
|
+
```jsx
|
|
154
|
+
<Tabs
|
|
155
|
+
suffix={
|
|
156
|
+
<>
|
|
157
|
+
<Tabs.Action icon={<PlusIcon />} onPress={handleAdd} />
|
|
158
|
+
<Tabs.Action icon={<SettingsIcon />} onPress={handleSettings} />
|
|
159
|
+
</>
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
163
|
+
</Tabs>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- **`icon`** `ReactNode` — Icon to display in the action button
|
|
167
|
+
- **`size`** `TabSize` — Override size (inherits from Tabs by default)
|
|
168
|
+
- **`onPress`** `() => void` — Callback when the action is pressed
|
|
169
|
+
- **`aria-label`** `string` — Accessible label for the button
|
|
170
|
+
|
|
171
|
+
Inherits all props from `ItemButton` except `shape` (always sharp).
|
|
172
|
+
|
|
173
|
+
### Tab Props
|
|
174
|
+
|
|
175
|
+
Individual tabs accept these props in addition to style props:
|
|
176
|
+
|
|
177
|
+
- **`title`** `ReactNode` — Content displayed in the tab button (required)
|
|
178
|
+
- **`isDisabled`** `boolean` — Disables the tab
|
|
179
|
+
- **`size`** `TabSize` — Override tab size for this tab
|
|
180
|
+
- **`type`** `TabType` — Override tab type for this tab
|
|
181
|
+
- **`actions`** `ReactNode` — Custom actions to render in the tab
|
|
182
|
+
- **`autoHideActions`** `boolean` — Show actions only on hover (overrides Tabs-level)
|
|
183
|
+
- **`isEditable`** `boolean` — Whether the tab title can be edited (overrides Tabs-level)
|
|
184
|
+
- **`onTitleChange`** `(newTitle: string) => void` — Callback when title changes (overrides Tabs-level)
|
|
185
|
+
- **`menu`** `ReactNode \| null` — Menu items for this tab (overrides Tabs-level, `null` disables)
|
|
186
|
+
- **`menuTriggerProps`** `Partial<CubeItemActionProps>` — Props for menu trigger button
|
|
187
|
+
- **`menuProps`** `Partial<CubeMenuProps>` — Props for Menu component
|
|
188
|
+
- **`contextMenu`** `boolean` — Enable right-click context menu
|
|
189
|
+
- **`onAction`** `(action: Key) => void` — Callback when menu action is triggered
|
|
190
|
+
- **`prerender`** `boolean` — Override panel prerender behavior
|
|
191
|
+
- **`keepMounted`** `boolean` — Override panel keepMounted behavior
|
|
192
|
+
|
|
193
|
+
## Examples
|
|
194
|
+
|
|
195
|
+
### Basic Usage
|
|
196
|
+
|
|
197
|
+
```jsx
|
|
198
|
+
<Tabs defaultActiveKey="overview">
|
|
199
|
+
<Tab key="overview" title="Overview">
|
|
200
|
+
Overview content goes here.
|
|
201
|
+
</Tab>
|
|
202
|
+
<Tab key="settings" title="Settings">
|
|
203
|
+
Settings content goes here.
|
|
204
|
+
</Tab>
|
|
205
|
+
</Tabs>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Controlled Tabs
|
|
209
|
+
|
|
210
|
+
Control the active tab externally with `activeKey` and `onChange`.
|
|
211
|
+
|
|
212
|
+
```jsx
|
|
213
|
+
const [activeKey, setActiveKey] = useState('tab1');
|
|
214
|
+
|
|
215
|
+
<Tabs activeKey={activeKey} onChange={setActiveKey}>
|
|
216
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
217
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
218
|
+
</Tabs>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Disabled Tab
|
|
222
|
+
|
|
223
|
+
```jsx
|
|
224
|
+
<Tabs defaultActiveKey="tab1">
|
|
225
|
+
<Tab key="tab1" title="Active Tab">Content</Tab>
|
|
226
|
+
<Tab key="tab2" title="Disabled Tab" isDisabled>
|
|
227
|
+
Inaccessible content
|
|
228
|
+
</Tab>
|
|
229
|
+
</Tabs>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### With Prefix and Suffix
|
|
233
|
+
|
|
234
|
+
Add buttons or other elements before or after the tab list.
|
|
235
|
+
|
|
236
|
+
```jsx
|
|
237
|
+
<Tabs
|
|
238
|
+
defaultActiveKey="items"
|
|
239
|
+
prefix={<Button size="small">Menu</Button>}
|
|
240
|
+
suffix={<Button size="small">Add New</Button>}
|
|
241
|
+
>
|
|
242
|
+
<Tab key="items" title="Items">Item list</Tab>
|
|
243
|
+
<Tab key="archived" title="Archived">Archived items</Tab>
|
|
244
|
+
</Tabs>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Deletable Tabs
|
|
248
|
+
|
|
249
|
+
Enable delete buttons with the `onDelete` callback. When no `menu` is defined, a delete button appears on each tab. Use `Tabs.Action` in the suffix slot to add an "Add" button.
|
|
250
|
+
|
|
251
|
+
```jsx
|
|
252
|
+
const [tabs, setTabs] = useState([
|
|
253
|
+
{ key: 'tab1', title: 'Tab 1' },
|
|
254
|
+
{ key: 'tab2', title: 'Tab 2' },
|
|
255
|
+
]);
|
|
256
|
+
|
|
257
|
+
<Tabs
|
|
258
|
+
defaultActiveKey="tab1"
|
|
259
|
+
onDelete={(key) => setTabs(tabs.filter(t => t.key !== key))}
|
|
260
|
+
suffix={
|
|
261
|
+
<Tabs.Action
|
|
262
|
+
icon={<PlusIcon />}
|
|
263
|
+
aria-label="Add tab"
|
|
264
|
+
onPress={handleAdd}
|
|
265
|
+
/>
|
|
266
|
+
}
|
|
267
|
+
>
|
|
268
|
+
{tabs.map(tab => (
|
|
269
|
+
<Tab key={tab.key} title={tab.title}>
|
|
270
|
+
Content for {tab.title}
|
|
271
|
+
</Tab>
|
|
272
|
+
))}
|
|
273
|
+
</Tabs>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Tab Menus
|
|
277
|
+
|
|
278
|
+
Add dropdown menus to tabs using the `menu` prop. This replaces the need for manually composing `MenuTrigger`, `ItemAction`, and `Menu` components.
|
|
279
|
+
|
|
280
|
+
```jsx
|
|
281
|
+
<Tabs
|
|
282
|
+
onDelete={handleDelete}
|
|
283
|
+
menu={
|
|
284
|
+
<>
|
|
285
|
+
<Menu.Item key="duplicate">Duplicate</Menu.Item>
|
|
286
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
287
|
+
</>
|
|
288
|
+
}
|
|
289
|
+
onAction={(action, tabKey) => {
|
|
290
|
+
if (action === 'duplicate') handleDuplicate(tabKey);
|
|
291
|
+
// 'delete' is handled automatically via onDelete
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
295
|
+
</Tabs>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Key features:**
|
|
299
|
+
|
|
300
|
+
- **Predefined actions**: `key="rename"` and `key="delete"` are handled automatically
|
|
301
|
+
- **Auto-labels**: Predefined actions get default labels if children not provided
|
|
302
|
+
- **Tabs-level menu**: Define menu once, all tabs inherit it
|
|
303
|
+
- **Tab-level override**: Individual tabs can override or disable menu with `menu={null}`
|
|
304
|
+
- **Delete button logic**: When `menu` is present, delete button is hidden (use `key="delete"` in menu instead)
|
|
305
|
+
|
|
306
|
+
### Editable Tabs with Menu
|
|
307
|
+
|
|
308
|
+
Combine editable tabs with a menu for rename, duplicate, and delete actions.
|
|
309
|
+
|
|
310
|
+
```jsx
|
|
311
|
+
<Tabs
|
|
312
|
+
isEditable
|
|
313
|
+
onDelete={handleDelete}
|
|
314
|
+
onTitleChange={handleTitleChange}
|
|
315
|
+
menu={
|
|
316
|
+
<>
|
|
317
|
+
<Menu.Item key="rename">Rename</Menu.Item>
|
|
318
|
+
<Menu.Item key="duplicate">Duplicate</Menu.Item>
|
|
319
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
320
|
+
</>
|
|
321
|
+
}
|
|
322
|
+
onAction={(action, tabKey) => {
|
|
323
|
+
if (action === 'duplicate') handleDuplicate(tabKey);
|
|
324
|
+
// 'rename' triggers inline editing automatically
|
|
325
|
+
// 'delete' triggers onDelete automatically
|
|
326
|
+
}}
|
|
327
|
+
>
|
|
328
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
329
|
+
</Tabs>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Context Menu
|
|
333
|
+
|
|
334
|
+
Enable right-click context menus with the `contextMenu` prop. Uses the same menu items.
|
|
335
|
+
|
|
336
|
+
```jsx
|
|
337
|
+
<Tabs
|
|
338
|
+
contextMenu
|
|
339
|
+
menu={
|
|
340
|
+
<>
|
|
341
|
+
<Menu.Item key="rename">Rename</Menu.Item>
|
|
342
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
343
|
+
</>
|
|
344
|
+
}
|
|
345
|
+
>
|
|
346
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
347
|
+
</Tabs>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Per-Tab Menu Override
|
|
351
|
+
|
|
352
|
+
Override or disable menus on individual tabs.
|
|
353
|
+
|
|
354
|
+
```jsx
|
|
355
|
+
<Tabs
|
|
356
|
+
menu={
|
|
357
|
+
<>
|
|
358
|
+
<Menu.Item key="rename">Rename</Menu.Item>
|
|
359
|
+
<Menu.Item key="info">Show Info</Menu.Item>
|
|
360
|
+
</>
|
|
361
|
+
}
|
|
362
|
+
>
|
|
363
|
+
<Tab key="tab1" title="Uses Default Menu">Content</Tab>
|
|
364
|
+
<Tab
|
|
365
|
+
key="tab2"
|
|
366
|
+
title="Custom Menu"
|
|
367
|
+
menu={
|
|
368
|
+
<>
|
|
369
|
+
<Menu.Item key="special">Special Action</Menu.Item>
|
|
370
|
+
</>
|
|
371
|
+
}
|
|
372
|
+
>
|
|
373
|
+
Content
|
|
374
|
+
</Tab>
|
|
375
|
+
<Tab key="tab3" title="No Menu" menu={null}>Content</Tab>
|
|
376
|
+
</Tabs>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Menu with Sections
|
|
380
|
+
|
|
381
|
+
Use `Menu.Section` for organized menus.
|
|
382
|
+
|
|
383
|
+
```jsx
|
|
384
|
+
<Tabs
|
|
385
|
+
menu={
|
|
386
|
+
<>
|
|
387
|
+
<Menu.Item key="rename">Rename</Menu.Item>
|
|
388
|
+
<Menu.Item key="duplicate">Duplicate</Menu.Item>
|
|
389
|
+
<Menu.Section title="Danger Zone">
|
|
390
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
391
|
+
</Menu.Section>
|
|
392
|
+
</>
|
|
393
|
+
}
|
|
394
|
+
>
|
|
395
|
+
<Tab key="tab1" title="Tab 1">Content</Tab>
|
|
396
|
+
</Tabs>
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Reorderable Tabs
|
|
400
|
+
|
|
401
|
+
Enable drag-and-drop tab reordering with the `isReorderable` prop. Control the order via `keyOrder` and handle changes with `onReorder`.
|
|
402
|
+
|
|
403
|
+
```jsx
|
|
404
|
+
const [keyOrder, setKeyOrder] = useState(['tab1', 'tab2', 'tab3']);
|
|
405
|
+
|
|
406
|
+
<Tabs
|
|
407
|
+
isReorderable
|
|
408
|
+
keyOrder={keyOrder}
|
|
409
|
+
onReorder={(newOrder) => setKeyOrder(newOrder)}
|
|
410
|
+
>
|
|
411
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
412
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
413
|
+
<Tab key="tab3" title="Tab 3">Content 3</Tab>
|
|
414
|
+
</Tabs>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Key features:**
|
|
418
|
+
|
|
419
|
+
- **Drag-and-drop**: Reorder tabs by dragging them to new positions
|
|
420
|
+
- **Controlled order**: Use `keyOrder` to control tab display order
|
|
421
|
+
- **Callback**: `onReorder` is called with the new key order after a drop
|
|
422
|
+
- **Accessibility**: Full keyboard support for reordering
|
|
423
|
+
|
|
424
|
+
### Reorderable Tabs with Menu
|
|
425
|
+
|
|
426
|
+
Combine drag-and-drop reordering with menu actions, editing, and delete functionality.
|
|
427
|
+
|
|
428
|
+
```jsx
|
|
429
|
+
const [tabs, setTabs] = useState([...]);
|
|
430
|
+
const [keyOrder, setKeyOrder] = useState(['tab1', 'tab2', 'tab3']);
|
|
431
|
+
|
|
432
|
+
<Tabs
|
|
433
|
+
isReorderable
|
|
434
|
+
isEditable
|
|
435
|
+
keyOrder={keyOrder}
|
|
436
|
+
onReorder={(newOrder) => setKeyOrder(newOrder)}
|
|
437
|
+
onDelete={handleDelete}
|
|
438
|
+
menu={
|
|
439
|
+
<>
|
|
440
|
+
<Menu.Item key="rename">Rename</Menu.Item>
|
|
441
|
+
<Menu.Item key="duplicate">Duplicate</Menu.Item>
|
|
442
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
443
|
+
</>
|
|
444
|
+
}
|
|
445
|
+
>
|
|
446
|
+
{tabs.map((tab) => (
|
|
447
|
+
<Tab key={tab.id} title={tab.title}>{tab.content}</Tab>
|
|
448
|
+
))}
|
|
449
|
+
</Tabs>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Scroll Arrows
|
|
453
|
+
|
|
454
|
+
Add left/right navigation arrows to scroll overflowed tabs. Use `showScrollArrows` with `true`, `false`, or `'auto'` (shows only when tabs overflow).
|
|
455
|
+
|
|
456
|
+
```jsx
|
|
457
|
+
<Tabs
|
|
458
|
+
defaultActiveKey="tab1"
|
|
459
|
+
showScrollArrows="auto"
|
|
460
|
+
styles={{ width: '500px' }}
|
|
461
|
+
>
|
|
462
|
+
{tabs.map(tab => (
|
|
463
|
+
<Tab key={tab.id} title={tab.title}>
|
|
464
|
+
{tab.content}
|
|
465
|
+
</Tab>
|
|
466
|
+
))}
|
|
467
|
+
</Tabs>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Combine with `showTabPicker` for both scroll arrows and a dropdown picker:
|
|
471
|
+
|
|
472
|
+
```jsx
|
|
473
|
+
<Tabs
|
|
474
|
+
defaultActiveKey="tab1"
|
|
475
|
+
showScrollArrows="auto"
|
|
476
|
+
showTabPicker="auto"
|
|
477
|
+
type="file"
|
|
478
|
+
>
|
|
479
|
+
{tabs.map(tab => (
|
|
480
|
+
<Tab key={tab.id} title={tab.title}>
|
|
481
|
+
{tab.content}
|
|
482
|
+
</Tab>
|
|
483
|
+
))}
|
|
484
|
+
</Tabs>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Actions in Prefix
|
|
488
|
+
|
|
489
|
+
By default, scroll arrows and the tab picker appear in the suffix (after the tab list). Use `scrollArrowsPosition` and `tabPickerPosition` to move them to the prefix (before the tab list).
|
|
490
|
+
|
|
491
|
+
```jsx
|
|
492
|
+
<Tabs
|
|
493
|
+
defaultActiveKey="tab1"
|
|
494
|
+
showTabPicker
|
|
495
|
+
showScrollArrows
|
|
496
|
+
tabPickerPosition="prefix"
|
|
497
|
+
scrollArrowsPosition="prefix"
|
|
498
|
+
type="file"
|
|
499
|
+
styles={{ width: '500px' }}
|
|
500
|
+
>
|
|
501
|
+
{tabs.map(tab => (
|
|
502
|
+
<Tab key={tab.id} title={tab.title}>
|
|
503
|
+
{tab.content}
|
|
504
|
+
</Tab>
|
|
505
|
+
))}
|
|
506
|
+
</Tabs>
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
When both are in the same slot:
|
|
510
|
+
- In **prefix**: TabPicker appears first (left), then scroll arrows (right)
|
|
511
|
+
- In **suffix**: Scroll arrows appear first (left), then TabPicker (right)
|
|
512
|
+
|
|
513
|
+
### Navigation-Only Tabs
|
|
514
|
+
|
|
515
|
+
Use tabs without panel content for navigation purposes.
|
|
516
|
+
|
|
517
|
+
```jsx
|
|
518
|
+
const [view, setView] = useState('overview');
|
|
519
|
+
|
|
520
|
+
<Tabs activeKey={view} onChange={setView}>
|
|
521
|
+
<Tab key="overview" title="Overview" />
|
|
522
|
+
<Tab key="settings" title="Settings" />
|
|
523
|
+
</Tabs>
|
|
524
|
+
|
|
525
|
+
{view === 'overview' && <OverviewPage />}
|
|
526
|
+
{view === 'settings' && <SettingsPage />}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### Explicit Panels
|
|
530
|
+
|
|
531
|
+
Use `Tabs.List` and `Tabs.Panel` for more control over panel placement.
|
|
532
|
+
|
|
533
|
+
```jsx
|
|
534
|
+
<Tabs defaultActiveKey="tab1">
|
|
535
|
+
<Tabs.List>
|
|
536
|
+
<Tab key="tab1" title="First" />
|
|
537
|
+
<Tab key="tab2" title="Second" />
|
|
538
|
+
</Tabs.List>
|
|
539
|
+
<Tabs.Panel key="tab1">First panel content</Tabs.Panel>
|
|
540
|
+
<Tabs.Panel key="tab2">Second panel content</Tabs.Panel>
|
|
541
|
+
</Tabs>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Prerender Mode
|
|
545
|
+
|
|
546
|
+
Render all panels immediately but keep inactive ones hidden.
|
|
547
|
+
|
|
548
|
+
```jsx
|
|
549
|
+
<Tabs defaultActiveKey="tab1" prerender>
|
|
550
|
+
<Tab key="tab1" title="Tab 1">Content 1</Tab>
|
|
551
|
+
<Tab key="tab2" title="Tab 2">Content 2</Tab>
|
|
552
|
+
</Tabs>
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### Keep Mounted Mode
|
|
556
|
+
|
|
557
|
+
Keep visited panels in the DOM to preserve their state.
|
|
558
|
+
|
|
559
|
+
```jsx
|
|
560
|
+
<Tabs defaultActiveKey="tab1" keepMounted>
|
|
561
|
+
<Tab key="tab1" title="Tab 1">
|
|
562
|
+
<FormWithState />
|
|
563
|
+
</Tab>
|
|
564
|
+
<Tab key="tab2" title="Tab 2">
|
|
565
|
+
<AnotherForm />
|
|
566
|
+
</Tab>
|
|
567
|
+
</Tabs>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
## Panel Rendering Modes
|
|
571
|
+
|
|
572
|
+
- **Default** — Panel renders only when active, unmounts when inactive
|
|
573
|
+
- **`prerender`** — All panels render on mount, inactive ones hidden via `display: none`
|
|
574
|
+
- **`keepMounted`** — Panel renders when first activated, stays mounted thereafter
|
|
575
|
+
|
|
576
|
+
Override per-tab/panel:
|
|
577
|
+
|
|
578
|
+
```jsx
|
|
579
|
+
<Tabs prerender>
|
|
580
|
+
<Tab key="tab1" title="Prerendered">Always in DOM</Tab>
|
|
581
|
+
<Tab key="tab2" title="Lazy" prerender={false}>Lazy loaded</Tab>
|
|
582
|
+
</Tabs>
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### Optimized Lazy Rendering with `renderPanel`
|
|
586
|
+
|
|
587
|
+
For tabs with expensive content, use the `renderPanel` prop for optimized lazy rendering.
|
|
588
|
+
This prevents content from being evaluated on every parent render - only the active tab's
|
|
589
|
+
content is computed, while inactive tabs use cached content.
|
|
590
|
+
|
|
591
|
+
```jsx
|
|
592
|
+
<Tabs
|
|
593
|
+
defaultActiveKey="tab1"
|
|
594
|
+
renderPanel={(key) => {
|
|
595
|
+
switch (key) {
|
|
596
|
+
case 'tab1': return <ExpensiveChart data={chartData} />;
|
|
597
|
+
case 'tab2': return <LargeTable rows={tableRows} />;
|
|
598
|
+
case 'tab3': return <ComplexForm fields={formFields} />;
|
|
599
|
+
default: return null;
|
|
600
|
+
}
|
|
601
|
+
}}
|
|
602
|
+
>
|
|
603
|
+
<Tab key="tab1" title="Charts" />
|
|
604
|
+
<Tab key="tab2" title="Data Table" />
|
|
605
|
+
<Tab key="tab3" title="Settings" />
|
|
606
|
+
</Tabs>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
**How it works:**
|
|
610
|
+
|
|
611
|
+
1. By default, `renderPanel(key)` is called on every Tabs render (no caching)
|
|
612
|
+
2. Add `panelCacheKeys` to enable caching for specific panels
|
|
613
|
+
3. Cached content is reused until the cache key changes
|
|
614
|
+
|
|
615
|
+
```jsx
|
|
616
|
+
// Enable caching with dependencies as cache keys
|
|
617
|
+
<Tabs
|
|
618
|
+
renderPanel={(key) => <Panel data={data[key]} />}
|
|
619
|
+
panelCacheKeys={{
|
|
620
|
+
tab1: data.tab1.version, // Cached, re-renders when version changes
|
|
621
|
+
tab2: data.tab2.version, // Cached, re-renders when version changes
|
|
622
|
+
// tab3 has no cache key - re-renders on every Tabs render
|
|
623
|
+
}}
|
|
624
|
+
>
|
|
625
|
+
...
|
|
626
|
+
</Tabs>
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
This approach is ideal for:
|
|
630
|
+
- Tabs with complex visualizations or charts
|
|
631
|
+
- Large data tables that are expensive to render
|
|
632
|
+
- Forms with many fields
|
|
633
|
+
- Any content that benefits from render caching
|
|
634
|
+
- File Editor
|
|
635
|
+
|
|
636
|
+
### Inside Layout
|
|
637
|
+
|
|
638
|
+
Tabs work seamlessly inside Layout components. When placed in a `Layout` or `Layout.Content`, the tab panels automatically stretch to fill all remaining space below the tab bar. Use nested Layout components inside panels to create complex layouts.
|
|
639
|
+
|
|
640
|
+
```jsx
|
|
641
|
+
<Layout height="400px">
|
|
642
|
+
<Layout.Content scrollbar="none" padding="0"> <!-- can be omitted if no other components are inside -->
|
|
643
|
+
<Tabs defaultActiveKey="tab1">
|
|
644
|
+
<Tab key="tab1" title="Dashboard">
|
|
645
|
+
<Layout fill="#purple.15">
|
|
646
|
+
<Layout.Content>
|
|
647
|
+
Dashboard content - stretches to fill remaining space
|
|
648
|
+
</Layout.Content>
|
|
649
|
+
</Layout>
|
|
650
|
+
</Tab>
|
|
651
|
+
<Tab key="tab2" title="Settings">
|
|
652
|
+
<Layout fill="#success.15">
|
|
653
|
+
<Layout.Content>
|
|
654
|
+
Settings content
|
|
655
|
+
</Layout.Content>
|
|
656
|
+
</Layout>
|
|
657
|
+
</Tab>
|
|
658
|
+
</Tabs>
|
|
659
|
+
</Layout.Content>
|
|
660
|
+
</Layout>
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
**How it works:**
|
|
664
|
+
- The tab bar has fixed height and doesn't grow
|
|
665
|
+
- Tab panels use `display: contents`, allowing children to participate in parent flex layout
|
|
666
|
+
- Nested Layout components with `flexGrow: 1` (default) stretch to fill remaining space
|
|
667
|
+
|
|
668
|
+
## Accessibility
|
|
669
|
+
|
|
670
|
+
### Keyboard Navigation
|
|
671
|
+
|
|
672
|
+
- `Tab` - Move focus into/out of the tab list
|
|
673
|
+
- `ArrowLeft` / `ArrowRight` - Navigate between tabs
|
|
674
|
+
- `Home` - Move to first tab
|
|
675
|
+
- `End` - Move to last tab
|
|
676
|
+
- `Enter` / `Space` - Activate focused tab
|
|
677
|
+
- `Shift+F10` - Open tab menu (when menu is present)
|
|
678
|
+
- `Delete` - Delete focused tab (when deletable)
|
|
679
|
+
- `F2` - Start editing tab title (when editable)
|
|
680
|
+
|
|
681
|
+
### Screen Reader Support
|
|
682
|
+
|
|
683
|
+
- Tab list announces as "tablist" role with proper label
|
|
684
|
+
- Individual tabs announce as "tab" with selected state
|
|
685
|
+
- Panels announce as "tabpanel" linked to their tab
|
|
686
|
+
- Disabled tabs are announced as such
|
|
687
|
+
|
|
688
|
+
### ARIA Properties
|
|
689
|
+
|
|
690
|
+
- `aria-label` - Set via `label` prop on Tabs
|
|
691
|
+
- `aria-selected` - Managed automatically for active tab
|
|
692
|
+
- `aria-disabled` - Applied when `isDisabled` is true
|
|
693
|
+
- `aria-controls` - Links tabs to their panels automatically
|
|
694
|
+
- `aria-labelledby` - Links panels to their tabs automatically
|
|
695
|
+
- `aria-haspopup` - Set to "menu" when tab has a menu
|
|
696
|
+
|
|
697
|
+
## Best Practices
|
|
698
|
+
|
|
699
|
+
1. **Do**: Use clear, descriptive tab titles
|
|
700
|
+
|
|
701
|
+
```jsx
|
|
702
|
+
<Tab key="billing" title="Billing & Payments">...</Tab>
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
2. **Don't**: Use vague or single-letter titles
|
|
706
|
+
|
|
707
|
+
```jsx
|
|
708
|
+
<Tab key="b" title="B">...</Tab>
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
3. **Do**: Provide meaningful accessible labels
|
|
712
|
+
|
|
713
|
+
```jsx
|
|
714
|
+
<Tabs label="Account Settings">...</Tabs>
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
4. **Performance**: Use `keepMounted` when tabs contain forms or stateful components
|
|
718
|
+
|
|
719
|
+
5. **Performance**: Use `renderPanel` for tabs with expensive content to avoid re-evaluation on every render
|
|
720
|
+
|
|
721
|
+
6. **Accessibility**: Ensure tab content is keyboard accessible
|
|
722
|
+
|
|
723
|
+
## Related Components
|
|
724
|
+
|
|
725
|
+
- [Disclosure](../content/Disclosure.md) - For collapsible content sections
|
|
726
|
+
- [Menu](../actions/Menu.md) - For dropdown navigation menus
|