@cube-dev/ui-kit 0.0.0-canary-0294ea6 → 0.0.0-canary-9f997c6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +270 -0
- 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 +7 -7
- package/cjs/_internal/index.js +1 -1
- package/cjs/components/Base.js +2 -2
- package/cjs/components/Block.js +1 -1
- package/cjs/components/GlobalStyles.js +1 -1
- package/cjs/components/GridProvider.js +2 -3
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +3 -38
- package/cjs/components/actions/Action.js +2 -2
- package/cjs/components/actions/Button/Button.js +3 -3
- 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 +2 -3
- 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 +2 -2
- 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 +6 -7
- package/cjs/components/forms/Form/Field.js +5 -5
- package/cjs/components/forms/Form/Form.js +8 -8
- 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 +4 -7
- package/cjs/components/forms/Form/validation.js +2 -2
- 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 +4 -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 +2 -2
- 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 +3 -9
- package/cjs/components/overlays/AlertDialog/AlertDialogApiProvider.js +6 -7
- package/cjs/components/overlays/AlertDialog/AlertDialogZone.js +2 -2
- 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 -1
- package/cjs/components/overlays/Dialog/DialogContainer.js +1 -1
- package/cjs/components/overlays/Dialog/DialogForm.js +7 -7
- 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 +12 -7
- package/cjs/components/overlays/Modal/OpenTransition.js +1 -1
- package/cjs/components/overlays/Modal/Overlay.js +3 -3
- package/cjs/components/overlays/Modal/Popover.js +1 -1
- package/cjs/components/overlays/Modal/Tray.js +34 -3
- 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 +2 -10
- package/cjs/components/overlays/NewNotifications/Bar/NotificationsBar.js +7 -9
- 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 +2 -2
- package/cjs/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Notification.js +3 -6
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationAction.js +3 -6
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +20 -9
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -4
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +2 -6
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -4
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -4
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -4
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationView.js +11 -14
- 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 +3 -3
- package/cjs/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +14 -20
- package/cjs/components/overlays/NewNotifications/NotificationsList.js +43 -0
- 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 +3 -4
- 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 +2 -2
- package/cjs/components/overlays/Toasts/index.js +1 -1
- package/cjs/components/overlays/Toasts/types.js +1 -1
- package/cjs/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/cjs/components/overlays/Tooltip/Tooltip.js +5 -5
- package/cjs/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/cjs/components/overlays/Tooltip/TooltipTrigger.js +2 -3
- package/cjs/components/overlays/Tooltip/context.js +1 -1
- package/cjs/components/pickers/ComboBox/ComboBox.js +2 -3
- 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 +5 -6
- 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 +5 -7
- 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 +11 -12
- 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 +2 -2
- 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 +8 -9
- 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 +2 -2
- package/cjs/tasty/utils/get-display-name.js +2 -3
- package/cjs/tasty/utils/index.js +1 -1
- package/cjs/tasty/utils/mergeStyles.js +3 -3
- 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 +3 -6
- package/cjs/tasty/utils/warnings.js +1 -1
- package/cjs/test/index.js +1 -1
- package/cjs/test/render.js +1 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +1 -1
- package/cjs/tokens.js +1 -1
- package/cjs/type-checks.js +1 -1
- package/cjs/utils/ResizeSensor.js +1 -1
- package/cjs/utils/modules.js +1 -1
- package/cjs/utils/promise.js +1 -1
- package/cjs/utils/react/Slots.js +7 -12
- 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 +3 -3
- 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 +2 -2
- package/cjs/utils/react/wrapNodeIfPlain.js +1 -1
- package/cjs/utils/transitions.js +1 -1
- package/cjs/utils/tree.js +1 -1
- package/cjs/utils/warnings.js +1 -1
- package/es/_internal/hooks/index.js +1 -1
- package/es/_internal/hooks/use-chained-callback.js +1 -1
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/hooks/use-event.js +1 -1
- package/es/_internal/hooks/use-sync-ref.js +1 -1
- package/es/_internal/hooks/use-timer/index.js +1 -1
- package/es/_internal/hooks/use-timer/timer.js +1 -1
- package/es/_internal/hooks/use-timer/use-timer.js +7 -7
- package/es/_internal/index.js +1 -1
- package/es/components/Base.js +2 -2
- package/es/components/Block.js +1 -1
- package/es/components/GlobalStyles.js +1 -1
- package/es/components/GridProvider.js +2 -3
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +3 -38
- package/es/components/actions/Action.js +2 -2
- package/es/components/actions/Button/Button.js +3 -3
- 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 +2 -3
- 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 +2 -2
- 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 +6 -7
- package/es/components/forms/Form/Field.js +5 -5
- package/es/components/forms/Form/Form.js +8 -8
- 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 +4 -7
- package/es/components/forms/Form/validation.js +2 -2
- 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 +4 -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 +2 -2
- 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 +3 -9
- package/es/components/overlays/AlertDialog/AlertDialogApiProvider.js +6 -7
- package/es/components/overlays/AlertDialog/AlertDialogZone.js +2 -2
- package/es/components/overlays/AlertDialog/index.js +1 -1
- package/es/components/overlays/AlertDialog/types.js +1 -1
- package/es/components/overlays/Dialog/Dialog.js +1 -1
- package/es/components/overlays/Dialog/DialogContainer.js +1 -1
- package/es/components/overlays/Dialog/DialogForm.js +7 -7
- 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 +12 -7
- package/es/components/overlays/Modal/OpenTransition.js +1 -1
- package/es/components/overlays/Modal/Overlay.js +3 -3
- package/es/components/overlays/Modal/Popover.js +1 -1
- package/es/components/overlays/Modal/Tray.js +35 -4
- 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 +2 -10
- package/es/components/overlays/NewNotifications/Bar/NotificationsBar.js +7 -9
- 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 +2 -2
- package/es/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/es/components/overlays/NewNotifications/Notification.js +3 -6
- package/es/components/overlays/NewNotifications/NotificationView/NotificationAction.js +3 -6
- package/es/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +20 -9
- package/es/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -4
- package/es/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +2 -6
- package/es/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -4
- package/es/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -4
- package/es/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -4
- package/es/components/overlays/NewNotifications/NotificationView/NotificationView.js +11 -14
- 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 +3 -3
- package/es/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +14 -20
- package/es/components/overlays/NewNotifications/NotificationsList.js +39 -0
- 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 +3 -4
- 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 +2 -2
- package/es/components/overlays/Toasts/index.js +1 -1
- package/es/components/overlays/Toasts/types.js +1 -1
- package/es/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/es/components/overlays/Tooltip/Tooltip.js +5 -5
- package/es/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/es/components/overlays/Tooltip/TooltipTrigger.js +2 -3
- package/es/components/overlays/Tooltip/context.js +1 -1
- package/es/components/pickers/ComboBox/ComboBox.js +2 -3
- 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 +5 -6
- 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 +5 -7
- 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 +11 -12
- 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 +2 -2
- 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 +8 -9
- 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 +2 -2
- package/es/tasty/utils/get-display-name.js +2 -3
- package/es/tasty/utils/index.js +1 -1
- package/es/tasty/utils/mergeStyles.js +3 -3
- 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 +3 -6
- package/es/tasty/utils/warnings.js +1 -1
- package/es/test/index.js +1 -1
- package/es/test/render.js +1 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +1 -1
- package/es/tokens.js +1 -1
- package/es/type-checks.js +1 -1
- package/es/utils/ResizeSensor.js +1 -1
- package/es/utils/modules.js +1 -1
- package/es/utils/promise.js +1 -1
- package/es/utils/react/Slots.js +7 -12
- 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 +3 -3
- 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 +2 -2
- package/es/utils/react/wrapNodeIfPlain.js +1 -1
- package/es/utils/transitions.js +1 -1
- package/es/utils/tree.js +1 -1
- package/es/utils/warnings.js +1 -1
- package/package.json +1 -1
- package/types/components/overlays/NewNotifications/Bar/FloatingNotification.d.ts +0 -3
- package/types/components/overlays/NewNotifications/Bar/NotificationsBar.d.ts +0 -3
- package/types/components/overlays/NewNotifications/Notification.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationAction.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.d.ts +2 -0
- package/types/components/overlays/NewNotifications/NotificationView/NotificationDescription.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationFooter.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationHeader.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationIcon.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationProvider.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationView/NotificationView.d.ts +0 -3
- package/types/components/overlays/NewNotifications/NotificationsContext/use-notifications.d.ts +1 -1
- package/types/components/overlays/NewNotifications/{NotificationsList/types.d.ts → NotificationsList.d.ts} +7 -9
- package/types/tasty/utils/styles.d.ts +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/NotificationsList.js +0 -48
- package/cjs/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +0 -33
- package/cjs/components/overlays/NewNotifications/NotificationsList/index.js +0 -22
- package/cjs/components/overlays/NewNotifications/NotificationsList/types.js +0 -11
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsList.js +0 -44
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +0 -29
- package/es/components/overlays/NewNotifications/NotificationsList/index.js +0 -10
- package/es/components/overlays/NewNotifications/NotificationsList/types.js +0 -10
- package/types/components/overlays/NewNotifications/NotificationsList/NotificationsList.d.ts +0 -21
- package/types/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.d.ts +0 -6
- package/types/components/overlays/NewNotifications/NotificationsList/index.d.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ const react_1 = require("../../../../utils/react");
|
|
|
18
18
|
const hooks_1 = require("../hooks");
|
|
19
19
|
function NotificationsDialogTrigger(props) {
|
|
20
20
|
const { onCloseNotificationInBar, ...dialogTriggerProps } = props;
|
|
21
|
-
(0, hooks_1.useNotificationsObserver)((args) => onCloseNotificationInBar
|
|
21
|
+
(0, hooks_1.useNotificationsObserver)((args) => onCloseNotificationInBar?.(args));
|
|
22
22
|
return (0, jsx_runtime_1.jsx)(Dialog_1.DialogTrigger, { ...dialogTriggerProps, type: "popover" }, void 0);
|
|
23
23
|
}
|
|
24
24
|
exports.NotificationsDialogTrigger = NotificationsDialogTrigger;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -13,20 +13,17 @@ const react_1 = require("react");
|
|
|
13
13
|
const _internal_1 = require("../../../_internal");
|
|
14
14
|
const useId_1 = require("../../../utils/react/useId");
|
|
15
15
|
const hooks_1 = require("./hooks");
|
|
16
|
-
/**
|
|
17
|
-
* Declarative wrap over the `useNotificationsApi` hook
|
|
18
|
-
*/
|
|
19
16
|
function Notification(props) {
|
|
20
17
|
const { id: propsId, disableRemoveOnUnmount = false } = props;
|
|
21
18
|
const defaultId = (0, useId_1.useId)();
|
|
22
19
|
const disableRemoveOnUnmountRef = (0, _internal_1.useSyncRef)(disableRemoveOnUnmount);
|
|
23
20
|
const { notify, update, remove } = (0, hooks_1.useNotificationsApi)();
|
|
24
|
-
const id = propsId
|
|
21
|
+
const id = propsId ?? defaultId;
|
|
25
22
|
const removeNotification = (0, _internal_1.useEvent)((id) => disableRemoveOnUnmountRef.current ? void 0 : remove(id));
|
|
26
23
|
(0, react_1.useEffect)(() => {
|
|
27
24
|
notify({ id, ...props });
|
|
28
25
|
}, [id]);
|
|
29
|
-
(0, react_1.useEffect)(() => () => removeNotification(id), [id
|
|
26
|
+
(0, react_1.useEffect)(() => () => removeNotification(id), [id]);
|
|
30
27
|
(0, react_1.useEffect)(() => update(id, props));
|
|
31
28
|
return null;
|
|
32
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -26,16 +26,13 @@ const Action = (0, tasty_1.tasty)(actions_1.Button, {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
|
-
/**
|
|
30
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
31
|
-
*/
|
|
32
29
|
function NotificationAction(props) {
|
|
33
30
|
const { children, onPress, type = 'primary', disableCloseOnAction = type !== 'primary', ...buttonProps } = props;
|
|
34
31
|
const { onClose } = (0, NotificationProvider_1.useNotificationContext)();
|
|
35
32
|
const onPressEvent = (0, _internal_1.useEvent)((e) => {
|
|
36
|
-
onPress
|
|
33
|
+
onPress?.(e);
|
|
37
34
|
if (!disableCloseOnAction) {
|
|
38
|
-
onClose
|
|
35
|
+
onClose?.();
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
return ((0, jsx_runtime_1.jsx)(Action, { ...buttonProps, type: "link", size: "small", mods: { primary: type === 'primary', secondary: type === 'secondary' }, onPress: onPressEvent, children: children }, void 0));
|
package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -14,16 +14,27 @@ const actions_1 = require("../../../actions");
|
|
|
14
14
|
const tasty_1 = require("../../../../tasty");
|
|
15
15
|
const icons_1 = require("../../../../icons");
|
|
16
16
|
const CloseButton = (0, tasty_1.tasty)(actions_1.Button, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
styles: {
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
right: '-0.75x',
|
|
20
|
+
top: '-0.75x',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
placeItems: 'center',
|
|
23
|
+
padding: '0.625x',
|
|
24
|
+
width: '3x',
|
|
25
|
+
height: '3x',
|
|
26
|
+
fill: '#white',
|
|
27
|
+
shadow: '0 0.5x 2x #shadow',
|
|
28
|
+
color: { '': '#dark-02', hovered: '#dark-03', pressed: '#dark-02' },
|
|
29
|
+
borderRadius: '50%',
|
|
30
|
+
visibility: { '': 'hidden', show: 'visible' },
|
|
31
|
+
opacity: { '': '0', show: '1' },
|
|
32
|
+
transition: 'opacity, visibility 0.2s ease-in-out',
|
|
33
|
+
},
|
|
23
34
|
});
|
|
24
35
|
exports.NotificationCloseButton = (0, react_1.memo)(function NotificationCloseButton(props) {
|
|
25
|
-
const { onPress } = props;
|
|
26
|
-
return (0, jsx_runtime_1.jsx)(CloseButton, { onPress: onPress }, void 0);
|
|
36
|
+
const { onPress, isHovered, isFocused } = props;
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(CloseButton, { qa: "NotificationCloseButton", type: "neutral", mods: { show: isHovered || isFocused }, icon: (0, jsx_runtime_1.jsx)(icons_1.Cross, {}, void 0), label: "Close the notification", onPress: onPress }, void 0));
|
|
27
38
|
});
|
|
28
39
|
|
|
29
40
|
|
package/cjs/components/overlays/NewNotifications/NotificationView/NotificationDescription.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -24,9 +24,6 @@ const Description = (0, tasty_1.tasty)(Paragraph_1.Paragraph, {
|
|
|
24
24
|
overflow: 'hidden',
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
|
-
/**
|
|
28
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
29
|
-
*/
|
|
30
27
|
exports.NotificationDescription = (0, react_1.memo)(function NotificationDescription(props) {
|
|
31
28
|
const { description, ...descriptionProps } = props;
|
|
32
29
|
return ((0, jsx_runtime_1.jsx)(Description, { ...(0, react_2.mergeProps)(descriptionProps, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -46,9 +46,6 @@ const FooterArea = (0, tasty_1.tasty)(actions_1.ButtonGroup, {
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
|
-
/**
|
|
50
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
51
|
-
*/
|
|
52
49
|
exports.NotificationFooter = (0, react_1.memo)(function NotificationFooter(props) {
|
|
53
50
|
const { actions, onClose, onDismiss, hasDescription } = props;
|
|
54
51
|
return ((0, jsx_runtime_1.jsx)(FooterArea, { mods: { 'has-description': hasDescription }, children: (0, react_keyed_flatten_children_1.default)(typeof actions === 'function'
|
|
@@ -56,12 +53,11 @@ exports.NotificationFooter = (0, react_1.memo)(function NotificationFooter(props
|
|
|
56
53
|
: actions)
|
|
57
54
|
.filter((action) => (0, react_is_1.isElement)(action))
|
|
58
55
|
.map((action, index) => {
|
|
59
|
-
var _a;
|
|
60
56
|
const { props } = action;
|
|
61
57
|
const defaultType = index === 0 ? 'primary' : 'secondary';
|
|
62
58
|
return react_1.default.cloneElement(action, {
|
|
63
59
|
...props,
|
|
64
|
-
type:
|
|
60
|
+
type: props.type ?? defaultType,
|
|
65
61
|
}, props.children);
|
|
66
62
|
}) }, void 0));
|
|
67
63
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -23,9 +23,6 @@ const Header = (0, tasty_1.tasty)(Title_1.Title, {
|
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
/**
|
|
27
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
28
|
-
*/
|
|
29
26
|
exports.NotificationHeader = (0, react_1.memo)(function NotificationHeader(props) {
|
|
30
27
|
const { header, ...headerProps } = props;
|
|
31
28
|
return (0, jsx_runtime_1.jsx)(Header, { ...headerProps, children: header }, void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -50,9 +50,6 @@ const IconPreset = (0, tasty_1.tasty)({
|
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
|
-
/**
|
|
54
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
55
|
-
*/
|
|
56
53
|
exports.NotificationIcon = (0, react_1.memo)(function NotificationIcon(props) {
|
|
57
54
|
const { icon, type } = props;
|
|
58
55
|
return ((0, jsx_runtime_1.jsx)(IconContainer, { children: icon ? (icon) : ((0, jsx_runtime_1.jsx)(IconPreset, { mods: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -15,9 +15,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
const react_1 = require("react");
|
|
16
16
|
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
|
17
17
|
const NotificationContext = (0, react_1.createContext)(null);
|
|
18
|
-
/**
|
|
19
|
-
* @internal This component is unstable and must not be used outside of `NotificationView`.
|
|
20
|
-
*/
|
|
21
18
|
function NotificationProvider(props) {
|
|
22
19
|
const { children, ...value } = props;
|
|
23
20
|
return ((0, jsx_runtime_1.jsx)(NotificationContext.Provider, { value: value, children: children }, void 0));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -28,15 +28,15 @@ const NotificationContainer = (0, tasty_1.tasty)({
|
|
|
28
28
|
position: 'relative',
|
|
29
29
|
display: 'grid',
|
|
30
30
|
width: '100%',
|
|
31
|
-
padding: '
|
|
31
|
+
padding: '1.5x 1x 1.5x 1.5x',
|
|
32
|
+
radius: '0.5x',
|
|
32
33
|
gridAreas: `
|
|
33
|
-
".
|
|
34
|
-
"icon .
|
|
35
|
-
"
|
|
36
|
-
". . footer footer footer"
|
|
34
|
+
"icon . header"
|
|
35
|
+
"icon . description"
|
|
36
|
+
". . footer"
|
|
37
37
|
`,
|
|
38
|
-
gridColumns: 'min-content 1x minmax(0, auto)
|
|
39
|
-
gridRows: '
|
|
38
|
+
gridColumns: 'min-content 1x minmax(0, auto)',
|
|
39
|
+
gridRows: 'minmax(0, auto) minmax(0, auto) minmax(0, auto)',
|
|
40
40
|
fill: '#white',
|
|
41
41
|
boxShadow: {
|
|
42
42
|
'': '0 0 0 4bw #purple-04.0 inset',
|
|
@@ -44,19 +44,16 @@ const NotificationContainer = (0, tasty_1.tasty)({
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
});
|
|
47
|
-
/**
|
|
48
|
-
* @internal This component is unstable and is a subject to change.
|
|
49
|
-
*/
|
|
50
47
|
exports.NotificationView = (0, react_1.forwardRef)(function NotificationView(props, ref) {
|
|
51
48
|
const { onClose, actions, header, icon, description, id, styles, type = 'attention', isDismissible = true, duration = null, attributes = {}, qa = 'notification', timer: propsTimer, onDismiss, } = props;
|
|
52
49
|
const labelID = (0, useId_1.useId)();
|
|
53
50
|
const descriptionID = (0, useId_1.useId)();
|
|
54
51
|
const onCloseEvent = (0, _internal_1.useEvent)(() => {
|
|
55
|
-
onClose
|
|
52
|
+
onClose?.();
|
|
56
53
|
});
|
|
57
54
|
const onDismissEvent = (0, _internal_1.useEvent)(() => {
|
|
58
55
|
if (isDismissible) {
|
|
59
|
-
onDismiss
|
|
56
|
+
onDismiss?.();
|
|
60
57
|
}
|
|
61
58
|
});
|
|
62
59
|
const { hoverProps, isHovered } = (0, interactions_1.useHover)({});
|
|
@@ -67,7 +64,7 @@ exports.NotificationView = (0, react_1.forwardRef)(function NotificationView(pro
|
|
|
67
64
|
callback: onDismissEvent,
|
|
68
65
|
isDisabled: isFocusVisible || isHovered || !isDismissible,
|
|
69
66
|
});
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(react_2.ClearSlots, { children: (0, jsx_runtime_1.jsx)(NotificationProvider_1.NotificationProvider, { onClose: onClose, children: (0, jsx_runtime_1.jsxs)(NotificationContainer, { ...(0, react_2.mergeProps)(attributes, hoverProps, focusProps), ref: ref, styles: styles, "data-id": id, "data-qa": qa, "aria-labelledby": labelID, "aria-describedby": descriptionID, mods: { focused: isFocusVisible, 'is-dismissible': isDismissible }, children: [(0, jsx_runtime_1.jsx)(NotificationIcon_1.NotificationIcon, { icon: icon, type: type }, void 0), (0, jsx_runtime_1.jsx)(NotificationHeader_1.NotificationHeader, { header: header, id: labelID }, void 0), description && ((0, jsx_runtime_1.jsx)(NotificationDescription_1.NotificationDescription, { description: description, id: descriptionID }, void 0)), (0, jsx_runtime_1.jsx)(NotificationFooter_1.NotificationFooter, { hasDescription: !!description, actions: actions, onClose: onCloseEvent, onDismiss: onDismissEvent }, void 0), isDismissible && ((0, jsx_runtime_1.jsx)(NotificationCloseButton_1.NotificationCloseButton, { onPress: onDismissEvent }, void 0))] }, void 0) }, void 0) }, void 0));
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(react_2.ClearSlots, { children: (0, jsx_runtime_1.jsx)(NotificationProvider_1.NotificationProvider, { onClose: onClose, children: (0, jsx_runtime_1.jsxs)(NotificationContainer, { ...(0, react_2.mergeProps)(attributes, hoverProps, focusProps), ref: ref, styles: styles, "data-id": id, "data-qa": qa, "aria-labelledby": labelID, "aria-describedby": descriptionID, mods: { focused: isFocusVisible, 'is-dismissible': isDismissible }, children: [(0, jsx_runtime_1.jsx)(NotificationIcon_1.NotificationIcon, { icon: icon, type: type }, void 0), (0, jsx_runtime_1.jsx)(NotificationHeader_1.NotificationHeader, { header: header, id: labelID }, void 0), description && ((0, jsx_runtime_1.jsx)(NotificationDescription_1.NotificationDescription, { description: description, id: descriptionID }, void 0)), (0, jsx_runtime_1.jsx)(NotificationFooter_1.NotificationFooter, { hasDescription: !!description, actions: actions, onClose: onCloseEvent, onDismiss: onDismissEvent }, void 0), isDismissible && ((0, jsx_runtime_1.jsx)(NotificationCloseButton_1.NotificationCloseButton, { isHovered: isHovered, isFocused: isFocusVisible, onPress: onDismissEvent }, void 0))] }, void 0) }, void 0) }, void 0));
|
|
71
68
|
});
|
|
72
69
|
|
|
73
70
|
|
package/cjs/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -16,9 +16,9 @@ const use_notifications_1 = require("./use-notifications");
|
|
|
16
16
|
exports.NotificationsContext = (0, react_1.createContext)(null);
|
|
17
17
|
function NotificationsProvider(props) {
|
|
18
18
|
const { children, rootRef } = props;
|
|
19
|
-
const {
|
|
19
|
+
const { toasts, api, addOnDismissListener, onDismissNotification } = (0, use_notifications_1.useNotifications)(rootRef);
|
|
20
20
|
const providerValue = (0, react_1.useMemo)(() => ({ api, addOnDismissListener }), []);
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(exports.NotificationsContext.Provider, { value: providerValue, children: [(0, jsx_runtime_1.jsx)(portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(Bar_1.NotificationsBar, { items:
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(exports.NotificationsContext.Provider, { value: providerValue, children: [(0, jsx_runtime_1.jsx)(portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(Bar_1.NotificationsBar, { items: toasts, onRemoveNotification: api.remove, onDismissNotification: onDismissNotification, children: (notification) => ((0, jsx_runtime_1.jsx)(Bar_1.NotificationsBar.Item, { ...notification }, notification.id)) }, void 0) }, void 0), children] }, void 0));
|
|
22
22
|
}
|
|
23
23
|
exports.NotificationsProvider = NotificationsProvider;
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,19 +12,18 @@ const react_1 = require("react");
|
|
|
12
12
|
const _internal_1 = require("../../../../_internal");
|
|
13
13
|
const DISMISS_EVENT_NAME = 'cube:notification:dismiss';
|
|
14
14
|
function useNotifications(rootRef) {
|
|
15
|
-
const idPrefix = (0, react_1.useMemo)(() => new Date().getTime(), []);
|
|
16
15
|
const idRef = (0, react_1.useRef)(0);
|
|
17
16
|
const listeners = (0, react_1.useRef)([]);
|
|
18
|
-
const [
|
|
17
|
+
const [toasts, setToasts] = (0, react_1.useState)(new Map());
|
|
19
18
|
const addToast = Object.assign((0, _internal_1.useEvent)((props) => {
|
|
20
19
|
const nextID = idRef.current++;
|
|
21
|
-
const { id =
|
|
22
|
-
|
|
20
|
+
const { id = nextID, duration, isDismissible = true, ...rest } = props;
|
|
21
|
+
setToasts((toasts) => {
|
|
23
22
|
const newToasts = new Map(toasts);
|
|
24
23
|
newToasts.set(id, {
|
|
25
24
|
id,
|
|
26
25
|
isDismissible,
|
|
27
|
-
duration: duration
|
|
26
|
+
duration: duration ?? (isDismissible ? 5000 : null),
|
|
28
27
|
...rest,
|
|
29
28
|
});
|
|
30
29
|
return newToasts;
|
|
@@ -40,7 +39,7 @@ function useNotifications(rootRef) {
|
|
|
40
39
|
attention: (props) => addToast({ type: 'attention', ...props }),
|
|
41
40
|
});
|
|
42
41
|
const updateToast = (0, _internal_1.useEvent)((id, props) => {
|
|
43
|
-
|
|
42
|
+
setToasts((toasts) => {
|
|
44
43
|
const currentToast = toasts.get(id);
|
|
45
44
|
if (currentToast) {
|
|
46
45
|
const newToasts = new Map(toasts);
|
|
@@ -54,7 +53,7 @@ function useNotifications(rootRef) {
|
|
|
54
53
|
});
|
|
55
54
|
});
|
|
56
55
|
const removeToast = (0, _internal_1.useEvent)((id) => {
|
|
57
|
-
|
|
56
|
+
setToasts((toasts) => {
|
|
58
57
|
if (toasts.has(id)) {
|
|
59
58
|
const newToasts = new Map(toasts);
|
|
60
59
|
newToasts.delete(id);
|
|
@@ -64,28 +63,23 @@ function useNotifications(rootRef) {
|
|
|
64
63
|
});
|
|
65
64
|
});
|
|
66
65
|
const onDismissNotification = (0, _internal_1.useEvent)((id) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(_a = rootRef === null || rootRef === void 0 ? void 0 : rootRef.current) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new CustomEvent(DISMISS_EVENT_NAME, { detail: toast }));
|
|
66
|
+
const toast = toasts.get(id);
|
|
67
|
+
if (toast?.putNotificationInDropdownOnDismiss !== false) {
|
|
68
|
+
rootRef?.current?.dispatchEvent(new CustomEvent(DISMISS_EVENT_NAME, { detail: toast }));
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
71
|
const addOnDismissListener = (0, _internal_1.useEvent)((listener) => {
|
|
74
|
-
var _a;
|
|
75
72
|
const callback = (e) => listener(e.detail);
|
|
76
|
-
const unsub = () =>
|
|
73
|
+
const unsub = () => rootRef?.current?.removeEventListener(DISMISS_EVENT_NAME, callback);
|
|
77
74
|
listeners.current.push(unsub);
|
|
78
|
-
|
|
75
|
+
rootRef?.current?.addEventListener(DISMISS_EVENT_NAME, callback);
|
|
79
76
|
return unsub;
|
|
80
77
|
});
|
|
81
78
|
(0, react_1.useEffect)(() => () => listeners.current.forEach((cb) => cb()), []);
|
|
82
|
-
const api = (0, react_1.useMemo)(() => ({ notify: addToast, update: updateToast, remove: removeToast }),
|
|
83
|
-
// All deps are stable since we use `useEvent` hook
|
|
84
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
|
-
[]);
|
|
79
|
+
const api = (0, react_1.useMemo)(() => ({ notify: addToast, update: updateToast, remove: removeToast }), []);
|
|
86
80
|
return {
|
|
87
81
|
api,
|
|
88
|
-
|
|
82
|
+
toasts: (0, react_1.useMemo)(() => [...toasts.values()], [toasts]),
|
|
89
83
|
onDismissNotification,
|
|
90
84
|
addOnDismissListener,
|
|
91
85
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.NotificationsList = void 0;
|
|
11
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const collections_1 = require("@react-stately/collections");
|
|
14
|
+
const tasty_1 = require("../../../tasty");
|
|
15
|
+
const NotificationView_1 = require("./NotificationView");
|
|
16
|
+
const hooks_1 = require("./hooks");
|
|
17
|
+
const NotificationListContainer = (0, tasty_1.tasty)({
|
|
18
|
+
styles: { boxSizing: 'border-box', width: '100%' },
|
|
19
|
+
});
|
|
20
|
+
function NotificationsList(props) {
|
|
21
|
+
const { items, children } = props;
|
|
22
|
+
const ref = (0, react_1.useRef)(null);
|
|
23
|
+
const { state, listProps } = (0, hooks_1.useNotificationsList)({
|
|
24
|
+
items,
|
|
25
|
+
children,
|
|
26
|
+
ref,
|
|
27
|
+
});
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(NotificationListContainer, { ref: ref, ...listProps, children: [...state.collection].map((item) => ((0, jsx_runtime_1.jsx)(NotificationListItem, { item: item, state: state }, item.key))) }, void 0));
|
|
29
|
+
}
|
|
30
|
+
exports.NotificationsList = NotificationsList;
|
|
31
|
+
NotificationsList.Item = collections_1.Item;
|
|
32
|
+
const NotificationListItemWrap = (0, tasty_1.tasty)({
|
|
33
|
+
styles: { borderBottom: { '': '1bw solid #border', ':last-child': 'none' } },
|
|
34
|
+
});
|
|
35
|
+
function NotificationListItem(props) {
|
|
36
|
+
const { item, state } = props;
|
|
37
|
+
const { key, props: notificationProps } = item;
|
|
38
|
+
const ref = (0, react_1.useRef)(null);
|
|
39
|
+
const { itemProps } = (0, hooks_1.useNotificationListItem)({ ref, key, state });
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(NotificationListItemWrap, { children: (0, jsx_runtime_1.jsx)(NotificationView_1.NotificationView, { ref: ref, attributes: itemProps, ...notificationProps, isDismissible: false }, void 0) }, void 0));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,10 +12,9 @@ const react_1 = require("react");
|
|
|
12
12
|
const _internal_1 = require("../../../../_internal");
|
|
13
13
|
const NotificationsContext_1 = require("../NotificationsContext");
|
|
14
14
|
function useNotificationsObserver(callback) {
|
|
15
|
-
|
|
16
|
-
const { addOnDismissListener } = (_a = (0, react_1.useContext)(NotificationsContext_1.NotificationsContext)) !== null && _a !== void 0 ? _a : {};
|
|
15
|
+
const { addOnDismissListener } = (0, react_1.useContext)(NotificationsContext_1.NotificationsContext) ?? {};
|
|
17
16
|
const callbackEvent = (0, _internal_1.useEvent)(callback);
|
|
18
|
-
(0, react_1.useEffect)(() => addOnDismissListener
|
|
17
|
+
(0, react_1.useEffect)(() => addOnDismissListener?.(callbackEvent), [addOnDismissListener]);
|
|
19
18
|
}
|
|
20
19
|
exports.useNotificationsObserver = useNotificationsObserver;
|
|
21
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-9f997c6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ function Toast(props) {
|
|
|
18
18
|
const defaultId = (0, useId_1.useId)();
|
|
19
19
|
const disableRemoveOnUnmountRef = (0, _internal_1.useSyncRef)(disableRemoveOnUnmount);
|
|
20
20
|
const { toast, update, remove } = (0, use_toasts_api_1.useToastsApi)();
|
|
21
|
-
const id = propsId
|
|
21
|
+
const id = propsId ?? defaultId;
|
|
22
22
|
const removeNotification = (0, _internal_1.useEvent)((id) => disableRemoveOnUnmountRef.current ? void 0 : remove(id));
|
|
23
23
|
(0, react_1.useEffect)(() => {
|
|
24
24
|
toast({ id, ...props });
|