@cube-dev/ui-kit 0.121.0 → 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 +6 -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.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/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 +1 -1
- 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 +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.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 +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 +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/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 +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.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/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 +4 -8
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
# ListBox
|
|
2
|
+
|
|
3
|
+
A versatile list selection component that allows users to select one or more items from a list of options. Built with React Aria's accessibility features and the Cube `tasty` style system, it supports sections, descriptions, keyboard navigation, and virtualization for large datasets.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Present a list of selectable options in a contained area
|
|
8
|
+
- Enable single or multiple selection from a set of choices
|
|
9
|
+
- Display structured data with sections and descriptions
|
|
10
|
+
- Create custom selection interfaces that need to remain visible
|
|
11
|
+
- Build form controls that require persistent option visibility
|
|
12
|
+
- Handle lists of any size (virtualization is automatic for flat lists)
|
|
13
|
+
- When you need rich option content (icons, descriptions, badges, hotkeys)
|
|
14
|
+
- For multiple selection with clear visual feedback (checkboxes)
|
|
15
|
+
- When options should always be visible (for searchable lists, consider FilterListBox)
|
|
16
|
+
|
|
17
|
+
## Component
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### Properties
|
|
22
|
+
|
|
23
|
+
- **`selectedKey`** `string` — The selected key in controlled mode
|
|
24
|
+
- **`defaultSelectedKey`** `string` — The default selected key in uncontrolled mode
|
|
25
|
+
- **`selectedKeys`** `string[] | 'all'` — The selected keys in controlled multiple mode. Use "all" to select all items or an array of keys.
|
|
26
|
+
- **`defaultSelectedKeys`** `string[] | 'all'` — The default selected keys in uncontrolled multiple mode. Use "all" to select all items or an array of keys.
|
|
27
|
+
- **`selectionMode`** `'single' | 'multiple'` (default: `single`) — Selection mode
|
|
28
|
+
- **`disallowEmptySelection`** `boolean` (default: `false`) — Whether to disallow empty selection
|
|
29
|
+
- **`disabledKeys`** `Key[]` — Array of keys for disabled items
|
|
30
|
+
- **`size`** `'small' | 'medium' | 'large'` (default: `medium`) — ListBox size
|
|
31
|
+
- **`shape`** `'card' | 'plain' | 'popover'` (default: `card`) — Visual shape of the ListBox
|
|
32
|
+
- **`filter`** `(nodes: Iterable<Node>) => Iterable<Node>` — Filter function for the list items
|
|
33
|
+
- **`emptyLabel`** `ReactNode` (default: `No items`) — Label shown when no items are available
|
|
34
|
+
- **`header`** `ReactNode` — Custom header content
|
|
35
|
+
- **`footer`** `ReactNode` — Custom footer content
|
|
36
|
+
- **`focusOnHover`** `boolean` (default: `true`) — Whether moving the pointer over an option will move DOM focus to that option
|
|
37
|
+
- **`shouldUseVirtualFocus`** `boolean` (default: `false`) — Whether to use virtual focus instead of DOM focus
|
|
38
|
+
- **`isCheckable`** `boolean` (default: `false`) — Whether to show checkboxes for multiple selection mode
|
|
39
|
+
- **`shouldFocusWrap`** `boolean` (default: `false`) — Whether keyboard navigation should wrap around
|
|
40
|
+
- **`description`** `string` — Field description
|
|
41
|
+
- **`message`** `string` — Help or error message
|
|
42
|
+
- **`showSelectAll`** `boolean` (default: `false`) — Whether to show the "Select All" option in multiple selection mode
|
|
43
|
+
- **`selectAllLabel`** `string` (default: `Select All`) — Label for the "Select All" option
|
|
44
|
+
- **`onSelectionChange`** `(keys: Key | Key[] | 'all' | null) => void` — Callback when selection changes
|
|
45
|
+
- **`onEscape`** `() => void` — Callback when Escape key is pressed
|
|
46
|
+
- **`onOptionClick`** `(key: Key) => void` — Callback when an option is clicked (non-checkbox area)
|
|
47
|
+
|
|
48
|
+
### Base Properties
|
|
49
|
+
|
|
50
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
51
|
+
|
|
52
|
+
### Field Properties
|
|
53
|
+
|
|
54
|
+
Supports all [Field properties](../../FieldProperties.md)
|
|
55
|
+
|
|
56
|
+
### Styling Properties
|
|
57
|
+
|
|
58
|
+
#### styles
|
|
59
|
+
|
|
60
|
+
Customizes the root wrapper element of the component.
|
|
61
|
+
|
|
62
|
+
**Sub-elements:**
|
|
63
|
+
- `ValidationState` - Container for validation and loading indicators
|
|
64
|
+
|
|
65
|
+
#### listStyles
|
|
66
|
+
|
|
67
|
+
Customizes the list container element.
|
|
68
|
+
|
|
69
|
+
#### optionStyles
|
|
70
|
+
|
|
71
|
+
Customizes individual option elements.
|
|
72
|
+
|
|
73
|
+
**Sub-elements:**
|
|
74
|
+
- `Label` - The main text of each option
|
|
75
|
+
- `Description` - Secondary descriptive text for options
|
|
76
|
+
- `Content` - Container for label and description
|
|
77
|
+
- `Checkbox` - Checkbox element when `isCheckable={true}`
|
|
78
|
+
- `CheckboxWrapper` - Wrapper around the checkbox
|
|
79
|
+
|
|
80
|
+
#### sectionStyles
|
|
81
|
+
|
|
82
|
+
Customizes section wrapper elements.
|
|
83
|
+
|
|
84
|
+
#### headingStyles
|
|
85
|
+
|
|
86
|
+
Customizes section heading elements.
|
|
87
|
+
|
|
88
|
+
#### headerStyles
|
|
89
|
+
|
|
90
|
+
Customizes the header area when header prop is provided.
|
|
91
|
+
|
|
92
|
+
#### footerStyles
|
|
93
|
+
|
|
94
|
+
Customizes the footer area when footer prop is provided.
|
|
95
|
+
|
|
96
|
+
### Style Properties
|
|
97
|
+
|
|
98
|
+
These properties allow direct style application without using the `styles` prop: `display`, `font`, `preset`, `hide`, `opacity`, `whiteSpace`, `color`, `fill`, `fade`, `width`, `height`, `flexBasis`, `flexGrow`, `flexShrink`, `flex`, `gridArea`, `order`, `gridColumn`, `gridRow`, `placeSelf`, `alignSelf`, `justifySelf`, `zIndex`, `margin`, `inset`, `position`, `reset`, `padding`, `paddingInline`, `paddingBlock`, `shadow`, `border`, `radius`, `overflow`, `scrollbar`, `outline`, `textAlign`, `flow`, `placeItems`, `placeContent`, `alignItems`, `alignContent`, `justifyItems`, `justifyContent`, `align`, `justify`, `gap`, `columnGap`, `rowGap`, `gridColumns`, `gridRows`, `gridTemplate`, `gridAreas`.
|
|
99
|
+
|
|
100
|
+
### Modifiers
|
|
101
|
+
|
|
102
|
+
The `mods` property accepts the following modifiers you can override:
|
|
103
|
+
|
|
104
|
+
- **`invalid`** `boolean` — Applied when `validationState="invalid"`
|
|
105
|
+
- **`valid`** `boolean` — Applied when `validationState="valid"`
|
|
106
|
+
- **`disabled`** `boolean` — Applied when `isDisabled={true}`
|
|
107
|
+
- **`focused`** `boolean` — Applied when the ListBox has focus
|
|
108
|
+
- **`header`** `boolean` — Applied when header prop is provided or `showSelectAll={true}`
|
|
109
|
+
- **`footer`** `boolean` — Applied when footer prop is provided
|
|
110
|
+
- **`selectAll`** `boolean` — Applied when `showSelectAll={true}` in multiple selection mode
|
|
111
|
+
|
|
112
|
+
## Key Properties
|
|
113
|
+
|
|
114
|
+
### Selection Behavior
|
|
115
|
+
|
|
116
|
+
**isCheckable** (`boolean`, default: `false`)
|
|
117
|
+
- When `true` in multiple selection mode, displays checkboxes on the left of each option
|
|
118
|
+
- Checkboxes are visible when the item is hovered, focused, or selected
|
|
119
|
+
- Improves clarity of multiple selection interactions
|
|
120
|
+
|
|
121
|
+
**showSelectAll** (`boolean`, default: `false`)
|
|
122
|
+
- When `true` in multiple selection mode, displays a "Select All" option in the header
|
|
123
|
+
- The checkbox shows three states: unchecked (none selected), indeterminate (some selected), checked (all selected)
|
|
124
|
+
- Only works with `selectionMode="multiple"`
|
|
125
|
+
|
|
126
|
+
**selectAllLabel** (`ReactNode`, default: `'Select All'`)
|
|
127
|
+
- Custom label for the "Select All" option
|
|
128
|
+
- Only used when `showSelectAll={true}`
|
|
129
|
+
|
|
130
|
+
**allValueProps** (`Partial<CubeItemProps>`)
|
|
131
|
+
- Props to customize the styling and behavior of the "Select All" option
|
|
132
|
+
- Accepts any Item props like `styles`, `icon`, etc.
|
|
133
|
+
|
|
134
|
+
**disallowEmptySelection** (`boolean`, default: `false`)
|
|
135
|
+
- When `true`, prevents the user from deselecting the last selected item
|
|
136
|
+
- Ensures at least one item is always selected in single selection mode
|
|
137
|
+
|
|
138
|
+
**disableSelectionToggle** (`boolean`, default: `false`)
|
|
139
|
+
- When `true`, clicking an already-selected item keeps it selected instead of toggling it off
|
|
140
|
+
- Useful when embedding ListBox inside components like ComboBox
|
|
141
|
+
|
|
142
|
+
**disabledKeys** (`Key[]`)
|
|
143
|
+
- Array of keys for items that should be disabled
|
|
144
|
+
- Disabled items cannot be selected and are visually distinguished
|
|
145
|
+
|
|
146
|
+
### Visual Styling
|
|
147
|
+
|
|
148
|
+
**shape** (`'card' | 'plain' | 'popover'`, default: `'card'`)
|
|
149
|
+
- Controls the visual styling of the ListBox container
|
|
150
|
+
- `card`: Standard card styling with border and margin (default)
|
|
151
|
+
- `plain`: No border, no margin, no radius - suitable for embedded use
|
|
152
|
+
- `popover`: No border, but keeps margin and radius - suitable for overlay use
|
|
153
|
+
- Use `plain` when embedding ListBox directly into another component
|
|
154
|
+
- Use `popover` when using ListBox inside overlays (Dialog, ComboBox, Picker)
|
|
155
|
+
|
|
156
|
+
### Focus and Interaction
|
|
157
|
+
|
|
158
|
+
**focusOnHover** (`boolean`, default: `true`)
|
|
159
|
+
- When `true`, moving the pointer over an option will move DOM focus to that option
|
|
160
|
+
- Set to `false` for components that keep DOM focus outside (e.g., searchable FilterListBox)
|
|
161
|
+
|
|
162
|
+
**shouldUseVirtualFocus** (`boolean`, default: `false`)
|
|
163
|
+
- When `true`, uses virtual focus for keyboard navigation
|
|
164
|
+
- DOM focus stays outside individual option elements (useful for searchable lists)
|
|
165
|
+
|
|
166
|
+
**shouldFocusWrap** (`boolean`, default: `false`)
|
|
167
|
+
- When `true`, keyboard navigation wraps around when reaching the end of the list
|
|
168
|
+
|
|
169
|
+
### Event Handlers
|
|
170
|
+
|
|
171
|
+
**onSelectionChange** (`(key: Key | null | 'all' | Key[]) => void`)
|
|
172
|
+
- Callback fired when selection changes
|
|
173
|
+
- In single mode: receives a single key or `null`
|
|
174
|
+
- In multiple mode: receives an array of keys or `'all'` for select all
|
|
175
|
+
|
|
176
|
+
**onEscape** (`() => void`)
|
|
177
|
+
- Callback fired when the user presses Escape key
|
|
178
|
+
- When provided, prevents React Aria's default Escape behavior (selection reset)
|
|
179
|
+
- Useful for closing parent overlays
|
|
180
|
+
|
|
181
|
+
**onOptionClick** (`(key: Key) => void`)
|
|
182
|
+
- Callback fired when an option is clicked (not on the checkbox area in checkable mode)
|
|
183
|
+
- Used by FilterPicker to close the popover on non-checkbox clicks
|
|
184
|
+
|
|
185
|
+
### Advanced
|
|
186
|
+
|
|
187
|
+
**stateRef** (`RefObject<any>`)
|
|
188
|
+
- Ref to access the internal ListState instance
|
|
189
|
+
- Allows parent components to access selection state and other list functionality
|
|
190
|
+
|
|
191
|
+
**listRef** (`RefObject<HTMLUListElement>`)
|
|
192
|
+
- Ref for accessing the list DOM element
|
|
193
|
+
|
|
194
|
+
## Sub-components
|
|
195
|
+
|
|
196
|
+
### ListBox.Item
|
|
197
|
+
|
|
198
|
+
Individual items within the ListBox. Each item is rendered using [Item](../content/Item.md) and supports all Item properties for layout, icons, descriptions, and interactive features.
|
|
199
|
+
|
|
200
|
+
#### Item API
|
|
201
|
+
|
|
202
|
+
ListBox.Item is built using [Item](../content/Item.md), which provides rich layout and interaction capabilities. All Item properties are supported:
|
|
203
|
+
|
|
204
|
+
- **`key`** `string \| number` — Unique identifier for the item (required)
|
|
205
|
+
- **`children`** `ReactNode` — The main content/label for the option
|
|
206
|
+
- **`textValue`** `string` — Text representation for complex JSX content (for screen readers and search)
|
|
207
|
+
- **`icon`** `ReactNode` — Icon displayed before the content
|
|
208
|
+
- **`rightIcon`** `ReactNode` — Icon displayed after the content
|
|
209
|
+
- **`description`** `ReactNode` — Secondary text below the main content
|
|
210
|
+
- **`descriptionPlacement`** `'inline' \| 'block'` (default: `'block'`) — How the description is positioned
|
|
211
|
+
- **`prefix`** `ReactNode` — Content displayed at the start (before icon)
|
|
212
|
+
- **`suffix`** `ReactNode` — Content displayed at the end (after content)
|
|
213
|
+
- **`hotkeys`** `string` — Keyboard shortcut hint (e.g., `'ctrl+a'`) displayed as suffix
|
|
214
|
+
- **`tooltip`** `string \| object` — Tooltip shown on hover. Object: `{ title, description, placement }`
|
|
215
|
+
- **`styles`** `Styles` — Custom styling for the item
|
|
216
|
+
- **`qa`** `string` — QA identifier for testing
|
|
217
|
+
|
|
218
|
+
#### Example with Rich Items
|
|
219
|
+
|
|
220
|
+
```jsx
|
|
221
|
+
<ListBox label="Team Members" selectionMode="multiple">
|
|
222
|
+
<ListBox.Item
|
|
223
|
+
key="user1"
|
|
224
|
+
icon={<IconUser />}
|
|
225
|
+
description="Product Manager"
|
|
226
|
+
suffix="Online"
|
|
227
|
+
>
|
|
228
|
+
Alice Johnson
|
|
229
|
+
</ListBox.Item>
|
|
230
|
+
<ListBox.Item
|
|
231
|
+
key="user2"
|
|
232
|
+
icon={<IconUser />}
|
|
233
|
+
description="Senior Developer"
|
|
234
|
+
rightIcon={<IconBadge />}
|
|
235
|
+
>
|
|
236
|
+
Bob Smith
|
|
237
|
+
</ListBox.Item>
|
|
238
|
+
</ListBox>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### ListBox.Section
|
|
242
|
+
|
|
243
|
+
Groups related items together with an optional heading.
|
|
244
|
+
|
|
245
|
+
- **`title`** `ReactNode` — Optional heading text for the section
|
|
246
|
+
- **`children`** `ListBox.Item[]` — Collection of ListBox.Item components
|
|
247
|
+
|
|
248
|
+
## Variants
|
|
249
|
+
|
|
250
|
+
### Selection Modes
|
|
251
|
+
|
|
252
|
+
- `single` - Allows selecting only one item at a time
|
|
253
|
+
- `multiple` - Allows selecting multiple items
|
|
254
|
+
- `none` - No selection allowed (display only)
|
|
255
|
+
|
|
256
|
+
### Sizes
|
|
257
|
+
|
|
258
|
+
- `small` - Compact size for dense interfaces (28px item height)
|
|
259
|
+
- `medium` - Standard size for general use (32px item height, default)
|
|
260
|
+
- `large` - Emphasized size for important sections (40px item height)
|
|
261
|
+
|
|
262
|
+
## Examples
|
|
263
|
+
|
|
264
|
+
### Basic Usage
|
|
265
|
+
|
|
266
|
+
```jsx
|
|
267
|
+
<ListBox label="Select a fruit" selectionMode="single">
|
|
268
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
269
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
270
|
+
<ListBox.Item key="cherry">Cherry</ListBox.Item>
|
|
271
|
+
</ListBox>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### With Descriptions
|
|
275
|
+
|
|
276
|
+
```jsx
|
|
277
|
+
<ListBox label="Choose a framework" selectionMode="single">
|
|
278
|
+
<ListBox.Item
|
|
279
|
+
key="react"
|
|
280
|
+
description="A JavaScript library for building user interfaces"
|
|
281
|
+
>
|
|
282
|
+
React
|
|
283
|
+
</ListBox.Item>
|
|
284
|
+
<ListBox.Item
|
|
285
|
+
key="vue"
|
|
286
|
+
description="The Progressive JavaScript Framework"
|
|
287
|
+
>
|
|
288
|
+
Vue.js
|
|
289
|
+
</ListBox.Item>
|
|
290
|
+
</ListBox>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### With Sections
|
|
294
|
+
|
|
295
|
+
```jsx
|
|
296
|
+
<ListBox label="Select food items" selectionMode="single">
|
|
297
|
+
<ListBox.Section title="Fruits">
|
|
298
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
299
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
300
|
+
</ListBox.Section>
|
|
301
|
+
<ListBox.Section title="Vegetables">
|
|
302
|
+
<ListBox.Item key="carrot">Carrot</ListBox.Item>
|
|
303
|
+
<ListBox.Item key="broccoli">Broccoli</ListBox.Item>
|
|
304
|
+
</ListBox.Section>
|
|
305
|
+
</ListBox>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Multiple Selection
|
|
309
|
+
|
|
310
|
+
```jsx
|
|
311
|
+
<ListBox
|
|
312
|
+
label="Select skills (multiple)"
|
|
313
|
+
selectionMode="multiple"
|
|
314
|
+
>
|
|
315
|
+
<ListBox.Item key="html">HTML</ListBox.Item>
|
|
316
|
+
<ListBox.Item key="css">CSS</ListBox.Item>
|
|
317
|
+
<ListBox.Item key="javascript">JavaScript</ListBox.Item>
|
|
318
|
+
</ListBox>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Multiple Selection with Checkboxes
|
|
322
|
+
|
|
323
|
+
```jsx
|
|
324
|
+
<ListBox
|
|
325
|
+
label="Select permissions"
|
|
326
|
+
selectionMode="multiple"
|
|
327
|
+
isCheckable={true}
|
|
328
|
+
>
|
|
329
|
+
<ListBox.Item key="read" description="View content and data">Read</ListBox.Item>
|
|
330
|
+
<ListBox.Item key="write" description="Create and edit content">Write</ListBox.Item>
|
|
331
|
+
<ListBox.Item key="delete" description="Remove content permanently">Delete</ListBox.Item>
|
|
332
|
+
</ListBox>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Multiple Selection with Select All
|
|
336
|
+
|
|
337
|
+
```jsx
|
|
338
|
+
<ListBox
|
|
339
|
+
label="Select permissions"
|
|
340
|
+
selectionMode="multiple"
|
|
341
|
+
isCheckable={true}
|
|
342
|
+
showSelectAll={true}
|
|
343
|
+
selectAllLabel="All Permissions"
|
|
344
|
+
>
|
|
345
|
+
<ListBox.Item key="read" description="View content and data">Read</ListBox.Item>
|
|
346
|
+
<ListBox.Item key="write" description="Create and edit content">Write</ListBox.Item>
|
|
347
|
+
<ListBox.Item key="execute" description="Execute operations">Execute</ListBox.Item>
|
|
348
|
+
</ListBox>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### With Header and Footer
|
|
352
|
+
|
|
353
|
+
```jsx
|
|
354
|
+
<ListBox
|
|
355
|
+
label="Programming Languages"
|
|
356
|
+
header={
|
|
357
|
+
<Space gap="1x" flow="row" placeItems="center">
|
|
358
|
+
<Title level={6}>Languages</Title>
|
|
359
|
+
<Badge type="note">12</Badge>
|
|
360
|
+
</Space>
|
|
361
|
+
}
|
|
362
|
+
footer={
|
|
363
|
+
<Text color="#dark.50" preset="t4">
|
|
364
|
+
Popular languages shown
|
|
365
|
+
</Text>
|
|
366
|
+
}
|
|
367
|
+
>
|
|
368
|
+
<ListBox.Item key="javascript">JavaScript</ListBox.Item>
|
|
369
|
+
<ListBox.Item key="python">Python</ListBox.Item>
|
|
370
|
+
</ListBox>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Controlled Selection
|
|
374
|
+
|
|
375
|
+
```jsx
|
|
376
|
+
const [selectedKey, setSelectedKey] = useState('apple');
|
|
377
|
+
|
|
378
|
+
<ListBox
|
|
379
|
+
label="Controlled ListBox"
|
|
380
|
+
selectedKey={selectedKey}
|
|
381
|
+
onSelectionChange={setSelectedKey}
|
|
382
|
+
selectionMode="single"
|
|
383
|
+
>
|
|
384
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
385
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
386
|
+
</ListBox>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Disabled Items
|
|
390
|
+
|
|
391
|
+
```jsx
|
|
392
|
+
<ListBox
|
|
393
|
+
label="Select an option"
|
|
394
|
+
selectionMode="single"
|
|
395
|
+
disabledKeys={['disabled1', 'disabled2']}
|
|
396
|
+
>
|
|
397
|
+
<ListBox.Item key="available1">Available Option 1</ListBox.Item>
|
|
398
|
+
<ListBox.Item key="disabled1">Disabled Option 1</ListBox.Item>
|
|
399
|
+
<ListBox.Item key="available2">Available Option 2</ListBox.Item>
|
|
400
|
+
</ListBox>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Disallow Empty Selection
|
|
404
|
+
|
|
405
|
+
```jsx
|
|
406
|
+
<ListBox
|
|
407
|
+
label="Must select one option"
|
|
408
|
+
selectionMode="single"
|
|
409
|
+
disallowEmptySelection={true}
|
|
410
|
+
defaultSelectedKey="apple"
|
|
411
|
+
>
|
|
412
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
413
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
414
|
+
</ListBox>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Rich Content Options
|
|
418
|
+
|
|
419
|
+
```jsx
|
|
420
|
+
<ListBox label="User Roles" selectionMode="single" size="large">
|
|
421
|
+
<ListBox.Item
|
|
422
|
+
key="admin"
|
|
423
|
+
description="Full system administration access"
|
|
424
|
+
prefix={<Badge type="danger">Admin</Badge>}
|
|
425
|
+
suffix={<Badge type="note">3</Badge>}
|
|
426
|
+
rightIcon={<SettingsIcon />}
|
|
427
|
+
hotkeys="ctrl+a"
|
|
428
|
+
>
|
|
429
|
+
System Administrator
|
|
430
|
+
</ListBox.Item>
|
|
431
|
+
<ListBox.Item
|
|
432
|
+
key="editor"
|
|
433
|
+
description="Content creation and editing permissions"
|
|
434
|
+
prefix={<Badge type="warning">Editor</Badge>}
|
|
435
|
+
suffix={<Badge type="note">12</Badge>}
|
|
436
|
+
rightIcon={<EditIcon />}
|
|
437
|
+
hotkeys="ctrl+e"
|
|
438
|
+
>
|
|
439
|
+
Content Editor
|
|
440
|
+
</ListBox.Item>
|
|
441
|
+
</ListBox>
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### With Tooltips
|
|
445
|
+
|
|
446
|
+
```jsx
|
|
447
|
+
<ListBox label="Project Actions" selectionMode="single">
|
|
448
|
+
<ListBox.Item
|
|
449
|
+
key="create"
|
|
450
|
+
tooltip="Create a new project with default settings"
|
|
451
|
+
icon={<PlusIcon />}
|
|
452
|
+
>
|
|
453
|
+
Create Project
|
|
454
|
+
</ListBox.Item>
|
|
455
|
+
<ListBox.Item
|
|
456
|
+
key="import"
|
|
457
|
+
tooltip={{
|
|
458
|
+
title: 'Import Project',
|
|
459
|
+
description: 'Import an existing project from file or URL',
|
|
460
|
+
placement: 'right',
|
|
461
|
+
}}
|
|
462
|
+
icon={<DatabaseIcon />}
|
|
463
|
+
>
|
|
464
|
+
Import Project
|
|
465
|
+
</ListBox.Item>
|
|
466
|
+
</ListBox>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### With Complex Content
|
|
470
|
+
|
|
471
|
+
```jsx
|
|
472
|
+
<ListBox label="Choose your plan" selectionMode="single">
|
|
473
|
+
<ListBox.Item
|
|
474
|
+
key="basic"
|
|
475
|
+
textValue="Basic Plan - Free with limited features"
|
|
476
|
+
>
|
|
477
|
+
<Space gap="1x" flow="column">
|
|
478
|
+
<Text weight="600">Basic Plan</Text>
|
|
479
|
+
<Badge type="neutral">Free</Badge>
|
|
480
|
+
</Space>
|
|
481
|
+
</ListBox.Item>
|
|
482
|
+
<ListBox.Item
|
|
483
|
+
key="pro"
|
|
484
|
+
textValue="Pro Plan - Monthly subscription with all features"
|
|
485
|
+
>
|
|
486
|
+
<Space gap="1x" flow="column">
|
|
487
|
+
<Text weight="600">Pro Plan</Text>
|
|
488
|
+
<Badge type="purple">$19/month</Badge>
|
|
489
|
+
</Space>
|
|
490
|
+
</ListBox.Item>
|
|
491
|
+
</ListBox>
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Different Sizes
|
|
495
|
+
|
|
496
|
+
```jsx
|
|
497
|
+
<ListBox size="small" label="Small Size">
|
|
498
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
499
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
500
|
+
</ListBox>
|
|
501
|
+
|
|
502
|
+
<ListBox size="medium" label="Medium Size (Default)">
|
|
503
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
504
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
505
|
+
</ListBox>
|
|
506
|
+
|
|
507
|
+
<ListBox size="large" label="Large Size">
|
|
508
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
509
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
510
|
+
</ListBox>
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
### Visual Shape Variants
|
|
514
|
+
|
|
515
|
+
```jsx
|
|
516
|
+
{/* Card shape (default) - with border and margin */}
|
|
517
|
+
<ListBox shape="card" label="Select a fruit" selectionMode="single">
|
|
518
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
519
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
520
|
+
</ListBox>
|
|
521
|
+
|
|
522
|
+
{/* Plain shape - no border, no margin, no radius */}
|
|
523
|
+
<ListBox shape="plain" label="Select a fruit" selectionMode="single">
|
|
524
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
525
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
526
|
+
</ListBox>
|
|
527
|
+
|
|
528
|
+
{/* Popover shape - no border, but keeps margin and radius */}
|
|
529
|
+
<ListBox shape="popover" label="Select a fruit" selectionMode="single">
|
|
530
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
531
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
532
|
+
</ListBox>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Custom Escape Handling
|
|
536
|
+
|
|
537
|
+
```jsx
|
|
538
|
+
const [selectedKey, setSelectedKey] = useState('apple');
|
|
539
|
+
|
|
540
|
+
<ListBox
|
|
541
|
+
label="Custom Escape Handling"
|
|
542
|
+
selectedKey={selectedKey}
|
|
543
|
+
selectionMode="single"
|
|
544
|
+
onSelectionChange={setSelectedKey}
|
|
545
|
+
onEscape={() => {
|
|
546
|
+
// Custom escape behavior - could close a parent modal, etc.
|
|
547
|
+
console.log('Escape pressed');
|
|
548
|
+
}}
|
|
549
|
+
>
|
|
550
|
+
<ListBox.Item key="apple">Apple</ListBox.Item>
|
|
551
|
+
<ListBox.Item key="banana">Banana</ListBox.Item>
|
|
552
|
+
</ListBox>
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### In Forms
|
|
556
|
+
|
|
557
|
+
```jsx
|
|
558
|
+
<Form onSubmit={handleSubmit}>
|
|
559
|
+
<ListBox
|
|
560
|
+
name="technology"
|
|
561
|
+
label="Preferred Technology"
|
|
562
|
+
isRequired
|
|
563
|
+
selectionMode="single"
|
|
564
|
+
>
|
|
565
|
+
<ListBox.Section title="Frontend">
|
|
566
|
+
<ListBox.Item key="react">React</ListBox.Item>
|
|
567
|
+
<ListBox.Item key="vue">Vue.js</ListBox.Item>
|
|
568
|
+
</ListBox.Section>
|
|
569
|
+
</ListBox>
|
|
570
|
+
<Form.Submit>Submit</Form.Submit>
|
|
571
|
+
</Form>
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
## Accessibility
|
|
575
|
+
|
|
576
|
+
### Keyboard Navigation
|
|
577
|
+
|
|
578
|
+
- `Tab` - Moves focus to/from the ListBox
|
|
579
|
+
- `Arrow Keys` - Navigate between options
|
|
580
|
+
- `Space/Enter` - Select/deselect the focused option
|
|
581
|
+
- `Home/End` - Move to first/last option
|
|
582
|
+
- `Page Up/Page Down` - Move up/down by multiple items
|
|
583
|
+
- `Escape` - Deselect all items (if onEscape not provided)
|
|
584
|
+
|
|
585
|
+
### Screen Reader Support
|
|
586
|
+
|
|
587
|
+
- ListBox announces as "listbox" with proper role
|
|
588
|
+
- Selected items are announced as "selected"
|
|
589
|
+
- Section headings are properly associated with their items
|
|
590
|
+
- Selection changes are announced immediately
|
|
591
|
+
- Item descriptions are read along with labels
|
|
592
|
+
|
|
593
|
+
### ARIA Properties
|
|
594
|
+
|
|
595
|
+
- `aria-label` - Provides accessible label when no visible label exists
|
|
596
|
+
- `aria-labelledby` - Associates with external label element
|
|
597
|
+
- `aria-describedby` - Associates with description text
|
|
598
|
+
- `aria-multiselectable` - Indicates multiple selection capability
|
|
599
|
+
- `aria-activedescendant` - Tracks focused item for screen readers
|
|
600
|
+
|
|
601
|
+
## Best Practices
|
|
602
|
+
|
|
603
|
+
1. **Do**: Provide clear, descriptive labels for options
|
|
604
|
+
```jsx
|
|
605
|
+
<ListBox.Item key="react" description="JavaScript library for UIs">
|
|
606
|
+
React
|
|
607
|
+
</ListBox.Item>
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
2. **Don't**: Use ListBox for very large datasets without considering virtualization
|
|
611
|
+
```jsx
|
|
612
|
+
// ✅ Virtualization is automatic for lists without sections
|
|
613
|
+
<ListBox height="300px">
|
|
614
|
+
{hugeArray.map(item => <ListBox.Item key={item.id}>{item.name}</ListBox.Item>)}
|
|
615
|
+
</ListBox>
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
3. **Do**: Use sections to organize related options
|
|
619
|
+
```jsx
|
|
620
|
+
<ListBox.Section title="Frontend Frameworks">
|
|
621
|
+
<ListBox.Item key="react">React</ListBox.Item>
|
|
622
|
+
</ListBox.Section>
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
4. **Do**: Use `isCheckable` for clearer multiple selection UI
|
|
626
|
+
```jsx
|
|
627
|
+
<ListBox selectionMode="multiple" isCheckable={true}>
|
|
628
|
+
{/* Checkboxes make the selection state obvious */}
|
|
629
|
+
</ListBox>
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
5. **Do**: Use `showSelectAll` for efficient multiple selection from lists
|
|
633
|
+
```jsx
|
|
634
|
+
<ListBox selectionMode="multiple" isCheckable={true} showSelectAll selectAllLabel="Select All">
|
|
635
|
+
{/* Easy bulk selection with visual feedback */}
|
|
636
|
+
</ListBox>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
6. **Do**: Use `textValue` for complex option content
|
|
640
|
+
```jsx
|
|
641
|
+
<ListBox.Item key="item" textValue="Basic Plan - Free">
|
|
642
|
+
<Space gap="1x" flow="column">
|
|
643
|
+
<Text weight="600">Basic Plan</Text>
|
|
644
|
+
<Badge>Free</Badge>
|
|
645
|
+
</Space>
|
|
646
|
+
</ListBox.Item>
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
7. **Do**: Leverage Item features for rich content
|
|
650
|
+
```jsx
|
|
651
|
+
<ListBox.Item
|
|
652
|
+
key="admin"
|
|
653
|
+
icon={<UserIcon />}
|
|
654
|
+
description="Full access"
|
|
655
|
+
suffix={<Badge>3</Badge>}
|
|
656
|
+
hotkeys="ctrl+a"
|
|
657
|
+
>
|
|
658
|
+
Administrator
|
|
659
|
+
</ListBox.Item>
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
8. **Accessibility**: Always provide meaningful labels and descriptions
|
|
663
|
+
9. **Performance**: Virtualization is automatic when there are no sections
|
|
664
|
+
10. **UX**: Consider FilterListBox for searchable lists with many options
|
|
665
|
+
|
|
666
|
+
## Integration with Forms
|
|
667
|
+
|
|
668
|
+
This component supports all [Field properties](../../FieldProperties.md) when used within a Form. The component automatically handles form validation, field states, and integrates with form submission.
|
|
669
|
+
|
|
670
|
+
```jsx
|
|
671
|
+
<Form onSubmit={handleSubmit}>
|
|
672
|
+
<ListBox
|
|
673
|
+
name="preferences"
|
|
674
|
+
label="User Preferences"
|
|
675
|
+
isRequired
|
|
676
|
+
rules={[{ required: true }]}
|
|
677
|
+
selectionMode="multiple"
|
|
678
|
+
>
|
|
679
|
+
<ListBox.Item key="notifications">Email Notifications</ListBox.Item>
|
|
680
|
+
<ListBox.Item key="newsletter">Newsletter</ListBox.Item>
|
|
681
|
+
</ListBox>
|
|
682
|
+
</Form>
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
## Performance
|
|
686
|
+
|
|
687
|
+
### Virtualization
|
|
688
|
+
|
|
689
|
+
ListBox automatically enables virtualization when:
|
|
690
|
+
- No sections are present (sections disable virtualization)
|
|
691
|
+
- Provides smooth scrolling even with large datasets
|
|
692
|
+
- Only visible items are rendered in the DOM
|
|
693
|
+
- Uses `@tanstack/react-virtual` for efficient rendering
|
|
694
|
+
- Automatically measures item heights for consistent scrolling
|
|
695
|
+
- Supports items with varying heights (descriptions, complex content)
|
|
696
|
+
|
|
697
|
+
**Note**: Virtualization is transparent to the user - no configuration needed. It works automatically when you have a flat list without sections.
|
|
698
|
+
|
|
699
|
+
### Optimization Tips
|
|
700
|
+
|
|
701
|
+
- Use `textValue` prop for complex option content to improve accessibility and search
|
|
702
|
+
- Avoid sections for very large lists to enable virtualization
|
|
703
|
+
- Use `items` prop pattern with dynamic data for better performance
|
|
704
|
+
- Consider FilterListBox for searchable large lists (100+ items)
|
|
705
|
+
- Virtualization handles items with varying heights automatically
|
|
706
|
+
|
|
707
|
+
## Related Components
|
|
708
|
+
|
|
709
|
+
- [FilterListBox](./FilterListBox.md) - ListBox with integrated search functionality
|
|
710
|
+
- [FilterPicker](./FilterPicker.md) - ListBox in a trigger-based popover
|
|
711
|
+
- [Select](./Select.md) - Dropdown selection without persistent visibility
|
|
712
|
+
- [ComboBox](./ComboBox.md) - Dropdown with text input and search
|
|
713
|
+
- [RadioGroup](./RadioGroup.md) - Single selection with radio buttons
|
|
714
|
+
- [CheckboxGroup](./Checkbox.md) - Multiple selection with checkboxes
|