@cube-dev/ui-kit 0.10.11 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/_internal/hooks/index.js +5 -1
- package/cjs/_internal/hooks/use-chained-callback.js +23 -0
- package/cjs/_internal/hooks/use-deprecation-warning.js +1 -1
- package/cjs/_internal/hooks/use-event.js +26 -0
- package/cjs/_internal/hooks/use-sync-ref.js +21 -0
- package/cjs/_internal/hooks/use-timer/index.js +23 -0
- package/cjs/_internal/hooks/use-timer/timer.js +61 -0
- package/cjs/_internal/hooks/use-timer/use-timer.js +49 -0
- 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 +3 -2
- package/cjs/components/actions/Action.js +1 -1
- package/cjs/components/actions/Button/Button.js +1 -1
- 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 -1
- 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 +11 -24
- 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 +4 -4
- 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/index.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 +1 -1
- 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/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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 -6
- package/cjs/components/overlays/Dialog/DialogContainer.js +1 -1
- package/cjs/components/overlays/Dialog/DialogForm.js +1 -1
- package/cjs/components/overlays/Dialog/DialogTrigger.js +1 -1
- 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 +1 -1
- package/cjs/components/overlays/Modal/OpenTransition.js +1 -1
- package/cjs/components/overlays/Modal/Overlay.js +1 -1
- 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 +1 -1
- package/cjs/components/overlays/Modal/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/FloatingNotification.js +49 -0
- package/cjs/components/overlays/NewNotifications/Bar/NotificationsBar.js +66 -0
- package/cjs/components/overlays/NewNotifications/Bar/TransitionComponent.js +61 -0
- package/cjs/components/overlays/NewNotifications/Bar/index.js +22 -0
- package/cjs/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +43 -0
- package/cjs/components/overlays/NewNotifications/Dialog/index.js +22 -0
- package/cjs/components/overlays/NewNotifications/Notification.js +38 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationAction.js +32 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +40 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +30 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +65 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +21 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +67 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +30 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationView.js +80 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/index.js +23 -0
- package/cjs/components/overlays/NewNotifications/NotificationView/types.js +11 -0
- package/cjs/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +25 -0
- package/cjs/components/overlays/NewNotifications/NotificationsContext/index.js +15 -0
- package/cjs/components/overlays/NewNotifications/NotificationsContext/use-notifications-api.js +24 -0
- package/cjs/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +91 -0
- package/cjs/components/overlays/NewNotifications/NotificationsList.js +43 -0
- package/cjs/components/overlays/NewNotifications/hooks/index.js +26 -0
- package/cjs/components/overlays/NewNotifications/hooks/types.js +11 -0
- package/cjs/components/overlays/NewNotifications/hooks/use-notification-list-item.js +18 -0
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-api.js +24 -0
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-list.js +33 -0
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-observer.js +22 -0
- package/cjs/components/overlays/NewNotifications/index.js +30 -0
- package/cjs/components/overlays/NewNotifications/types.js +11 -0
- package/cjs/components/overlays/Notification/Notification.js +1 -1
- package/cjs/components/overlays/OverlayWrapper.js +1 -1
- package/cjs/components/overlays/Toasts/Toast.js +40 -0
- package/cjs/components/overlays/Toasts/index.js +23 -0
- package/cjs/components/overlays/Toasts/types.js +11 -0
- package/cjs/components/overlays/Toasts/use-toasts-api.js +43 -0
- 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 +4 -4
- package/cjs/components/pickers/Menu/MenuButton.js +32 -4
- package/cjs/components/pickers/Menu/MenuItem.js +3 -3
- 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 +1 -1
- 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 +14 -0
- package/cjs/components/status/Spin/Cube.js +196 -0
- package/cjs/components/status/Spin/InternalSpinner.js +29 -0
- package/cjs/components/status/Spin/Spin.js +10 -23
- package/cjs/components/status/Spin/SpinsContainer.js +45 -0
- package/cjs/components/status/Spin/index.js +22 -0
- package/cjs/components/status/Spin/types.js +11 -0
- package/cjs/components/status/index.js +23 -0
- package/cjs/data/themes.js +1 -1
- package/cjs/icons/Attention.js +17 -0
- package/cjs/icons/Cross.js +17 -0
- package/cjs/icons/Danger.js +17 -0
- package/cjs/icons/Success.js +17 -0
- package/cjs/icons/index.js +25 -0
- package/cjs/index.js +6 -7
- package/cjs/provider.js +1 -1
- package/cjs/providers/StyleProvider.js +1 -1
- package/cjs/services/notification.js +4 -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 +5 -4
- 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 +4 -3
- 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/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 +2 -1
- package/cjs/test/render.js +12 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +2 -2
- package/cjs/tokens.js +2 -2
- 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 +5 -4
- package/cjs/utils/react/chain.js +1 -1
- package/cjs/utils/react/get-display-name.js +21 -0
- package/cjs/utils/react/index.js +12 -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/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 +5 -1
- package/es/_internal/hooks/use-chained-callback.js +19 -0
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/hooks/use-event.js +22 -0
- package/es/_internal/hooks/use-sync-ref.js +17 -0
- package/es/_internal/hooks/use-timer/index.js +11 -0
- package/es/_internal/hooks/use-timer/timer.js +57 -0
- package/es/_internal/hooks/use-timer/use-timer.js +45 -0
- 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 +3 -2
- package/es/components/actions/Action.js +1 -1
- package/es/components/actions/Button/Button.js +1 -1
- 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 -1
- package/es/components/content/ActiveZone/ActiveZone.js +1 -1
- package/es/components/content/Alert/Alert.js +1 -1
- package/es/components/content/Alert/index.js +1 -1
- package/es/components/content/Alert/types.js +1 -1
- package/es/components/content/Alert/use-alert.js +1 -1
- package/es/components/content/Avatar/Avatar.js +1 -1
- package/es/components/content/Badge/Badge.js +1 -1
- package/es/components/content/Card/Card.js +1 -1
- package/es/components/content/Content.js +1 -1
- package/es/components/content/CopySnippet/CopySnippet.js +11 -24
- 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 +4 -4
- 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/index.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 +1 -1
- 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/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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 -6
- package/es/components/overlays/Dialog/DialogContainer.js +1 -1
- package/es/components/overlays/Dialog/DialogForm.js +1 -1
- package/es/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/es/components/overlays/Dialog/context.js +1 -1
- package/es/components/overlays/Dialog/index.js +1 -1
- package/es/components/overlays/Modal/Modal.js +1 -1
- package/es/components/overlays/Modal/OpenTransition.js +1 -1
- package/es/components/overlays/Modal/Overlay.js +1 -1
- package/es/components/overlays/Modal/Popover.js +1 -1
- package/es/components/overlays/Modal/Tray.js +1 -1
- package/es/components/overlays/Modal/Underlay.js +1 -1
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/FloatingNotification.js +46 -0
- package/es/components/overlays/NewNotifications/Bar/NotificationsBar.js +62 -0
- package/es/components/overlays/NewNotifications/Bar/TransitionComponent.js +54 -0
- package/es/components/overlays/NewNotifications/Bar/index.js +10 -0
- package/es/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +38 -0
- package/es/components/overlays/NewNotifications/Dialog/index.js +10 -0
- package/es/components/overlays/NewNotifications/Notification.js +34 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationAction.js +28 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +37 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +27 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +40 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +18 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +64 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +22 -0
- package/es/components/overlays/NewNotifications/NotificationView/NotificationView.js +77 -0
- package/es/components/overlays/NewNotifications/NotificationView/index.js +11 -0
- package/es/components/overlays/NewNotifications/NotificationView/types.js +10 -0
- package/es/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +21 -0
- package/es/components/overlays/NewNotifications/NotificationsContext/index.js +10 -0
- package/es/components/overlays/NewNotifications/NotificationsContext/use-notifications-api.js +17 -0
- package/es/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +87 -0
- package/es/components/overlays/NewNotifications/NotificationsList.js +39 -0
- package/es/components/overlays/NewNotifications/hooks/index.js +14 -0
- package/es/components/overlays/NewNotifications/hooks/types.js +10 -0
- package/es/components/overlays/NewNotifications/hooks/use-notification-list-item.js +14 -0
- package/es/components/overlays/NewNotifications/hooks/use-notifications-api.js +17 -0
- package/es/components/overlays/NewNotifications/hooks/use-notifications-list.js +29 -0
- package/es/components/overlays/NewNotifications/hooks/use-notifications-observer.js +18 -0
- package/es/components/overlays/NewNotifications/index.js +15 -0
- package/es/components/overlays/NewNotifications/types.js +10 -0
- package/es/components/overlays/Notification/Notification.js +1 -1
- package/es/components/overlays/OverlayWrapper.js +1 -1
- package/es/components/overlays/Toasts/Toast.js +36 -0
- package/es/components/overlays/Toasts/index.js +11 -0
- package/es/components/overlays/Toasts/types.js +10 -0
- package/es/components/overlays/Toasts/use-toasts-api.js +39 -0
- 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 +4 -4
- package/es/components/pickers/Menu/MenuButton.js +32 -4
- package/es/components/pickers/Menu/MenuItem.js +3 -3
- 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 +1 -1
- package/es/components/portal/Portal.js +1 -1
- package/es/components/portal/PortalProvider.js +1 -1
- package/es/components/portal/index.js +1 -1
- package/es/components/portal/storybook/templates/CustomRoot.js +1 -1
- package/es/components/portal/storybook/templates/PortalOrder.js +1 -1
- package/es/components/portal/storybook/templates/basic.js +1 -1
- package/es/components/portal/storybook/templates/index.js +1 -1
- package/es/components/portal/types.js +1 -1
- package/es/components/portal/usePortal.js +1 -1
- package/es/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/es/components/status/LoadingAnimation/index.js +10 -0
- package/es/components/status/Spin/Cube.js +190 -0
- package/es/components/status/Spin/InternalSpinner.js +26 -0
- package/es/components/status/Spin/Spin.js +10 -24
- package/es/components/status/Spin/SpinsContainer.js +39 -0
- package/es/components/status/Spin/index.js +10 -0
- package/es/components/status/Spin/types.js +10 -0
- package/es/components/status/index.js +11 -0
- package/es/data/themes.js +1 -1
- package/es/icons/Attention.js +13 -0
- package/es/icons/Cross.js +13 -0
- package/es/icons/Danger.js +13 -0
- package/es/icons/Success.js +13 -0
- package/es/icons/index.js +13 -0
- package/es/index.js +4 -3
- package/es/provider.js +1 -1
- package/es/providers/StyleProvider.js +1 -1
- package/es/services/notification.js +4 -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 +5 -4
- 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 +4 -3
- 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/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 +2 -1
- package/es/test/render.js +2 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +2 -2
- package/es/tokens.js +2 -2
- package/es/type-checks.js +1 -1
- package/es/utils/ResizeSensor.js +1 -1
- package/es/utils/modules.js +1 -1
- package/es/utils/promise.js +1 -1
- package/es/utils/react/Slots.js +5 -4
- package/es/utils/react/chain.js +1 -1
- package/es/utils/react/get-display-name.js +17 -0
- package/es/utils/react/index.js +2 -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/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 +3 -2
- package/types/_internal/hooks/index.d.ts +4 -0
- package/types/_internal/hooks/use-chained-callback.d.ts +1 -0
- package/types/_internal/hooks/use-event.d.ts +7 -0
- package/types/_internal/hooks/use-sync-ref.d.ts +2 -0
- package/types/_internal/hooks/use-timer/index.d.ts +2 -0
- package/types/_internal/hooks/use-timer/timer.d.ts +15 -0
- package/types/_internal/hooks/use-timer/use-timer.d.ts +10 -0
- package/types/components/actions/Button/Button.d.ts +1 -1
- package/types/components/overlays/AlertDialog/AlertDialogApiProvider.d.ts +1 -1
- package/types/components/overlays/NewNotifications/Bar/FloatingNotification.d.ts +12 -0
- package/types/components/overlays/NewNotifications/Bar/NotificationsBar.d.ts +13 -0
- package/types/components/overlays/NewNotifications/Bar/TransitionComponent.d.ts +4 -0
- package/types/components/overlays/NewNotifications/Bar/index.d.ts +1 -0
- package/types/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.d.ts +11 -0
- package/types/components/overlays/NewNotifications/Dialog/index.d.ts +1 -0
- package/types/components/overlays/NewNotifications/Notification.d.ts +8 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationAction.d.ts +10 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.d.ts +7 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationDescription.d.ts +8 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationFooter.d.ts +10 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationHeader.d.ts +8 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationIcon.d.ts +3 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationProvider.d.ts +7 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationView.d.ts +8 -0
- package/types/components/overlays/NewNotifications/NotificationView/index.d.ts +2 -0
- package/types/components/overlays/NewNotifications/NotificationView/types.d.ts +16 -0
- package/types/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.d.ts +9 -0
- package/types/components/overlays/NewNotifications/NotificationsContext/index.d.ts +1 -0
- package/types/components/overlays/NewNotifications/NotificationsContext/use-notifications-api.d.ts +1 -0
- package/types/components/overlays/NewNotifications/NotificationsContext/use-notifications.d.ts +8 -0
- package/types/components/overlays/NewNotifications/NotificationsList.d.ts +20 -0
- package/types/components/overlays/NewNotifications/hooks/index.d.ts +5 -0
- package/types/components/overlays/NewNotifications/hooks/types.d.ts +10 -0
- package/types/components/overlays/NewNotifications/hooks/use-notification-list-item.d.ts +9 -0
- package/types/components/overlays/NewNotifications/hooks/use-notifications-api.d.ts +1 -0
- package/types/components/overlays/NewNotifications/hooks/use-notifications-list.d.ts +12 -0
- package/types/components/overlays/NewNotifications/hooks/use-notifications-observer.d.ts +2 -0
- package/types/components/overlays/NewNotifications/index.d.ts +8 -0
- package/types/components/overlays/NewNotifications/types.d.ts +87 -0
- package/types/components/overlays/Toasts/Toast.d.ts +8 -0
- package/types/components/overlays/Toasts/index.d.ts +3 -0
- package/types/components/overlays/Toasts/types.d.ts +23 -0
- package/types/components/overlays/Toasts/use-toasts-api.d.ts +6 -0
- package/types/components/pickers/Menu/Menu.d.ts +2 -1
- package/types/components/pickers/Menu/MenuButton.d.ts +2 -0
- package/types/components/pickers/Menu/MenuItem.d.ts +2 -0
- package/types/components/status/LoadingAnimation/index.d.ts +2 -0
- package/types/components/status/Spin/Cube.d.ts +2 -0
- package/types/components/status/Spin/InternalSpinner.d.ts +3 -0
- package/types/components/status/Spin/Spin.d.ts +2 -7
- package/types/components/status/Spin/SpinsContainer.d.ts +1 -0
- package/types/components/status/Spin/index.d.ts +2 -0
- package/types/components/status/Spin/types.d.ts +23 -0
- package/types/components/status/index.d.ts +2 -0
- package/types/icons/Attention.d.ts +2 -0
- package/types/icons/Cross.d.ts +2 -0
- package/types/icons/Danger.d.ts +2 -0
- package/types/icons/Success.d.ts +2 -0
- package/types/icons/index.d.ts +4 -0
- package/types/index.d.ts +3 -4
- package/types/services/notification.d.ts +3 -0
- package/types/stories/components/StyledButton.d.ts +1 -1
- package/types/test/index.d.ts +1 -0
- package/types/test/render.d.ts +1 -0
- package/types/utils/react/get-display-name.d.ts +2 -0
- package/types/utils/react/index.d.ts +1 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -24,7 +24,7 @@ const MenuItem_1 = require("./MenuItem");
|
|
24
24
|
const MenuSection_1 = require("./MenuSection");
|
25
25
|
const context_1 = require("./context");
|
26
26
|
function Menu(props, ref) {
|
27
|
-
const { header, footer } = props;
|
27
|
+
const { header, footer, selectionIcon } = props;
|
28
28
|
const domRef = (0, utils_2.useDOMRef)(ref);
|
29
29
|
const contextProps = (0, context_1.useMenuContext)();
|
30
30
|
const completeProps = (0, utils_1.mergeProps)(contextProps, props);
|
@@ -44,9 +44,9 @@ function Menu(props, ref) {
|
|
44
44
|
(0, utils_1.useSyncRef)(contextProps, domRef);
|
45
45
|
return ((0, jsx_runtime_1.jsxs)(styled_1.StyledMenu, { ...(0, utils_1.mergeProps)(menuProps, completeProps, baseProps), ref: domRef, children: [header && (0, jsx_runtime_1.jsx)(styled_1.StyledMenuHeader, { children: header }, void 0), items.map((item) => {
|
46
46
|
if (item.type === 'section') {
|
47
|
-
return ((0, jsx_runtime_1.jsx)(MenuSection_1.MenuSection, { item: item, state: state, onAction: completeProps.onAction }, item.key));
|
47
|
+
return ((0, jsx_runtime_1.jsx)(MenuSection_1.MenuSection, { item: item, state: state, selectionIcon: selectionIcon, onAction: completeProps.onAction }, item.key));
|
48
48
|
}
|
49
|
-
let menuItem = ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { item: item, state: state, onAction: completeProps.onAction }, item.key));
|
49
|
+
let menuItem = ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { item: item, state: state, selectionIcon: selectionIcon, onAction: completeProps.onAction }, item.key));
|
50
50
|
if (item.wrapper) {
|
51
51
|
menuItem = item.wrapper(menuItem);
|
52
52
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -11,6 +11,7 @@ exports.MenuButton = void 0;
|
|
11
11
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
12
12
|
const actions_1 = require("../../actions");
|
13
13
|
const Text_1 = require("../../content/Text");
|
14
|
+
const tasty_1 = require("../../../tasty");
|
14
15
|
const Space_1 = require("../../layout/Space");
|
15
16
|
const icons_1 = require("@ant-design/icons");
|
16
17
|
const ACTION_BUTTON = {
|
@@ -37,7 +38,8 @@ const ACTION_BUTTON = {
|
|
37
38
|
shadow: '#clear',
|
38
39
|
padding: {
|
39
40
|
'': '(0.75x - 1px) (1.5x - 1px)',
|
40
|
-
'selectable & !selected': '(0.75x - 1px) (1.5x - 1px) (0.75x - 1px) (1.5x - 1px
|
41
|
+
'selectable & !selected': '(0.75x - 1px) (1.5x - 1px) (0.75x - 1px) (1.5x - 1px)',
|
42
|
+
'selectionIcon & selectable & !selected': '(0.75x - 1px) (1.5x - 1px) (0.75x - 1px) (1.5x - 1px + 22px)',
|
41
43
|
},
|
42
44
|
display: 'flex',
|
43
45
|
flow: 'row',
|
@@ -51,12 +53,38 @@ const ACTION_BUTTON = {
|
|
51
53
|
},
|
52
54
|
},
|
53
55
|
};
|
56
|
+
const RadioIcon = (0, tasty_1.tasty)({
|
57
|
+
styles: {
|
58
|
+
display: 'flex',
|
59
|
+
width: '1.875x',
|
60
|
+
placeContent: 'center',
|
61
|
+
'&::before': {
|
62
|
+
display: 'block',
|
63
|
+
content: '""',
|
64
|
+
width: '1x',
|
65
|
+
height: '1x',
|
66
|
+
radius: 'round',
|
67
|
+
fill: '#current',
|
68
|
+
},
|
69
|
+
},
|
70
|
+
});
|
54
71
|
const getPostfix = (postfix) => typeof postfix === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { nowrap: true, color: "inherit", "data-element": "Postfix", children: postfix }, void 0)) : (postfix);
|
72
|
+
const getSelectionTypeIcon = (selectionIcon) => {
|
73
|
+
switch (selectionIcon) {
|
74
|
+
case 'checkbox':
|
75
|
+
return (0, jsx_runtime_1.jsx)(icons_1.CheckOutlined, {}, void 0);
|
76
|
+
case 'radio':
|
77
|
+
return (0, jsx_runtime_1.jsx)(RadioIcon, {}, void 0);
|
78
|
+
default:
|
79
|
+
return null;
|
80
|
+
}
|
81
|
+
};
|
55
82
|
function MenuButton({ children, icon, postfix, ...props }) {
|
56
|
-
const { isSelected, isSelectable } = props;
|
57
|
-
const checkIcon = isSelectable && isSelected ? (
|
83
|
+
const { selectionIcon, isSelected, isSelectable } = props;
|
84
|
+
const checkIcon = isSelectable && isSelected ? getSelectionTypeIcon(selectionIcon) : null;
|
58
85
|
const mods = {
|
59
86
|
...props.mods,
|
87
|
+
selectionIcon: !!selectionIcon,
|
60
88
|
selectable: isSelectable,
|
61
89
|
selected: isSelected,
|
62
90
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -19,7 +19,7 @@ const styled_1 = require("./styled");
|
|
19
19
|
const MenuButton_1 = require("./MenuButton");
|
20
20
|
/** @private */
|
21
21
|
function MenuItem(props) {
|
22
|
-
const { item, state, isVirtualized, onAction } = props;
|
22
|
+
const { item, state, selectionIcon, isVirtualized, onAction } = props;
|
23
23
|
const { onClose, closeOnSelect } = (0, context_1.useMenuContext)();
|
24
24
|
const { rendered, key, props: itemProps } = item;
|
25
25
|
const isSelectable = state.selectionManager.selectionMode !== 'none';
|
@@ -37,7 +37,7 @@ function MenuItem(props) {
|
|
37
37
|
isVirtualized,
|
38
38
|
onAction,
|
39
39
|
}, state, ref);
|
40
|
-
let contents = typeof rendered === 'string' ? ((0, jsx_runtime_1.jsx)(MenuButton_1.MenuButton, { ...itemProps, isSelectable: isSelectable, isSelected: isSelected, isDisabled: isDisabled, children: rendered }, void 0)) : (rendered);
|
40
|
+
let contents = typeof rendered === 'string' ? ((0, jsx_runtime_1.jsx)(MenuButton_1.MenuButton, { ...itemProps, selectionIcon: selectionIcon, isSelectable: isSelectable, isSelected: isSelected, isDisabled: isDisabled, children: rendered }, void 0)) : (rendered);
|
41
41
|
return ((0, jsx_runtime_1.jsx)(focus_1.FocusRing, { children: (0, jsx_runtime_1.jsx)(styled_1.StyledMenuItem, { ...(0, react_2.mergeProps)(menuItemProps, hoverProps), ref: ref, mods: {
|
42
42
|
disabled: isDisabled,
|
43
43
|
selected: isSelected,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @license MIT
|
3
|
+
* author: Cube Dev Team
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
|
+
* Released under the MIT license.
|
6
|
+
*/
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
+
exports.LoadingAnimation = void 0;
|
11
|
+
var LoadingAnimation_1 = require("./LoadingAnimation");
|
12
|
+
Object.defineProperty(exports, "LoadingAnimation", { enumerable: true, get: function () { return LoadingAnimation_1.LoadingAnimation; } });
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,196 @@
|
|
1
|
+
/**
|
2
|
+
* @license MIT
|
3
|
+
* author: Cube Dev Team
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
|
+
* Released under the MIT license.
|
6
|
+
*/
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.Cube = void 0;
|
14
|
+
const react_1 = require("react");
|
15
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
16
|
+
const fillByPosition = {
|
17
|
+
top: '#7a77ff',
|
18
|
+
right: '#727290',
|
19
|
+
bottom: '#ff6492',
|
20
|
+
};
|
21
|
+
exports.Cube = (0, react_1.memo)(styled_components_1.default.div.attrs(({ position }) => ({
|
22
|
+
role: 'presentation',
|
23
|
+
style: {
|
24
|
+
'--cube-spin-animation-name': `cube-spin-${position}`,
|
25
|
+
'--cube-spin-fill': fillByPosition[position],
|
26
|
+
},
|
27
|
+
})) `
|
28
|
+
--cube-spin-cube-border-width: calc(4 / 100 * var(--cube-spin-size));
|
29
|
+
--cube-spin-cube-border-compensation: calc(
|
30
|
+
-1 * (var(--cube-spin-cube-border-width))
|
31
|
+
);
|
32
|
+
--cube-spin-cube-size: calc(
|
33
|
+
(100% - 2 * var(--cube-spin-cube-border-width)) / 2
|
34
|
+
);
|
35
|
+
|
36
|
+
box-sizing: content-box;
|
37
|
+
position: absolute;
|
38
|
+
top: var(--cube-spin-cube-border-compensation);
|
39
|
+
left: var(--cube-spin-cube-border-compensation);
|
40
|
+
width: var(--cube-spin-cube-size);
|
41
|
+
height: var(--cube-spin-cube-size);
|
42
|
+
border: var(--cube-spin-cube-border-width) solid transparent;
|
43
|
+
overflow: hidden;
|
44
|
+
contain: size layout style paint;
|
45
|
+
pointer-events: none;
|
46
|
+
user-select: none;
|
47
|
+
|
48
|
+
animation-name: var(--cube-spin-animation-name);
|
49
|
+
animation-duration: 2.2s;
|
50
|
+
animation-iteration-count: infinite;
|
51
|
+
animation-timing-function: cubic-bezier(0.5, 0.05, 0.3, 0.95);
|
52
|
+
|
53
|
+
@media (prefers-reduced-motion) {
|
54
|
+
animation-play-state: paused;
|
55
|
+
}
|
56
|
+
|
57
|
+
&::before {
|
58
|
+
--cube-spin-cube-round-radius: calc((4 / 100) * var(--cube-spin-size));
|
59
|
+
|
60
|
+
content: '';
|
61
|
+
display: block;
|
62
|
+
width: 100%;
|
63
|
+
height: 100%;
|
64
|
+
border-radius: var(--cube-spin-cube-round-radius);
|
65
|
+
|
66
|
+
background-color: var(--cube-spin-fill);
|
67
|
+
}
|
68
|
+
|
69
|
+
@keyframes cube-spin-top {
|
70
|
+
0% {
|
71
|
+
transform: translate(0%, 0);
|
72
|
+
}
|
73
|
+
8% {
|
74
|
+
transform: translate(100%, 0);
|
75
|
+
}
|
76
|
+
17% {
|
77
|
+
transform: translate(100%, 0);
|
78
|
+
}
|
79
|
+
25% {
|
80
|
+
transform: translate(100%, 0);
|
81
|
+
}
|
82
|
+
33% {
|
83
|
+
transform: translate(100%, 100%);
|
84
|
+
}
|
85
|
+
42% {
|
86
|
+
transform: translate(100%, 100%);
|
87
|
+
}
|
88
|
+
50% {
|
89
|
+
transform: translate(100%, 100%);
|
90
|
+
}
|
91
|
+
58% {
|
92
|
+
transform: translate(0, 100%);
|
93
|
+
}
|
94
|
+
67% {
|
95
|
+
transform: translate(0, 100%);
|
96
|
+
}
|
97
|
+
75% {
|
98
|
+
transform: translate(0, 100%);
|
99
|
+
}
|
100
|
+
83% {
|
101
|
+
transform: translate(0, 0);
|
102
|
+
}
|
103
|
+
92% {
|
104
|
+
transform: translate(0, 0);
|
105
|
+
}
|
106
|
+
100% {
|
107
|
+
transform: translate(0, 0);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
@keyframes cube-spin-right {
|
112
|
+
0% {
|
113
|
+
transform: translate(100%, 100%);
|
114
|
+
}
|
115
|
+
8% {
|
116
|
+
transform: translate(100%, 100%);
|
117
|
+
}
|
118
|
+
17% {
|
119
|
+
transform: translate(100%, 100%);
|
120
|
+
}
|
121
|
+
25% {
|
122
|
+
transform: translate(0, 100%);
|
123
|
+
}
|
124
|
+
33% {
|
125
|
+
transform: translate(0, 100%);
|
126
|
+
}
|
127
|
+
42% {
|
128
|
+
transform: translate(0, 100%);
|
129
|
+
}
|
130
|
+
50% {
|
131
|
+
transform: translate(0, 0);
|
132
|
+
}
|
133
|
+
58% {
|
134
|
+
transform: translate(0, 0);
|
135
|
+
}
|
136
|
+
67% {
|
137
|
+
transform: translate(0, 0);
|
138
|
+
}
|
139
|
+
75% {
|
140
|
+
transform: translate(100%, 0);
|
141
|
+
}
|
142
|
+
83% {
|
143
|
+
transform: translate(100%, 0);
|
144
|
+
}
|
145
|
+
92% {
|
146
|
+
transform: translate(100%, 0);
|
147
|
+
}
|
148
|
+
100% {
|
149
|
+
transform: translate(100%, 100%);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
@keyframes cube-spin-bottom {
|
154
|
+
0% {
|
155
|
+
transform: translate(0, 100%);
|
156
|
+
}
|
157
|
+
8% {
|
158
|
+
transform: translate(0, 100%);
|
159
|
+
}
|
160
|
+
17% {
|
161
|
+
transform: translate(0, 0);
|
162
|
+
}
|
163
|
+
25% {
|
164
|
+
transform: translate(0, 0);
|
165
|
+
}
|
166
|
+
33% {
|
167
|
+
transform: translate(0, 0);
|
168
|
+
}
|
169
|
+
42% {
|
170
|
+
transform: translate(100%, 0);
|
171
|
+
}
|
172
|
+
50% {
|
173
|
+
transform: translate(100%, 0);
|
174
|
+
}
|
175
|
+
58% {
|
176
|
+
transform: translate(100%, 0);
|
177
|
+
}
|
178
|
+
67% {
|
179
|
+
transform: translate(100%, 100%);
|
180
|
+
}
|
181
|
+
75% {
|
182
|
+
transform: translate(100%, 100%);
|
183
|
+
}
|
184
|
+
83% {
|
185
|
+
transform: translate(100%, 100%);
|
186
|
+
}
|
187
|
+
92% {
|
188
|
+
transform: translate(0, 100%);
|
189
|
+
}
|
190
|
+
100% {
|
191
|
+
transform: translate(0, 100%);
|
192
|
+
}
|
193
|
+
}
|
194
|
+
`);
|
195
|
+
|
196
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* @license MIT
|
3
|
+
* author: Cube Dev Team
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
|
+
* Released under the MIT license.
|
6
|
+
*/
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
+
exports.InternalSpinner = void 0;
|
11
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
12
|
+
const react_1 = require("react");
|
13
|
+
const tasty_1 = require("../../../tasty");
|
14
|
+
const Cube_1 = require("./Cube");
|
15
|
+
const SpinsContainer_1 = require("./SpinsContainer");
|
16
|
+
const SpinsBox = (0, tasty_1.tasty)({ styles: { position: 'relative', blockSize: '100%' } });
|
17
|
+
exports.InternalSpinner = (0, react_1.memo)(function InternalSpinner(props) {
|
18
|
+
const { size } = props;
|
19
|
+
return (
|
20
|
+
// Even though using size as a key resets the animation, it helps safari to resize the cubes.
|
21
|
+
(0, jsx_runtime_1.jsx)(SpinsContainer_1.SpinsContainer, { ownSize: CUBE_SIZE_MAP[size], children: (0, jsx_runtime_1.jsxs)(SpinsBox, { children: [(0, jsx_runtime_1.jsx)(Cube_1.Cube, { position: "top" }, void 0), (0, jsx_runtime_1.jsx)(Cube_1.Cube, { position: "right" }, void 0), (0, jsx_runtime_1.jsx)(Cube_1.Cube, { position: "bottom" }, void 0)] }, void 0) }, size));
|
22
|
+
});
|
23
|
+
const CUBE_SIZE_MAP = {
|
24
|
+
small: 24,
|
25
|
+
default: 32,
|
26
|
+
large: 48,
|
27
|
+
};
|
28
|
+
|
29
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license MIT
|
3
3
|
* author: Cube Dev Team
|
4
|
-
* @cube-dev/ui-kit v0.
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
5
|
* Released under the MIT license.
|
6
6
|
*/
|
7
7
|
|
@@ -9,30 +9,17 @@
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
exports.Spin = void 0;
|
11
11
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
12
|
-
const
|
12
|
+
const InternalSpinner_1 = require("./InternalSpinner");
|
13
|
+
const tasty_1 = require("../../../tasty");
|
13
14
|
const Block_1 = require("../../Block");
|
14
|
-
const
|
15
|
-
|
16
|
-
default
|
17
|
-
|
18
|
-
};
|
19
|
-
const Spin = ({ size, spinning, style, children, ...props }, ref) => {
|
20
|
-
const localSize = (size && SIZE_MAP[size]) || size || SIZE_MAP.default;
|
21
|
-
if (spinning === false) {
|
15
|
+
const SpinContainer = (0, tasty_1.tasty)(Block_1.Block, { styles: { lineHeight: '0' } });
|
16
|
+
function Spin(props) {
|
17
|
+
const { size = 'default', spinning = true, children, styles } = props;
|
18
|
+
if (!spinning) {
|
22
19
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }, void 0);
|
23
20
|
}
|
24
|
-
return ((0, jsx_runtime_1.jsx)(
|
25
|
-
|
26
|
-
|
27
|
-
...(style || {}),
|
28
|
-
}, ...props, children: (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
29
|
-
margin: 'auto',
|
30
|
-
display: 'inline-block',
|
31
|
-
width: '1em',
|
32
|
-
height: '1em',
|
33
|
-
}, viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid", children: [(0, jsx_runtime_1.jsxs)("rect", { fill: "#7a77ff", x: "14", y: "14", width: "32", height: "32", rx: "4", ry: "4", children: [(0, jsx_runtime_1.jsx)("animate", { attributeName: "x", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "-2.083333333333333s" }, void 0), (0, jsx_runtime_1.jsx)("animate", { attributeName: "y", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "-1.5151515151515151s" }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("rect", { fill: "#ff6492", x: "14", y: "14", width: "32", height: "32", rx: "4", ry: "4", children: [(0, jsx_runtime_1.jsx)("animate", { attributeName: "x", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "-1.325757575757576s" }, void 0), (0, jsx_runtime_1.jsx)("animate", { attributeName: "y", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "-0.7575757575757576s" }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("rect", { fill: "#727290", x: "14", y: "14", width: "32", height: "32", rx: "4", ry: "4", children: [(0, jsx_runtime_1.jsx)("animate", { attributeName: "x", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "-0.5681818181818182s" }, void 0), (0, jsx_runtime_1.jsx)("animate", { attributeName: "y", dur: "2.272727272727273s", repeatCount: "indefinite", keyTimes: "0;0.083;0.25;0.333;0.5;0.583;0.75;0.833;1", values: "14;54;54;54;54;14;14;14;14", begin: "0s" }, void 0)] }, void 0)] }, void 0) }, void 0));
|
34
|
-
};
|
35
|
-
const _Spin = (0, react_1.forwardRef)(Spin);
|
36
|
-
exports.Spin = _Spin;
|
21
|
+
return ((0, jsx_runtime_1.jsx)(SpinContainer, { styles: styles, children: (0, jsx_runtime_1.jsx)(InternalSpinner_1.InternalSpinner, { size: size }, void 0) }, void 0));
|
22
|
+
}
|
23
|
+
exports.Spin = Spin;
|
37
24
|
|
38
25
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/**
|
2
|
+
* @license MIT
|
3
|
+
* author: Cube Dev Team
|
4
|
+
* @cube-dev/ui-kit v0.11.0
|
5
|
+
* Released under the MIT license.
|
6
|
+
*/
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.SpinsContainer = void 0;
|
14
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
15
|
+
exports.SpinsContainer = styled_components_1.default.div.attrs(({ ownSize }) => ({
|
16
|
+
role: 'presentation',
|
17
|
+
style: { '--cube-spin-size': `${ownSize}px` },
|
18
|
+
})) `
|
19
|
+
box-sizing: border-box;
|
20
|
+
|
21
|
+
display: inline-block;
|
22
|
+
padding: calc(10 / 100 * var(--cube-spin-size));
|
23
|
+
width: var(--cube-spin-size);
|
24
|
+
height: var(--cube-spin-size);
|
25
|
+
opacity: 0.8;
|
26
|
+
contain: size layout style paint;
|
27
|
+
|
28
|
+
@media (prefers-reduced-motion) {
|
29
|
+
animation: cube-spin-reduced-motion 2s infinite ease-in-out;
|
30
|
+
}
|
31
|
+
|
32
|
+
@keyframes cube-spin-reduced-motion {
|
33
|
+
0% {
|
34
|
+
opacity: 0.4;
|
35
|
+
}
|
36
|
+
50% {
|
37
|
+
opacity: 0.8;
|
38
|
+
}
|
39
|
+
100% {
|
40
|
+
opacity: 0.4;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
`;
|
44
|
+
|
45
|
+
|