@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,422 @@
|
|
|
1
|
+
# CommandMenu
|
|
2
|
+
|
|
3
|
+
A searchable menu interface that combines the functionality of Menu and ListBox components. It provides a command-line-like experience for users to quickly find and execute actions through a searchable interface.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- **Quick action access**: Enable users to quickly find and execute commands or actions
|
|
8
|
+
- **Large command sets**: When you have many available actions that benefit from search filtering
|
|
9
|
+
- **Keyboard-first workflows**: For power users who prefer keyboard navigation
|
|
10
|
+
- **Command-line interfaces**: When building developer tools or admin interfaces
|
|
11
|
+
- **Global search**: As a global command palette accessible via keyboard shortcuts
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default Usage
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
- **`searchPlaceholder`** (default: `Search commands...`) — Placeholder text for the search input
|
|
20
|
+
- **`searchValue`** — The search value in controlled mode
|
|
21
|
+
- **`onSearchChange`** `function` — Callback fired when search value changes
|
|
22
|
+
- **`filter`** — Custom filter function for search
|
|
23
|
+
- **`emptyLabel`** (default: `No commands found`) — Label to show when no results are found
|
|
24
|
+
- **`searchInputStyles`** — Custom styles for the search input
|
|
25
|
+
- **`isLoading`** (default: `false`) — Whether the command palette is loading
|
|
26
|
+
- **`shouldFilter`** (default: `true`) — Whether to filter items based on search
|
|
27
|
+
- **`autoFocus`** (default: `true`) — Whether to auto-focus the search input
|
|
28
|
+
- **`onAction`** `function` — Callback fired when an item is selected
|
|
29
|
+
- **`onSelectionChange`** `function` — Callback fired when selection changes
|
|
30
|
+
- **`selectionMode`** `'none' | 'single' | 'multiple'` (default: `none`) — Selection mode for the command palette
|
|
31
|
+
- **`isDisabled`** — Whether the command palette is disabled
|
|
32
|
+
- **`size`** `string` (default: `medium`) — Size of the command menu component
|
|
33
|
+
- **`styles`** — Custom styles for the command palette container
|
|
34
|
+
|
|
35
|
+
## Styling
|
|
36
|
+
|
|
37
|
+
### Style Props
|
|
38
|
+
|
|
39
|
+
The CommandMenu component supports all standard style properties:
|
|
40
|
+
|
|
41
|
+
- **Layout**: `width`, `height`, `padding`, `margin`
|
|
42
|
+
- **Positioning**: `position`, `top`, `left`, `right`, `bottom`
|
|
43
|
+
- **Flexbox**: `flex`, `alignSelf`, `justifySelf`
|
|
44
|
+
- **Grid**: `gridArea`, `gridColumn`, `gridRow`
|
|
45
|
+
- **Spacing**: `gap`, `rowGap`, `columnGap`
|
|
46
|
+
- **Sizing**: `minWidth`, `maxWidth`, `minHeight`, `maxHeight`
|
|
47
|
+
|
|
48
|
+
### Sub-elements
|
|
49
|
+
|
|
50
|
+
The CommandMenu component has several sub-elements that can be styled:
|
|
51
|
+
|
|
52
|
+
- `SearchWrapper` - Container for the search input area
|
|
53
|
+
- `SearchInput` - The search input field specifically
|
|
54
|
+
- `SearchIcon` - The search/loading icon
|
|
55
|
+
- `LoadingWrapper` - Container for loading state
|
|
56
|
+
- `EmptyState` - Container for empty state message
|
|
57
|
+
- `MenuWrapper` - Container for the menu content
|
|
58
|
+
|
|
59
|
+
#### searchInputStyles
|
|
60
|
+
|
|
61
|
+
Customizes the search input field specifically.
|
|
62
|
+
|
|
63
|
+
### Modifiers
|
|
64
|
+
|
|
65
|
+
The CommandMenu component supports the following modifiers:
|
|
66
|
+
|
|
67
|
+
- **`loading`** `boolean` — Whether the command palette is in loading state
|
|
68
|
+
|
|
69
|
+
## Sub-components
|
|
70
|
+
|
|
71
|
+
### CommandMenu.Item
|
|
72
|
+
|
|
73
|
+
Individual menu items within the CommandMenu. Each item is rendered using [Item](../content/Item.md) and supports all Item properties for layout, icons, descriptions, and interactive features.
|
|
74
|
+
|
|
75
|
+
For detailed information about all available item properties, see the [Menu.Item documentation](./Menu.md#sub-components) which provides the complete API reference. Key properties include:
|
|
76
|
+
|
|
77
|
+
- **`key`** `Key` — Unique identifier for the item (required)
|
|
78
|
+
- **`children`** `ReactNode` — The main content/label for the menu item
|
|
79
|
+
- **`icon`** `ReactNode` — Icon displayed before the content
|
|
80
|
+
- **`rightIcon`** `ReactNode` — Icon displayed after the content
|
|
81
|
+
- **`description`** `ReactNode` — Secondary text below the main content
|
|
82
|
+
- **`prefix`** `ReactNode` — Content before the main text
|
|
83
|
+
- **`suffix`** `ReactNode` — Content after the main text
|
|
84
|
+
- **`hotkeys`** `string` — Keyboard shortcut that triggers this item
|
|
85
|
+
- **`tooltip`** `string | boolean | object` — Tooltip configuration
|
|
86
|
+
- **`isDisabled`** `boolean` — Whether the item is disabled
|
|
87
|
+
- **`onAction`** `() => void` — Callback fired when item is activated
|
|
88
|
+
|
|
89
|
+
#### CommandMenu-specific Properties
|
|
90
|
+
|
|
91
|
+
- **`keywords`** `string[]` — Additional search terms for better discoverability
|
|
92
|
+
- **`forceMount`** `boolean` — Whether to always show this item regardless of search filter
|
|
93
|
+
- **`textValue`** `string` — Text value for search filtering (if different from children)
|
|
94
|
+
|
|
95
|
+
#### Example with Enhanced Search
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
<CommandMenu searchPlaceholder="Search commands...">
|
|
99
|
+
<CommandMenu.Item
|
|
100
|
+
key="save"
|
|
101
|
+
icon={<IconSave />}
|
|
102
|
+
hotkeys="cmd+s"
|
|
103
|
+
keywords={["write", "disk", "persist"]}
|
|
104
|
+
description="Save the current document"
|
|
105
|
+
>
|
|
106
|
+
Save Document
|
|
107
|
+
</CommandMenu.Item>
|
|
108
|
+
<CommandMenu.Item
|
|
109
|
+
key="help"
|
|
110
|
+
icon={<IconHelp />}
|
|
111
|
+
forceMount={true}
|
|
112
|
+
description="Always visible help option"
|
|
113
|
+
>
|
|
114
|
+
Help & Support
|
|
115
|
+
</CommandMenu.Item>
|
|
116
|
+
</CommandMenu>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### CommandMenu.Section
|
|
120
|
+
|
|
121
|
+
Groups related items together with an optional heading. Same as Menu.Section - see [Menu documentation](./Menu.md#sub-components) for full details.
|
|
122
|
+
|
|
123
|
+
- **`title`** `ReactNode` — Optional heading text for the section
|
|
124
|
+
- **`children`** `CommandMenu.Item[]` — Collection of CommandMenu.Item components
|
|
125
|
+
|
|
126
|
+
### CommandMenu.Trigger
|
|
127
|
+
|
|
128
|
+
Alias for MenuTrigger component. See [Menu.Trigger documentation](./Menu.md#menu-trigger) for full API reference.
|
|
129
|
+
|
|
130
|
+
## Accessibility
|
|
131
|
+
|
|
132
|
+
### Keyboard Navigation
|
|
133
|
+
|
|
134
|
+
The CommandMenu component provides comprehensive keyboard support:
|
|
135
|
+
|
|
136
|
+
- **Search Input Focus**: The search input is automatically focused when the palette opens
|
|
137
|
+
- **Arrow Keys**: Navigate through filtered options while keeping search input focused
|
|
138
|
+
- **Enter**: Select the currently highlighted option
|
|
139
|
+
- **Escape**: Clear search term or close the palette
|
|
140
|
+
- **Tab**: Navigate between focusable elements
|
|
141
|
+
|
|
142
|
+
### Screen Reader Support
|
|
143
|
+
|
|
144
|
+
- Proper ARIA roles and labels for search and menu functionality
|
|
145
|
+
- Live region announcements for state changes
|
|
146
|
+
- Support for `aria-activedescendant` for virtual focus
|
|
147
|
+
- Descriptive labels for loading and empty states
|
|
148
|
+
|
|
149
|
+
### Focus Management
|
|
150
|
+
|
|
151
|
+
- Search input maintains focus during keyboard navigation
|
|
152
|
+
- Virtual focus pattern for menu items
|
|
153
|
+
- Proper focus restoration when closing
|
|
154
|
+
|
|
155
|
+
## Usage Patterns
|
|
156
|
+
|
|
157
|
+
### Basic Usage
|
|
158
|
+
|
|
159
|
+
```jsx
|
|
160
|
+
<CommandMenu searchPlaceholder="Search commands...">
|
|
161
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
162
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
163
|
+
<Menu.Item key="cut">Cut</Menu.Item>
|
|
164
|
+
</CommandMenu>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### With MenuTrigger
|
|
168
|
+
|
|
169
|
+
```jsx
|
|
170
|
+
<CommandMenu.Trigger>
|
|
171
|
+
<Button>Open Commands</Button>
|
|
172
|
+
<CommandMenu searchPlaceholder="Search commands...">
|
|
173
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
174
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
175
|
+
</CommandMenu>
|
|
176
|
+
</CommandMenu.Trigger>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### With Sections and Keywords
|
|
180
|
+
|
|
181
|
+
```jsx
|
|
182
|
+
<CommandMenu searchPlaceholder="Search commands...">
|
|
183
|
+
<Menu.Section title="Edit">
|
|
184
|
+
<Menu.Item key="copy" keywords={["duplicate", "clone"]}>
|
|
185
|
+
Copy
|
|
186
|
+
</Menu.Item>
|
|
187
|
+
<Menu.Item key="paste" keywords={["insert"]}>
|
|
188
|
+
Paste
|
|
189
|
+
</Menu.Item>
|
|
190
|
+
</Menu.Section>
|
|
191
|
+
<Menu.Section title="View">
|
|
192
|
+
<Menu.Item key="zoom-in" keywords={["magnify", "enlarge"]}>
|
|
193
|
+
Zoom In
|
|
194
|
+
</Menu.Item>
|
|
195
|
+
</Menu.Section>
|
|
196
|
+
</CommandMenu>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Controlled Search
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
const [searchValue, setSearchValue] = useState('');
|
|
203
|
+
|
|
204
|
+
<CommandMenu
|
|
205
|
+
searchValue={searchValue}
|
|
206
|
+
onSearchChange={setSearchValue}
|
|
207
|
+
searchPlaceholder="Type to search..."
|
|
208
|
+
>
|
|
209
|
+
<Menu.Item key="action1">Action 1</Menu.Item>
|
|
210
|
+
<Menu.Item key="action2">Action 2</Menu.Item>
|
|
211
|
+
</CommandMenu>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### With Loading State
|
|
215
|
+
|
|
216
|
+
```jsx
|
|
217
|
+
<CommandMenu
|
|
218
|
+
isLoading={isLoading}
|
|
219
|
+
searchPlaceholder="Search commands..."
|
|
220
|
+
>
|
|
221
|
+
{commands.map(command => (
|
|
222
|
+
<Menu.Item key={command.id}>
|
|
223
|
+
{command.name}
|
|
224
|
+
</Menu.Item>
|
|
225
|
+
))}
|
|
226
|
+
</CommandMenu>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Custom Filtering
|
|
230
|
+
|
|
231
|
+
```jsx
|
|
232
|
+
<CommandMenu
|
|
233
|
+
filter={(textValue, inputValue) => {
|
|
234
|
+
// Custom fuzzy search logic
|
|
235
|
+
return textValue.toLowerCase().includes(inputValue.toLowerCase());
|
|
236
|
+
}}
|
|
237
|
+
searchPlaceholder="Fuzzy search..."
|
|
238
|
+
>
|
|
239
|
+
<Menu.Item key="action1">Action 1</Menu.Item>
|
|
240
|
+
<Menu.Item key="action2">Action 2</Menu.Item>
|
|
241
|
+
</CommandMenu>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Force Mount Items
|
|
245
|
+
|
|
246
|
+
```jsx
|
|
247
|
+
<CommandMenu searchPlaceholder="Search commands...">
|
|
248
|
+
<Menu.Item key="help" forceMount>
|
|
249
|
+
Help (always visible)
|
|
250
|
+
</Menu.Item>
|
|
251
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
252
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
253
|
+
</CommandMenu>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### With Selection
|
|
257
|
+
|
|
258
|
+
```jsx
|
|
259
|
+
const [selectedKeys, setSelectedKeys] = useState(['copy']);
|
|
260
|
+
|
|
261
|
+
<CommandMenu
|
|
262
|
+
selectionMode="single"
|
|
263
|
+
selectedKeys={selectedKeys}
|
|
264
|
+
onSelectionChange={setSelectedKeys}
|
|
265
|
+
searchPlaceholder="Select commands..."
|
|
266
|
+
>
|
|
267
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
268
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
269
|
+
<Menu.Item key="cut">Cut</Menu.Item>
|
|
270
|
+
</CommandMenu>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Multiple Selection
|
|
274
|
+
|
|
275
|
+
```jsx
|
|
276
|
+
const [selectedKeys, setSelectedKeys] = useState(['copy', 'paste']);
|
|
277
|
+
|
|
278
|
+
<CommandMenu
|
|
279
|
+
selectionMode="multiple"
|
|
280
|
+
selectedKeys={selectedKeys}
|
|
281
|
+
onSelectionChange={setSelectedKeys}
|
|
282
|
+
searchPlaceholder="Select multiple commands..."
|
|
283
|
+
>
|
|
284
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
285
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
286
|
+
<Menu.Item key="cut">Cut</Menu.Item>
|
|
287
|
+
</CommandMenu>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### With DialogTrigger
|
|
291
|
+
|
|
292
|
+
Use CommandMenu inside a Dialog with DialogTrigger for modal command palette functionality:
|
|
293
|
+
|
|
294
|
+
```jsx
|
|
295
|
+
<DialogTrigger>
|
|
296
|
+
<Button>Open Command Menu</Button>
|
|
297
|
+
<Dialog size="medium" isDismissable={false}>
|
|
298
|
+
<CommandMenu width="100%" height="max(40x, 90vh)" size="medium" searchPlaceholder="Search commands...">
|
|
299
|
+
<Menu.Item key="copy" description="Copy selected text" hotkeys="Ctrl+C">
|
|
300
|
+
Copy
|
|
301
|
+
</Menu.Item>
|
|
302
|
+
<Menu.Item key="paste" description="Paste from clipboard" hotkeys="Ctrl+V">
|
|
303
|
+
Paste
|
|
304
|
+
</Menu.Item>
|
|
305
|
+
<Menu.Item key="cut" description="Cut selected text" hotkeys="Ctrl+X">
|
|
306
|
+
Cut
|
|
307
|
+
</Menu.Item>
|
|
308
|
+
</CommandMenu>
|
|
309
|
+
</Dialog>
|
|
310
|
+
</DialogTrigger>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### With useDialogContainer Hook
|
|
314
|
+
|
|
315
|
+
For programmatic control over the command menu dialog:
|
|
316
|
+
|
|
317
|
+
```jsx
|
|
318
|
+
import { useDialogContainer } from '@cube-dev/ui-kit';
|
|
319
|
+
|
|
320
|
+
function CommandMenuDialogContent({ onClose, ...args }) {
|
|
321
|
+
const handleAction = (key) => {
|
|
322
|
+
console.log('Action selected:', key);
|
|
323
|
+
onClose();
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
<Dialog size="medium" isDismissable={false}>
|
|
328
|
+
<CommandMenu
|
|
329
|
+
width="100%"
|
|
330
|
+
height="max(40x, 90vh)"
|
|
331
|
+
size="medium"
|
|
332
|
+
onAction={handleAction}
|
|
333
|
+
{...args}
|
|
334
|
+
>
|
|
335
|
+
<Menu.Item key="copy" description="Copy selected text" hotkeys="Ctrl+C">
|
|
336
|
+
Copy
|
|
337
|
+
</Menu.Item>
|
|
338
|
+
<Menu.Item key="paste" description="Paste from clipboard" hotkeys="Ctrl+V">
|
|
339
|
+
Paste
|
|
340
|
+
</Menu.Item>
|
|
341
|
+
<Menu.Item key="cut" description="Cut selected text" hotkeys="Ctrl+X">
|
|
342
|
+
Cut
|
|
343
|
+
</Menu.Item>
|
|
344
|
+
</CommandMenu>
|
|
345
|
+
</Dialog>
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function App() {
|
|
350
|
+
const dialog = useDialogContainer(CommandMenuDialogContent);
|
|
351
|
+
|
|
352
|
+
const handleOpenDialog = () => {
|
|
353
|
+
dialog.open({
|
|
354
|
+
searchPlaceholder: 'Search commands...',
|
|
355
|
+
autoFocus: true,
|
|
356
|
+
onClose: dialog.close,
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
return (
|
|
361
|
+
<div>
|
|
362
|
+
<Button onPress={handleOpenDialog}>Open Command Menu</Button>
|
|
363
|
+
{dialog.rendered}
|
|
364
|
+
</div>
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Advanced Features
|
|
370
|
+
|
|
371
|
+
### Enhanced Search
|
|
372
|
+
|
|
373
|
+
The CommandMenu supports enhanced search capabilities:
|
|
374
|
+
|
|
375
|
+
- **Keywords**: Items can include additional keywords for better discoverability
|
|
376
|
+
- **Custom values**: Items can have custom search values separate from display text
|
|
377
|
+
- **Force mount**: Certain items can always be visible regardless of search filter
|
|
378
|
+
- **Custom filtering**: Override the default search algorithm with custom logic
|
|
379
|
+
|
|
380
|
+
## Best Practices
|
|
381
|
+
|
|
382
|
+
### Do's
|
|
383
|
+
|
|
384
|
+
- **Provide clear placeholders**: Use descriptive placeholder text that indicates what users can search for
|
|
385
|
+
- **Use keywords**: Add relevant keywords to items for better discoverability
|
|
386
|
+
- **Group related commands**: Use sections to organize commands logically
|
|
387
|
+
- **Handle loading states**: Show loading indicators for async operations
|
|
388
|
+
- **Provide keyboard shortcuts**: Include hotkey hints in menu items when applicable
|
|
389
|
+
|
|
390
|
+
### Don'ts
|
|
391
|
+
|
|
392
|
+
- **Don't overload with options**: Too many commands can overwhelm users even with search
|
|
393
|
+
- **Don't use for simple menus**: Use regular Menu component for small, static option sets
|
|
394
|
+
- **Don't ignore empty states**: Always provide helpful empty state messages
|
|
395
|
+
- **Don't disable search**: The search functionality is core to the component's purpose
|
|
396
|
+
|
|
397
|
+
## Related Components
|
|
398
|
+
|
|
399
|
+
- [Menu](./Menu.md) - For static menu options without search
|
|
400
|
+
- [ListBox](../fields/ListBox.md) - For searchable selection lists
|
|
401
|
+
- [Dialog](../overlays/Dialog.md) - For modal command palette usage
|
|
402
|
+
- [MenuTrigger](./Menu.md) - For trigger-based command palette usage
|
|
403
|
+
|
|
404
|
+
## Technical Notes
|
|
405
|
+
|
|
406
|
+
### Performance
|
|
407
|
+
|
|
408
|
+
- The component uses efficient filtering with React Stately's collection system
|
|
409
|
+
- Search filtering is debounced to prevent excessive re-renders
|
|
410
|
+
- Virtual focus is used to maintain performance with large option sets
|
|
411
|
+
|
|
412
|
+
### Accessibility Compliance
|
|
413
|
+
|
|
414
|
+
- Meets WCAG 2.1 AA standards for keyboard navigation
|
|
415
|
+
- Supports screen readers with proper ARIA attributes
|
|
416
|
+
- Implements virtual focus pattern for optimal accessibility
|
|
417
|
+
|
|
418
|
+
### Browser Support
|
|
419
|
+
|
|
420
|
+
- Modern browsers with ES2018+ support
|
|
421
|
+
- Requires React 18+ for concurrent features
|
|
422
|
+
- Uses React Aria for cross-browser accessibility
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ItemAction
|
|
2
|
+
|
|
3
|
+
A compact action button designed for use inside `Item`, `ItemButton`, and `ItemCard`. Automatically inherits `type` and `theme` from its parent context.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Row actions in lists (edit, delete, etc.)
|
|
8
|
+
- Card action buttons
|
|
9
|
+
- Inline actions that inherit context from parent
|
|
10
|
+
|
|
11
|
+
## Component
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
- **`icon`** `ReactNode | 'checkbox'` — Icon element or `'checkbox'` for a selection indicator
|
|
18
|
+
- **`type`** `'primary' | 'secondary' | 'outline' | 'neutral' | 'clear'` (default: `'neutral'`) — Visual type. Inherits from parent context.
|
|
19
|
+
- **`theme`** `'default' | 'danger' | 'success' | 'warning' | 'note' | 'special'` (default: `'default'`) — Color theme. Inherits from parent context.
|
|
20
|
+
- **`isLoading`** `boolean` (default: `false`) — Shows loading spinner
|
|
21
|
+
- **`isSelected`** `boolean` (default: `false`) — Selected state (works with `icon="checkbox"`)
|
|
22
|
+
- **`isDisabled`** `boolean` (default: `false`) — Disables the action. Inherits from parent; use `isDisabled={false}` to override.
|
|
23
|
+
- **`tooltip`** `string | object` — Tooltip content (shown for icon-only buttons)
|
|
24
|
+
- **`onPress`** `() => void` — Press event handler
|
|
25
|
+
|
|
26
|
+
### Base Properties
|
|
27
|
+
|
|
28
|
+
Supports [Base properties](../../BaseProperties.md).
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
### Icon-only actions
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
<ItemAction icon={<IconEdit />} tooltip="Edit" onPress={() => edit()} />
|
|
36
|
+
<ItemAction icon={<IconTrash />} tooltip="Delete" theme="danger" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Checkbox action
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
<ItemAction icon="checkbox" isSelected={isChecked} onPress={toggle} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Inside ItemButton
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
<ItemButton
|
|
49
|
+
type="outline"
|
|
50
|
+
icon={<IconFile />}
|
|
51
|
+
actions={
|
|
52
|
+
<>
|
|
53
|
+
<ItemAction icon={<IconEdit />} tooltip="Edit" />
|
|
54
|
+
<ItemAction icon={<IconTrash />} tooltip="Delete" theme="danger" />
|
|
55
|
+
</>
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
Document.pdf
|
|
59
|
+
</ItemButton>
|
|
60
|
+
```
|