@cube-dev/ui-kit 0.12.2 → 0.12.5
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/_internal/hooks/index.js +1 -1
- package/cjs/_internal/hooks/use-chained-callback.js +1 -1
- package/cjs/_internal/hooks/use-deprecation-warning.js +1 -1
- package/cjs/_internal/hooks/use-event.js +1 -1
- package/cjs/_internal/hooks/use-sync-ref.js +1 -1
- package/cjs/_internal/hooks/use-timer/index.js +1 -1
- package/cjs/_internal/hooks/use-timer/timer.js +1 -1
- package/cjs/_internal/hooks/use-timer/use-timer.js +1 -1
- package/cjs/_internal/index.js +1 -1
- package/cjs/components/Base.js +4 -4
- package/cjs/components/Block.js +3 -3
- package/cjs/components/GlobalStyles.js +4 -4
- package/cjs/components/GridProvider.js +4 -4
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +7 -7
- package/cjs/components/actions/Action.js +7 -7
- package/cjs/components/actions/Button/Button.js +16 -16
- package/cjs/components/actions/Button/Submit.js +2 -2
- package/cjs/components/actions/Button/index.js +1 -1
- package/cjs/components/actions/ButtonGroup/ButtonGroup.js +2 -2
- package/cjs/components/actions/index.js +1 -1
- package/cjs/components/content/ActiveZone/ActiveZone.js +6 -6
- package/cjs/components/content/Alert/Alert.js +3 -3
- package/cjs/components/content/Alert/index.js +1 -1
- package/cjs/components/content/Alert/types.js +1 -1
- package/cjs/components/content/Alert/use-alert.js +1 -1
- package/cjs/components/content/Avatar/Avatar.js +3 -3
- package/cjs/components/content/Badge/Badge.js +4 -4
- package/cjs/components/content/Card/Card.js +3 -3
- package/cjs/components/content/Content.js +3 -3
- package/cjs/components/content/CopySnippet/CopySnippet.js +1 -1
- package/cjs/components/content/CopySnippet/index.js +1 -1
- package/cjs/components/content/Divider.js +3 -3
- package/cjs/components/content/Footer.js +3 -3
- package/cjs/components/content/Header.js +3 -3
- package/cjs/components/content/Paragraph.js +4 -4
- package/cjs/components/content/Placeholder/Placeholder.js +5 -5
- package/cjs/components/content/PrismCode/PrismCode.js +1 -1
- package/cjs/components/content/Result/Result.js +1 -1
- package/cjs/components/content/Skeleton/Skeleton.js +1 -1
- package/cjs/components/content/Tag/Tag.js +5 -5
- package/cjs/components/content/Text.js +5 -5
- package/cjs/components/content/Title.js +4 -4
- package/cjs/components/forms/Checkbox/Checkbox.js +8 -4
- package/cjs/components/forms/Checkbox/CheckboxGroup.js +3 -3
- package/cjs/components/forms/Checkbox/context.js +1 -1
- package/cjs/components/forms/FieldWrapper.js +6 -6
- package/cjs/components/forms/FileInput/FileInput.js +20 -12
- package/cjs/components/forms/Form/Field.js +12 -9
- package/cjs/components/forms/Form/Form.js +4 -4
- package/cjs/components/forms/Form/index.js +1 -1
- package/cjs/components/forms/Form/types.js +1 -1
- package/cjs/components/forms/Form/useForm.js +19 -8
- package/cjs/components/forms/Form/validation.js +1 -1
- package/cjs/components/forms/Input/Input.js +1 -1
- package/cjs/components/forms/Input/index.js +1 -1
- package/cjs/components/forms/Label.js +3 -5
- package/cjs/components/forms/NumberInput/NumberInput.js +6 -6
- package/cjs/components/forms/NumberInput/StepButton.js +4 -4
- package/cjs/components/forms/PasswordInput/PasswordInput.js +5 -5
- package/cjs/components/forms/RadioGroup/Radio.js +5 -5
- package/cjs/components/forms/RadioGroup/RadioGroup.js +3 -3
- package/cjs/components/forms/RadioGroup/context.js +1 -1
- package/cjs/components/forms/SearchInput/SearchInput.js +15 -8
- package/cjs/components/forms/Switch/Switch.js +2 -2
- package/cjs/components/forms/TextArea/TextArea.js +4 -4
- package/cjs/components/forms/TextInput/TextInput.js +4 -4
- package/cjs/components/forms/TextInput/TextInputBase.js +130 -67
- package/cjs/components/forms/index.js +1 -1
- package/cjs/components/layout/Flex.js +3 -3
- package/cjs/components/layout/Flow.js +3 -3
- package/cjs/components/layout/Grid.js +3 -3
- package/cjs/components/layout/Prefix.js +3 -3
- package/cjs/components/layout/Space.js +3 -3
- package/cjs/components/layout/Suffix.js +3 -3
- package/cjs/components/navigation/LegacyTabs/LegacyTabs.js +5 -5
- package/cjs/components/navigation/Link/Link.js +2 -2
- package/cjs/components/organisms/FileTabs/FileTabs.js +5 -5
- package/cjs/components/organisms/Modal/Modal.js +7 -7
- package/cjs/components/organisms/StatsCard/StatsCard.js +2 -2
- package/cjs/components/other/Base64Upload/Base64Upload.js +4 -4
- package/cjs/components/other/CloudLogo/CloudLogo.js +2 -2
- package/cjs/components/overlays/AlertDialog/AlertDialog.js +2 -2
- package/cjs/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/cjs/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/cjs/components/overlays/AlertDialog/index.js +1 -1
- package/cjs/components/overlays/AlertDialog/types.js +1 -1
- package/cjs/components/overlays/Dialog/Dialog.js +3 -3
- package/cjs/components/overlays/Dialog/DialogContainer.js +4 -4
- package/cjs/components/overlays/Dialog/DialogForm.js +6 -6
- package/cjs/components/overlays/Dialog/DialogTrigger.js +10 -10
- package/cjs/components/overlays/Dialog/context.js +1 -1
- package/cjs/components/overlays/Dialog/index.js +1 -1
- package/cjs/components/overlays/Modal/Modal.js +4 -4
- package/cjs/components/overlays/Modal/OpenTransition.js +1 -1
- package/cjs/components/overlays/Modal/Overlay.js +4 -4
- package/cjs/components/overlays/Modal/Popover.js +8 -8
- package/cjs/components/overlays/Modal/Tray.js +6 -6
- package/cjs/components/overlays/Modal/Underlay.js +3 -3
- package/cjs/components/overlays/Modal/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/FloatingNotification.js +2 -2
- package/cjs/components/overlays/NewNotifications/Bar/NotificationsBar.js +4 -4
- package/cjs/components/overlays/NewNotifications/Bar/TransitionComponent.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +1 -1
- package/cjs/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Notification.js +2 -2
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationAction.js +2 -2
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +2 -2
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationView.js +3 -3
- package/cjs/components/overlays/NewNotifications/NotificationView/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/types.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/types.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notification-list-item.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-api.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-list.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-observer.js +1 -1
- package/cjs/components/overlays/NewNotifications/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/types.js +1 -1
- package/cjs/components/overlays/Notification/Notification.js +2 -2
- package/cjs/components/overlays/OverlayWrapper.js +2 -2
- package/cjs/components/overlays/Toasts/Toast.js +2 -2
- package/cjs/components/overlays/Toasts/index.js +1 -1
- package/cjs/components/overlays/Toasts/types.js +1 -1
- package/cjs/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/cjs/components/overlays/Tooltip/Tooltip.js +7 -7
- package/cjs/components/overlays/Tooltip/TooltipProvider.js +2 -2
- package/cjs/components/overlays/Tooltip/TooltipTrigger.js +2 -2
- package/cjs/components/overlays/Tooltip/context.js +1 -1
- package/cjs/components/pickers/ComboBox/ComboBox.js +39 -36
- package/cjs/components/pickers/Menu/Menu.js +4 -3
- package/cjs/components/pickers/Menu/MenuButton.js +3 -3
- package/cjs/components/pickers/Menu/MenuItem.js +1 -1
- package/cjs/components/pickers/Menu/MenuSection.js +2 -2
- package/cjs/components/pickers/Menu/MenuTrigger.js +2 -2
- package/cjs/components/pickers/Menu/context.js +1 -1
- package/cjs/components/pickers/Menu/styled.js +1 -1
- package/cjs/components/pickers/Select/Select.js +101 -70
- package/cjs/components/portal/Portal.js +1 -1
- package/cjs/components/portal/PortalProvider.js +1 -1
- package/cjs/components/portal/index.js +1 -1
- package/cjs/components/portal/storybook/templates/CustomRoot.js +1 -1
- package/cjs/components/portal/storybook/templates/PortalOrder.js +1 -1
- package/cjs/components/portal/storybook/templates/basic.js +2 -2
- package/cjs/components/portal/storybook/templates/index.js +1 -1
- package/cjs/components/portal/types.js +1 -1
- package/cjs/components/portal/usePortal.js +1 -1
- package/cjs/components/status/LoadingAnimation/LoadingAnimation.js +4 -4
- package/cjs/components/status/LoadingAnimation/index.js +1 -1
- package/cjs/components/status/Spin/Cube.js +1 -1
- package/cjs/components/status/Spin/InternalSpinner.js +1 -1
- package/cjs/components/status/Spin/Spin.js +2 -2
- package/cjs/components/status/Spin/SpinsContainer.js +1 -1
- package/cjs/components/status/Spin/index.js +1 -1
- package/cjs/components/status/Spin/types.js +1 -1
- package/cjs/components/status/index.js +1 -1
- package/cjs/data/themes.js +1 -1
- package/cjs/icons/Attention.js +1 -1
- package/cjs/icons/Cross.js +1 -1
- package/cjs/icons/Danger.js +1 -1
- package/cjs/icons/Success.js +1 -1
- package/cjs/icons/index.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/provider.js +1 -1
- package/cjs/providers/StyleProvider.js +1 -1
- package/cjs/services/notification.js +2 -2
- package/cjs/shared/form.js +1 -1
- package/cjs/shared/index.js +1 -1
- package/cjs/stories/FormFieldArgs.js +15 -2
- package/cjs/stories/components/ConfirmDeletionDialogForm.js +3 -3
- package/cjs/stories/components/DialogFormApp.js +1 -1
- package/cjs/stories/components/StyledButton.js +1 -1
- package/cjs/stories/lists/baseProps.js +1 -1
- package/cjs/styled/index.js +1 -1
- package/cjs/styled/styled.js +1 -1
- package/cjs/tasty/index.js +1 -1
- package/cjs/tasty/providers/BreakpointsProvider.js +1 -1
- package/cjs/tasty/styles/align.js +1 -1
- package/cjs/tasty/styles/border.js +1 -1
- package/cjs/tasty/styles/boxShadow.combinator.js +1 -1
- package/cjs/tasty/styles/color.js +1 -1
- package/cjs/tasty/styles/createStyle.js +1 -1
- package/cjs/tasty/styles/dimension.js +1 -1
- package/cjs/tasty/styles/display.js +1 -1
- package/cjs/tasty/styles/fill.js +1 -1
- package/cjs/tasty/styles/flow.js +1 -1
- package/cjs/tasty/styles/font.js +1 -1
- package/cjs/tasty/styles/fontStyle.js +1 -1
- package/cjs/tasty/styles/gap.js +1 -1
- package/cjs/tasty/styles/groupRadius.js +1 -1
- package/cjs/tasty/styles/height.js +1 -1
- package/cjs/tasty/styles/index.js +1 -1
- package/cjs/tasty/styles/justify.js +1 -1
- package/cjs/tasty/styles/list.js +1 -1
- package/cjs/tasty/styles/margin.js +1 -1
- package/cjs/tasty/styles/marginBlock.js +1 -1
- package/cjs/tasty/styles/marginInline.js +1 -1
- package/cjs/tasty/styles/outline.js +1 -1
- package/cjs/tasty/styles/padding.js +1 -1
- package/cjs/tasty/styles/paddingBlock.js +1 -1
- package/cjs/tasty/styles/paddingInline.js +1 -1
- package/cjs/tasty/styles/predefined.js +1 -1
- package/cjs/tasty/styles/preset.js +1 -1
- package/cjs/tasty/styles/radius.js +1 -1
- package/cjs/tasty/styles/reset.js +1 -1
- package/cjs/tasty/styles/shadow.js +1 -1
- package/cjs/tasty/styles/styledScrollbar.js +1 -1
- package/cjs/tasty/styles/transition.js +1 -1
- package/cjs/tasty/styles/types.js +1 -1
- package/cjs/tasty/styles/width.js +1 -1
- package/cjs/tasty/tasty.js +1 -1
- package/cjs/tasty/types.js +1 -1
- package/cjs/tasty/utils/colors.js +1 -1
- package/cjs/tasty/utils/dotize.js +1 -1
- package/cjs/tasty/utils/filterBaseProps.js +1 -1
- package/cjs/tasty/utils/get-display-name.js +1 -1
- package/cjs/tasty/utils/index.js +1 -1
- package/cjs/tasty/utils/mergeStyles.js +1 -1
- package/cjs/tasty/utils/modAttrs.js +1 -1
- package/cjs/tasty/utils/renderStyles.js +2 -2
- package/cjs/tasty/utils/responsive.js +1 -1
- package/cjs/tasty/utils/string.js +1 -1
- package/cjs/tasty/utils/styles.js +1 -1
- package/cjs/tasty/utils/warnings.js +1 -1
- package/cjs/test/index.js +1 -1
- package/cjs/test/render.js +1 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +1 -1
- package/cjs/tokens.js +1 -1
- package/cjs/type-checks.js +1 -1
- package/cjs/utils/ResizeSensor.js +1 -1
- package/cjs/utils/modules.js +1 -1
- package/cjs/utils/promise.js +1 -1
- package/cjs/utils/react/Slots.js +13 -8
- package/cjs/utils/react/chain.js +1 -1
- package/cjs/utils/react/index.js +1 -1
- package/cjs/utils/react/interactions.js +1 -1
- package/cjs/utils/react/isTextOnly.js +1 -1
- package/cjs/utils/react/mapProps.js +1 -1
- package/cjs/utils/react/mergeProps.js +1 -1
- package/cjs/utils/react/nullableValue.js +1 -1
- package/cjs/utils/react/useCombinedRefs.js +1 -1
- package/cjs/utils/react/useId.js +4 -3
- package/cjs/utils/react/useLayoutEffect.js +2 -2
- package/cjs/utils/react/wrapNodeIfPlain.js +1 -1
- package/cjs/utils/transitions.js +1 -1
- package/cjs/utils/tree.js +1 -1
- package/cjs/utils/warnings.js +1 -1
- package/es/_internal/hooks/index.js +1 -1
- package/es/_internal/hooks/use-chained-callback.js +1 -1
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/hooks/use-event.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/index.js +1 -1
- package/es/components/Base.js +4 -4
- package/es/components/Block.js +3 -3
- package/es/components/GlobalStyles.js +4 -4
- package/es/components/GridProvider.js +4 -4
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +7 -7
- package/es/components/actions/Action.js +7 -7
- package/es/components/actions/Button/Button.js +14 -14
- package/es/components/actions/Button/Submit.js +2 -2
- package/es/components/actions/Button/index.js +1 -1
- package/es/components/actions/ButtonGroup/ButtonGroup.js +2 -2
- package/es/components/actions/index.js +1 -1
- package/es/components/content/ActiveZone/ActiveZone.js +6 -6
- package/es/components/content/Alert/Alert.js +3 -3
- 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 +3 -3
- package/es/components/content/Badge/Badge.js +4 -4
- package/es/components/content/Card/Card.js +3 -3
- package/es/components/content/Content.js +3 -3
- package/es/components/content/CopySnippet/CopySnippet.js +1 -1
- package/es/components/content/CopySnippet/index.js +1 -1
- package/es/components/content/Divider.js +3 -3
- package/es/components/content/Footer.js +3 -3
- package/es/components/content/Header.js +3 -3
- package/es/components/content/Paragraph.js +4 -4
- package/es/components/content/Placeholder/Placeholder.js +5 -5
- package/es/components/content/PrismCode/PrismCode.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 +5 -5
- package/es/components/content/Text.js +5 -5
- package/es/components/content/Title.js +4 -4
- package/es/components/forms/Checkbox/Checkbox.js +8 -4
- package/es/components/forms/Checkbox/CheckboxGroup.js +3 -3
- package/es/components/forms/Checkbox/context.js +1 -1
- package/es/components/forms/FieldWrapper.js +6 -6
- package/es/components/forms/FileInput/FileInput.js +20 -12
- package/es/components/forms/Form/Field.js +12 -9
- package/es/components/forms/Form/Form.js +4 -4
- package/es/components/forms/Form/index.js +1 -1
- package/es/components/forms/Form/types.js +1 -1
- package/es/components/forms/Form/useForm.js +19 -8
- package/es/components/forms/Form/validation.js +1 -1
- package/es/components/forms/Input/Input.js +1 -1
- package/es/components/forms/Input/index.js +1 -1
- package/es/components/forms/Label.js +3 -5
- package/es/components/forms/NumberInput/NumberInput.js +6 -6
- package/es/components/forms/NumberInput/StepButton.js +4 -4
- package/es/components/forms/PasswordInput/PasswordInput.js +5 -5
- package/es/components/forms/RadioGroup/Radio.js +5 -5
- package/es/components/forms/RadioGroup/RadioGroup.js +3 -3
- package/es/components/forms/RadioGroup/context.js +1 -1
- package/es/components/forms/SearchInput/SearchInput.js +15 -8
- package/es/components/forms/Switch/Switch.js +2 -2
- package/es/components/forms/TextArea/TextArea.js +4 -4
- package/es/components/forms/TextInput/TextInput.js +4 -4
- package/es/components/forms/TextInput/TextInputBase.js +131 -68
- package/es/components/forms/index.js +1 -1
- package/es/components/layout/Flex.js +3 -3
- package/es/components/layout/Flow.js +3 -3
- package/es/components/layout/Grid.js +3 -3
- package/es/components/layout/Prefix.js +3 -3
- package/es/components/layout/Space.js +3 -3
- package/es/components/layout/Suffix.js +3 -3
- package/es/components/navigation/LegacyTabs/LegacyTabs.js +5 -5
- package/es/components/navigation/Link/Link.js +2 -2
- package/es/components/organisms/FileTabs/FileTabs.js +5 -5
- package/es/components/organisms/Modal/Modal.js +7 -7
- package/es/components/organisms/StatsCard/StatsCard.js +2 -2
- package/es/components/other/Base64Upload/Base64Upload.js +4 -4
- package/es/components/other/CloudLogo/CloudLogo.js +2 -2
- package/es/components/overlays/AlertDialog/AlertDialog.js +2 -2
- 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 +3 -3
- package/es/components/overlays/Dialog/DialogContainer.js +4 -4
- package/es/components/overlays/Dialog/DialogForm.js +6 -6
- package/es/components/overlays/Dialog/DialogTrigger.js +10 -10
- package/es/components/overlays/Dialog/context.js +1 -1
- package/es/components/overlays/Dialog/index.js +1 -1
- package/es/components/overlays/Modal/Modal.js +4 -4
- package/es/components/overlays/Modal/OpenTransition.js +1 -1
- package/es/components/overlays/Modal/Overlay.js +4 -4
- package/es/components/overlays/Modal/Popover.js +5 -5
- package/es/components/overlays/Modal/Tray.js +6 -6
- package/es/components/overlays/Modal/Underlay.js +3 -3
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/FloatingNotification.js +2 -2
- package/es/components/overlays/NewNotifications/Bar/NotificationsBar.js +4 -4
- 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 +2 -2
- package/es/components/overlays/NewNotifications/NotificationView/NotificationAction.js +2 -2
- package/es/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +2 -2
- 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 +3 -3
- 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/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.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 +2 -2
- package/es/components/overlays/OverlayWrapper.js +2 -2
- package/es/components/overlays/Toasts/Toast.js +2 -2
- 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 +7 -7
- package/es/components/overlays/Tooltip/TooltipProvider.js +2 -2
- package/es/components/overlays/Tooltip/TooltipTrigger.js +2 -2
- package/es/components/overlays/Tooltip/context.js +1 -1
- package/es/components/pickers/ComboBox/ComboBox.js +42 -39
- package/es/components/pickers/Menu/Menu.js +4 -3
- package/es/components/pickers/Menu/MenuButton.js +3 -3
- package/es/components/pickers/Menu/MenuItem.js +1 -1
- package/es/components/pickers/Menu/MenuSection.js +2 -2
- package/es/components/pickers/Menu/MenuTrigger.js +2 -2
- package/es/components/pickers/Menu/context.js +1 -1
- package/es/components/pickers/Menu/styled.js +1 -1
- package/es/components/pickers/Select/Select.js +92 -61
- 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 +2 -2
- 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/status/LoadingAnimation/LoadingAnimation.js +4 -4
- 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 +2 -2
- 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/Attention.js +1 -1
- package/es/icons/Cross.js +1 -1
- package/es/icons/Danger.js +1 -1
- package/es/icons/Success.js +1 -1
- package/es/icons/index.js +1 -1
- package/es/index.js +1 -1
- package/es/provider.js +1 -1
- package/es/providers/StyleProvider.js +1 -1
- package/es/services/notification.js +2 -2
- package/es/shared/form.js +1 -1
- package/es/shared/index.js +1 -1
- package/es/stories/FormFieldArgs.js +14 -1
- package/es/stories/components/ConfirmDeletionDialogForm.js +3 -3
- 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/styled/index.js +1 -1
- package/es/styled/styled.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/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/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/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/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/colors.js +1 -1
- package/es/tasty/utils/dotize.js +1 -1
- package/es/tasty/utils/filterBaseProps.js +1 -1
- package/es/tasty/utils/get-display-name.js +1 -1
- package/es/tasty/utils/index.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 +2 -2
- 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/test/index.js +1 -1
- package/es/test/render.js +1 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +1 -1
- package/es/tokens.js +1 -1
- 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/react/Slots.js +13 -8
- 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 +4 -3
- package/es/utils/react/useLayoutEffect.js +2 -2
- 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/package.json +6 -1
- package/types/components/Root.d.ts +1 -1
- package/types/components/actions/Action.d.ts +1 -1
- package/types/components/actions/Button/Button.d.ts +3 -1
- package/types/components/content/ActiveZone/ActiveZone.d.ts +1 -1
- package/types/components/content/Paragraph.d.ts +1 -1
- package/types/components/content/Title.d.ts +1 -1
- package/types/components/forms/Checkbox/Checkbox.d.ts +2 -2
- package/types/components/forms/Checkbox/CheckboxGroup.d.ts +1 -1
- package/types/components/forms/FileInput/FileInput.d.ts +1 -1
- package/types/components/forms/Form/Field.d.ts +2 -2
- package/types/components/forms/Form/Form.d.ts +2 -2
- package/types/components/forms/Form/types.d.ts +1 -0
- package/types/components/forms/Form/useForm.d.ts +6 -6
- package/types/components/forms/RadioGroup/Radio.d.ts +2 -2
- package/types/components/forms/RadioGroup/RadioGroup.d.ts +1 -1
- package/types/components/forms/Switch/Switch.d.ts +1 -1
- package/types/components/forms/TextInput/TextInput.d.ts +1 -1
- package/types/components/forms/TextInput/TextInputBase.d.ts +4 -1
- package/types/components/organisms/StatsCard/StatsCard.d.ts +1 -1
- package/types/components/overlays/AlertDialog/types.d.ts +1 -1
- package/types/components/overlays/Dialog/DialogForm.d.ts +2 -2
- package/types/components/overlays/Modal/Popover.d.ts +1 -1
- package/types/components/overlays/NewNotifications/NotificationView/types.d.ts +2 -2
- package/types/components/overlays/NewNotifications/NotificationsList.d.ts +1 -1
- package/types/components/overlays/NewNotifications/hooks/use-notification-list-item.d.ts +1 -1
- package/types/components/overlays/NewNotifications/hooks/use-notifications-list.d.ts +1 -1
- package/types/components/overlays/Tooltip/Tooltip.d.ts +2 -2
- package/types/components/overlays/Tooltip/TooltipProvider.d.ts +2 -2
- package/types/components/pickers/ComboBox/ComboBox.d.ts +5 -2
- package/types/components/pickers/Menu/Menu.d.ts +3 -2
- package/types/components/pickers/Select/Select.d.ts +7 -3
- package/types/shared/form.d.ts +1 -1
- package/types/stories/FormFieldArgs.d.ts +16 -0
- package/types/utils/react/mapProps.d.ts +1 -1
@@ -1,49 +1,38 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
9
9
|
import { CheckOutlined, LoadingOutlined, WarningOutlined, } from '@ant-design/icons';
|
10
|
-
import { cloneElement, forwardRef,
|
10
|
+
import { cloneElement, forwardRef, useMemo, } from 'react';
|
11
11
|
import { useComboBoxState } from '@react-stately/combobox';
|
12
12
|
import { useComboBox } from '@react-aria/combobox';
|
13
13
|
import { useButton } from '@react-aria/button';
|
14
|
-
import { useFormProps } from '../../forms/Form';
|
15
14
|
import { useHover } from '@react-aria/interactions';
|
16
|
-
import { useProviderProps } from '../../../provider';
|
17
15
|
import { useFilter } from '@react-aria/i18n';
|
16
|
+
import { Item } from '@react-stately/collections';
|
17
|
+
import { useOverlayPosition } from '@react-aria/overlays';
|
18
|
+
import { useFormProps } from '../../forms/Form';
|
19
|
+
import { useProviderProps } from '../../../provider';
|
18
20
|
import { BLOCK_STYLES, extractStyles, OUTER_STYLES, tasty, } from '../../../tasty';
|
19
21
|
import { useFocus } from '../../../utils/react/interactions';
|
20
22
|
import { mergeProps, modAttrs, useCombinedRefs } from '../../../utils/react';
|
21
23
|
import { FieldWrapper } from '../../forms/FieldWrapper';
|
22
24
|
import { ListBoxPopup } from '../Select/Select';
|
23
|
-
import {
|
24
|
-
import { Suffix } from '../../layout/Suffix';
|
25
|
-
import { Space } from '../../layout/Space';
|
26
|
-
import { Item } from '@react-stately/collections';
|
27
|
-
import { DEFAULT_INPUT_STYLES } from '../../forms/TextInput/TextInputBase';
|
28
|
-
import { useOverlayPosition } from '@react-aria/overlays';
|
25
|
+
import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES, } from '../../forms/TextInput/TextInputBase';
|
29
26
|
import { OverlayWrapper } from '../../overlays/OverlayWrapper';
|
30
|
-
|
27
|
+
function CaretDownIcon() {
|
28
|
+
return (_jsx("svg", { "aria-hidden": "true", width: "14", height: "14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.49 4.102H2.51c-.269 0-.42.284-.253.478l4.49 5.206a.342.342 0 00.506 0l4.49-5.206c.167-.194.016-.478-.253-.478z", fill: "currentColor" }, void 0) }, void 0));
|
29
|
+
}
|
31
30
|
const ComboBoxWrapperElement = tasty({
|
32
|
-
styles:
|
33
|
-
position: 'relative',
|
34
|
-
display: 'grid',
|
35
|
-
zIndex: {
|
36
|
-
'': 'initial',
|
37
|
-
focused: 1,
|
38
|
-
},
|
39
|
-
},
|
31
|
+
styles: INPUT_WRAPPER_STYLES,
|
40
32
|
});
|
41
33
|
const InputElement = tasty({
|
42
34
|
as: 'input',
|
43
|
-
styles:
|
44
|
-
...DEFAULT_INPUT_STYLES,
|
45
|
-
width: '100%',
|
46
|
-
},
|
35
|
+
styles: DEFAULT_INPUT_STYLES,
|
47
36
|
});
|
48
37
|
const TriggerElement = tasty({
|
49
38
|
as: 'button',
|
@@ -53,7 +42,7 @@ const TriggerElement = tasty({
|
|
53
42
|
placeContent: 'center',
|
54
43
|
placeSelf: 'stretch',
|
55
44
|
radius: 'right',
|
56
|
-
|
45
|
+
width: '4x',
|
57
46
|
color: {
|
58
47
|
'': '#dark.75',
|
59
48
|
hovered: '#dark.75',
|
@@ -76,11 +65,9 @@ function ComboBox(props, ref) {
|
|
76
65
|
var _a;
|
77
66
|
props = useProviderProps(props);
|
78
67
|
props = useFormProps(props);
|
79
|
-
let { qa, label, extra, labelPosition = 'top', labelStyles, isRequired, necessityIndicator, validationState, prefix, isDisabled, multiLine, autoFocus, inputRef, triggerRef, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, optionStyles, triggerStyles, suffix, listBoxStyles, overlayStyles, hideTrigger, message, description, size, autoComplete = 'off', direction = 'bottom', shouldFlip = true, requiredMark = true, menuTrigger = 'input', loadingState, filter, styles, labelSuffix, ...otherProps } = props;
|
68
|
+
let { qa, label, extra, labelPosition = 'top', labelStyles, isRequired, necessityIndicator, validationState, icon, prefix, isDisabled, multiLine, autoFocus, wrapperRef, inputRef, triggerRef, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, optionStyles, triggerStyles, suffix, listBoxStyles, overlayStyles, hideTrigger, message, description, size, autoComplete = 'off', direction = 'bottom', shouldFlip = true, requiredMark = true, menuTrigger = 'input', suffixPosition = 'before', loadingState, filter, styles, labelSuffix, ...otherProps } = props;
|
80
69
|
let isAsync = loadingState != null;
|
81
70
|
let { contains } = useFilter({ sensitivity: 'base' });
|
82
|
-
let [suffixWidth, setSuffixWidth] = useState(0);
|
83
|
-
let [prefixWidth, setPrefixWidth] = useState(0);
|
84
71
|
let state = useComboBoxState({
|
85
72
|
...props,
|
86
73
|
defaultFilter: filter || contains,
|
@@ -89,6 +76,7 @@ function ComboBox(props, ref) {
|
|
89
76
|
const outerStyles = extractStyles(otherProps, OUTER_STYLES, styles);
|
90
77
|
inputStyles = extractStyles(otherProps, BLOCK_STYLES, inputStyles);
|
91
78
|
ref = useCombinedRefs(ref);
|
79
|
+
wrapperRef = useCombinedRefs(wrapperRef);
|
92
80
|
inputRef = useCombinedRefs(inputRef);
|
93
81
|
triggerRef = useCombinedRefs(triggerRef);
|
94
82
|
popoverRef = useCombinedRefs(popoverRef);
|
@@ -111,10 +99,6 @@ function ComboBox(props, ref) {
|
|
111
99
|
onClose: state.close,
|
112
100
|
offset: overlayOffset,
|
113
101
|
});
|
114
|
-
if (prefix) {
|
115
|
-
inputStyles.paddingLeft = `${prefixWidth}px`;
|
116
|
-
}
|
117
|
-
inputStyles.paddingRight = `${suffixWidth}px`;
|
118
102
|
let { isFocused, focusProps } = useFocus({ isDisabled });
|
119
103
|
let { hoverProps, isHovered } = useHover({ isDisabled });
|
120
104
|
// Get props for the button based on the trigger props from useComboBox
|
@@ -122,26 +106,45 @@ function ComboBox(props, ref) {
|
|
122
106
|
let { hoverProps: triggerHoverProps, isHovered: isTriggerHovered } = useHover({ isDisabled });
|
123
107
|
let { focusProps: triggerFocusProps, isFocused: isTriggerFocused } = useFocus({ isDisabled }, true);
|
124
108
|
let isInvalid = validationState === 'invalid';
|
125
|
-
let validationIcon = isInvalid ? (_jsx(WarningOutlined, { style: { color: 'var(--danger-color)' } }, void 0)) : (_jsx(CheckOutlined, { style: { color: 'var(--success-color)' } }, void 0));
|
109
|
+
let validationIcon = isInvalid ? (_jsx(WarningOutlined, { "data-element": "ValidationIcon", style: { color: 'var(--danger-color)' } }, void 0)) : (_jsx(CheckOutlined, { "data-element": "ValidationIcon", style: { color: 'var(--success-color)' } }, void 0));
|
126
110
|
let validation = cloneElement(validationIcon);
|
127
|
-
let comboBoxWidth = (_a =
|
128
|
-
|
111
|
+
let comboBoxWidth = (_a = wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
112
|
+
if (icon) {
|
113
|
+
icon = _jsx("div", { "data-element": "InputIcon", children: icon }, void 0);
|
114
|
+
if (prefix) {
|
115
|
+
prefix = (_jsxs(_Fragment, { children: [icon, prefix] }, void 0));
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
prefix = icon;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
let mods = useMemo(() => ({
|
129
122
|
invalid: isInvalid,
|
130
123
|
valid: validationState === 'valid',
|
131
124
|
disabled: isDisabled,
|
132
125
|
hovered: isHovered,
|
133
126
|
focused: isFocused,
|
134
127
|
loading: isLoading,
|
135
|
-
|
136
|
-
|
128
|
+
prefix: !!prefix,
|
129
|
+
suffix: true,
|
130
|
+
}), [
|
131
|
+
isInvalid,
|
132
|
+
validationState,
|
133
|
+
isDisabled,
|
134
|
+
isHovered,
|
135
|
+
isFocused,
|
136
|
+
isLoading,
|
137
|
+
prefix,
|
138
|
+
]);
|
139
|
+
let comboBoxField = (_jsxs(ComboBoxWrapperElement, { ref: wrapperRef, qa: qa || 'ComboBox', ...modAttrs(mods), styles: outerStyles, style: {
|
137
140
|
zIndex: isFocused ? 1 : 'initial',
|
138
|
-
}, "data-size": size, children: [_jsx(InputElement, { qa: "Input", ...mergeProps(inputProps, hoverProps, focusProps), ref: inputRef, autoComplete: autoComplete, styles: inputStyles, ...modAttrs(mods), "data-size": size }, void 0), prefix ?
|
141
|
+
}, "data-size": size, children: [_jsx(InputElement, { qa: "Input", ...mergeProps(inputProps, hoverProps, focusProps), ref: inputRef, autoComplete: autoComplete, styles: inputStyles, ...modAttrs(mods), "data-size": size }, void 0), prefix ? _jsx("div", { "data-element": "Prefix", children: prefix }, void 0) : null, _jsxs("div", { "data-element": "Suffix", children: [suffixPosition === 'before' ? suffix : null, validationState || isLoading ? (_jsxs(_Fragment, { children: [validationState && !isLoading ? validation : null, isLoading ? _jsx(LoadingOutlined, {}, void 0) : null] }, void 0)) : null, suffixPosition === 'after' ? suffix : null, !hideTrigger ? (_jsx(TriggerElement, { qa: "ComboBoxTrigger", ...mergeProps(buttonProps, triggerFocusProps, triggerHoverProps), ...modAttrs({
|
139
142
|
pressed: isTriggerPressed,
|
140
143
|
focused: isTriggerFocused,
|
141
144
|
hovered: isTriggerHovered,
|
142
145
|
disabled: isDisabled,
|
143
146
|
loading: isLoading,
|
144
|
-
}), "data-size": size, isDisabled: isDisabled,
|
147
|
+
}), ref: triggerRef, "data-size": size, isDisabled: isDisabled, styles: triggerStyles, children: _jsx(CaretDownIcon, {}, void 0) }, void 0)) : null] }, void 0), _jsx(OverlayWrapper, { isOpen: state.isOpen && !isDisabled, children: _jsx(ListBoxPopup, { ...listBoxProps, shouldUseVirtualFocus: true, listBoxRef: listBoxRef, popoverRef: popoverRef, overlayProps: overlayProps, placement: placement, state: state, listBoxStyles: listBoxStyles, overlayStyles: overlayStyles, optionStyles: optionStyles, minWidth: comboBoxWidth }, void 0) }, void 0)] }, void 0));
|
145
148
|
return (_jsx(FieldWrapper, { ...{
|
146
149
|
labelPosition,
|
147
150
|
label,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -13,13 +13,13 @@ import { useSyncRef } from '@react-aria/utils';
|
|
13
13
|
import { useDOMRef } from '@react-spectrum/utils';
|
14
14
|
import { useTreeState } from '@react-stately/tree';
|
15
15
|
import { CONTAINER_STYLES, extractStyles, } from '../../../tasty';
|
16
|
+
import { mergeProps } from '../../../utils/react';
|
16
17
|
import { StyledMenu, StyledMenuHeader } from './styled';
|
17
18
|
import { MenuItem } from './MenuItem';
|
18
19
|
import { MenuSection } from './MenuSection';
|
19
20
|
import { useMenuContext } from './context';
|
20
|
-
import { mergeProps } from '../../../utils/react';
|
21
21
|
function Menu(props, ref) {
|
22
|
-
const { header, footer, selectionIcon } = props;
|
22
|
+
const { header, footer, selectionIcon, qa } = props;
|
23
23
|
const domRef = useDOMRef(ref);
|
24
24
|
const contextProps = useMenuContext();
|
25
25
|
const completeProps = mergeProps(contextProps, props);
|
@@ -29,6 +29,7 @@ function Menu(props, ref) {
|
|
29
29
|
const { menuProps } = useMenu(completeProps, state, domRef);
|
30
30
|
const styles = extractStyles(completeProps, CONTAINER_STYLES);
|
31
31
|
const baseProps = {
|
32
|
+
qa,
|
32
33
|
styles,
|
33
34
|
mods: {
|
34
35
|
sections: hasSections,
|
@@ -1,16 +1,16 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
import { CheckOutlined } from '@ant-design/icons';
|
9
10
|
import { Button } from '../../actions';
|
10
11
|
import { Text } from '../../content/Text';
|
11
12
|
import { tasty } from '../../../tasty';
|
12
13
|
import { Space } from '../../layout/Space';
|
13
|
-
import { CheckOutlined } from '@ant-design/icons';
|
14
14
|
const ACTION_BUTTON = {
|
15
15
|
border: {
|
16
16
|
'': '#clear',
|
@@ -87,7 +87,7 @@ export function MenuButton({ children, icon, postfix, ...props }) {
|
|
87
87
|
selectable: isSelectable,
|
88
88
|
selected: isSelected,
|
89
89
|
};
|
90
|
-
return (_jsxs(Button, { type: "neutral", size: "small", styles: ACTION_BUTTON, ...props, icon: checkIcon, mods: mods, children: [icon && _jsx(Text, { color: "inherit", children: icon }, void 0), _jsxs(Space, { gap: "1x", placeContent: "space-between", overflow: "auto", width: "100%", children: [_jsx(Text, { color: "inherit",
|
90
|
+
return (_jsxs(Button, { type: "neutral", size: "small", styles: ACTION_BUTTON, ...props, icon: checkIcon, mods: mods, children: [icon && _jsx(Text, { color: "inherit", children: icon }, void 0), _jsxs(Space, { gap: "1x", placeContent: "space-between", overflow: "auto", width: "100%", children: [_jsx(Text, { ellipsis: true, color: "inherit", children: children }, void 0), postfix && getPostfix(postfix)] }, void 0)] }, void 0));
|
91
91
|
}
|
92
92
|
|
93
93
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
9
|
-
import { MenuItem } from './MenuItem';
|
10
9
|
import { useMenuSection } from '@react-aria/menu';
|
10
|
+
import { MenuItem } from './MenuItem';
|
11
11
|
import { StyledMenu, StyledMenuSection, StyledMenuSectionHeading, } from './styled';
|
12
12
|
/** @private */
|
13
13
|
export function MenuSection(props) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -74,7 +74,7 @@ function MenuTrigger(props, ref) {
|
|
74
74
|
overlay = (_jsx(Tray, { isOpen: state.isOpen, onClose: state.close, children: contents }, void 0));
|
75
75
|
}
|
76
76
|
else {
|
77
|
-
overlay = (_jsx(Popover, { isOpen: state.isOpen, style: positionProps.style,
|
77
|
+
overlay = (_jsx(Popover, { ref: menuPopoverRef, hideArrow: true, isNonModal: true, isOpen: state.isOpen, style: positionProps.style, placement: placement, onClose: state.close, children: contents }, void 0));
|
78
78
|
}
|
79
79
|
return (_jsxs(Fragment, { children: [_jsx(SlotProvider, { slots: { actionButton: { holdAffordance: trigger === 'longPress' } }, children: _jsx(PressResponder, { ...menuTriggerProps, ref: menuTriggerRef, isPressed: state.isOpen, children: menuTrigger }, void 0) }, void 0), _jsx(MenuContext.Provider, { value: menuContext, children: overlay }, void 0)] }, void 0));
|
80
80
|
}
|
@@ -1,43 +1,77 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { createElement as _createElement } from "react";
|
9
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
10
10
|
import { CheckOutlined, LoadingOutlined, WarningOutlined, } from '@ant-design/icons';
|
11
|
-
import {
|
12
|
-
import { cloneElement, forwardRef, useRef, useState, } from 'react';
|
11
|
+
import { cloneElement, forwardRef, useMemo, useRef, useState, } from 'react';
|
13
12
|
import { useSelectState } from '@react-stately/select';
|
14
13
|
import { HiddenSelect, useSelect } from '@react-aria/select';
|
15
14
|
import { useListBox, useOption } from '@react-aria/listbox';
|
16
15
|
import { useButton } from '@react-aria/button';
|
17
16
|
import { FocusScope } from '@react-aria/focus';
|
18
17
|
import { DismissButton, useOverlay, useOverlayPosition, } from '@react-aria/overlays';
|
19
|
-
import { useFormProps } from '../../forms/Form/Form';
|
20
18
|
import { useFocus as useAriaFocus, useHover } from '@react-aria/interactions';
|
19
|
+
import { Item } from '@react-stately/collections';
|
20
|
+
import styled from 'styled-components';
|
21
|
+
import { useFormProps } from '../../forms';
|
21
22
|
import { useProviderProps } from '../../../provider';
|
22
23
|
import { BLOCK_STYLES, extractStyles, OUTER_STYLES, tasty, } from '../../../tasty';
|
23
24
|
import { useFocus } from '../../../utils/react/interactions';
|
24
25
|
import { FieldWrapper } from '../../forms/FieldWrapper';
|
25
|
-
import { Item } from '@react-stately/collections';
|
26
26
|
import { OverlayWrapper } from '../../overlays/OverlayWrapper';
|
27
27
|
import { getOverlayTransitionCSS } from '../../../utils/transitions';
|
28
|
-
import
|
29
|
-
|
28
|
+
import { mergeProps, useCombinedRefs } from '../../../utils/react';
|
29
|
+
import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES, } from '../../forms/TextInput/TextInputBase';
|
30
|
+
import { provideButtonStyles } from '../../actions';
|
31
|
+
function CaretDownIcon() {
|
32
|
+
return (_jsx("svg", { "aria-hidden": "true", width: "14", height: "14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.49 4.102H2.51c-.269 0-.42.284-.253.478l4.49 5.206a.342.342 0 00.506 0l4.49-5.206c.167-.194.016-.478-.253-.478z", fill: "currentColor" }, void 0) }, void 0));
|
33
|
+
}
|
30
34
|
const SelectWrapperElement = tasty({
|
31
35
|
styles: {
|
32
36
|
display: 'grid',
|
33
37
|
position: 'relative',
|
34
38
|
radius: true,
|
35
|
-
fill:
|
39
|
+
fill: {
|
40
|
+
'': '#white',
|
41
|
+
disabled: '#dark.04',
|
42
|
+
},
|
36
43
|
color: {
|
37
44
|
'': '#dark.85',
|
38
|
-
invalid: '#danger-text',
|
39
45
|
focused: '#dark.85',
|
40
|
-
|
46
|
+
invalid: '#danger-text',
|
47
|
+
disabled: '#dark.30',
|
48
|
+
},
|
49
|
+
Value: {
|
50
|
+
...DEFAULT_INPUT_STYLES,
|
51
|
+
color: 'inherit',
|
52
|
+
opacity: {
|
53
|
+
'': 1,
|
54
|
+
placeholder: '.6',
|
55
|
+
},
|
56
|
+
textAlign: 'left',
|
57
|
+
fill: '#clear',
|
58
|
+
},
|
59
|
+
CaretIcon: {
|
60
|
+
display: 'grid',
|
61
|
+
placeItems: 'center',
|
62
|
+
width: 'min 4x',
|
63
|
+
cursor: 'pointer',
|
64
|
+
},
|
65
|
+
ButtonIcon: {
|
66
|
+
display: 'grid',
|
67
|
+
placeItems: 'center',
|
68
|
+
width: 'min 4x',
|
69
|
+
color: 'inherit',
|
70
|
+
fontSize: {
|
71
|
+
'': 'initial',
|
72
|
+
'[data-size="small"]': '14px',
|
73
|
+
'[data-size="medium"]': '16px',
|
74
|
+
},
|
41
75
|
},
|
42
76
|
},
|
43
77
|
});
|
@@ -45,47 +79,15 @@ const SelectElement = tasty({
|
|
45
79
|
as: 'button',
|
46
80
|
qa: 'Button',
|
47
81
|
styles: {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
'': '1fr auto',
|
52
|
-
'with-prefix': 'auto 1fr auto',
|
53
|
-
},
|
54
|
-
placeItems: 'center stretch',
|
55
|
-
placeContent: 'center stretch',
|
56
|
-
gap: '1x',
|
57
|
-
padding: {
|
58
|
-
'': '(1.25x - 1bw) 1x (1.25x - 1bw) (1.5x - 1bw)',
|
59
|
-
'[data-size="small"]': '(.75x - 1px) 1x (.75x - 1px) (1.5x - 1px)',
|
60
|
-
},
|
82
|
+
...INPUT_WRAPPER_STYLES,
|
83
|
+
cursor: 'pointer',
|
84
|
+
padding: '0',
|
61
85
|
border: {
|
62
86
|
'': true,
|
63
|
-
invalid: '#danger-text.50',
|
64
87
|
valid: '#success-text.50',
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
reset: 'button',
|
69
|
-
margin: 0,
|
70
|
-
preset: 'default',
|
71
|
-
outline: {
|
72
|
-
'': '#purple-03.0',
|
73
|
-
focused: '#purple-03',
|
74
|
-
},
|
75
|
-
color: 'inherit',
|
76
|
-
fill: {
|
77
|
-
'': '#dark.0',
|
78
|
-
'hovered | disabled': '#dark.04',
|
79
|
-
},
|
80
|
-
fontWeight: 400,
|
81
|
-
textAlign: 'left',
|
82
|
-
cursor: 'pointer',
|
83
|
-
transition: 'theme',
|
84
|
-
Value: {
|
85
|
-
color: {
|
86
|
-
'': 'inherit',
|
87
|
-
placeholder: '#dark.4',
|
88
|
-
},
|
88
|
+
invalid: '#danger-text.50',
|
89
|
+
'[data-type="clear"]': '#clear',
|
90
|
+
disabled: true,
|
89
91
|
},
|
90
92
|
},
|
91
93
|
});
|
@@ -144,10 +146,20 @@ function Select(props, ref) {
|
|
144
146
|
var _a;
|
145
147
|
props = useProviderProps(props);
|
146
148
|
props = useFormProps(props);
|
147
|
-
let { qa, label, extra, labelPosition = 'top', labelStyles, isRequired, necessityIndicator, validationState, prefix, isDisabled, autoFocus, inputProps, triggerRef, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, optionStyles, suffix, listBoxStyles, overlayStyles, message, description, direction = 'bottom', shouldFlip = true, requiredMark = true, placeholder, tooltip, size, styles, labelSuffix, ...otherProps } = props;
|
149
|
+
let { qa, label, extra, icon, labelPosition = 'top', labelStyles, isRequired, necessityIndicator, validationState, prefix, isDisabled, autoFocus, inputProps, triggerRef, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, optionStyles, suffix, listBoxStyles, overlayStyles, message, description, direction = 'bottom', shouldFlip = true, requiredMark = true, placeholder, tooltip, size, styles, type = 'neutral', theme, labelSuffix, suffixPosition = 'before', ...otherProps } = props;
|
148
150
|
let state = useSelectState(props);
|
149
151
|
const outerStyles = extractStyles(otherProps, OUTER_STYLES, styles);
|
150
|
-
inputStyles = extractStyles(otherProps, BLOCK_STYLES,
|
152
|
+
inputStyles = extractStyles(otherProps, BLOCK_STYLES, {
|
153
|
+
...(() => {
|
154
|
+
let styles = provideButtonStyles({ type, theme });
|
155
|
+
delete styles['border'];
|
156
|
+
if (isDisabled || validationState === 'invalid') {
|
157
|
+
styles.color = 'inherit';
|
158
|
+
}
|
159
|
+
return styles;
|
160
|
+
})(),
|
161
|
+
...inputStyles,
|
162
|
+
});
|
151
163
|
ref = useCombinedRefs(ref);
|
152
164
|
triggerRef = useCombinedRefs(triggerRef);
|
153
165
|
popoverRef = useCombinedRefs(popoverRef);
|
@@ -168,22 +180,41 @@ function Select(props, ref) {
|
|
168
180
|
// Get props for the button based on the trigger props from useSelect
|
169
181
|
let { buttonProps } = useButton(triggerProps, triggerRef);
|
170
182
|
let isInvalid = validationState === 'invalid';
|
171
|
-
let validationIcon = isInvalid ? (_jsx(WarningOutlined, { style: { color: 'var(--danger-color)' } }, void 0)) : (_jsx(CheckOutlined, { style: { color: 'var(--success-color)' } }, void 0));
|
183
|
+
let validationIcon = isInvalid ? (_jsx(WarningOutlined, { "data-element": "ValidationIcon", style: { color: 'var(--danger-color)' } }, void 0)) : (_jsx(CheckOutlined, { "data-element": "ValidationIcon", style: { color: 'var(--success-color)' } }, void 0));
|
172
184
|
let validation = cloneElement(validationIcon);
|
173
185
|
let triggerWidth = (_a = triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
174
|
-
|
186
|
+
if (icon) {
|
187
|
+
icon = _jsx("div", { "data-element": "ButtonIcon", children: icon }, void 0);
|
188
|
+
if (prefix) {
|
189
|
+
prefix = (_jsxs(_Fragment, { children: [icon, prefix] }, void 0));
|
190
|
+
}
|
191
|
+
else {
|
192
|
+
prefix = icon;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
const showPlaceholder = !!(placeholder === null || placeholder === void 0 ? void 0 : placeholder.trim()) && !state.selectedItem;
|
196
|
+
const modifiers = useMemo(() => ({
|
175
197
|
invalid: isInvalid,
|
176
198
|
valid: validationState === 'valid',
|
177
199
|
disabled: isDisabled,
|
178
200
|
loading: isLoading,
|
179
201
|
hovered: isHovered,
|
180
202
|
focused: isFocused,
|
181
|
-
placeholder:
|
182
|
-
|
183
|
-
|
184
|
-
|
203
|
+
placeholder: showPlaceholder,
|
204
|
+
prefix: !!prefix,
|
205
|
+
suffix: true,
|
206
|
+
}), [
|
207
|
+
validationState,
|
208
|
+
isDisabled,
|
209
|
+
isLoading,
|
210
|
+
isHovered,
|
211
|
+
isFocused,
|
212
|
+
showPlaceholder,
|
213
|
+
prefix,
|
214
|
+
]);
|
215
|
+
let selectField = (_jsxs(SelectWrapperElement, { qa: qa || 'Select', mods: modifiers, styles: outerStyles, "data-size": size, children: [_jsx(HiddenSelect, { state: state, triggerRef: triggerRef, label: props.label, name: props.name }, void 0), _jsxs(SelectElement, { ...mergeProps(buttonProps, hoverProps, focusProps), ref: triggerRef, styles: inputStyles, "data-size": size, "data-type": type || 'neutral', mods: modifiers, children: [prefix ? _jsx("div", { "data-element": "Prefix", children: prefix }, void 0) : null, _jsx("span", { "data-element": "Value", ...valueProps, children: state.selectedItem
|
185
216
|
? state.selectedItem.rendered
|
186
|
-
: placeholder || _jsx(_Fragment, { children: "\u00A0" }, void 0) }, void 0),
|
217
|
+
: placeholder || _jsx(_Fragment, { children: "\u00A0" }, void 0) }, void 0), _jsxs("div", { "data-element": "Suffix", children: [suffixPosition === 'before' ? suffix : null, validationState && !isLoading ? validation : null, isLoading && _jsx(LoadingOutlined, {}, void 0), suffixPosition === 'after' ? suffix : null, _jsx("div", { "data-element": "CaretIcon", children: _jsx(CaretDownIcon, {}, void 0) }, void 0)] }, void 0)] }, void 0), _jsx(OverlayWrapper, { isOpen: state.isOpen && !isDisabled, children: _jsx(ListBoxPopup, { ...menuProps, popoverRef: popoverRef, listBoxRef: listBoxRef, overlayProps: overlayProps, placement: placement, state: state, listBoxStyles: listBoxStyles, overlayStyles: overlayStyles, optionStyles: optionStyles, minWidth: triggerWidth }, void 0) }, void 0)] }, void 0));
|
187
218
|
return (_jsx(FieldWrapper, { ...{
|
188
219
|
labelPosition,
|
189
220
|
label,
|
@@ -223,10 +254,10 @@ export function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, ove
|
|
223
254
|
// trigger when the popup is closed. In addition, add hidden
|
224
255
|
// <DismissButton> components at the start and end of the list
|
225
256
|
// to allow screen reader users to dismiss the popup easily.
|
226
|
-
return (_jsx(StyledOverlayElement, { ...overlayProps, ...parentOverlayProps, styles: overlayStyles, style: {
|
257
|
+
return (_jsx(StyledOverlayElement, { ...overlayProps, ...parentOverlayProps, ref: popoverRef, styles: overlayStyles, style: {
|
227
258
|
'--overlay-min-width': minWidth ? `${minWidth}px` : 'initial',
|
228
259
|
...parentOverlayProps === null || parentOverlayProps === void 0 ? void 0 : parentOverlayProps.style,
|
229
|
-
}, "data-position": placement,
|
260
|
+
}, "data-position": placement, children: _jsxs(FocusScope, { restoreFocus: true, children: [_jsx(DismissButton, { onDismiss: () => state.close() }, void 0), _jsx(ListBoxElement, { styles: listBoxStyles, ...mergeProps(listBoxProps, otherProps), ref: listBoxRef, children: Array.from(state.collection).map((item) => (_jsx(Option, { item: item, state: state, styles: optionStyles, shouldUseVirtualFocus: shouldUseVirtualFocus }, item.key))) }, void 0), _jsx(DismissButton, { onDismiss: () => state.close() }, void 0)] }, void 0) }, void 0));
|
230
261
|
}
|
231
262
|
function Option({ item, state, styles, shouldUseVirtualFocus }) {
|
232
263
|
let ref = useRef(null);
|
@@ -245,11 +276,11 @@ function Option({ item, state, styles, shouldUseVirtualFocus }) {
|
|
245
276
|
// style to the focused option
|
246
277
|
let [isFocused, setFocused] = useState(false);
|
247
278
|
let { focusProps } = useAriaFocus({ onFocusChange: setFocused });
|
248
|
-
return (_createElement(OptionElement, { ...mergeProps(optionProps, focusProps), ref: ref, mods: {
|
279
|
+
return (_createElement(OptionElement, { ...mergeProps(optionProps, focusProps), ref: ref, key: item.key, mods: {
|
249
280
|
selected: isSelected,
|
250
281
|
focused: shouldUseVirtualFocus ? isVirtualFocused : isFocused,
|
251
282
|
disabled: isDisabled,
|
252
|
-
}, "data-theme": isSelected ? 'special' : undefined, styles: styles
|
283
|
+
}, "data-theme": isSelected ? 'special' : undefined, styles: styles }, item.rendered));
|
253
284
|
}
|
254
285
|
const _Select = forwardRef(Select);
|
255
286
|
_Select.cubeInputType = 'Select';
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.12.
|
4
|
+
* @cube-dev/ui-kit v0.12.5
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
9
9
|
import { Portal } from '../../Portal';
|
10
10
|
import { Divider } from '../../../content/Divider';
|
11
|
-
export const Basic = (args) => (_jsxs(_Fragment, { children: ["By default, Portal content should be there ", ' -> ', _jsxs(Portal, { ...args, children: ["Portal's content.", !args.isDisabled &&
|
11
|
+
export const Basic = (args) => (_jsxs(_Fragment, { children: ["By default, Portal content should be there ", ' -> ', _jsxs(Portal, { ...args, children: ["Portal's content.", !args.isDisabled && " But, if you disable me, I'll be near the arrow"] }, void 0), _jsx(Divider, {}, void 0)] }, void 0));
|
12
12
|
|
13
13
|
|