@cube-dev/ui-kit 0.121.0 → 0.121.2
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 +12 -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 +695 -0
- package/package.json +4 -8
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# Menu
|
|
2
|
+
|
|
3
|
+
A versatile dropdown menu component that displays a list of actions or options. Built with React Aria for accessibility and supports single/multiple selection, sections, keyboard navigation, and custom styling.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Display a list of actions that can be performed (like Cut, Copy, Paste)
|
|
8
|
+
- Create context menus for right-click interactions
|
|
9
|
+
- Build dropdown menus for navigation or settings
|
|
10
|
+
- Implement selection lists with single or multiple selection modes
|
|
11
|
+
- Group related options using sections with dividers
|
|
12
|
+
|
|
13
|
+
## Component
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- **`children`** `ReactNode` — Menu items and sections as static children
|
|
20
|
+
- **`items`** `Iterable<T>` — Item objects for dynamic collections
|
|
21
|
+
- **`header`** `ReactNode` — Optional header content (deprecated)
|
|
22
|
+
- **`footer`** `ReactNode` — Optional footer content
|
|
23
|
+
- **`selectionMode`** `'none' | 'single' | 'multiple'` (default: `none`) — Type of selection allowed in the menu
|
|
24
|
+
- **`selectedKeys`** `Iterable<Key>` — Currently selected keys (controlled)
|
|
25
|
+
- **`defaultSelectedKeys`** `Iterable<Key>` — Initially selected keys (uncontrolled)
|
|
26
|
+
- **`disabledKeys`** `Iterable<Key>` — Keys of items that should appear disabled
|
|
27
|
+
- **`autoFocus`** `boolean | FocusStrategy` (default: `false`) — Whether to auto-focus the menu when it opens
|
|
28
|
+
- **`shouldFocusWrap`** `boolean` (default: `false`) — Whether keyboard navigation should wrap around
|
|
29
|
+
- **`size`** `'medium' | 'large'` (default: `medium`) — Size of the menu items
|
|
30
|
+
- **`styles`** `Styles` — Custom styles for the menu container
|
|
31
|
+
- **`itemStyles`** `Styles` — Custom styles for menu items
|
|
32
|
+
- **`sectionStyles`** `Styles` — Custom styles for section containers
|
|
33
|
+
- **`sectionHeadingStyles`** `Styles` — Custom styles for section headings
|
|
34
|
+
- **`onAction`** `(key: Key) => void` — Handler called when an item is activated
|
|
35
|
+
- **`onSelectionChange`** `(keys: Selection) => void` — Handler called when selection changes
|
|
36
|
+
- **`onClose`** `() => void` — Handler called when menu should close
|
|
37
|
+
- **`id`** `string` — Unique identifier for the menu
|
|
38
|
+
- **`aria-label`** `string` — Accessibility label for the menu
|
|
39
|
+
- **`aria-labelledby`** `string` — ID of element that labels the menu
|
|
40
|
+
- **`width`** `string | number` — Width of the menu
|
|
41
|
+
- **`height`** `string | number` — Height of the menu
|
|
42
|
+
- **`qa`** `string` — Test identifier for the menu
|
|
43
|
+
|
|
44
|
+
### Base Properties
|
|
45
|
+
|
|
46
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
47
|
+
|
|
48
|
+
### Styling Properties
|
|
49
|
+
|
|
50
|
+
#### styles
|
|
51
|
+
|
|
52
|
+
Customizes the root menu container element.
|
|
53
|
+
|
|
54
|
+
**Sub-elements:**
|
|
55
|
+
- `Header` - Optional header element at the top of the menu
|
|
56
|
+
- `Divider` - Separator elements between sections
|
|
57
|
+
|
|
58
|
+
#### itemStyles
|
|
59
|
+
|
|
60
|
+
Customizes individual menu items.
|
|
61
|
+
|
|
62
|
+
**Sub-elements:**
|
|
63
|
+
- `Icon` - Icon element within menu items
|
|
64
|
+
- `Text` - Main text content of menu items
|
|
65
|
+
- `Description` - Secondary text content for items with descriptions
|
|
66
|
+
- `Postfix` - Right-aligned content (shortcuts, badges, etc.)
|
|
67
|
+
|
|
68
|
+
#### sectionStyles
|
|
69
|
+
|
|
70
|
+
Customizes section container elements.
|
|
71
|
+
|
|
72
|
+
**Sub-elements:**
|
|
73
|
+
- `SectionHeading` - Section title/heading element
|
|
74
|
+
|
|
75
|
+
#### sectionHeadingStyles
|
|
76
|
+
|
|
77
|
+
Customizes section heading text styling.
|
|
78
|
+
|
|
79
|
+
### Style Properties
|
|
80
|
+
|
|
81
|
+
These properties allow direct style application without using the `styles` prop: `width`, `height`, `padding`, `margin`.
|
|
82
|
+
|
|
83
|
+
### Modifiers
|
|
84
|
+
|
|
85
|
+
The `mods` property accepts the following modifiers you can override:
|
|
86
|
+
|
|
87
|
+
- `sections` `boolean` — Applied when menu contains sections
|
|
88
|
+
- `footer` `boolean` — Applied when footer prop is provided
|
|
89
|
+
- `header` `boolean` — Applied when header prop is provided
|
|
90
|
+
- `popover` `boolean` — Applied when menu is displayed as popover
|
|
91
|
+
|
|
92
|
+
## Menu Properties
|
|
93
|
+
|
|
94
|
+
### Collection Properties
|
|
95
|
+
|
|
96
|
+
- **`items`** `Iterable<T>` — Item objects for dynamic collections
|
|
97
|
+
- **`children`** `ReactNode` — Static menu items and sections
|
|
98
|
+
|
|
99
|
+
### Selection Properties
|
|
100
|
+
|
|
101
|
+
- **`selectionMode`** `'single' \| 'multiple'` (default: `'none'`) — Type of selection allowed
|
|
102
|
+
- **`selectedKeys`** `string[]` — Currently selected keys (controlled)
|
|
103
|
+
- **`defaultSelectedKeys`** `string[]` — Initially selected keys (uncontrolled)
|
|
104
|
+
- **`onSelectionChange`** `(keys: string[]) => void` — Handler for selection changes
|
|
105
|
+
- **`selectionIcon`** `'checkbox' \| 'radio'` — Type of selection indicator
|
|
106
|
+
|
|
107
|
+
### State Properties
|
|
108
|
+
|
|
109
|
+
- **`disabledKeys`** `Iterable<Key>` — Keys of disabled items
|
|
110
|
+
- **`autoFocus`** `boolean \| FocusStrategy` — Focus behavior when menu opens
|
|
111
|
+
- **`shouldFocusWrap`** `boolean` — Whether keyboard navigation wraps
|
|
112
|
+
|
|
113
|
+
### Event Properties
|
|
114
|
+
|
|
115
|
+
- **`onAction`** `(key: Key) => void` — Handler for item activation
|
|
116
|
+
- **`onClose`** `() => void` — Handler for menu close requests
|
|
117
|
+
|
|
118
|
+
### Content Properties
|
|
119
|
+
|
|
120
|
+
- **`header`** `ReactNode` — Optional header content (deprecated)
|
|
121
|
+
- **`footer`** `ReactNode` — Optional footer content
|
|
122
|
+
|
|
123
|
+
## Sub-components
|
|
124
|
+
|
|
125
|
+
### Menu.Item
|
|
126
|
+
|
|
127
|
+
Individual menu items. Each item is rendered using [Item](../content/Item.md) and supports all Item properties for layout, icons, descriptions, and interactive features.
|
|
128
|
+
|
|
129
|
+
#### Item API
|
|
130
|
+
|
|
131
|
+
For detailed information about all available item properties, see [Item documentation](../content/Item.md). Key properties include:
|
|
132
|
+
|
|
133
|
+
- **`key`** `Key` — Unique identifier for the item (required)
|
|
134
|
+
- **`children`** `ReactNode` — The main content/label for the menu item
|
|
135
|
+
- **`icon`** `ReactNode` — Icon displayed before the content
|
|
136
|
+
- **`rightIcon`** `ReactNode` — Icon displayed after the content
|
|
137
|
+
- **`description`** `ReactNode` — Secondary text below the main content
|
|
138
|
+
- **`descriptionPlacement`** `'inline' \| 'block'` — How the description is positioned
|
|
139
|
+
- **`prefix`** `ReactNode` — Content before the main text
|
|
140
|
+
- **`suffix`** `ReactNode` — Content after the main text
|
|
141
|
+
- **`hotkeys`** `string` — Keyboard shortcut that triggers this item
|
|
142
|
+
- **`tooltip`** `string \| boolean \| object` — Tooltip configuration
|
|
143
|
+
- **`isDisabled`** `boolean` — Whether the item is disabled
|
|
144
|
+
- **`styles`** `Styles` — Custom styling for the item
|
|
145
|
+
- **`qa`** `string` — QA identifier for testing
|
|
146
|
+
|
|
147
|
+
#### Menu-specific Properties
|
|
148
|
+
|
|
149
|
+
- **`textValue`** `string` — Text for typeahead search
|
|
150
|
+
- **`wrapper`** `(item: ReactElement) => ReactElement` — Function to wrap the item
|
|
151
|
+
- **`onAction`** `() => void` — Callback fired when item is activated
|
|
152
|
+
|
|
153
|
+
#### Example with Rich Items
|
|
154
|
+
|
|
155
|
+
```jsx
|
|
156
|
+
<Menu>
|
|
157
|
+
<Menu.Item
|
|
158
|
+
key="save"
|
|
159
|
+
icon={<IconSave />}
|
|
160
|
+
hotkeys="cmd+s"
|
|
161
|
+
description="Save the current document"
|
|
162
|
+
>
|
|
163
|
+
Save
|
|
164
|
+
</Menu.Item>
|
|
165
|
+
<Menu.Item
|
|
166
|
+
key="export"
|
|
167
|
+
icon={<IconExport />}
|
|
168
|
+
suffix="PDF"
|
|
169
|
+
tooltip="Export as PDF file"
|
|
170
|
+
>
|
|
171
|
+
Export
|
|
172
|
+
</Menu.Item>
|
|
173
|
+
</Menu>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Menu.Section Properties
|
|
177
|
+
|
|
178
|
+
- **`key`** `Key` — Unique identifier for the section
|
|
179
|
+
- **`title`** `ReactNode` — Section heading text
|
|
180
|
+
- **`children`** `ReactNode` — Menu items within the section
|
|
181
|
+
- **`items`** `Iterable<T>` — Dynamic items for the section
|
|
182
|
+
|
|
183
|
+
### Menu.Section Styling Properties
|
|
184
|
+
|
|
185
|
+
- **`aria-label`** `string` — Accessibility label for sections without titles
|
|
186
|
+
|
|
187
|
+
## Menu.SubMenuTrigger Properties
|
|
188
|
+
|
|
189
|
+
- **`children`** `[ReactNode, ReactElement]` — Must be exactly two elements: trigger (Menu.Item) and submenu (Menu)
|
|
190
|
+
- **`disabled`** `boolean` (default: `false`) — Whether the submenu trigger is disabled
|
|
191
|
+
- **`onAction`** `(key: Key) => void` — Callback that bubbles onAction events from the submenu
|
|
192
|
+
- **`autoFocus`** `boolean \| 'first' \| 'last'` (default: `'first'`) — Whether and how the submenu should receive focus on open
|
|
193
|
+
|
|
194
|
+
### Menu.SubMenuTrigger Positioning Properties
|
|
195
|
+
|
|
196
|
+
- **`placement`** `Placement` (default: `'right start'`) — Placement of the submenu relative to trigger
|
|
197
|
+
- **`offset`** `number` (default: `0`) — Distance between trigger and submenu
|
|
198
|
+
- **`crossOffset`** `number` (default: `0`) — Cross-axis offset for submenu positioning
|
|
199
|
+
- **`shouldFlip`** `boolean` (default: `true`) — Whether submenu should flip when it doesn't fit
|
|
200
|
+
- **`containerPadding`** `number` (default: `8`) — Padding from viewport edges
|
|
201
|
+
|
|
202
|
+
## Selection Modes
|
|
203
|
+
|
|
204
|
+
### None (Default)
|
|
205
|
+
Items are not selectable and only trigger `onAction` when activated.
|
|
206
|
+
|
|
207
|
+
```jsx
|
|
208
|
+
<Menu onAction={(key) => console.log('Action:', key)}>
|
|
209
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
210
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
211
|
+
</Menu>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Single Selection
|
|
215
|
+
Only one item can be selected at a time.
|
|
216
|
+
|
|
217
|
+
```jsx
|
|
218
|
+
<Menu selectionMode="single" selectedKeys={['option1']}>
|
|
219
|
+
<Menu.Item key="option1">Option 1</Menu.Item>
|
|
220
|
+
<Menu.Item key="option2">Option 2</Menu.Item>
|
|
221
|
+
</Menu>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Multiple Selection
|
|
225
|
+
Multiple items can be selected simultaneously.
|
|
226
|
+
|
|
227
|
+
```jsx
|
|
228
|
+
<Menu selectionMode="multiple" selectedKeys={['option1', 'option3']}>
|
|
229
|
+
<Menu.Item key="option1">Option 1</Menu.Item>
|
|
230
|
+
<Menu.Item key="option2">Option 2</Menu.Item>
|
|
231
|
+
<Menu.Item key="option3">Option 3</Menu.Item>
|
|
232
|
+
</Menu>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Examples
|
|
236
|
+
|
|
237
|
+
### Basic Menu
|
|
238
|
+
|
|
239
|
+
```jsx
|
|
240
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
241
|
+
<Menu.Item key="new">New File</Menu.Item>
|
|
242
|
+
<Menu.Item key="open">Open File</Menu.Item>
|
|
243
|
+
<Menu.Item key="save">Save</Menu.Item>
|
|
244
|
+
</Menu>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Menu with Sections
|
|
248
|
+
|
|
249
|
+
```jsx
|
|
250
|
+
<Menu>
|
|
251
|
+
<Menu.Section title="File Operations">
|
|
252
|
+
<Menu.Item key="new">New</Menu.Item>
|
|
253
|
+
<Menu.Item key="open">Open</Menu.Item>
|
|
254
|
+
</Menu.Section>
|
|
255
|
+
<Menu.Section title="Edit Operations">
|
|
256
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
257
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
258
|
+
</Menu.Section>
|
|
259
|
+
</Menu>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Menu with Icons and Shortcuts
|
|
263
|
+
|
|
264
|
+
```jsx
|
|
265
|
+
<Menu>
|
|
266
|
+
<Menu.Item key="copy" icon={<CopyIcon />} hotkeys="Ctrl+C">
|
|
267
|
+
Copy
|
|
268
|
+
</Menu.Item>
|
|
269
|
+
<Menu.Item key="paste" icon={<PasteIcon />} hotkeys="Ctrl+V">
|
|
270
|
+
Paste
|
|
271
|
+
</Menu.Item>
|
|
272
|
+
</Menu>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Dynamic Menu
|
|
276
|
+
|
|
277
|
+
```jsx
|
|
278
|
+
const items = [
|
|
279
|
+
{ id: 'copy', label: 'Copy', shortcut: 'Ctrl+C' },
|
|
280
|
+
{ id: 'paste', label: 'Paste', shortcut: 'Ctrl+V' }
|
|
281
|
+
];
|
|
282
|
+
|
|
283
|
+
<Menu items={items}>
|
|
284
|
+
{(item) => (
|
|
285
|
+
<Menu.Item key={item.id} hotkeys={item.shortcut}>
|
|
286
|
+
{item.label}
|
|
287
|
+
</Menu.Item>
|
|
288
|
+
)}
|
|
289
|
+
</Menu>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Selection with Custom Icons
|
|
293
|
+
|
|
294
|
+
```jsx
|
|
295
|
+
<Menu selectionMode="multiple" selectionIcon="checkbox">
|
|
296
|
+
<Menu.Item key="bold">Bold</Menu.Item>
|
|
297
|
+
<Menu.Item key="italic">Italic</Menu.Item>
|
|
298
|
+
<Menu.Item key="underline">Underline</Menu.Item>
|
|
299
|
+
</Menu>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Menu Items with Tooltips
|
|
303
|
+
|
|
304
|
+
```jsx
|
|
305
|
+
<Menu>
|
|
306
|
+
<Menu.Item key="copy" tooltip="Copy selected text">
|
|
307
|
+
Copy
|
|
308
|
+
</Menu.Item>
|
|
309
|
+
<Menu.Item
|
|
310
|
+
key="paste"
|
|
311
|
+
tooltip={{ title: "Paste from clipboard", placement: "left" }}
|
|
312
|
+
>
|
|
313
|
+
Paste
|
|
314
|
+
</Menu.Item>
|
|
315
|
+
</Menu>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Basic Submenu
|
|
319
|
+
|
|
320
|
+
```jsx
|
|
321
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
322
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
323
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
324
|
+
|
|
325
|
+
<Menu.SubMenuTrigger>
|
|
326
|
+
<Menu.Item key="share">Share</Menu.Item>
|
|
327
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
328
|
+
<Menu.Item key="share-link">Copy link</Menu.Item>
|
|
329
|
+
<Menu.Item key="share-email">Email</Menu.Item>
|
|
330
|
+
<Menu.Item key="share-sms">SMS</Menu.Item>
|
|
331
|
+
</Menu>
|
|
332
|
+
</Menu.SubMenuTrigger>
|
|
333
|
+
|
|
334
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
335
|
+
</Menu>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Nested Submenus
|
|
339
|
+
|
|
340
|
+
```jsx
|
|
341
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
342
|
+
<Menu.Item key="new">New File</Menu.Item>
|
|
343
|
+
|
|
344
|
+
<Menu.SubMenuTrigger>
|
|
345
|
+
<Menu.Item key="export">Export</Menu.Item>
|
|
346
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
347
|
+
<Menu.Item key="export-pdf">Export as PDF</Menu.Item>
|
|
348
|
+
<Menu.Item key="export-image">Export as Image</Menu.Item>
|
|
349
|
+
|
|
350
|
+
<Menu.SubMenuTrigger>
|
|
351
|
+
<Menu.Item key="export-formats">More formats</Menu.Item>
|
|
352
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
353
|
+
<Menu.Item key="export-docx">DOCX Document</Menu.Item>
|
|
354
|
+
<Menu.Item key="export-xlsx">Excel Spreadsheet</Menu.Item>
|
|
355
|
+
<Menu.Item key="export-pptx">PowerPoint</Menu.Item>
|
|
356
|
+
</Menu>
|
|
357
|
+
</Menu.SubMenuTrigger>
|
|
358
|
+
</Menu>
|
|
359
|
+
</Menu.SubMenuTrigger>
|
|
360
|
+
</Menu>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Submenu with Sections
|
|
364
|
+
|
|
365
|
+
```jsx
|
|
366
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
367
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
368
|
+
|
|
369
|
+
<Menu.SubMenuTrigger>
|
|
370
|
+
<Menu.Item key="settings">Settings</Menu.Item>
|
|
371
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
372
|
+
<Menu.Section title="General">
|
|
373
|
+
<Menu.Item key="preferences">Preferences</Menu.Item>
|
|
374
|
+
<Menu.Item key="account">Account Settings</Menu.Item>
|
|
375
|
+
</Menu.Section>
|
|
376
|
+
<Menu.Section title="Display">
|
|
377
|
+
<Menu.Item key="theme">Theme</Menu.Item>
|
|
378
|
+
<Menu.Item key="layout">Layout</Menu.Item>
|
|
379
|
+
</Menu.Section>
|
|
380
|
+
</Menu>
|
|
381
|
+
</Menu.SubMenuTrigger>
|
|
382
|
+
</Menu>
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Accessibility
|
|
386
|
+
|
|
387
|
+
### Keyboard Navigation
|
|
388
|
+
|
|
389
|
+
- `Tab` - Moves focus to the menu
|
|
390
|
+
- `Arrow Keys` - Navigate between items
|
|
391
|
+
- `Right Arrow` - Open submenu when focused on submenu trigger
|
|
392
|
+
- `Left Arrow` - Close submenu and return to parent
|
|
393
|
+
- `Home/End` - Move to first/last item
|
|
394
|
+
- `Enter/Space` - Activate the focused item or open submenu
|
|
395
|
+
- `Escape` - Close the menu or submenu
|
|
396
|
+
- `A-Z` - Typeahead search for items
|
|
397
|
+
|
|
398
|
+
### Screen Reader Support
|
|
399
|
+
|
|
400
|
+
- Menu announces as "menu" with proper role
|
|
401
|
+
- Items announce as "menuitem", "menuitemcheckbox", or "menuitemradio"
|
|
402
|
+
- Submenu triggers announce with "has submenu" indication
|
|
403
|
+
- Selection state is announced for selectable items
|
|
404
|
+
- Keyboard shortcuts are announced when present
|
|
405
|
+
- Section headings provide context for grouped items
|
|
406
|
+
- Submenu opening and closing is announced to screen readers
|
|
407
|
+
|
|
408
|
+
### ARIA Properties
|
|
409
|
+
|
|
410
|
+
- `aria-label` - Provides accessible label for the menu
|
|
411
|
+
- `aria-labelledby` - References element that labels the menu
|
|
412
|
+
- `aria-activedescendant` - Indicates the currently focused item
|
|
413
|
+
- `aria-orientation` - Indicates menu orientation (vertical by default)
|
|
414
|
+
|
|
415
|
+
## Best Practices
|
|
416
|
+
|
|
417
|
+
1. **Clear Labels**: Use descriptive, action-oriented labels
|
|
418
|
+
```jsx
|
|
419
|
+
<Menu.Item key="save">Save Document</Menu.Item> // Good
|
|
420
|
+
<Menu.Item key="save">Save</Menu.Item> // Less clear
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
2. **Logical Grouping**: Group related actions using sections
|
|
424
|
+
```jsx
|
|
425
|
+
<Menu.Section title="File Operations">
|
|
426
|
+
<Menu.Item key="new">New</Menu.Item>
|
|
427
|
+
<Menu.Item key="open">Open</Menu.Item>
|
|
428
|
+
</Menu.Section>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
3. **Keyboard Shortcuts**: Include shortcuts for common actions
|
|
432
|
+
```jsx
|
|
433
|
+
<Menu.Item key="copy" hotkeys="Ctrl+C">Copy</Menu.Item>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
4. **Appropriate Selection**: Choose the right selection mode
|
|
437
|
+
- Use `selectionMode="none"` for action menus
|
|
438
|
+
- Use `selectionMode="single"` for mutually exclusive options
|
|
439
|
+
- Use `selectionMode="multiple"` for independent toggles
|
|
440
|
+
|
|
441
|
+
5. **Disabled States**: Clearly indicate unavailable actions
|
|
442
|
+
```jsx
|
|
443
|
+
<Menu disabledKeys={['paste']}>
|
|
444
|
+
<Menu.Item key="paste">Paste</Menu.Item>
|
|
445
|
+
</Menu>
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
6. **Submenu Structure**: Use clear hierarchy for submenus
|
|
449
|
+
```jsx
|
|
450
|
+
<Menu.SubMenuTrigger>
|
|
451
|
+
<Menu.Item key="share">Share</Menu.Item>
|
|
452
|
+
<Menu onAction={handleAction}>
|
|
453
|
+
<Menu.Item key="link">Copy Link</Menu.Item>
|
|
454
|
+
<Menu.Item key="email">Email</Menu.Item>
|
|
455
|
+
</Menu>
|
|
456
|
+
</Menu.SubMenuTrigger>
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
## Integration with MenuTrigger
|
|
460
|
+
|
|
461
|
+
The Menu component is typically used with MenuTrigger for dropdown functionality:
|
|
462
|
+
|
|
463
|
+
```jsx
|
|
464
|
+
<MenuTrigger>
|
|
465
|
+
<Button>Actions</Button>
|
|
466
|
+
<Menu>
|
|
467
|
+
<Menu.Item key="edit">Edit</Menu.Item>
|
|
468
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
469
|
+
</Menu>
|
|
470
|
+
</MenuTrigger>
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## Suggested Improvements
|
|
474
|
+
|
|
475
|
+
- Enhancement 1: Implement virtual scrolling for large item lists
|
|
476
|
+
- Enhancement 2: Add animation presets for menu transitions
|
|
477
|
+
- Enhancement 3: Support for item templates and custom renderers
|
|
478
|
+
- Enhancement 4: Built-in search/filter functionality
|
|
479
|
+
- Enhancement 5: Add support for icons in section headers
|
|
480
|
+
|
|
481
|
+
## Related Components
|
|
482
|
+
|
|
483
|
+
- [Button](./Button.md) - Common trigger element for menus
|
|
484
|
+
- [ListBox](../fields/ListBox.md) - Alternative for selection-focused interfaces
|
|
485
|
+
- [ComboBox](../fields/ComboBox.md) - Combines input with menu selection
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# MenuTrigger
|
|
2
|
+
|
|
3
|
+
Wraps a trigger element and a `Menu` to create a dropdown menu. Positions the menu relative to the trigger.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Dropdown menus from buttons
|
|
8
|
+
- Context menus attached to elements
|
|
9
|
+
- Any menu that opens from a trigger element
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
- **`trigger`** `'press' | 'longPress'` (default: `'press'`) — How the menu is opened
|
|
14
|
+
- **`placement`** `Placement` (default: `'bottom start'`) — Menu position relative to trigger
|
|
15
|
+
- **`closeOnSelect`** `boolean` — Close menu when an item is selected
|
|
16
|
+
- **`isDisabled`** `boolean` — Disable the trigger
|
|
17
|
+
- **`shouldFlip`** `boolean` (default: `true`) — Flip menu position when overflowing viewport
|
|
18
|
+
- **`offset`** `number` (default: `8`) — Distance from trigger in pixels
|
|
19
|
+
- **`crossOffset`** `number` (default: `0`) — Cross-axis offset in pixels
|
|
20
|
+
|
|
21
|
+
Extends React Aria `AriaMenuTriggerProps` and `PositionProps`.
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
### Basic dropdown
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
<MenuTrigger>
|
|
29
|
+
<Button>Open Menu</Button>
|
|
30
|
+
<Menu onAction={(key) => console.log(key)}>
|
|
31
|
+
<Menu.Item key="edit">Edit</Menu.Item>
|
|
32
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
33
|
+
</Menu>
|
|
34
|
+
</MenuTrigger>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Long press trigger
|
|
38
|
+
|
|
39
|
+
```jsx
|
|
40
|
+
<MenuTrigger trigger="longPress">
|
|
41
|
+
<Button>Long Press Me</Button>
|
|
42
|
+
<Menu>
|
|
43
|
+
<Menu.Item key="option1">Option 1</Menu.Item>
|
|
44
|
+
<Menu.Item key="option2">Option 2</Menu.Item>
|
|
45
|
+
</Menu>
|
|
46
|
+
</MenuTrigger>
|
|
47
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# SubMenuTrigger
|
|
2
|
+
|
|
3
|
+
Wraps a `Menu.Item` and a nested `Menu` to create hierarchical menus. Opens on hover or keyboard navigation (ArrowRight).
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Nested menu items
|
|
8
|
+
- Hierarchical menu structures
|
|
9
|
+
- Menus with sub-categories
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
- **`placement`** `Placement` (default: `'right top'`) — Sub-menu position relative to trigger
|
|
14
|
+
- **`offset`** `number` (default: `4`) — Distance from trigger in pixels
|
|
15
|
+
- **`crossOffset`** `number` (default: `-5`) — Cross-axis offset in pixels
|
|
16
|
+
- **`shouldFlip`** `boolean` (default: `true`) — Flip when overflowing viewport
|
|
17
|
+
- **`isDisabled`** `boolean` — Disable the trigger
|
|
18
|
+
- **`onAction`** `(key: Key) => void` — Callback when a sub-menu item is selected
|
|
19
|
+
- **`autoFocus`** `boolean | 'first' | 'last'` (default: `'first'`) — Focus behavior when sub-menu opens
|
|
20
|
+
|
|
21
|
+
Extends React Aria `AriaMenuTriggerProps`.
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
<Menu>
|
|
27
|
+
<Menu.Item key="edit">Edit</Menu.Item>
|
|
28
|
+
<SubMenuTrigger>
|
|
29
|
+
<Menu.Item key="more">More Options</Menu.Item>
|
|
30
|
+
<Menu>
|
|
31
|
+
<Menu.Item key="copy">Copy</Menu.Item>
|
|
32
|
+
<Menu.Item key="move">Move</Menu.Item>
|
|
33
|
+
<Menu.Item key="archive">Archive</Menu.Item>
|
|
34
|
+
</Menu>
|
|
35
|
+
</SubMenuTrigger>
|
|
36
|
+
<Menu.Item key="delete">Delete</Menu.Item>
|
|
37
|
+
</Menu>
|
|
38
|
+
```
|