@cube-dev/ui-kit 0.65.0 → 0.66.0
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/CHANGELOG.md +14 -0
- package/es/_internal/hooks/index.js +1 -1
- package/es/_internal/hooks/use-chained-callback.js +1 -1
- package/es/_internal/hooks/use-debounced-value.js +1 -1
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/hooks/use-effect-once.js +1 -1
- package/es/_internal/hooks/use-event.js +1 -1
- package/es/_internal/hooks/use-is-first-render.js +1 -1
- package/es/_internal/hooks/use-sync-ref.js +1 -1
- package/es/_internal/hooks/use-timer/index.js +1 -1
- package/es/_internal/hooks/use-timer/timer.js +1 -1
- package/es/_internal/hooks/use-timer/use-timer.js +1 -1
- package/es/_internal/hooks/use-update-effect.js +1 -1
- package/es/_internal/hooks/use-warn.js +1 -1
- package/es/_internal/index.js +1 -1
- package/es/components/Block.js +1 -1
- package/es/components/GlobalStyles.js +1 -1
- package/es/components/GridProvider.js +1 -1
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +1 -1
- package/es/components/actions/Action/Action.js +1 -1
- package/es/components/actions/Button/Button.js +1 -1
- package/es/components/actions/Button/index.js +1 -1
- package/es/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/es/components/actions/CommandMenu/CommandMenu.js +457 -0
- package/es/components/actions/CommandMenu/index.js +11 -0
- package/es/components/actions/CommandMenu/styled.js +110 -0
- package/es/components/actions/Menu/Menu.js +127 -0
- package/es/components/actions/Menu/MenuItem.js +101 -0
- package/es/components/{pickers → actions}/Menu/MenuSection.js +13 -5
- package/es/components/{pickers → actions}/Menu/MenuTrigger.js +2 -1
- package/es/components/{pickers → actions}/Menu/context.js +1 -1
- package/es/components/actions/Menu/index.js +17 -0
- package/es/components/actions/Menu/styled.js +173 -0
- package/es/components/actions/index.js +3 -1
- package/es/components/actions/use-action.js +1 -1
- package/es/components/content/ActiveZone/ActiveZone.js +1 -1
- package/es/components/content/Alert/Alert.js +1 -1
- package/es/components/content/Alert/index.js +1 -1
- package/es/components/content/Alert/types.js +1 -1
- package/es/components/content/Alert/use-alert.js +1 -1
- package/es/components/content/Avatar/Avatar.js +1 -1
- package/es/components/content/Badge/Badge.js +1 -1
- package/es/components/content/Card/Card.js +1 -1
- package/es/components/content/Content.js +1 -1
- package/es/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/es/components/content/CopyPasteBlock/index.js +1 -1
- package/es/components/content/CopySnippet/CopySnippet.js +1 -1
- package/es/components/content/CopySnippet/index.js +1 -1
- package/es/components/content/Divider.js +1 -1
- package/es/components/content/Footer.js +1 -1
- package/es/components/content/Header.js +1 -1
- package/es/components/content/HotKeys/HotKeys.js +14 -4
- package/es/components/content/HotKeys/index.js +1 -1
- package/es/components/content/Paragraph.js +1 -1
- package/es/components/content/Placeholder/Placeholder.js +1 -1
- package/es/components/content/PrismCode/PrismCode.js +1 -1
- package/es/components/content/PrismCode/prismSetup.js +1 -1
- package/es/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/es/components/content/Result/Result.js +1 -1
- package/es/components/content/Skeleton/Skeleton.js +1 -1
- package/es/components/content/Tag/Tag.js +1 -1
- package/es/components/content/Text.js +1 -1
- package/es/components/content/Title.js +1 -1
- package/es/components/fields/Checkbox/Checkbox.js +1 -1
- package/es/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/es/components/fields/Checkbox/context.js +1 -1
- package/es/components/fields/Checkbox/index.js +1 -1
- package/es/components/fields/ComboBox/ComboBox.js +3 -2
- package/es/components/fields/ComboBox/index.js +1 -1
- package/es/components/fields/DatePicker/DateInput.js +1 -1
- package/es/components/fields/DatePicker/DateInputBase.js +1 -1
- package/es/components/fields/DatePicker/DatePicker.js +1 -1
- package/es/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/es/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/es/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/es/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/es/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/es/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/es/components/fields/DatePicker/TimeInput.js +1 -1
- package/es/components/fields/DatePicker/index.js +1 -1
- package/es/components/fields/DatePicker/intl.js +1 -1
- package/es/components/fields/DatePicker/parseDate.js +1 -1
- package/es/components/fields/DatePicker/props.js +1 -1
- package/es/components/fields/DatePicker/types.js +1 -1
- package/es/components/fields/DatePicker/utils.js +1 -1
- package/es/components/fields/FileInput/FileInput.js +1 -1
- package/es/components/fields/Input/Input.js +1 -1
- package/es/components/fields/Input/index.js +1 -1
- package/es/components/fields/ListBox/ListBox.js +1 -1
- package/es/components/fields/ListBox/index.js +1 -1
- package/es/components/fields/NumberInput/NumberInput.js +1 -1
- package/es/components/fields/NumberInput/StepButton.js +1 -1
- package/es/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/es/components/fields/RadioGroup/Radio.js +1 -1
- package/es/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/es/components/fields/RadioGroup/context.js +1 -1
- package/es/components/fields/RadioGroup/index.js +1 -1
- package/es/components/fields/SearchInput/SearchInput.js +1 -1
- package/es/components/fields/SearchInput/index.js +1 -1
- package/es/components/fields/Select/Select.js +19 -11
- package/es/components/fields/Select/index.js +1 -1
- package/es/components/fields/Slider/Gradation.js +1 -1
- package/es/components/fields/Slider/Header.js +1 -1
- package/es/components/fields/Slider/RangeSlider.js +1 -1
- package/es/components/fields/Slider/Slider.js +1 -1
- package/es/components/fields/Slider/SliderBase.js +1 -1
- package/es/components/fields/Slider/SliderInput.js +1 -1
- package/es/components/fields/Slider/SliderThumb.js +1 -1
- package/es/components/fields/Slider/SliderTrack.js +1 -1
- package/es/components/fields/Slider/elements.js +1 -1
- package/es/components/fields/Slider/index.js +1 -1
- package/es/components/fields/Slider/types.js +1 -1
- package/es/components/fields/Switch/Switch.js +1 -1
- package/es/components/fields/Switch/index.js +1 -1
- package/es/components/fields/TextArea/TextArea.js +1 -1
- package/es/components/fields/TextArea/index.js +1 -1
- package/es/components/fields/TextInput/TextInput.js +1 -1
- package/es/components/fields/TextInput/TextInputBase.js +1 -1
- package/es/components/fields/TextInput/index.js +1 -1
- package/es/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/es/components/fields/TextInputMapper/index.js +1 -1
- package/es/components/fields/index.js +1 -1
- package/es/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/es/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
- package/es/components/form/FieldWrapper/index.js +1 -1
- package/es/components/form/FieldWrapper/types.js +1 -1
- package/es/components/form/Form/Field.js +1 -1
- package/es/components/form/Form/Form.js +1 -1
- package/es/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/es/components/form/Form/ResetButton/index.js +1 -1
- package/es/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/es/components/form/Form/SubmitButton/index.js +1 -1
- package/es/components/form/Form/SubmitError.js +1 -1
- package/es/components/form/Form/index.js +1 -1
- package/es/components/form/Form/types.js +1 -1
- package/es/components/form/Form/use-field/index.js +1 -1
- package/es/components/form/Form/use-field/types.js +1 -1
- package/es/components/form/Form/use-field/use-field-props.js +1 -1
- package/es/components/form/Form/use-field/use-field.js +1 -1
- package/es/components/form/Form/use-form.js +1 -1
- package/es/components/form/Form/validation.js +1 -1
- package/es/components/form/Label.js +1 -1
- package/es/components/form/index.js +1 -1
- package/es/components/form/wrapper.js +1 -1
- package/es/components/layout/Flex.js +1 -1
- package/es/components/layout/Flow.js +1 -1
- package/es/components/layout/Grid.js +1 -1
- package/es/components/layout/Panel.js +1 -1
- package/es/components/layout/Prefix.js +1 -1
- package/es/components/layout/ResizablePanel.js +1 -1
- package/es/components/layout/Space.js +1 -1
- package/es/components/layout/Suffix.js +1 -1
- package/es/components/navigation/LegacyTabs/LegacyTabs.js +1 -1
- package/es/components/navigation/Link/Link.js +1 -1
- package/es/components/organisms/FileTabs/FileTabs.js +1 -1
- package/es/components/organisms/Modal/Modal.js +1 -1
- package/es/components/organisms/StatsCard/StatsCard.js +1 -1
- package/es/components/other/Base64Upload/Base64Upload.js +1 -1
- package/es/components/other/Calendar/Calendar.js +1 -1
- package/es/components/other/Calendar/CalendarCell.js +1 -1
- package/es/components/other/Calendar/CalendarGrid.js +1 -1
- package/es/components/other/Calendar/RangeCalendar.js +1 -1
- package/es/components/other/CloudLogo/CloudLogo.js +1 -1
- package/es/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/es/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/es/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/es/components/overlays/AlertDialog/index.js +1 -1
- package/es/components/overlays/AlertDialog/types.js +1 -1
- package/es/components/overlays/Dialog/Dialog.js +1 -1
- package/es/components/overlays/Dialog/DialogContainer.js +1 -1
- package/es/components/overlays/Dialog/DialogForm.js +1 -1
- package/es/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/es/components/overlays/Dialog/context.js +1 -1
- package/es/components/overlays/Dialog/dialog-container.js +1 -1
- package/es/components/overlays/Dialog/index.js +1 -1
- package/es/components/overlays/Modal/Modal.js +1 -1
- package/es/components/overlays/Modal/OpenTransition.js +1 -1
- package/es/components/overlays/Modal/Overlay.js +1 -1
- package/es/components/overlays/Modal/Popover.js +1 -1
- package/es/components/overlays/Modal/Tray.js +1 -1
- package/es/components/overlays/Modal/Underlay.js +1 -1
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/Modal/types.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/FloatingNotification.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/NotificationsBar.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/TransitionComponent.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/index.js +1 -1
- package/es/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +1 -1
- package/es/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/es/components/overlays/NewNotifications/Notification.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationAction.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationView.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/types.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/NotificationsContext.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsList.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/types.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/index.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/types.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notification-list-item.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-api.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-list.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-observer.js +1 -1
- package/es/components/overlays/NewNotifications/index.js +1 -1
- package/es/components/overlays/NewNotifications/types.js +1 -1
- package/es/components/overlays/Notification/Notification.js +1 -1
- package/es/components/overlays/OverlayWrapper.js +1 -1
- package/es/components/overlays/Toasts/Toast.js +1 -1
- package/es/components/overlays/Toasts/index.js +1 -1
- package/es/components/overlays/Toasts/types.js +1 -1
- package/es/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/es/components/overlays/Tooltip/Tooltip.js +1 -1
- package/es/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/es/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/es/components/overlays/Tooltip/context.js +1 -1
- package/es/components/overlays/Tooltip/index.js +1 -1
- package/es/components/portal/Portal.js +1 -1
- package/es/components/portal/PortalProvider.js +1 -1
- package/es/components/portal/index.js +1 -1
- package/es/components/portal/storybook/templates/CustomRoot.js +1 -1
- package/es/components/portal/storybook/templates/PortalOrder.js +1 -1
- package/es/components/portal/storybook/templates/basic.js +1 -1
- package/es/components/portal/storybook/templates/index.js +1 -1
- package/es/components/portal/types.js +1 -1
- package/es/components/portal/usePortal.js +1 -1
- package/es/components/shared/InvalidIcon.js +1 -1
- package/es/components/shared/ValidIcon.js +1 -1
- package/es/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/es/components/status/LoadingAnimation/index.js +1 -1
- package/es/components/status/Spin/Cube.js +1 -1
- package/es/components/status/Spin/InternalSpinner.js +1 -1
- package/es/components/status/Spin/Spin.js +1 -1
- package/es/components/status/Spin/SpinsContainer.js +1 -1
- package/es/components/status/Spin/index.js +1 -1
- package/es/components/status/Spin/types.js +1 -1
- package/es/components/status/index.js +1 -1
- package/es/data/themes.js +1 -1
- package/es/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/es/icons/AdjustmentsIcon.js +1 -1
- package/es/icons/AiIcon.js +1 -1
- package/es/icons/AreaChartIcon.js +1 -1
- package/es/icons/BackwardIcon.js +1 -1
- package/es/icons/BarChartIcon.js +1 -1
- package/es/icons/BellFilledIcon.js +1 -1
- package/es/icons/BellIcon.js +1 -1
- package/es/icons/BooleanIcon.js +1 -1
- package/es/icons/CalendarEditIcon.js +1 -1
- package/es/icons/CalendarIcon.js +1 -1
- package/es/icons/CaretDownIcon.js +1 -1
- package/es/icons/CaretUpIcon.js +1 -1
- package/es/icons/ChartAreaStackedIcon.js +1 -1
- package/es/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/es/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/es/icons/ChartBarGroupedIcon.js +1 -1
- package/es/icons/ChartBarHorizontalIcon.js +1 -1
- package/es/icons/ChartBarLineIcon.js +1 -1
- package/es/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/es/icons/ChartBarStackedIcon.js +1 -1
- package/es/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/es/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/es/icons/ChartBoxPlot2Icon.js +1 -1
- package/es/icons/ChartBoxPlotIcon.js +1 -1
- package/es/icons/ChartBubbleIcon.js +1 -1
- package/es/icons/ChartDonut2Icon.js +1 -1
- package/es/icons/ChartFunnelIcon.js +1 -1
- package/es/icons/ChartPie2Icon.js +1 -1
- package/es/icons/ChartScatterIcon.js +1 -1
- package/es/icons/CheckCircleFilledIcon.js +1 -1
- package/es/icons/CheckCircleIcon.js +1 -1
- package/es/icons/CheckIcon.js +1 -1
- package/es/icons/CircleFilledIcon.js +1 -1
- package/es/icons/ClearIcon.js +1 -1
- package/es/icons/CloseCircleFilledIcon.js +1 -1
- package/es/icons/CloseCircleIcon.js +1 -1
- package/es/icons/CloseIcon.js +1 -1
- package/es/icons/CodeIcon.js +1 -1
- package/es/icons/CopyIcon.js +1 -1
- package/es/icons/CountIcon.js +1 -1
- package/es/icons/CubeIcon.js +1 -1
- package/es/icons/DangerIcon.js +1 -1
- package/es/icons/DashboardIcon.js +1 -1
- package/es/icons/DatabaseIcon.js +1 -1
- package/es/icons/DirectionIcon.js +1 -1
- package/es/icons/DonutIcon.js +1 -1
- package/es/icons/DownIcon.js +1 -1
- package/es/icons/EditIcon.js +1 -1
- package/es/icons/ExclamationCircleFilledIcon.js +1 -1
- package/es/icons/ExclamationCircleIcon.js +1 -1
- package/es/icons/ExclamationIcon.js +1 -1
- package/es/icons/EyeIcon.js +1 -1
- package/es/icons/EyeInvisibleIcon.js +1 -1
- package/es/icons/FilterIcon.js +1 -1
- package/es/icons/FolderFilledIcon.js +1 -1
- package/es/icons/FolderIcon.js +1 -1
- package/es/icons/FolderOpenFilledIcon.js +1 -1
- package/es/icons/FolderOpenIcon.js +1 -1
- package/es/icons/ForwardIcon.js +1 -1
- package/es/icons/HierarchyIcon.js +1 -1
- package/es/icons/Icon.js +1 -1
- package/es/icons/InfoCircleIcon.js +1 -1
- package/es/icons/InfoIcon.js +1 -1
- package/es/icons/KeyIcon.js +1 -1
- package/es/icons/LeftIcon.js +1 -1
- package/es/icons/LineChartIcon.js +1 -1
- package/es/icons/LoadingIcon.js +1 -1
- package/es/icons/LockFilledIcon.js +1 -1
- package/es/icons/LockIcon.js +1 -1
- package/es/icons/MoreIcon.js +1 -1
- package/es/icons/NotAllowedIcon.js +1 -1
- package/es/icons/NumberIcon.js +1 -1
- package/es/icons/PauseCircleFilledIcon.js +1 -1
- package/es/icons/PauseCircleIcon.js +1 -1
- package/es/icons/PauseIcon.js +1 -1
- package/es/icons/PieChartIcon.js +1 -1
- package/es/icons/PlayCircleIcon.js +1 -1
- package/es/icons/PlayIcon.js +1 -1
- package/es/icons/PlusIcon.js +1 -1
- package/es/icons/ReloadIcon.js +1 -1
- package/es/icons/ReportIcon.js +1 -1
- package/es/icons/ReturnIcon.js +1 -1
- package/es/icons/RightIcon.js +1 -1
- package/es/icons/SchemeIcon.js +1 -1
- package/es/icons/SearchIcon.js +1 -1
- package/es/icons/SettingsIcon.js +1 -1
- package/es/icons/ShieldFilledIcon.js +1 -1
- package/es/icons/ShieldIcon.js +1 -1
- package/es/icons/SlashIcon.js +1 -1
- package/es/icons/SparklesIcon.js +1 -1
- package/es/icons/SqlIcon.js +1 -1
- package/es/icons/StatsIcon.js +1 -1
- package/es/icons/StopIcon.js +1 -1
- package/es/icons/StringIcon.js +1 -1
- package/es/icons/SwitchIcon.js +1 -1
- package/es/icons/TableIcon.js +1 -1
- package/es/icons/ThumbsDownIcon.js +1 -1
- package/es/icons/ThumbsUpIcon.js +1 -1
- package/es/icons/ThunderboltCrossedIcon.js +1 -1
- package/es/icons/ThunderboltFilledIcon.js +1 -1
- package/es/icons/ThunderboltIcon.js +1 -1
- package/es/icons/TimeIcon.js +1 -1
- package/es/icons/UnlockIcon.js +1 -1
- package/es/icons/UpIcon.js +1 -1
- package/es/icons/UserGroupIcon.js +1 -1
- package/es/icons/UserIcon.js +1 -1
- package/es/icons/UserLockIcon.js +1 -1
- package/es/icons/ViewIcon.js +1 -1
- package/es/icons/WarningFilledIcon.js +1 -1
- package/es/icons/WarningIcon.js +1 -1
- package/es/icons/add-new-icon.js +1 -1
- package/es/icons/index.js +1 -1
- package/es/icons/wrap-icon.js +1 -1
- package/es/index.js +4 -3
- package/es/provider.js +1 -1
- package/es/providers/TrackingProvider.js +1 -1
- package/es/services/notification.js +1 -1
- package/es/shared/form.js +1 -1
- package/es/shared/index.js +1 -1
- package/es/stories/Form.legacy-stories.js +1 -1
- package/es/stories/FormFieldArgs.js +1 -1
- package/es/stories/Layout.stories.js +1 -1
- package/es/stories/Tasty.stories.js +1 -1
- package/es/stories/components/ConfirmDeletionDialogForm.js +1 -1
- package/es/stories/components/DialogFormApp.js +1 -1
- package/es/stories/components/StyledButton.js +1 -1
- package/es/stories/lists/baseProps.js +1 -1
- package/es/tasty/index.js +1 -1
- package/es/tasty/providers/BreakpointsProvider.js +1 -1
- package/es/tasty/styles/align.js +1 -1
- package/es/tasty/styles/border.js +1 -1
- package/es/tasty/styles/boxShadow.combinator.js +1 -1
- package/es/tasty/styles/color.js +1 -1
- package/es/tasty/styles/createStyle.js +1 -1
- package/es/tasty/styles/dimension.js +1 -1
- package/es/tasty/styles/display.js +1 -1
- package/es/tasty/styles/fade.js +1 -1
- package/es/tasty/styles/fill.js +1 -1
- package/es/tasty/styles/flow.js +1 -1
- package/es/tasty/styles/font.js +1 -1
- package/es/tasty/styles/fontStyle.js +1 -1
- package/es/tasty/styles/gap.js +1 -1
- package/es/tasty/styles/groupRadius.js +1 -1
- package/es/tasty/styles/height.js +1 -1
- package/es/tasty/styles/index.js +1 -1
- package/es/tasty/styles/inset.js +1 -1
- package/es/tasty/styles/justify.js +1 -1
- package/es/tasty/styles/list.js +1 -1
- package/es/tasty/styles/margin.js +1 -1
- package/es/tasty/styles/marginBlock.js +1 -1
- package/es/tasty/styles/marginInline.js +1 -1
- package/es/tasty/styles/outline.js +1 -1
- package/es/tasty/styles/padding.js +1 -1
- package/es/tasty/styles/paddingBlock.js +1 -1
- package/es/tasty/styles/paddingInline.js +1 -1
- package/es/tasty/styles/place.js +1 -1
- package/es/tasty/styles/predefined.js +1 -1
- package/es/tasty/styles/preset.js +1 -1
- package/es/tasty/styles/radius.js +1 -1
- package/es/tasty/styles/reset.js +1 -1
- package/es/tasty/styles/scrollbar.js +1 -1
- package/es/tasty/styles/shadow.js +1 -1
- package/es/tasty/styles/styledScrollbar.js +1 -1
- package/es/tasty/styles/transition.js +1 -1
- package/es/tasty/styles/types.js +1 -1
- package/es/tasty/styles/width.js +1 -1
- package/es/tasty/tasty.js +1 -1
- package/es/tasty/types.js +1 -1
- package/es/tasty/utils/cache-wrapper.js +1 -1
- package/es/tasty/utils/case-converter.js +1 -1
- package/es/tasty/utils/colors.js +1 -1
- package/es/tasty/utils/dotize.js +1 -1
- package/es/tasty/utils/filterBaseProps.js +1 -1
- package/es/tasty/utils/getDisplayName.js +1 -1
- package/es/tasty/utils/getModCombinations.js +1 -1
- package/es/tasty/utils/mergeStyles.js +1 -1
- package/es/tasty/utils/modAttrs.js +1 -1
- package/es/tasty/utils/renderStyles.js +1 -1
- package/es/tasty/utils/responsive.js +1 -1
- package/es/tasty/utils/string.js +1 -1
- package/es/tasty/utils/styles.js +1 -1
- package/es/tasty/utils/warnings.js +1 -1
- package/es/tokens.js +3 -2
- package/es/type-checks.js +1 -1
- package/es/utils/ResizeSensor.js +1 -1
- package/es/utils/modules.js +1 -1
- package/es/utils/promise.js +1 -1
- package/es/utils/random.js +1 -1
- package/es/utils/range.js +1 -1
- package/es/utils/react/Slots.js +1 -1
- package/es/utils/react/chain.js +1 -1
- package/es/utils/react/index.js +1 -1
- package/es/utils/react/interactions.js +1 -1
- package/es/utils/react/isTextOnly.js +1 -1
- package/es/utils/react/mapProps.js +1 -1
- package/es/utils/react/mergeProps.js +1 -1
- package/es/utils/react/nullableValue.js +1 -1
- package/es/utils/react/useCombinedRefs.js +1 -1
- package/es/utils/react/useId.js +1 -1
- package/es/utils/react/useIsDarwin.js +1 -1
- package/es/utils/react/useKeySymbols.js +8 -8
- package/es/utils/react/useLayoutEffect.js +1 -1
- package/es/utils/react/useQaProps.js +1 -1
- package/es/utils/react/useViewportSize.js +1 -1
- package/es/utils/react/wrapNodeIfPlain.js +1 -1
- package/es/utils/transitions.js +1 -1
- package/es/utils/tree.js +1 -1
- package/es/utils/warnings.js +1 -1
- package/es/version.js +2 -2
- package/package.json +1 -1
- package/types/components/actions/CommandMenu/CommandMenu.d.ts +38 -0
- package/types/components/actions/CommandMenu/index.d.ts +2 -0
- package/types/components/actions/CommandMenu/styled.d.ts +5 -0
- package/types/components/actions/Menu/Menu.d.ts +65 -0
- package/types/components/{pickers → actions}/Menu/MenuItem.d.ts +2 -1
- package/types/components/{pickers → actions}/Menu/MenuSection.d.ts +1 -0
- package/types/components/{pickers → actions}/Menu/context.d.ts +4 -0
- package/types/components/actions/Menu/index.d.ts +7 -0
- package/types/components/{pickers → actions}/Menu/styled.d.ts +432 -0
- package/types/components/actions/index.d.ts +2 -0
- package/types/components/content/HotKeys/HotKeys.d.ts +3 -3
- package/types/components/fields/ComboBox/ComboBox.d.ts +1 -1
- package/types/components/fields/Select/Select.d.ts +3 -2
- package/types/components/status/Spin/Cube.d.ts +1 -1
- package/types/components/status/Spin/SpinsContainer.d.ts +1 -1
- package/types/index.d.ts +6 -4
- package/es/components/pickers/Menu/Menu.js +0 -95
- package/es/components/pickers/Menu/MenuButton.js +0 -96
- package/es/components/pickers/Menu/MenuItem.js +0 -90
- package/es/components/pickers/Menu/styled.js +0 -113
- package/types/components/pickers/Menu/Menu.d.ts +0 -43
- package/types/components/pickers/Menu/MenuButton.d.ts +0 -14
- /package/types/components/{pickers → actions}/Menu/MenuTrigger.d.ts +0 -0
@@ -6,5 +6,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("./B
|
|
6
6
|
};
|
7
7
|
export * from './Button';
|
8
8
|
export * from './Action/Action';
|
9
|
+
export * from './Menu';
|
10
|
+
export * from './CommandMenu';
|
9
11
|
export * from './use-action';
|
10
12
|
export { Button, ButtonGroup };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
export interface CubeHotKeysProps extends
|
3
|
-
|
1
|
+
import { BasePropsWithoutChildren, ContainerStyleProps } from '../../../tasty';
|
2
|
+
export interface CubeHotKeysProps extends BasePropsWithoutChildren, ContainerStyleProps {
|
3
|
+
children: string;
|
4
4
|
}
|
5
5
|
declare const _HotKeys: import("react").ForwardRefExoticComponent<CubeHotKeysProps & import("react").RefAttributes<unknown>>;
|
6
6
|
export { _HotKeys as HotKeys };
|
@@ -30,7 +30,7 @@ export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOp
|
|
30
30
|
* Has no effect when `items` is provided.
|
31
31
|
*/
|
32
32
|
filter?: FilterFn;
|
33
|
-
size?: 'small' | 'default' | 'large' | string;
|
33
|
+
size?: 'small' | 'medium' | 'default' | 'large' | string;
|
34
34
|
suffixPosition?: 'before' | 'after';
|
35
35
|
menuTrigger?: MenuTriggerAction;
|
36
36
|
allowsCustomValue?: boolean;
|
@@ -31,10 +31,10 @@ export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
|
|
31
31
|
popoverRef?: RefObject<HTMLInputElement>;
|
32
32
|
/** The ref for the list box. */
|
33
33
|
listBoxRef?: RefObject<HTMLElement>;
|
34
|
-
size?: 'small' | 'default' | 'large' | string;
|
34
|
+
size?: 'small' | 'medium' | 'default' | 'large' | string;
|
35
35
|
placeholder?: string;
|
36
36
|
}
|
37
|
-
export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
|
37
|
+
export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, shouldUseVirtualFocus, placement, minWidth, size, ...otherProps }: {
|
38
38
|
[x: string]: any;
|
39
39
|
state: any;
|
40
40
|
popoverRef: any;
|
@@ -46,6 +46,7 @@ export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxSty
|
|
46
46
|
shouldUseVirtualFocus?: boolean | undefined;
|
47
47
|
placement: any;
|
48
48
|
minWidth: any;
|
49
|
+
size?: string | undefined;
|
49
50
|
}): import("react/jsx-runtime").JSX.Element;
|
50
51
|
type SectionComponent = typeof BaseSection;
|
51
52
|
declare const SelectSectionComponent: SectionComponent;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { SpinCubeProps } from './types';
|
2
2
|
export declare const Cube: import("react").MemoExoticComponent<import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
3
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
3
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
4
4
|
}>, SpinCubeProps>, never>>>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export declare const SpinsContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
2
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
3
3
|
}>, {
|
4
4
|
$ownSize: number;
|
5
5
|
}>, never>>;
|
package/types/index.d.ts
CHANGED
@@ -64,10 +64,12 @@ export * from './components/content/HotKeys';
|
|
64
64
|
export type { CubeSearchInputProps } from './components/fields/SearchInput/SearchInput';
|
65
65
|
export type { CubeListBoxProps } from './components/fields/ListBox';
|
66
66
|
export { ListBox } from './components/fields/ListBox';
|
67
|
-
export { Menu } from './components/
|
68
|
-
export type { CubeMenuProps } from './components/
|
69
|
-
export { MenuTrigger } from './components/
|
70
|
-
export type { CubeMenuTriggerProps } from './components/
|
67
|
+
export { Menu } from './components/actions/Menu/Menu';
|
68
|
+
export type { CubeMenuProps } from './components/actions/Menu/Menu';
|
69
|
+
export { MenuTrigger } from './components/actions/Menu/MenuTrigger';
|
70
|
+
export type { CubeMenuTriggerProps } from './components/actions/Menu/MenuTrigger';
|
71
|
+
export { CommandMenu } from './components/actions/CommandMenu';
|
72
|
+
export type { CubeCommandMenuProps, CommandMenuItem, } from './components/actions/CommandMenu';
|
71
73
|
export { Select, ListBoxPopup } from './components/fields/Select/Select';
|
72
74
|
export type { CubeSelectProps, CubeSelectBaseProps, } from './components/fields/Select/Select';
|
73
75
|
export { Avatar } from './components/content/Avatar/Avatar';
|
@@ -1,95 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license MIT
|
3
|
-
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.65.0
|
5
|
-
* Released under the MIT license.
|
6
|
-
*/
|
7
|
-
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
-
import { useSyncRef } from '@react-aria/utils';
|
10
|
-
import { useDOMRef } from '@react-spectrum/utils';
|
11
|
-
import React, { useMemo } from 'react';
|
12
|
-
import { useMenu } from 'react-aria';
|
13
|
-
import { Item as BaseItem, Section as BaseSection, useTreeState, } from 'react-stately';
|
14
|
-
import { CONTAINER_STYLES, extractStyles, filterBaseProps, } from '../../../tasty';
|
15
|
-
import { mergeProps } from '../../../utils/react';
|
16
|
-
import { useMenuContext } from './context';
|
17
|
-
import { MenuItem } from './MenuItem';
|
18
|
-
import { MenuSection } from './MenuSection';
|
19
|
-
import { StyledDivider, StyledHeader, StyledMenu } from './styled';
|
20
|
-
function Menu(props, ref) {
|
21
|
-
const { header, footer, itemStyles, sectionStyles, sectionHeadingStyles, selectionIcon, qa, ...rest } = props;
|
22
|
-
const domRef = useDOMRef(ref);
|
23
|
-
const contextProps = useMenuContext();
|
24
|
-
const completeProps = mergeProps(contextProps, rest);
|
25
|
-
// Props used for collection building.
|
26
|
-
const treeProps = completeProps;
|
27
|
-
const state = useTreeState(treeProps);
|
28
|
-
const collectionItems = [...state.collection];
|
29
|
-
const hasSections = collectionItems.some((item) => item.type === 'section');
|
30
|
-
const { menuProps } = useMenu(treeProps, state, domRef);
|
31
|
-
const styles = useMemo(() => extractStyles(completeProps, CONTAINER_STYLES), [completeProps]);
|
32
|
-
const defaultProps = {
|
33
|
-
qa,
|
34
|
-
styles,
|
35
|
-
mods: {
|
36
|
-
sections: hasSections,
|
37
|
-
footer: !!footer,
|
38
|
-
header: !!header,
|
39
|
-
},
|
40
|
-
};
|
41
|
-
// Sync the ref stored in the context object with the DOM ref returned by useDOMRef.
|
42
|
-
// The helper from @react-aria/utils expects the context object as the first argument
|
43
|
-
// to keep it up-to-date, and a ref object as the second.
|
44
|
-
useSyncRef(contextProps, domRef);
|
45
|
-
return (_jsxs(StyledMenu, { ...mergeProps(defaultProps, menuProps, filterBaseProps(completeProps)), ref: domRef, children: [header && _jsx(StyledHeader, { role: "presentation", children: header }), (() => {
|
46
|
-
// Build the list of menu elements, automatically inserting dividers between sections.
|
47
|
-
const renderedItems = useMemo(() => {
|
48
|
-
const items = [];
|
49
|
-
let isFirstSection = true;
|
50
|
-
collectionItems.forEach((item) => {
|
51
|
-
if (item.type === 'section') {
|
52
|
-
if (!isFirstSection) {
|
53
|
-
items.push(_jsx(StyledDivider, { as: "li", role: "separator", "aria-orientation": "horizontal" }, `divider-${String(item.key)}`));
|
54
|
-
}
|
55
|
-
items.push(_jsx(MenuSection, { item: item, state: state, styles: sectionStyles, itemStyles: itemStyles, headingStyles: sectionHeadingStyles, selectionIcon: selectionIcon }, item.key));
|
56
|
-
isFirstSection = false;
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
let menuItem = (_jsx(MenuItem, { item: item, state: state, styles: itemStyles, selectionIcon: selectionIcon, onAction: item.onAction }, item.key));
|
60
|
-
if (item.props.wrapper) {
|
61
|
-
menuItem = item.props.wrapper(menuItem);
|
62
|
-
}
|
63
|
-
// Ensure every child has a stable key, even if the wrapper component didn't set one.
|
64
|
-
items.push(React.cloneElement(menuItem, { key: item.key }));
|
65
|
-
});
|
66
|
-
return items;
|
67
|
-
}, [
|
68
|
-
collectionItems,
|
69
|
-
state,
|
70
|
-
sectionStyles,
|
71
|
-
itemStyles,
|
72
|
-
selectionIcon,
|
73
|
-
sectionHeadingStyles,
|
74
|
-
]);
|
75
|
-
return renderedItems;
|
76
|
-
})()] }));
|
77
|
-
}
|
78
|
-
// forwardRef doesn't support generic parameters, so cast the result to the correct type
|
79
|
-
// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
|
80
|
-
const _Menu = React.forwardRef(Menu);
|
81
|
-
const Item = Object.assign(BaseItem, {
|
82
|
-
displayName: 'Item',
|
83
|
-
});
|
84
|
-
const Section = Object.assign(BaseSection, {
|
85
|
-
displayName: 'Section',
|
86
|
-
});
|
87
|
-
const __Menu = Object.assign(_Menu, {
|
88
|
-
Item: Item,
|
89
|
-
Section,
|
90
|
-
displayName: 'Menu',
|
91
|
-
});
|
92
|
-
__Menu.displayName = 'Menu';
|
93
|
-
export { __Menu as Menu };
|
94
|
-
|
95
|
-
|
@@ -1,96 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license MIT
|
3
|
-
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.65.0
|
5
|
-
* Released under the MIT license.
|
6
|
-
*/
|
7
|
-
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
-
import { IconPointFilled } from '@tabler/icons-react';
|
10
|
-
import { CheckIcon } from '../../../icons';
|
11
|
-
import { tasty } from '../../../tasty';
|
12
|
-
import { DEFAULT_BUTTON_STYLES, DEFAULT_NEUTRAL_STYLES } from '../../actions';
|
13
|
-
import { Block } from '../../Block';
|
14
|
-
import { Text } from '../../content/Text';
|
15
|
-
import { Space } from '../../layout/Space';
|
16
|
-
const StyledButton = tasty(Block, {
|
17
|
-
styles: {
|
18
|
-
...DEFAULT_BUTTON_STYLES,
|
19
|
-
...DEFAULT_NEUTRAL_STYLES,
|
20
|
-
height: 'min 4x',
|
21
|
-
border: '#clear',
|
22
|
-
fill: {
|
23
|
-
'': '#clear',
|
24
|
-
focused: '#dark.03',
|
25
|
-
selected: '#dark.06',
|
26
|
-
'selected & focused': '#dark.09',
|
27
|
-
pressed: '#dark.06',
|
28
|
-
disabled: '#clear',
|
29
|
-
},
|
30
|
-
color: {
|
31
|
-
'': '#dark-02',
|
32
|
-
'selected | pressed': '#dark',
|
33
|
-
disabled: '#dark-04',
|
34
|
-
},
|
35
|
-
cursor: {
|
36
|
-
'': 'pointer',
|
37
|
-
disabled: 'default',
|
38
|
-
},
|
39
|
-
shadow: '#clear',
|
40
|
-
padding: {
|
41
|
-
'': '0 (1x - 1bw)',
|
42
|
-
'selectionIcon & selectable & !selected': '0 (1x - 1bw) 0 (1x - 1bw + 3x)',
|
43
|
-
},
|
44
|
-
display: 'flex',
|
45
|
-
flow: 'row',
|
46
|
-
justifyContent: 'start',
|
47
|
-
gap: '.75x',
|
48
|
-
outline: false,
|
49
|
-
ButtonIcon: {
|
50
|
-
display: 'grid',
|
51
|
-
fontSize: '@icon-size',
|
52
|
-
width: '@icon-size',
|
53
|
-
height: '@icon-size',
|
54
|
-
placeSelf: 'center',
|
55
|
-
placeItems: 'center',
|
56
|
-
},
|
57
|
-
Postfix: {
|
58
|
-
color: {
|
59
|
-
'': '#dark-03',
|
60
|
-
pressed: '#dark-02',
|
61
|
-
disabled: '#dark-04',
|
62
|
-
},
|
63
|
-
},
|
64
|
-
Description: {
|
65
|
-
preset: 't4',
|
66
|
-
color: '#dark-03',
|
67
|
-
},
|
68
|
-
},
|
69
|
-
});
|
70
|
-
const getPostfix = (postfix) => typeof postfix === 'string' ? (_jsx(Text, { nowrap: true, color: "inherit", "data-element": "Postfix", children: postfix })) : (postfix);
|
71
|
-
const getSelectionTypeIcon = (selectionIcon) => {
|
72
|
-
switch (selectionIcon) {
|
73
|
-
case 'checkbox':
|
74
|
-
return _jsx(CheckIcon, {});
|
75
|
-
case 'radio':
|
76
|
-
return _jsx(IconPointFilled, {});
|
77
|
-
default:
|
78
|
-
return undefined;
|
79
|
-
}
|
80
|
-
};
|
81
|
-
export function MenuButton({ children, icon, postfix, description, ...props }) {
|
82
|
-
const { selectionIcon, isSelected, isSelectable, isDisabled, ...rest } = props;
|
83
|
-
const checkIcon = isSelectable && isSelected
|
84
|
-
? getSelectionTypeIcon(selectionIcon)
|
85
|
-
: undefined;
|
86
|
-
const mods = {
|
87
|
-
...props.mods,
|
88
|
-
selectionIcon: !!selectionIcon,
|
89
|
-
selectable: isSelectable,
|
90
|
-
selected: isSelected,
|
91
|
-
disabled: isDisabled,
|
92
|
-
};
|
93
|
-
return (_jsxs(StyledButton, { "data-size": "small", ...rest, mods: mods, children: [checkIcon ? _jsx("div", { "data-element": "ButtonIcon", children: checkIcon }) : null, icon ? _jsx("div", { "data-element": "ButtonIcon", children: icon }) : null, _jsxs(Space, { gap: "1x", placeContent: "space-between", overflow: "clip", width: "100%", children: [_jsxs(Space, { flow: "column", gap: "0", width: "100%", children: [_jsx(Text, { ellipsis: true, color: "inherit", children: children }), description ? (_jsx(Text, { nowrap: true, ellipsis: true, "data-element": "Description", preset: "t4", color: "#dark-03", children: description })) : null] }), postfix && getPostfix(postfix)] })] }));
|
94
|
-
}
|
95
|
-
|
96
|
-
|
@@ -1,90 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license MIT
|
3
|
-
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.65.0
|
5
|
-
* Released under the MIT license.
|
6
|
-
*/
|
7
|
-
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
-
import { useRef } from 'react';
|
10
|
-
import { FocusRing, useMenuItem } from 'react-aria';
|
11
|
-
import { useHotkeys } from 'react-hotkeys-hook';
|
12
|
-
import { ClearSlots, mergeProps, SlotProvider } from '../../../utils/react';
|
13
|
-
import { HotKeys } from '../../content/HotKeys';
|
14
|
-
import { useMenuContext } from './context';
|
15
|
-
import { MenuButton } from './MenuButton';
|
16
|
-
import { StyledItem } from './styled';
|
17
|
-
/** @private */
|
18
|
-
export function MenuItem(props) {
|
19
|
-
const { item, state, styles, selectionIcon, isVirtualized, onAction } = props;
|
20
|
-
const { onClose, closeOnSelect } = useMenuContext();
|
21
|
-
const { rendered, key, props: itemProps } = item;
|
22
|
-
// Extract optional keyboard shortcut from item props so it is not passed down to DOM elements.
|
23
|
-
// `hotkeys` is our custom prop for specifying keyboard shortcuts, similar to `postfix` or `icon`.
|
24
|
-
const { hotkeys, ...cleanItemProps } = (itemProps || {});
|
25
|
-
const isSelectable = state.selectionManager.selectionMode !== 'none';
|
26
|
-
const isDisabledKey = state.disabledKeys.has(key);
|
27
|
-
const ref = useRef(null);
|
28
|
-
const { menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, isFocused, isSelected, isPressed, isDisabled, } = useMenuItem({
|
29
|
-
isSelected: state.selectionManager.isSelected(key),
|
30
|
-
isDisabled: isDisabledKey,
|
31
|
-
'aria-label': item['aria-label'],
|
32
|
-
key,
|
33
|
-
onClose,
|
34
|
-
closeOnSelect,
|
35
|
-
isVirtualized,
|
36
|
-
onAction,
|
37
|
-
}, state, ref);
|
38
|
-
const buttonProps = {
|
39
|
-
qa: cleanItemProps.qa
|
40
|
-
? cleanItemProps.qa
|
41
|
-
: `MenuButton-${key}`,
|
42
|
-
mods: {
|
43
|
-
...cleanItemProps.mods,
|
44
|
-
focused: isFocused,
|
45
|
-
pressed: isPressed,
|
46
|
-
},
|
47
|
-
};
|
48
|
-
// Build extra props for MenuButton: automatically add postfix HotKeys component when shortcut provided
|
49
|
-
const extraButtonProps = {};
|
50
|
-
if (hotkeys && !cleanItemProps.postfix) {
|
51
|
-
extraButtonProps.postfix = _jsx(HotKeys, { keys: hotkeys });
|
52
|
-
}
|
53
|
-
const contents = (_jsx(MenuButton, { ...mergeProps(cleanItemProps, buttonProps, extraButtonProps), styles: styles, selectionIcon: selectionIcon, isSelectable: isSelectable, isSelected: isSelected, isDisabled: isDisabled, children: rendered }));
|
54
|
-
// Register global hotkey if provided
|
55
|
-
useHotkeys(typeof hotkeys === 'string' ? hotkeys.toLowerCase() : '', () => {
|
56
|
-
if (!hotkeys)
|
57
|
-
return;
|
58
|
-
if (isDisabledKey || isDisabled) {
|
59
|
-
return;
|
60
|
-
}
|
61
|
-
// Simulate a click on the menu item so all existing handlers run
|
62
|
-
if (ref.current) {
|
63
|
-
ref.current.click();
|
64
|
-
}
|
65
|
-
}, {
|
66
|
-
// Ensure the hotkey is active even when the element is not focused
|
67
|
-
enableOnContentEditable: true,
|
68
|
-
enabled: !!hotkeys,
|
69
|
-
preventDefault: true,
|
70
|
-
}, [hotkeys, isDisabledKey, isDisabled]);
|
71
|
-
return (_jsx(FocusRing, { children: _jsx(StyledItem, { ...mergeProps(menuItemProps, {
|
72
|
-
'aria-disabled': isDisabled || undefined,
|
73
|
-
}), ref: ref, qa: cleanItemProps.qa
|
74
|
-
? `MenuItem-${cleanItemProps.qa}`
|
75
|
-
: `MenuItem-${key}`, mods: {
|
76
|
-
disabled: isDisabled,
|
77
|
-
selected: isSelected,
|
78
|
-
selectable: isSelectable,
|
79
|
-
focused: isFocused,
|
80
|
-
pressed: isPressed,
|
81
|
-
}, children: _jsx(ClearSlots, { children: _jsx(SlotProvider, { slots: {
|
82
|
-
text: { className: 'itemLabel', ...labelProps },
|
83
|
-
end: { className: 'end', ...descriptionProps },
|
84
|
-
icon: { className: 'icon', size: 'S' },
|
85
|
-
description: { className: 'description', ...descriptionProps },
|
86
|
-
keyboard: { className: 'keyboard', ...keyboardShortcutProps },
|
87
|
-
}, children: contents }) }) }) }));
|
88
|
-
}
|
89
|
-
|
90
|
-
|
@@ -1,113 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license MIT
|
3
|
-
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.65.0
|
5
|
-
* Released under the MIT license.
|
6
|
-
*/
|
7
|
-
|
8
|
-
import { tasty } from '../../../tasty';
|
9
|
-
import { Space } from '../../layout/Space';
|
10
|
-
export const StyledMenu = tasty({
|
11
|
-
as: 'ul',
|
12
|
-
qa: 'Menu',
|
13
|
-
styles: {
|
14
|
-
display: 'flex',
|
15
|
-
flow: 'column',
|
16
|
-
gap: {
|
17
|
-
'': '1bw',
|
18
|
-
sections: false,
|
19
|
-
},
|
20
|
-
fill: '#white',
|
21
|
-
margin: 0,
|
22
|
-
padding: {
|
23
|
-
'': '0.5x',
|
24
|
-
section: 0, // section menu
|
25
|
-
},
|
26
|
-
overflow: {
|
27
|
-
'': 'auto',
|
28
|
-
section: '',
|
29
|
-
},
|
30
|
-
border: {
|
31
|
-
'': '#border',
|
32
|
-
section: false,
|
33
|
-
},
|
34
|
-
radius: '(1cr + 1bw)',
|
35
|
-
boxShadow: {
|
36
|
-
'': '',
|
37
|
-
popover: '0px 5px 15px #dark.05',
|
38
|
-
},
|
39
|
-
scrollbar: 'styled',
|
40
|
-
},
|
41
|
-
});
|
42
|
-
export const StyledDivider = tasty({
|
43
|
-
qa: 'Divider',
|
44
|
-
as: 'li',
|
45
|
-
styles: {
|
46
|
-
display: 'flex',
|
47
|
-
flow: 'column',
|
48
|
-
margin: '.5x',
|
49
|
-
listStyle: 'none',
|
50
|
-
fill: '#border',
|
51
|
-
height: '1bw',
|
52
|
-
flexShrink: 0,
|
53
|
-
},
|
54
|
-
});
|
55
|
-
export const StyledHeader = tasty(Space, {
|
56
|
-
qa: 'Header',
|
57
|
-
as: 'li',
|
58
|
-
styles: {
|
59
|
-
color: '#dark-02',
|
60
|
-
preset: 't2m',
|
61
|
-
padding: '0.75x 1.5x',
|
62
|
-
margin: '-0.5x -0.5x (0.5x - 1bw) -0.5x',
|
63
|
-
border: '#dark-05 bottom',
|
64
|
-
placeContent: 'space-between',
|
65
|
-
align: 'start',
|
66
|
-
radius: '1r 1r 0 0',
|
67
|
-
whiteSpace: 'nowrap',
|
68
|
-
},
|
69
|
-
});
|
70
|
-
export const StyledSection = tasty({
|
71
|
-
qa: 'Section',
|
72
|
-
as: 'li',
|
73
|
-
styles: {
|
74
|
-
display: 'flex',
|
75
|
-
flow: 'column',
|
76
|
-
margin: '0',
|
77
|
-
padding: '0',
|
78
|
-
listStyle: 'none',
|
79
|
-
fill: '#white',
|
80
|
-
},
|
81
|
-
});
|
82
|
-
export const StyledItem = tasty({
|
83
|
-
qa: 'Item',
|
84
|
-
as: 'li',
|
85
|
-
styles: {
|
86
|
-
display: 'flex',
|
87
|
-
flow: 'column',
|
88
|
-
gap: '1bw',
|
89
|
-
margin: '0',
|
90
|
-
padding: '0',
|
91
|
-
listStyle: 'none',
|
92
|
-
fill: '#white',
|
93
|
-
preset: 't3m',
|
94
|
-
color: {
|
95
|
-
'': 'inherit',
|
96
|
-
disabled: '#dark-04',
|
97
|
-
},
|
98
|
-
whiteSpace: 'nowrap',
|
99
|
-
},
|
100
|
-
});
|
101
|
-
export const StyledSectionHeading = tasty(Space, {
|
102
|
-
as: 'SectionHeading',
|
103
|
-
styles: {
|
104
|
-
color: '#dark-04',
|
105
|
-
preset: 'c2',
|
106
|
-
padding: '.5x 1.5x',
|
107
|
-
height: '3x',
|
108
|
-
placeContent: 'center space-between',
|
109
|
-
align: 'start',
|
110
|
-
},
|
111
|
-
});
|
112
|
-
|
113
|
-
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { DOMRef, ItemProps, Key } from '@react-types/shared';
|
2
|
-
import { ReactElement, ReactNode } from 'react';
|
3
|
-
import { AriaMenuProps } from 'react-aria';
|
4
|
-
import { Section as BaseSection } from 'react-stately';
|
5
|
-
import { BasePropsWithoutChildren, ContainerStyleProps, Styles } from '../../../tasty';
|
6
|
-
import { MenuButtonProps, MenuSelectionType } from './MenuButton';
|
7
|
-
export interface CubeMenuProps<T> extends BasePropsWithoutChildren, ContainerStyleProps, AriaMenuProps<T> {
|
8
|
-
selectionIcon?: MenuSelectionType;
|
9
|
-
header?: ReactNode;
|
10
|
-
footer?: ReactNode;
|
11
|
-
styles?: Styles;
|
12
|
-
itemStyles?: Styles;
|
13
|
-
sectionStyles?: Styles;
|
14
|
-
sectionHeadingStyles?: Styles;
|
15
|
-
/** Keys that should appear disabled */
|
16
|
-
disabledKeys?: Iterable<Key>;
|
17
|
-
/** Selection mode for the menu: 'single' | 'multiple' */
|
18
|
-
selectionMode?: 'single' | 'multiple';
|
19
|
-
}
|
20
|
-
type PartialMenuButton = Partial<MenuButtonProps>;
|
21
|
-
type ItemComponent = <T>(props: ItemProps<T> & PartialMenuButton & {
|
22
|
-
description?: ReactNode;
|
23
|
-
wrapper?: (item: ReactElement) => ReactElement;
|
24
|
-
/** Keyboard shortcut string, e.g. "Ctrl+C" */
|
25
|
-
hotkeys?: string;
|
26
|
-
}) => ReactElement;
|
27
|
-
type SectionComponent = typeof BaseSection;
|
28
|
-
declare const Item: ItemComponent;
|
29
|
-
declare const Section: SectionComponent;
|
30
|
-
declare const __Menu: (<T>(props: CubeMenuProps<T> & {
|
31
|
-
ref?: DOMRef<HTMLUListElement>;
|
32
|
-
}) => ReactElement) & {
|
33
|
-
Item: typeof Item;
|
34
|
-
Section: typeof Section;
|
35
|
-
} & {
|
36
|
-
Item: (props: {
|
37
|
-
description?: ReactNode;
|
38
|
-
[key: string]: any;
|
39
|
-
}) => ReactElement;
|
40
|
-
Section: any;
|
41
|
-
displayName: string;
|
42
|
-
};
|
43
|
-
export { __Menu as Menu };
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
2
|
-
import { CubeBlockProps } from '../../Block';
|
3
|
-
export type MenuSelectionType = 'checkbox' | 'radio';
|
4
|
-
export type MenuButtonProps = {
|
5
|
-
postfix?: ReactNode;
|
6
|
-
/** Optional description shown under the main label */
|
7
|
-
description?: ReactNode;
|
8
|
-
selectionIcon?: MenuSelectionType;
|
9
|
-
isSelectable?: boolean;
|
10
|
-
isSelected?: boolean;
|
11
|
-
icon?: ReactElement;
|
12
|
-
onAction?: () => void;
|
13
|
-
} & CubeBlockProps;
|
14
|
-
export declare function MenuButton({ children, icon, postfix, description, ...props }: MenuButtonProps): import("react/jsx-runtime").JSX.Element;
|
File without changes
|