@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,576 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
A select allows users to choose a single option from a list of predefined choices. It provides a compact interface for selection with a dropdown menu that displays available options when activated.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Allow users to select one option from a predefined list
|
|
8
|
+
- Provide selection in forms where space is limited
|
|
9
|
+
- Offer choices where only one selection is allowed
|
|
10
|
+
- Create dropdown menus for navigation or filtering
|
|
11
|
+
- Present structured options in a compact interface
|
|
12
|
+
|
|
13
|
+
## Component
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- **`selectedKey`** `string` — The selected value in controlled mode
|
|
20
|
+
- **`defaultSelectedKey`** `string` — The default selected value in uncontrolled mode
|
|
21
|
+
- **`placeholder`** `string` — Placeholder text when no option is selected
|
|
22
|
+
- **`icon`** `ReactElement` — Icon element rendered before the select value
|
|
23
|
+
- **`rightIcon`** `ReactNode` — Icon element rendered after the select value (caret by default)
|
|
24
|
+
- **`prefix`** `ReactNode` — Content rendered before the select value
|
|
25
|
+
- **`suffix`** `ReactNode` — Content rendered after the select value
|
|
26
|
+
- **`shape`** `'card' | 'button' | 'sharp' | 'pill'` (default: `button`) — Shape of the trigger border radius
|
|
27
|
+
- **`suffixPosition`** `string` (default: `before`) — Position of suffix relative to validation icons
|
|
28
|
+
- **`type`** `string` (default: `outline`) — Visual style variant of the select
|
|
29
|
+
- **`theme`** `string` (default: `default`) — Theme variant affecting overall styling
|
|
30
|
+
- **`size`** `string` (default: `medium`) — Size of the select component
|
|
31
|
+
- **`direction`** `string` (default: `bottom`) — Preferred direction for the dropdown menu
|
|
32
|
+
- **`isClearable`** `boolean` (default: `false`) — Whether the select is clearable using a clear button in the rightIcon slot
|
|
33
|
+
- **`shouldFlip`** `boolean` (default: `true`) — Whether dropdown should flip to fit in viewport
|
|
34
|
+
- **`overlayOffset`** `number` (default: `8`) — Distance between select and dropdown in pixels
|
|
35
|
+
- **`items`** `Iterable<T>` — Item objects used when rendering dynamic collections
|
|
36
|
+
- **`disabledKeys`** `Iterable<Key>` — Keys of items that are disabled
|
|
37
|
+
- **`children`** `ReactNode | (item: T) => ReactElement` — Static child items or render function for dynamic items
|
|
38
|
+
- **`triggerRef`** `RefObject<HTMLButtonElement>` — Ref for the trigger button element
|
|
39
|
+
- **`popoverRef`** `RefObject<HTMLInputElement>` — Ref for the popover overlay element
|
|
40
|
+
- **`listBoxRef`** `RefObject<HTMLElement>` — Ref for the list box element
|
|
41
|
+
- **`loadingIndicator`** `ReactNode` — Custom loading indicator element
|
|
42
|
+
- **`hideTrigger`** `boolean` (default: `false`) — Whether to hide the trigger button
|
|
43
|
+
- **`styles`** `Styles` — Styles for the root wrapper element
|
|
44
|
+
- **`inputStyles`** `Styles` — Styles for the input trigger element
|
|
45
|
+
- **`listBoxStyles`** `Styles` — Styles for the dropdown list container
|
|
46
|
+
- **`optionStyles`** `Styles` — Styles for individual option items
|
|
47
|
+
- **`overlayStyles`** `Styles` — Styles for the dropdown overlay wrapper
|
|
48
|
+
- **`wrapperStyles`** `Styles` — Styles for the outer wrapper element
|
|
49
|
+
- **`triggerStyles`** `Styles` — Styles for the trigger button element
|
|
50
|
+
- **`inputProps`** `Props` — Additional props for the input element
|
|
51
|
+
- **`onSelectionChange`** `(key: Key) => void` — Callback fired when the selected option changes
|
|
52
|
+
- **`onOpenChange`** `(isOpen: boolean) => void` — Callback fired when the dropdown opens or closes
|
|
53
|
+
- **`onFocus`** `(e: FocusEvent) => void` — Callback fired when the select receives focus
|
|
54
|
+
- **`onBlur`** `(e: FocusEvent) => void` — Callback fired when the select loses focus
|
|
55
|
+
- **`onFocusChange`** `(isFocused: boolean) => void` — Callback fired when focus state changes
|
|
56
|
+
- **`aria-label`** `string` — Accessible label when no visible label exists
|
|
57
|
+
- **`aria-labelledby`** `string` — ID of element that labels the select
|
|
58
|
+
- **`aria-describedby`** `string` — ID of element that describes the select
|
|
59
|
+
|
|
60
|
+
#### Notable Properties
|
|
61
|
+
|
|
62
|
+
**isClearable** - Adds a clear button in the rightIcon slot that allows users to clear the selected value. The clear button only appears when a value is selected and the select is not disabled or read-only.
|
|
63
|
+
|
|
64
|
+
**onClear** - Callback fired when the clear button is pressed, allowing you to perform custom actions when the selection is cleared.
|
|
65
|
+
|
|
66
|
+
**tooltip** - Enables tooltip display on the trigger button. Can be:
|
|
67
|
+
- `string` - Simple tooltip text
|
|
68
|
+
- `true` - Auto tooltip on overflow (shows selected value when truncated)
|
|
69
|
+
- `object` - Advanced configuration with optional `auto` property
|
|
70
|
+
|
|
71
|
+
**triggerDescription** - Text description displayed within the trigger button. Different from field-level description provided by FieldWrapper.
|
|
72
|
+
|
|
73
|
+
**descriptionPlacement** - Controls how description is positioned: `inline` or `block`.
|
|
74
|
+
|
|
75
|
+
**overlayOffset** - Distance between the select trigger and dropdown in pixels (default: 8).
|
|
76
|
+
|
|
77
|
+
**direction** - Preferred direction for the dropdown: `top` or `bottom` (default: `bottom`).
|
|
78
|
+
|
|
79
|
+
**shouldFlip** - Whether the dropdown should flip to fit in viewport (default: `true`).
|
|
80
|
+
|
|
81
|
+
**suffixPosition** - Position of suffix content relative to validation icons: `before` or `after` (default: `before`).
|
|
82
|
+
|
|
83
|
+
### Base Properties
|
|
84
|
+
|
|
85
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
86
|
+
|
|
87
|
+
### Field Properties
|
|
88
|
+
|
|
89
|
+
Supports all [Field properties](../../FieldProperties.md)
|
|
90
|
+
|
|
91
|
+
### Styling Properties
|
|
92
|
+
|
|
93
|
+
#### styles
|
|
94
|
+
|
|
95
|
+
Customizes the root wrapper element of the component.
|
|
96
|
+
|
|
97
|
+
#### triggerStyles
|
|
98
|
+
|
|
99
|
+
Customizes the trigger button element that opens the dropdown.
|
|
100
|
+
|
|
101
|
+
**Sub-elements:**
|
|
102
|
+
- `Label` - The displayed selected value text or placeholder
|
|
103
|
+
- `Prefix` - Container for prefix content
|
|
104
|
+
- `Suffix` - Container for suffix content
|
|
105
|
+
- `Icon` - Container for left icon
|
|
106
|
+
- `RightIcon` - Container for right icon (caret, loading, clear button)
|
|
107
|
+
- `Description` - Description text within the trigger
|
|
108
|
+
- `Hotkeys` - Keyboard shortcut display
|
|
109
|
+
|
|
110
|
+
#### listBoxStyles
|
|
111
|
+
|
|
112
|
+
Customizes the dropdown list container that displays options.
|
|
113
|
+
|
|
114
|
+
#### overlayStyles
|
|
115
|
+
|
|
116
|
+
Customizes the popover overlay wrapper that contains the list.
|
|
117
|
+
|
|
118
|
+
#### optionStyles
|
|
119
|
+
|
|
120
|
+
Customizes individual option items in the dropdown.
|
|
121
|
+
|
|
122
|
+
**Sub-elements:**
|
|
123
|
+
- `Label` - The main content/text of the option
|
|
124
|
+
- `Description` - Secondary description text
|
|
125
|
+
- `Prefix` - Container for prefix content
|
|
126
|
+
- `Suffix` - Container for suffix content
|
|
127
|
+
- `Icon` - Container for left icon
|
|
128
|
+
- `RightIcon` - Container for right icon
|
|
129
|
+
|
|
130
|
+
### Style Properties
|
|
131
|
+
|
|
132
|
+
These properties allow direct style application without using the `styles` prop: `display`, `font`, `preset`, `hide`, `opacity`, `whiteSpace`, `gridArea`, `order`, `gridColumn`, `gridRow`, `placeSelf`, `alignSelf`, `justifySelf`, `zIndex`, `margin`, `inset`, `position`, `width`, `height`, `flexBasis`, `flexGrow`, `flexShrink`, `flex`, `color`, `fill`, `fade`
|
|
133
|
+
|
|
134
|
+
### Modifiers
|
|
135
|
+
|
|
136
|
+
The `mods` property accepts the following modifiers you can override:
|
|
137
|
+
|
|
138
|
+
- `focused` `boolean` — Whether the select has focus
|
|
139
|
+
- `disabled` `boolean` — Whether the select is disabled
|
|
140
|
+
- `invalid` `boolean` — Whether the select has validation errors
|
|
141
|
+
- `valid` `boolean` — Whether the select is valid
|
|
142
|
+
- `placeholder` `boolean` — Whether showing placeholder text
|
|
143
|
+
- `hovered` `boolean` — Whether the select is being hovered
|
|
144
|
+
- `loading` `boolean` — Whether the select is in loading state
|
|
145
|
+
- `prefix` `boolean` — Whether prefix content is present
|
|
146
|
+
- `suffix` `boolean` — Whether suffix content is present
|
|
147
|
+
|
|
148
|
+
## Sub-components
|
|
149
|
+
|
|
150
|
+
### Select.Item
|
|
151
|
+
|
|
152
|
+
Individual option items within the select dropdown. Each item is rendered using [Item](../content/Item.md) and supports all Item properties for layout, icons, descriptions, and interactive features.
|
|
153
|
+
|
|
154
|
+
#### Item API
|
|
155
|
+
|
|
156
|
+
For detailed information about all available item properties, see [Item documentation](../content/Item.md). Key properties include:
|
|
157
|
+
|
|
158
|
+
- **`key`** `string \| number` — Unique identifier for the item (required)
|
|
159
|
+
- **`children`** `ReactNode` — The main content/label for the option
|
|
160
|
+
- **`icon`** `ReactNode` — Icon displayed before the content
|
|
161
|
+
- **`rightIcon`** `ReactNode` — Icon displayed after the content
|
|
162
|
+
- **`description`** `ReactNode` — Secondary text below the main content
|
|
163
|
+
- **`descriptionPlacement`** `'inline' \| 'block'` — How the description is positioned
|
|
164
|
+
- **`prefix`** `ReactNode` — Content before the main text
|
|
165
|
+
- **`suffix`** `ReactNode` — Content after the main text
|
|
166
|
+
- **`tooltip`** `string \| boolean \| object` — Tooltip configuration
|
|
167
|
+
- **`styles`** `Styles` — Custom styling for the item
|
|
168
|
+
- **`qa`** `string` — QA identifier for testing
|
|
169
|
+
|
|
170
|
+
#### Example with Rich Items
|
|
171
|
+
|
|
172
|
+
```jsx
|
|
173
|
+
<Select label="Users">
|
|
174
|
+
<Select.Item
|
|
175
|
+
key="user1"
|
|
176
|
+
icon={<IconUser />}
|
|
177
|
+
description="Administrator"
|
|
178
|
+
>
|
|
179
|
+
John Doe
|
|
180
|
+
</Select.Item>
|
|
181
|
+
<Select.Item
|
|
182
|
+
key="user2"
|
|
183
|
+
icon={<IconUser />}
|
|
184
|
+
description="Editor"
|
|
185
|
+
suffix="Online"
|
|
186
|
+
>
|
|
187
|
+
Jane Smith
|
|
188
|
+
</Select.Item>
|
|
189
|
+
</Select>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Select.Section
|
|
193
|
+
|
|
194
|
+
Groups related options together with an optional heading.
|
|
195
|
+
|
|
196
|
+
- **`title`** `ReactNode` — Optional heading text for the section
|
|
197
|
+
- **`children`** `Select.Item[]` — Collection of Select.Item components
|
|
198
|
+
|
|
199
|
+
## Variants
|
|
200
|
+
|
|
201
|
+
### Themes
|
|
202
|
+
|
|
203
|
+
- `default` - Standard select appearance
|
|
204
|
+
- `special` - Alternative styling for special contexts
|
|
205
|
+
|
|
206
|
+
### Types
|
|
207
|
+
|
|
208
|
+
- `primary` - Primary emphasis styling
|
|
209
|
+
- `secondary` - Secondary emphasis styling
|
|
210
|
+
- `outline` - Outlined appearance
|
|
211
|
+
- `neutral` - Neutral appearance
|
|
212
|
+
- `clear` - Minimal appearance
|
|
213
|
+
- `link` - Link-like appearance
|
|
214
|
+
|
|
215
|
+
### Sizes
|
|
216
|
+
|
|
217
|
+
- `small` - Compact size for dense interfaces
|
|
218
|
+
- `medium` - Standard size for general interfaces (default)
|
|
219
|
+
- `large` - Emphasized size for important selections
|
|
220
|
+
|
|
221
|
+
## Examples
|
|
222
|
+
|
|
223
|
+
### Basic Usage
|
|
224
|
+
|
|
225
|
+
```jsx
|
|
226
|
+
<Select label="Choose an option">
|
|
227
|
+
<Select.Item key="option1">Option 1</Select.Item>
|
|
228
|
+
<Select.Item key="option2">Option 2</Select.Item>
|
|
229
|
+
<Select.Item key="option3">Option 3</Select.Item>
|
|
230
|
+
</Select>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### With Default Value
|
|
234
|
+
|
|
235
|
+
```jsx
|
|
236
|
+
<Select label="Color" defaultSelectedKey="purple">
|
|
237
|
+
<Select.Item key="red">Red</Select.Item>
|
|
238
|
+
<Select.Item key="blue">Blue</Select.Item>
|
|
239
|
+
<Select.Item key="purple">Purple</Select.Item>
|
|
240
|
+
</Select>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### With Placeholder
|
|
244
|
+
|
|
245
|
+
```jsx
|
|
246
|
+
<Select label="Country" placeholder="Select a country">
|
|
247
|
+
<Select.Item key="us">United States</Select.Item>
|
|
248
|
+
<Select.Item key="ca">Canada</Select.Item>
|
|
249
|
+
<Select.Item key="uk">United Kingdom</Select.Item>
|
|
250
|
+
</Select>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Clearable
|
|
254
|
+
|
|
255
|
+
```jsx
|
|
256
|
+
<Select
|
|
257
|
+
isClearable
|
|
258
|
+
label="Color"
|
|
259
|
+
defaultSelectedKey="blue"
|
|
260
|
+
placeholder="Choose a color..."
|
|
261
|
+
>
|
|
262
|
+
<Select.Item key="red">Red</Select.Item>
|
|
263
|
+
<Select.Item key="blue">Blue</Select.Item>
|
|
264
|
+
<Select.Item key="green">Green</Select.Item>
|
|
265
|
+
</Select>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Validation States
|
|
269
|
+
|
|
270
|
+
```jsx
|
|
271
|
+
{/* Valid state */}
|
|
272
|
+
<Select
|
|
273
|
+
label="Validated field"
|
|
274
|
+
selectedKey="yes"
|
|
275
|
+
validationState="valid"
|
|
276
|
+
>
|
|
277
|
+
<Select.Item key="yes">Yes</Select.Item>
|
|
278
|
+
<Select.Item key="no">No</Select.Item>
|
|
279
|
+
</Select>
|
|
280
|
+
|
|
281
|
+
{/* Invalid state */}
|
|
282
|
+
<Select
|
|
283
|
+
label="Required field"
|
|
284
|
+
validationState="invalid"
|
|
285
|
+
errorMessage="Please select an option"
|
|
286
|
+
>
|
|
287
|
+
<Select.Item key="yes">Yes</Select.Item>
|
|
288
|
+
<Select.Item key="no">No</Select.Item>
|
|
289
|
+
</Select>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Disabled State
|
|
293
|
+
|
|
294
|
+
```jsx
|
|
295
|
+
<Select
|
|
296
|
+
isDisabled
|
|
297
|
+
label="Disabled select"
|
|
298
|
+
selectedKey="option1"
|
|
299
|
+
>
|
|
300
|
+
<Select.Item key="option1">Cannot change</Select.Item>
|
|
301
|
+
<Select.Item key="option2">Option 2</Select.Item>
|
|
302
|
+
</Select>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### With Icon
|
|
306
|
+
|
|
307
|
+
```jsx
|
|
308
|
+
<Select label="Currency" icon={<IconCoin />}>
|
|
309
|
+
<Select.Item key="usd">USD</Select.Item>
|
|
310
|
+
<Select.Item key="eur">EUR</Select.Item>
|
|
311
|
+
<Select.Item key="gbp">GBP</Select.Item>
|
|
312
|
+
</Select>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### With Description
|
|
316
|
+
|
|
317
|
+
```jsx
|
|
318
|
+
<Select placeholder="Select a color" listBoxStyles={{ width: 'max 30x' }}>
|
|
319
|
+
<Select.Item key="red" description="The color of fire">
|
|
320
|
+
Red
|
|
321
|
+
</Select.Item>
|
|
322
|
+
<Select.Item key="green" description="The color of nature">
|
|
323
|
+
Green
|
|
324
|
+
</Select.Item>
|
|
325
|
+
<Select.Item key="blue" description="The color of the sky">
|
|
326
|
+
Blue
|
|
327
|
+
</Select.Item>
|
|
328
|
+
</Select>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### With Icons and Descriptions
|
|
332
|
+
|
|
333
|
+
```jsx
|
|
334
|
+
<Select placeholder="Select a color">
|
|
335
|
+
<Select.Item
|
|
336
|
+
key="yellow"
|
|
337
|
+
description="Child and light"
|
|
338
|
+
icon={<IconUser />}
|
|
339
|
+
>
|
|
340
|
+
Yellow
|
|
341
|
+
</Select.Item>
|
|
342
|
+
<Select.Item
|
|
343
|
+
key="red"
|
|
344
|
+
description="Hot and strong"
|
|
345
|
+
prefix={<span>🔥</span>}
|
|
346
|
+
>
|
|
347
|
+
Red
|
|
348
|
+
</Select.Item>
|
|
349
|
+
<Select.Item
|
|
350
|
+
key="green"
|
|
351
|
+
description="Fresh and calm"
|
|
352
|
+
suffix={<Text color="#dark-03">#00A000</Text>}
|
|
353
|
+
>
|
|
354
|
+
Green
|
|
355
|
+
</Select.Item>
|
|
356
|
+
</Select>
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### With Sections (Static)
|
|
360
|
+
|
|
361
|
+
```jsx
|
|
362
|
+
<Select placeholder="Pick something">
|
|
363
|
+
<Select.Section title="Warm colors">
|
|
364
|
+
<Select.Item key="red">Red</Select.Item>
|
|
365
|
+
<Select.Item key="orange">Orange</Select.Item>
|
|
366
|
+
<Select.Item key="yellow">Yellow</Select.Item>
|
|
367
|
+
</Select.Section>
|
|
368
|
+
<Select.Section title="Cool colors">
|
|
369
|
+
<Select.Item key="blue">Blue</Select.Item>
|
|
370
|
+
<Select.Item key="purple">Purple</Select.Item>
|
|
371
|
+
</Select.Section>
|
|
372
|
+
</Select>
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### With Sections (Dynamic)
|
|
376
|
+
|
|
377
|
+
```jsx
|
|
378
|
+
const groups = [
|
|
379
|
+
{
|
|
380
|
+
name: 'Fruits',
|
|
381
|
+
children: [
|
|
382
|
+
{ id: 'apple', label: 'Apple' },
|
|
383
|
+
{ id: 'orange', label: 'Orange' },
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: 'Vegetables',
|
|
388
|
+
children: [
|
|
389
|
+
{ id: 'carrot', label: 'Carrot' },
|
|
390
|
+
{ id: 'peas', label: 'Peas' },
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
];
|
|
394
|
+
|
|
395
|
+
<Select items={groups} placeholder="Choose an item">
|
|
396
|
+
{(group) => (
|
|
397
|
+
<Select.Section key={group.name} title={group.name} items={group.children}>
|
|
398
|
+
{(item) => <Select.Item key={item.id}>{item.label}</Select.Item>}
|
|
399
|
+
</Select.Section>
|
|
400
|
+
)}
|
|
401
|
+
</Select>
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### With Tooltips
|
|
405
|
+
|
|
406
|
+
```jsx
|
|
407
|
+
<Select placeholder="Choose a framework">
|
|
408
|
+
<Select.Item
|
|
409
|
+
key="react"
|
|
410
|
+
tooltip="React - A JavaScript library for building user interfaces"
|
|
411
|
+
>
|
|
412
|
+
React
|
|
413
|
+
</Select.Item>
|
|
414
|
+
<Select.Item
|
|
415
|
+
key="vue"
|
|
416
|
+
tooltip={{ title: 'Vue.js Framework' }}
|
|
417
|
+
>
|
|
418
|
+
Vue.js
|
|
419
|
+
</Select.Item>
|
|
420
|
+
<Select.Item
|
|
421
|
+
key="angular"
|
|
422
|
+
tooltip="Angular - Platform for building mobile and desktop web applications"
|
|
423
|
+
>
|
|
424
|
+
Angular
|
|
425
|
+
</Select.Item>
|
|
426
|
+
</Select>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### With Disabled Items
|
|
430
|
+
|
|
431
|
+
```jsx
|
|
432
|
+
<Select disabledKeys={['red']}>
|
|
433
|
+
<Select.Item key="red">Red (disabled)</Select.Item>
|
|
434
|
+
<Select.Item key="blue">Blue</Select.Item>
|
|
435
|
+
<Select.Item key="green">Green</Select.Item>
|
|
436
|
+
</Select>
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## Accessibility
|
|
440
|
+
|
|
441
|
+
### Keyboard Navigation
|
|
442
|
+
|
|
443
|
+
- `Tab` - Moves focus to the select
|
|
444
|
+
- `Space/Enter` - Opens the dropdown
|
|
445
|
+
- `Arrow Down` - Opens dropdown and moves to first/next option
|
|
446
|
+
- `Arrow Up` - Moves to previous option (when open)
|
|
447
|
+
- `Home` - Moves to first option
|
|
448
|
+
- `End` - Moves to last option
|
|
449
|
+
- `Escape` - Closes dropdown without selecting
|
|
450
|
+
- `Enter` - Selects focused option and closes dropdown
|
|
451
|
+
- Typing - Navigates to options starting with typed character
|
|
452
|
+
|
|
453
|
+
### Screen Reader Support
|
|
454
|
+
|
|
455
|
+
- Component announces as "combobox" or "listbox" to screen readers
|
|
456
|
+
- Current selection is announced when changed
|
|
457
|
+
- Available options are announced during navigation
|
|
458
|
+
- Dropdown state (open/closed) is communicated
|
|
459
|
+
|
|
460
|
+
### ARIA Properties
|
|
461
|
+
|
|
462
|
+
- `aria-label` - Provides accessible label when no visible label exists
|
|
463
|
+
- `aria-labelledby` - References external label elements
|
|
464
|
+
- `aria-describedby` - References additional descriptive text
|
|
465
|
+
- `aria-expanded` - Indicates if dropdown is open
|
|
466
|
+
- `aria-activedescendant` - References the currently focused option
|
|
467
|
+
- `aria-required` - Indicates if selection is required
|
|
468
|
+
- `aria-invalid` - Indicates validation state
|
|
469
|
+
|
|
470
|
+
## Best Practices
|
|
471
|
+
|
|
472
|
+
1. **Do**: Provide clear, descriptive labels and meaningful option text
|
|
473
|
+
```jsx
|
|
474
|
+
<Select label="Shipping method">
|
|
475
|
+
<Select.Item key="standard">Standard (5-7 days)</Select.Item>
|
|
476
|
+
<Select.Item key="express">Express (2-3 days)</Select.Item>
|
|
477
|
+
</Select>
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
2. **Don't**: Use select for very long lists (use ComboBox or FilterPicker with search instead)
|
|
481
|
+
```jsx
|
|
482
|
+
{/* Consider ComboBox or FilterPicker for 50+ options */}
|
|
483
|
+
<Select label="Country">
|
|
484
|
+
{/* 100+ countries... */}
|
|
485
|
+
</Select>
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
3. **Do**: Use sections to group related options logically
|
|
489
|
+
```jsx
|
|
490
|
+
<Select label="Category">
|
|
491
|
+
<Select.Section title="Popular">
|
|
492
|
+
<Select.Item key="featured1">Featured Option 1</Select.Item>
|
|
493
|
+
</Select.Section>
|
|
494
|
+
<Select.Section title="All Options">
|
|
495
|
+
<Select.Item key="all1">All Option 1</Select.Item>
|
|
496
|
+
</Select.Section>
|
|
497
|
+
</Select>
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
4. **Do**: Provide clear error messages for validation failures
|
|
501
|
+
```jsx
|
|
502
|
+
<Select
|
|
503
|
+
isRequired
|
|
504
|
+
validationState="invalid"
|
|
505
|
+
errorMessage="Please select a shipping method"
|
|
506
|
+
label="Shipping"
|
|
507
|
+
>
|
|
508
|
+
<Select.Item key="standard">Standard</Select.Item>
|
|
509
|
+
</Select>
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
5. **Do**: Consider providing sensible defaults when appropriate
|
|
513
|
+
```jsx
|
|
514
|
+
<Select label="Language" defaultSelectedKey="en">
|
|
515
|
+
<Select.Item key="en">English</Select.Item>
|
|
516
|
+
<Select.Item key="es">Spanish</Select.Item>
|
|
517
|
+
</Select>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
6. **Do**: Show loading state when options are being fetched
|
|
521
|
+
```jsx
|
|
522
|
+
<Select isLoading label="Categories" placeholder="Loading...">
|
|
523
|
+
{categories.map(cat => <Select.Item key={cat.id}>{cat.name}</Select.Item>)}
|
|
524
|
+
</Select>
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
7. **Accessibility**: Always provide meaningful labels
|
|
528
|
+
```jsx
|
|
529
|
+
<Select label="Country" aria-label="Select your country">
|
|
530
|
+
<Select.Item key="us">United States</Select.Item>
|
|
531
|
+
</Select>
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
8. **Clearable**: Use `isClearable` for optional selections
|
|
535
|
+
```jsx
|
|
536
|
+
<Select isClearable label="Filter by status" placeholder="All statuses">
|
|
537
|
+
<Select.Item key="active">Active</Select.Item>
|
|
538
|
+
<Select.Item key="inactive">Inactive</Select.Item>
|
|
539
|
+
</Select>
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
## Integration with Forms
|
|
543
|
+
|
|
544
|
+
This component supports all [Field properties](../../FieldProperties.md) when used within a Form. It integrates seamlessly with the form validation system and supports both controlled and uncontrolled modes.
|
|
545
|
+
|
|
546
|
+
```jsx
|
|
547
|
+
<Form>
|
|
548
|
+
<Select
|
|
549
|
+
name="country"
|
|
550
|
+
label="Country"
|
|
551
|
+
isRequired
|
|
552
|
+
validationBehavior="native"
|
|
553
|
+
>
|
|
554
|
+
<Select.Item key="us">United States</Select.Item>
|
|
555
|
+
<Select.Item key="uk">United Kingdom</Select.Item>
|
|
556
|
+
<Select.Item key="ca">Canada</Select.Item>
|
|
557
|
+
</Select>
|
|
558
|
+
</Form>
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
## Suggested Improvements
|
|
562
|
+
|
|
563
|
+
- Add support for multi-selection mode with visual badges
|
|
564
|
+
- Implement virtual scrolling for very large option lists (1000+ items)
|
|
565
|
+
- Built-in async loading support with loading states per scroll position
|
|
566
|
+
- Enhanced keyboard shortcuts for power users (e.g., type to jump to option)
|
|
567
|
+
- Custom empty state component when no options are available
|
|
568
|
+
- Support for option groups with visual separators beyond sections
|
|
569
|
+
|
|
570
|
+
## Related Components
|
|
571
|
+
|
|
572
|
+
- [ComboBox](./ComboBox.md) - For searchable selection with filtering capabilities
|
|
573
|
+
- [FilterPicker](./FilterPicker.md) - Alternative with different interaction patterns
|
|
574
|
+
- [ListBox](./ListBox.md) - The underlying list component used in Select
|
|
575
|
+
- [RadioGroup](./RadioGroup.md) - For visible selection options with fewer choices
|
|
576
|
+
- [Item](../content/Item.md) - The base component used for rendering items
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
<Badge variant="neutral">Form component</Badge>
|
|
4
|
+
|
|
5
|
+
The Slider component allows users to select a numeric value from a range by dragging a thumb along a track. It provides an intuitive way to input values that fall within a specific range.
|
|
6
|
+
|
|
7
|
+
## Examples
|
|
8
|
+
|
|
9
|
+
### With Label
|
|
10
|
+
|
|
11
|
+
### Without Value Label
|
|
12
|
+
|
|
13
|
+
### Custom Value Formatting
|
|
14
|
+
|
|
15
|
+
### Vertical Orientation
|
|
16
|
+
|
|
17
|
+
### Disabled State
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
## Sub-elements
|
|
22
|
+
|
|
23
|
+
The Slider component renders the following sub-elements that can be customized via the `styles` prop:
|
|
24
|
+
|
|
25
|
+
- **SliderControls**: The container for the track and thumb
|
|
26
|
+
- **SliderTrackContainer**: The track background and range fill
|
|
27
|
+
- **SliderThumb**: The draggable thumb element
|
|
28
|
+
- **SliderGradation**: Container for gradation marks
|
|
29
|
+
- **SliderGrade**: Individual gradation mark
|
|
30
|
+
|
|
31
|
+
## Style Properties
|
|
32
|
+
|
|
33
|
+
The Slider component supports all standard style properties:
|
|
34
|
+
|
|
35
|
+
`display`, `font`, `preset`, `hide`, `opacity`, `whiteSpace`, `gridArea`, `order`, `gridColumn`, `gridRow`, `placeSelf`, `alignSelf`, `justifySelf`, `zIndex`, `margin`, `inset`, `position`, `width`, `height`, `flexBasis`, `flexGrow`, `flexShrink`, `flex`, `reset`, `padding`, `paddingInline`, `paddingBlock`, `shadow`, `border`, `radius`, `overflow`, `scrollbar`, `outline`, `textAlign`, `color`, `fill`, `fade`, `textTransform`, `fontWeight`, `fontStyle`, `flow`, `placeItems`, `placeContent`, `alignItems`, `alignContent`, `justifyItems`, `justifyContent`, `align`, `justify`, `gap`, `columnGap`, `rowGap`, `gridColumns`, `gridRows`, `gridTemplate`, `gridAreas`
|
|
36
|
+
|
|
37
|
+
## Accessibility
|
|
38
|
+
|
|
39
|
+
The Slider component follows WAI-ARIA guidelines:
|
|
40
|
+
|
|
41
|
+
- Uses appropriate ARIA roles and properties for slider interaction
|
|
42
|
+
- Supports keyboard navigation with arrow keys
|
|
43
|
+
- Provides clear focus indicators
|
|
44
|
+
- Associates labels with the input element
|
|
45
|
+
- Includes proper value announcements for screen readers
|
|
46
|
+
|
|
47
|
+
## Best Practices
|
|
48
|
+
|
|
49
|
+
- Use descriptive labels that clearly indicate what the slider controls
|
|
50
|
+
- Consider providing gradation marks for better value reference
|
|
51
|
+
- Set appropriate min, max, and step values for your use case
|
|
52
|
+
- Use custom value formatting when the raw numeric value isn't user-friendly
|
|
53
|
+
- Consider the orientation based on your layout and user expectations
|