@cube-dev/ui-kit 0.0.0-canary-bea6dd5 → 0.0.0-canary-77aa518
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/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 +1 -1
- package/cjs/components/Block.js +1 -1
- package/cjs/components/GlobalStyles.js +1 -1
- package/cjs/components/GridProvider.js +1 -1
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +1 -1
- package/cjs/components/actions/Action.js +104 -14
- package/cjs/components/actions/Button/Button.js +215 -184
- package/cjs/components/actions/Button/Submit.js +1 -1
- package/cjs/components/actions/Button/index.js +1 -1
- package/cjs/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/cjs/components/actions/index.js +1 -2
- package/cjs/components/content/ActiveZone/ActiveZone.js +1 -1
- package/cjs/components/content/Alert/Alert.js +1 -1
- 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 +1 -1
- package/cjs/components/content/Badge/Badge.js +1 -1
- package/cjs/components/content/Card/Card.js +1 -1
- package/cjs/components/content/Content.js +1 -1
- package/cjs/components/content/CopySnippet/CopySnippet.js +1 -1
- package/cjs/components/content/CopySnippet/index.js +1 -1
- package/cjs/components/content/Divider.js +1 -1
- package/cjs/components/content/Footer.js +1 -1
- package/cjs/components/content/Header.js +1 -1
- package/cjs/components/content/Paragraph.js +1 -1
- package/cjs/components/content/Placeholder/Placeholder.js +1 -1
- 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 +1 -1
- package/cjs/components/content/Text.js +1 -1
- package/cjs/components/content/Title.js +1 -1
- package/cjs/components/forms/Checkbox/Checkbox.js +1 -1
- package/cjs/components/forms/Checkbox/CheckboxGroup.js +1 -1
- package/cjs/components/forms/Checkbox/context.js +1 -1
- package/cjs/components/forms/FieldWrapper.js +1 -1
- package/cjs/components/forms/FileInput/FileInput.js +1 -1
- package/cjs/components/forms/Form/Field.js +1 -1
- package/cjs/components/forms/Form/Form.js +1 -1
- package/cjs/components/forms/Form/SubmitError.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/cjs/components/forms/NumberInput/NumberInput.js +2 -2
- package/cjs/components/forms/NumberInput/StepButton.js +1 -1
- package/cjs/components/forms/PasswordInput/PasswordInput.js +1 -1
- package/cjs/components/forms/RadioGroup/Radio.js +1 -1
- package/cjs/components/forms/RadioGroup/RadioGroup.js +1 -1
- package/cjs/components/forms/RadioGroup/context.js +1 -1
- package/cjs/components/forms/RangeSlider/Gradation.js +1 -1
- package/cjs/components/forms/RangeSlider/Header.js +1 -1
- package/cjs/components/forms/RangeSlider/RangeInput.js +5 -5
- package/cjs/components/forms/RangeSlider/RangeSlider.js +4 -3
- package/cjs/components/forms/RangeSlider/Slide.js +1 -1
- package/cjs/components/forms/RangeSlider/Thumb.js +1 -1
- package/cjs/components/forms/RangeSlider/helpers.js +1 -1
- package/cjs/components/forms/RangeSlider/styled.js +1 -1
- package/cjs/components/forms/SearchInput/SearchInput.js +1 -1
- package/cjs/components/forms/Switch/Switch.js +1 -1
- package/cjs/components/forms/TextArea/TextArea.js +1 -1
- package/cjs/components/forms/TextInput/TextInput.js +1 -1
- package/cjs/components/forms/TextInput/TextInputBase.js +2 -4
- package/cjs/components/forms/index.js +1 -1
- package/cjs/components/layout/Flex.js +1 -1
- package/cjs/components/layout/Flow.js +1 -1
- package/cjs/components/layout/Grid.js +1 -1
- package/cjs/components/layout/Prefix.js +1 -1
- package/cjs/components/layout/Space.js +1 -1
- package/cjs/components/layout/Suffix.js +1 -1
- package/cjs/components/navigation/LegacyTabs/LegacyTabs.js +1 -1
- package/cjs/components/navigation/Link/Link.js +1 -1
- package/cjs/components/organisms/FileTabs/FileTabs.js +1 -1
- package/cjs/components/organisms/Modal/Modal.js +2 -2
- package/cjs/components/organisms/StatsCard/StatsCard.js +1 -1
- package/cjs/components/other/Base64Upload/Base64Upload.js +1 -1
- package/cjs/components/other/CloudLogo/CloudLogo.js +1 -1
- package/cjs/components/overlays/AlertDialog/AlertDialog.js +1 -1
- 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 +1 -2
- package/cjs/components/overlays/Dialog/DialogContainer.js +1 -1
- package/cjs/components/overlays/Dialog/DialogForm.js +2 -2
- package/cjs/components/overlays/Dialog/DialogTrigger.js +7 -7
- 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 +5 -1
- package/cjs/components/overlays/Modal/OpenTransition.js +5 -2
- package/cjs/components/overlays/Modal/Overlay.js +5 -3
- package/cjs/components/overlays/Modal/Popover.js +1 -1
- package/cjs/components/overlays/Modal/Tray.js +1 -1
- package/cjs/components/overlays/Modal/Underlay.js +5 -1
- package/cjs/components/overlays/Modal/index.js +12 -1
- package/cjs/components/overlays/Modal/types.js +11 -0
- package/cjs/components/overlays/NewNotifications/Bar/FloatingNotification.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/NotificationsBar.js +1 -1
- 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 +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationAction.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +1 -1
- 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 +1 -1
- 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/NotificationsList.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/types.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 +1 -1
- package/cjs/components/overlays/OverlayWrapper.js +1 -1
- package/cjs/components/overlays/Toasts/Toast.js +1 -1
- 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 +1 -1
- package/cjs/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/cjs/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/cjs/components/overlays/Tooltip/context.js +1 -1
- package/cjs/components/pickers/ComboBox/ComboBox.js +1 -1
- package/cjs/components/pickers/Menu/Menu.js +1 -1
- package/cjs/components/pickers/Menu/MenuButton.js +1 -1
- package/cjs/components/pickers/Menu/MenuItem.js +1 -1
- package/cjs/components/pickers/Menu/MenuSection.js +1 -1
- package/cjs/components/pickers/Menu/MenuTrigger.js +1 -1
- 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 +14 -50
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/cjs/shared/form.js +1 -1
- package/cjs/shared/index.js +1 -1
- package/cjs/stories/FormFieldArgs.js +1 -1
- package/cjs/stories/components/ConfirmDeletionDialogForm.js +1 -1
- 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 +10 -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 +5 -17
- 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 +1 -1
- 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/random.js +1 -1
- package/cjs/utils/range.js +1 -1
- package/cjs/utils/react/Slots.js +1 -1
- 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 +1 -1
- package/cjs/utils/react/useLayoutEffect.js +1 -1
- package/cjs/utils/react/useViewportSize.js +1 -1
- 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 +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.js +102 -15
- package/es/components/actions/Button/Button.js +213 -183
- package/es/components/actions/Button/Submit.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/index.js +1 -2
- 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/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/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/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/forms/Checkbox/Checkbox.js +1 -1
- package/es/components/forms/Checkbox/CheckboxGroup.js +1 -1
- package/es/components/forms/Checkbox/context.js +1 -1
- package/es/components/forms/FieldWrapper.js +1 -1
- package/es/components/forms/FileInput/FileInput.js +1 -1
- package/es/components/forms/Form/Field.js +1 -1
- package/es/components/forms/Form/Form.js +1 -1
- package/es/components/forms/Form/SubmitError.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/es/components/forms/NumberInput/NumberInput.js +2 -2
- package/es/components/forms/NumberInput/StepButton.js +1 -1
- package/es/components/forms/PasswordInput/PasswordInput.js +1 -1
- package/es/components/forms/RadioGroup/Radio.js +1 -1
- package/es/components/forms/RadioGroup/RadioGroup.js +1 -1
- package/es/components/forms/RadioGroup/context.js +1 -1
- package/es/components/forms/RangeSlider/Gradation.js +1 -1
- package/es/components/forms/RangeSlider/Header.js +1 -1
- package/es/components/forms/RangeSlider/RangeInput.js +6 -6
- package/es/components/forms/RangeSlider/RangeSlider.js +4 -3
- package/es/components/forms/RangeSlider/Slide.js +1 -1
- package/es/components/forms/RangeSlider/Thumb.js +1 -1
- package/es/components/forms/RangeSlider/helpers.js +1 -1
- package/es/components/forms/RangeSlider/styled.js +1 -1
- package/es/components/forms/SearchInput/SearchInput.js +1 -1
- package/es/components/forms/Switch/Switch.js +1 -1
- package/es/components/forms/TextArea/TextArea.js +1 -1
- package/es/components/forms/TextInput/TextInput.js +1 -1
- package/es/components/forms/TextInput/TextInputBase.js +2 -4
- package/es/components/forms/index.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/Prefix.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 +2 -2
- package/es/components/organisms/StatsCard/StatsCard.js +1 -1
- package/es/components/other/Base64Upload/Base64Upload.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 -2
- package/es/components/overlays/Dialog/DialogContainer.js +1 -1
- package/es/components/overlays/Dialog/DialogForm.js +2 -2
- package/es/components/overlays/Dialog/DialogTrigger.js +7 -7
- 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 +5 -1
- package/es/components/overlays/Modal/OpenTransition.js +5 -2
- package/es/components/overlays/Modal/Overlay.js +5 -3
- 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 +5 -1
- package/es/components/overlays/Modal/index.js +2 -1
- package/es/components/overlays/Modal/types.js +10 -0
- 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/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/pickers/ComboBox/ComboBox.js +1 -1
- package/es/components/pickers/Menu/Menu.js +1 -1
- package/es/components/pickers/Menu/MenuButton.js +1 -1
- package/es/components/pickers/Menu/MenuItem.js +1 -1
- package/es/components/pickers/Menu/MenuSection.js +1 -1
- package/es/components/pickers/Menu/MenuTrigger.js +1 -1
- 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 +15 -51
- 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/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/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 +1 -1
- package/es/shared/form.js +1 -1
- package/es/shared/index.js +1 -1
- package/es/stories/FormFieldArgs.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/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 +10 -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 +5 -17
- 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 +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/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/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/useLayoutEffect.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/package.json +1 -1
- package/types/components/actions/Action.d.ts +12 -0
- package/types/components/actions/Button/Button.d.ts +806 -0
- package/types/components/actions/index.d.ts +0 -1
- package/types/components/forms/RangeSlider/RangeInput.d.ts +0 -1
- package/types/components/forms/RangeSlider/RangeSlider.d.ts +2 -4
- package/types/components/forms/RangeSlider/helpers.d.ts +2 -2
- package/types/components/overlays/Dialog/DialogTrigger.d.ts +1 -0
- package/types/components/overlays/Modal/Modal.d.ts +2 -1
- package/types/components/overlays/Modal/OpenTransition.d.ts +2 -1
- package/types/components/overlays/Modal/Overlay.d.ts +2 -1
- package/types/components/overlays/Modal/Popover.d.ts +2 -1
- package/types/components/overlays/Modal/Tray.d.ts +2 -1
- package/types/components/overlays/Modal/index.d.ts +1 -0
- package/types/components/overlays/Modal/types.d.ts +4 -0
- package/types/components/pickers/Menu/styled.d.ts +2 -2
- package/types/components/pickers/Select/Select.d.ts +2 -2
- package/types/stories/components/StyledButton.d.ts +1 -1
- package/types/tasty/types.d.ts +1 -1
- package/cjs/components/actions/use-action.js +0 -129
- package/es/components/actions/use-action.js +0 -122
- package/types/components/actions/use-action.d.ts +0 -42
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormFieldProps } from '../../../shared';
|
|
3
3
|
import { BasePropsWithoutChildren, BlockStyleProps, OuterStyleProps, Styles } from '../../../tasty';
|
|
4
|
-
import { CubeNumberInputProps } from '../NumberInput/NumberInput';
|
|
5
4
|
import { SliderValue } from './helpers';
|
|
6
5
|
import type { AriaSliderProps, SliderProps } from '@react-types/slider';
|
|
7
|
-
export interface CubeRangeSliderProps extends
|
|
6
|
+
export interface CubeRangeSliderProps extends AriaSliderProps<SliderValue>, SliderProps<SliderValue>, BasePropsWithoutChildren, OuterStyleProps, FormFieldProps, BlockStyleProps {
|
|
8
7
|
showInput?: boolean;
|
|
8
|
+
inputSuffix?: string;
|
|
9
9
|
inputStyles?: Styles;
|
|
10
10
|
gradation?: string[];
|
|
11
11
|
onChange?: (range: SliderValue) => void;
|
|
12
12
|
onChangeEnd?: (range: SliderValue) => void;
|
|
13
|
-
inputWidth?: string;
|
|
14
|
-
formatOptions?: CubeNumberInputProps['formatOptions'];
|
|
15
13
|
}
|
|
16
14
|
declare const __RangeSlider: import("react").ForwardRefExoticComponent<CubeRangeSliderProps & import("react").RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>> & {
|
|
17
15
|
cubeInputType: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare type SliderValue = number[]
|
|
1
|
+
export declare type SliderValue = number[];
|
|
2
2
|
export declare function getRanges(value: any): number[];
|
|
3
3
|
export declare function isNumber(val: any): val is number;
|
|
4
4
|
export declare function isValueValid(value?: SliderValue): value is number[];
|
|
5
|
-
export declare function getValidValue(value?: SliderValue, min?: number, max?: number): number
|
|
5
|
+
export declare function getValidValue(value?: SliderValue, min?: number, max?: number): number[] | undefined;
|
|
6
6
|
export declare function getMinMaxValue(min?: number, max?: number, value?: SliderValue): (number | undefined)[];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseProps, Styles } from '../../../tasty';
|
|
3
|
+
import { WithCloseBehavior } from './types';
|
|
3
4
|
import type { ModalProps } from '@react-types/overlays';
|
|
4
5
|
export declare const OVERLAY_WRAPPER_STYLES: Styles;
|
|
5
|
-
export interface CubeModalProps extends Omit<ModalProps, 'container'
|
|
6
|
+
export interface CubeModalProps extends Omit<ModalProps, 'container'>, WithCloseBehavior {
|
|
6
7
|
container?: HTMLElement;
|
|
7
8
|
qa?: BaseProps['qa'];
|
|
8
9
|
onClose?: (action?: string) => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { TimeoutProps } from 'react-transition-group/Transition';
|
|
3
|
+
export declare function OpenTransition(props: Omit<TimeoutProps<undefined>, 'timeout'>): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WithCloseBehavior } from './types';
|
|
2
3
|
import type { OverlayProps } from '@react-types/overlays';
|
|
3
|
-
export interface CubeOverlayProps extends Omit<OverlayProps, 'container'
|
|
4
|
+
export interface CubeOverlayProps extends Omit<OverlayProps, 'container'>, WithCloseBehavior {
|
|
4
5
|
container?: HTMLElement | null;
|
|
5
6
|
}
|
|
6
7
|
declare let _Overlay: import("react").ForwardRefExoticComponent<CubeOverlayProps & import("react").RefAttributes<unknown>>;
|
|
@@ -2,7 +2,8 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
import { OverlayProps } from '@react-types/overlays';
|
|
3
3
|
import { BaseProps } from '../../../tasty';
|
|
4
4
|
import { PlacementAxis } from '../../../shared';
|
|
5
|
-
|
|
5
|
+
import { WithCloseBehavior } from './types';
|
|
6
|
+
export interface CubePopoverProps extends BaseProps, Omit<OverlayProps, 'children'>, WithCloseBehavior {
|
|
6
7
|
container?: HTMLElement;
|
|
7
8
|
placement?: PlacementAxis;
|
|
8
9
|
arrowProps?: HTMLAttributes<HTMLElement>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseProps, Styles } from '../../../tasty';
|
|
3
|
+
import { WithCloseBehavior } from './types';
|
|
3
4
|
import type { TrayProps } from '@react-types/overlays';
|
|
4
|
-
export interface CubeTrayProps extends TrayProps {
|
|
5
|
+
export interface CubeTrayProps extends TrayProps, WithCloseBehavior {
|
|
5
6
|
container?: HTMLElement;
|
|
6
7
|
qa?: BaseProps['qa'];
|
|
7
8
|
onClose?: (action?: string) => void;
|
|
@@ -75,7 +75,7 @@ export declare const StyledMenuHeader: import("react").ComponentType<{
|
|
|
75
75
|
isHidden?: boolean | undefined;
|
|
76
76
|
isDisabled?: boolean | undefined;
|
|
77
77
|
styleName?: string | undefined;
|
|
78
|
-
theme?: (string & {}) | "danger" | "default" |
|
|
78
|
+
theme?: (string & {}) | "danger" | "default" | undefined;
|
|
79
79
|
key?: import("react").Key | null | undefined;
|
|
80
80
|
} & {}>;
|
|
81
81
|
export declare const StyledMenuSection: any;
|
|
@@ -154,6 +154,6 @@ export declare const StyledMenuSectionHeading: import("react").ComponentType<{
|
|
|
154
154
|
isHidden?: boolean | undefined;
|
|
155
155
|
isDisabled?: boolean | undefined;
|
|
156
156
|
styleName?: string | undefined;
|
|
157
|
-
theme?: (string & {}) | "danger" | "default" |
|
|
157
|
+
theme?: (string & {}) | "danger" | "default" | undefined;
|
|
158
158
|
key?: import("react").Key | null | undefined;
|
|
159
159
|
} & {}>;
|
|
@@ -2,6 +2,7 @@ import { ReactElement, ReactNode, RefObject } from 'react';
|
|
|
2
2
|
import { Item } from '@react-stately/collections';
|
|
3
3
|
import { BasePropsWithoutChildren, BlockStyleProps, OuterStyleProps, Props, Styles } from '../../../tasty';
|
|
4
4
|
import { FormFieldProps } from '../../../shared';
|
|
5
|
+
import { CubeButtonProps } from '../../actions';
|
|
5
6
|
import type { AriaSelectProps } from '@react-types/select';
|
|
6
7
|
export interface CubeSelectBaseProps<T> extends BasePropsWithoutChildren, OuterStyleProps, FormFieldProps, BlockStyleProps, AriaSelectProps<T> {
|
|
7
8
|
icon?: ReactElement;
|
|
@@ -20,7 +21,7 @@ export interface CubeSelectBaseProps<T> extends BasePropsWithoutChildren, OuterS
|
|
|
20
21
|
direction?: 'top' | 'bottom';
|
|
21
22
|
shouldFlip?: boolean;
|
|
22
23
|
inputProps?: Props;
|
|
23
|
-
type?: '
|
|
24
|
+
type?: CubeButtonProps['type'];
|
|
24
25
|
suffixPosition?: 'before' | 'after';
|
|
25
26
|
}
|
|
26
27
|
export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
|
|
@@ -28,7 +29,6 @@ export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
|
|
|
28
29
|
/** The ref for the list box. */
|
|
29
30
|
listBoxRef?: RefObject<HTMLElement>;
|
|
30
31
|
size?: 'small' | 'default' | 'large' | string;
|
|
31
|
-
ellipsis?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
|
|
34
34
|
[x: string]: any;
|
|
@@ -78,7 +78,7 @@ export declare const StyledButton: import("react").ComponentType<{
|
|
|
78
78
|
isHidden?: boolean | undefined;
|
|
79
79
|
isDisabled?: boolean | undefined;
|
|
80
80
|
styleName?: string | undefined;
|
|
81
|
-
theme?: (string & {}) | "danger" | "default" |
|
|
81
|
+
theme?: (string & {}) | "danger" | "default" | undefined;
|
|
82
82
|
as?: keyof HTMLElementTagNameMap | undefined;
|
|
83
83
|
autoFocus?: boolean | undefined;
|
|
84
84
|
href?: string | undefined;
|
package/types/tasty/types.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
|
|
|
37
37
|
[key: string]: string | number | null;
|
|
38
38
|
});
|
|
39
39
|
/** User-defined theme for the element. Mapped to data-theme attribute. Use `default`, or `danger`, or any custom string value you need. */
|
|
40
|
-
theme?: 'default' | 'danger' |
|
|
40
|
+
theme?: 'default' | 'danger' | (string & {});
|
|
41
41
|
}
|
|
42
42
|
export interface BaseProps extends BasePropsWithoutChildren, Pick<AllHTMLAttributes<HTMLElementTagNameMap['div']>, 'children'> {
|
|
43
43
|
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-bea6dd5
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.useAction = exports.performClickHandler = exports.parseTo = exports.openLink = void 0;
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const interactions_1 = require("@react-aria/interactions");
|
|
13
|
-
const button_1 = require("@react-aria/button");
|
|
14
|
-
const utils_1 = require("@react-spectrum/utils");
|
|
15
|
-
const provider_1 = require("../../provider");
|
|
16
|
-
const react_2 = require("../../utils/react");
|
|
17
|
-
const interactions_2 = require("../../utils/react/interactions");
|
|
18
|
-
const tasty_1 = require("../../tasty");
|
|
19
|
-
const FILTER_OPTIONS = { propNames: new Set(['onMouseEnter', 'onMouseLeave']) };
|
|
20
|
-
/**
|
|
21
|
-
* Helper to open link.
|
|
22
|
-
* @param {String} href
|
|
23
|
-
* @param {String|Boolean} [target]
|
|
24
|
-
*/
|
|
25
|
-
function openLink(href, target) {
|
|
26
|
-
const link = document.createElement('a');
|
|
27
|
-
link.href = href;
|
|
28
|
-
if (target) {
|
|
29
|
-
link.target = target === true ? '_blank' : target;
|
|
30
|
-
}
|
|
31
|
-
document.body.appendChild(link);
|
|
32
|
-
link.click();
|
|
33
|
-
document.body.removeChild(link);
|
|
34
|
-
}
|
|
35
|
-
exports.openLink = openLink;
|
|
36
|
-
function parseTo(to) {
|
|
37
|
-
const newTab = to && typeof to === 'string' && to.startsWith('!');
|
|
38
|
-
const nativeRoute = to && typeof to === 'string' && to.startsWith('@');
|
|
39
|
-
const href = to && typeof to === 'string'
|
|
40
|
-
? newTab || nativeRoute
|
|
41
|
-
? to.slice(1)
|
|
42
|
-
: to
|
|
43
|
-
: undefined;
|
|
44
|
-
return {
|
|
45
|
-
newTab,
|
|
46
|
-
nativeRoute,
|
|
47
|
-
href,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
exports.parseTo = parseTo;
|
|
51
|
-
function performClickHandler(evt, router, to, onPress) {
|
|
52
|
-
const { newTab, nativeRoute, href } = parseTo(to);
|
|
53
|
-
onPress?.(evt);
|
|
54
|
-
if (!to)
|
|
55
|
-
return;
|
|
56
|
-
if (evt.shiftKey || evt.metaKey || newTab) {
|
|
57
|
-
openLink(href, true);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (nativeRoute) {
|
|
61
|
-
openLink(href || window.location.href);
|
|
62
|
-
}
|
|
63
|
-
else if (href && href.startsWith('#')) {
|
|
64
|
-
const id = href.slice(1);
|
|
65
|
-
const element = document.getElementById(id);
|
|
66
|
-
if (element) {
|
|
67
|
-
element.scrollIntoView({
|
|
68
|
-
behavior: 'smooth',
|
|
69
|
-
block: 'start',
|
|
70
|
-
inline: 'nearest',
|
|
71
|
-
});
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (router) {
|
|
76
|
-
router.push(href);
|
|
77
|
-
}
|
|
78
|
-
else if (href) {
|
|
79
|
-
window.location.href = href;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.performClickHandler = performClickHandler;
|
|
83
|
-
const useAction = function useAction({ to, as, htmlType, label, mods, onPress, ...props }, ref) {
|
|
84
|
-
as = to ? 'a' : as || 'button';
|
|
85
|
-
const router = (0, react_1.useContext)(provider_1.UIKitContext).router;
|
|
86
|
-
const isDisabled = props.isDisabled;
|
|
87
|
-
const { newTab, href } = parseTo(to);
|
|
88
|
-
const target = newTab ? '_blank' : undefined;
|
|
89
|
-
const domRef = (0, utils_1.useFocusableRef)(ref);
|
|
90
|
-
const customOnPress = (0, react_1.useCallback)((evt) => {
|
|
91
|
-
performClickHandler(evt, router, to, onPress);
|
|
92
|
-
}, [router, to, onPress]);
|
|
93
|
-
let { buttonProps, isPressed } = (0, button_1.useButton)({
|
|
94
|
-
...props,
|
|
95
|
-
onPress: customOnPress,
|
|
96
|
-
}, domRef);
|
|
97
|
-
let { hoverProps, isHovered } = (0, interactions_1.useHover)({ isDisabled });
|
|
98
|
-
let { focusProps, isFocused } = (0, interactions_2.useFocus)({ isDisabled }, true);
|
|
99
|
-
const customProps = to
|
|
100
|
-
? {
|
|
101
|
-
onClick(evt) {
|
|
102
|
-
evt.preventDefault();
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
: {};
|
|
106
|
-
return {
|
|
107
|
-
actionProps: {
|
|
108
|
-
mods: {
|
|
109
|
-
hovered: isHovered && !isDisabled,
|
|
110
|
-
pressed: isPressed && !isDisabled,
|
|
111
|
-
focused: isFocused && !isDisabled,
|
|
112
|
-
disabled: isDisabled,
|
|
113
|
-
...mods,
|
|
114
|
-
},
|
|
115
|
-
...(0, react_2.mergeProps)(buttonProps, hoverProps, focusProps, customProps, (0, tasty_1.filterBaseProps)(props, FILTER_OPTIONS)),
|
|
116
|
-
'aria-label': label,
|
|
117
|
-
ref: domRef,
|
|
118
|
-
type: htmlType || 'button',
|
|
119
|
-
rel: as === 'a' && newTab ? 'rel="noopener noreferrer"' : undefined,
|
|
120
|
-
as,
|
|
121
|
-
isDisabled,
|
|
122
|
-
target,
|
|
123
|
-
href,
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
exports.useAction = useAction;
|
|
128
|
-
|
|
129
|
-
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-bea6dd5
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { useCallback, useContext } from 'react';
|
|
9
|
-
import { useHover } from '@react-aria/interactions';
|
|
10
|
-
import { useButton } from '@react-aria/button';
|
|
11
|
-
import { useFocusableRef } from '@react-spectrum/utils';
|
|
12
|
-
import { UIKitContext } from '../../provider';
|
|
13
|
-
import { mergeProps } from '../../utils/react';
|
|
14
|
-
import { useFocus } from '../../utils/react/interactions';
|
|
15
|
-
import { filterBaseProps } from '../../tasty';
|
|
16
|
-
const FILTER_OPTIONS = { propNames: new Set(['onMouseEnter', 'onMouseLeave']) };
|
|
17
|
-
/**
|
|
18
|
-
* Helper to open link.
|
|
19
|
-
* @param {String} href
|
|
20
|
-
* @param {String|Boolean} [target]
|
|
21
|
-
*/
|
|
22
|
-
export function openLink(href, target) {
|
|
23
|
-
const link = document.createElement('a');
|
|
24
|
-
link.href = href;
|
|
25
|
-
if (target) {
|
|
26
|
-
link.target = target === true ? '_blank' : target;
|
|
27
|
-
}
|
|
28
|
-
document.body.appendChild(link);
|
|
29
|
-
link.click();
|
|
30
|
-
document.body.removeChild(link);
|
|
31
|
-
}
|
|
32
|
-
export function parseTo(to) {
|
|
33
|
-
const newTab = to && typeof to === 'string' && to.startsWith('!');
|
|
34
|
-
const nativeRoute = to && typeof to === 'string' && to.startsWith('@');
|
|
35
|
-
const href = to && typeof to === 'string'
|
|
36
|
-
? newTab || nativeRoute
|
|
37
|
-
? to.slice(1)
|
|
38
|
-
: to
|
|
39
|
-
: undefined;
|
|
40
|
-
return {
|
|
41
|
-
newTab,
|
|
42
|
-
nativeRoute,
|
|
43
|
-
href,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export function performClickHandler(evt, router, to, onPress) {
|
|
47
|
-
const { newTab, nativeRoute, href } = parseTo(to);
|
|
48
|
-
onPress?.(evt);
|
|
49
|
-
if (!to)
|
|
50
|
-
return;
|
|
51
|
-
if (evt.shiftKey || evt.metaKey || newTab) {
|
|
52
|
-
openLink(href, true);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (nativeRoute) {
|
|
56
|
-
openLink(href || window.location.href);
|
|
57
|
-
}
|
|
58
|
-
else if (href && href.startsWith('#')) {
|
|
59
|
-
const id = href.slice(1);
|
|
60
|
-
const element = document.getElementById(id);
|
|
61
|
-
if (element) {
|
|
62
|
-
element.scrollIntoView({
|
|
63
|
-
behavior: 'smooth',
|
|
64
|
-
block: 'start',
|
|
65
|
-
inline: 'nearest',
|
|
66
|
-
});
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (router) {
|
|
71
|
-
router.push(href);
|
|
72
|
-
}
|
|
73
|
-
else if (href) {
|
|
74
|
-
window.location.href = href;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export const useAction = function useAction({ to, as, htmlType, label, mods, onPress, ...props }, ref) {
|
|
78
|
-
as = to ? 'a' : as || 'button';
|
|
79
|
-
const router = useContext(UIKitContext).router;
|
|
80
|
-
const isDisabled = props.isDisabled;
|
|
81
|
-
const { newTab, href } = parseTo(to);
|
|
82
|
-
const target = newTab ? '_blank' : undefined;
|
|
83
|
-
const domRef = useFocusableRef(ref);
|
|
84
|
-
const customOnPress = useCallback((evt) => {
|
|
85
|
-
performClickHandler(evt, router, to, onPress);
|
|
86
|
-
}, [router, to, onPress]);
|
|
87
|
-
let { buttonProps, isPressed } = useButton({
|
|
88
|
-
...props,
|
|
89
|
-
onPress: customOnPress,
|
|
90
|
-
}, domRef);
|
|
91
|
-
let { hoverProps, isHovered } = useHover({ isDisabled });
|
|
92
|
-
let { focusProps, isFocused } = useFocus({ isDisabled }, true);
|
|
93
|
-
const customProps = to
|
|
94
|
-
? {
|
|
95
|
-
onClick(evt) {
|
|
96
|
-
evt.preventDefault();
|
|
97
|
-
},
|
|
98
|
-
}
|
|
99
|
-
: {};
|
|
100
|
-
return {
|
|
101
|
-
actionProps: {
|
|
102
|
-
mods: {
|
|
103
|
-
hovered: isHovered && !isDisabled,
|
|
104
|
-
pressed: isPressed && !isDisabled,
|
|
105
|
-
focused: isFocused && !isDisabled,
|
|
106
|
-
disabled: isDisabled,
|
|
107
|
-
...mods,
|
|
108
|
-
},
|
|
109
|
-
...mergeProps(buttonProps, hoverProps, focusProps, customProps, filterBaseProps(props, FILTER_OPTIONS)),
|
|
110
|
-
'aria-label': label,
|
|
111
|
-
ref: domRef,
|
|
112
|
-
type: htmlType || 'button',
|
|
113
|
-
rel: as === 'a' && newTab ? 'rel="noopener noreferrer"' : undefined,
|
|
114
|
-
as,
|
|
115
|
-
isDisabled,
|
|
116
|
-
target,
|
|
117
|
-
href,
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
|
-
import { AriaButtonProps } from '@react-types/button';
|
|
3
|
-
import { FocusableRef } from '@react-types/shared';
|
|
4
|
-
import { BaseProps, TagNameProps } from '../../tasty';
|
|
5
|
-
export interface CubeUseActionProps extends BaseProps, TagNameProps, Omit<AriaButtonProps, 'type'> {
|
|
6
|
-
to?: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
htmlType?: 'button' | 'submit' | 'reset' | undefined;
|
|
9
|
-
onClick?: MouseEventHandler;
|
|
10
|
-
onMouseEnter?: MouseEventHandler;
|
|
11
|
-
onMouseLeave?: MouseEventHandler;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Helper to open link.
|
|
15
|
-
* @param {String} href
|
|
16
|
-
* @param {String|Boolean} [target]
|
|
17
|
-
*/
|
|
18
|
-
export declare function openLink(href: any, target?: any): void;
|
|
19
|
-
export declare function parseTo(to: any): {
|
|
20
|
-
newTab: boolean;
|
|
21
|
-
nativeRoute: boolean;
|
|
22
|
-
href: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
export declare function performClickHandler(evt: any, router: any, to: any, onPress: any): void;
|
|
25
|
-
export declare const useAction: ({ to, as, htmlType, label, mods, onPress, ...props }: CubeUseActionProps, ref: FocusableRef<HTMLElement>) => {
|
|
26
|
-
actionProps: {
|
|
27
|
-
'aria-label': string | undefined;
|
|
28
|
-
ref: import("react").RefObject<HTMLElement>;
|
|
29
|
-
type: "button" | "reset" | "submit";
|
|
30
|
-
rel: string | undefined;
|
|
31
|
-
as: "object" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "font" | "dir" | "frame" | "frameset" | "marquee";
|
|
32
|
-
isDisabled: boolean | undefined;
|
|
33
|
-
target: string | undefined;
|
|
34
|
-
href: string | undefined;
|
|
35
|
-
mods: {
|
|
36
|
-
hovered: boolean;
|
|
37
|
-
pressed: boolean;
|
|
38
|
-
focused: boolean;
|
|
39
|
-
disabled: boolean | undefined;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|