@cube-dev/ui-kit 0.0.0-canary-b916e8d → 0.0.0-canary-5cc6499
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_internal/hooks/index.js +1 -1
- package/cjs/_internal/hooks/use-deprecation-warning.js +1 -1
- package/cjs/_internal/index.js +1 -1
- package/cjs/components/Base.js +1 -1
- package/cjs/components/Block.js +3 -3
- package/cjs/components/GlobalStyles.js +1 -1
- package/cjs/components/GridProvider.js +7 -8
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +3 -6
- package/cjs/components/actions/Action.js +3 -2
- package/cjs/components/actions/Button/Button.js +5 -2
- 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 +11 -9
- package/cjs/components/actions/index.js +1 -1
- package/cjs/components/content/ActiveZone/ActiveZone.js +3 -2
- package/cjs/components/content/Alert/Alert.js +8 -6
- package/cjs/components/content/Alert/index.js +1 -1
- package/cjs/components/content/Alert/types.js +1 -1
- package/cjs/components/content/Alert/use-alert.js +1 -1
- package/cjs/components/content/Avatar/Avatar.js +3 -2
- package/cjs/components/content/Badge/Badge.js +3 -3
- package/cjs/components/content/Card/Card.js +13 -15
- package/cjs/components/content/Content.js +3 -3
- package/cjs/components/content/CopySnippet/CopySnippet.js +21 -57
- package/cjs/components/content/CopySnippet/index.js +1 -1
- package/cjs/components/content/Divider.js +31 -31
- package/cjs/components/content/Footer.js +3 -3
- package/cjs/components/content/Header.js +3 -3
- package/cjs/components/content/Paragraph.js +1 -1
- package/cjs/components/content/Placeholder/Placeholder.js +18 -36
- package/cjs/components/content/PrismCode/PrismCode.js +3 -3
- 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 +13 -11
- package/cjs/components/content/Text.js +3 -3
- package/cjs/components/content/Title.js +3 -3
- package/cjs/components/forms/Checkbox/Checkbox.js +61 -57
- package/cjs/components/forms/Checkbox/CheckboxGroup.js +35 -21
- package/cjs/components/forms/Checkbox/context.js +1 -1
- package/cjs/components/forms/FieldWrapper.js +4 -4
- package/cjs/components/forms/FileInput/FileInput.js +49 -45
- package/cjs/components/forms/Form/Field.js +1 -1
- package/cjs/components/forms/Form/Form.js +11 -13
- 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 +6 -4
- 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 +92 -95
- package/cjs/components/forms/RadioGroup/RadioGroup.js +35 -20
- 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 +76 -72
- 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 +20 -24
- package/cjs/components/forms/index.js +1 -1
- package/cjs/components/layout/Flex.js +8 -9
- package/cjs/components/layout/Flow.js +8 -9
- package/cjs/components/layout/Grid.js +9 -9
- package/cjs/components/layout/Prefix.js +17 -19
- package/cjs/components/layout/Space.js +17 -21
- package/cjs/components/layout/Suffix.js +17 -19
- package/cjs/components/navigation/LegacyTabs/LegacyTabs.js +41 -64
- package/cjs/components/navigation/Link/Link.js +1 -1
- package/cjs/components/organisms/FileTabs/FileTabs.js +50 -73
- 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 +1 -1
- package/cjs/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/cjs/components/overlays/AlertDialog/index.js +1 -1
- package/cjs/components/overlays/AlertDialog/types.js +1 -1
- package/cjs/components/overlays/Dialog/Dialog.js +62 -60
- 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 +32 -32
- 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 +26 -23
- package/cjs/components/overlays/Modal/Tray.js +24 -24
- package/cjs/components/overlays/Modal/Underlay.js +31 -25
- package/cjs/components/overlays/Modal/index.js +1 -1
- package/cjs/components/overlays/Notification/Notification.js +10 -53
- package/cjs/components/overlays/OverlayWrapper.js +1 -1
- package/cjs/components/overlays/Tooltip/Tooltip.js +56 -67
- 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 +45 -44
- package/cjs/components/pickers/Menu/Menu.js +10 -4
- 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 +6 -6
- 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 +14 -13
- package/cjs/components/pickers/Select/Select.js +113 -117
- 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 +4 -4
- package/cjs/components/status/Spin/Spin.js +2 -2
- package/cjs/data/themes.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/provider.js +1 -1
- package/cjs/providers/StyleProvider.js +1 -1
- package/cjs/services/notification.js +1 -1
- package/cjs/shared/form.js +1 -1
- package/cjs/shared/index.js +1 -1
- package/cjs/stories/FormFieldArgs.js +1 -1
- package/cjs/stories/components/ConfirmDeletionDialogForm.js +1 -1
- package/cjs/stories/components/DialogFormApp.js +1 -1
- package/cjs/stories/components/StyledButton.js +1 -1
- package/cjs/stories/lists/baseProps.js +1 -1
- package/cjs/styled/index.js +1 -1
- package/cjs/styled/styled.js +1 -1
- package/cjs/tasty/index.js +2 -3
- 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 +3 -8
- 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 -2
- package/cjs/tasty/utils/index.js +1 -1
- package/cjs/tasty/utils/mergeStyles.js +1 -1
- package/cjs/tasty/utils/modAttrs.js +1 -1
- package/cjs/tasty/utils/renderStyles.js +1 -1
- package/cjs/tasty/utils/responsive.js +1 -1
- package/cjs/tasty/utils/string.js +1 -1
- package/cjs/tasty/utils/styles.js +1 -1
- package/cjs/tasty/utils/warnings.js +1 -1
- package/cjs/test/index.js +1 -1
- package/cjs/test/render.js +1 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +1 -1
- package/cjs/tokens.js +1 -6
- 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 +1 -1
- package/cjs/utils/react/chain.js +1 -1
- package/cjs/utils/react/index.js +1 -1
- package/cjs/utils/react/interactions.js +1 -1
- package/cjs/utils/react/isTextOnly.js +1 -1
- package/cjs/utils/react/mapProps.js +1 -1
- package/cjs/utils/react/mergeProps.js +3 -4
- 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 +9 -13
- package/es/_internal/hooks/index.js +1 -1
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/index.js +1 -1
- package/es/components/Base.js +1 -1
- package/es/components/Block.js +3 -3
- package/es/components/GlobalStyles.js +1 -1
- package/es/components/GridProvider.js +7 -8
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +4 -7
- package/es/components/actions/Action.js +4 -3
- package/es/components/actions/Button/Button.js +5 -2
- 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 +11 -9
- package/es/components/actions/index.js +1 -1
- package/es/components/content/ActiveZone/ActiveZone.js +4 -3
- package/es/components/content/Alert/Alert.js +8 -6
- 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 +4 -3
- package/es/components/content/Badge/Badge.js +3 -3
- package/es/components/content/Card/Card.js +14 -16
- package/es/components/content/Content.js +3 -3
- package/es/components/content/CopySnippet/CopySnippet.js +21 -57
- package/es/components/content/CopySnippet/index.js +1 -1
- package/es/components/content/Divider.js +32 -32
- package/es/components/content/Footer.js +3 -3
- package/es/components/content/Header.js +3 -3
- package/es/components/content/Paragraph.js +1 -1
- package/es/components/content/Placeholder/Placeholder.js +19 -34
- package/es/components/content/PrismCode/PrismCode.js +3 -3
- 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 +13 -11
- package/es/components/content/Text.js +3 -3
- package/es/components/content/Title.js +3 -3
- package/es/components/forms/Checkbox/Checkbox.js +62 -58
- package/es/components/forms/Checkbox/CheckboxGroup.js +36 -22
- package/es/components/forms/Checkbox/context.js +1 -1
- package/es/components/forms/FieldWrapper.js +4 -4
- package/es/components/forms/FileInput/FileInput.js +50 -46
- package/es/components/forms/Form/Field.js +1 -1
- package/es/components/forms/Form/Form.js +12 -14
- 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 +6 -4
- 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 +93 -96
- package/es/components/forms/RadioGroup/RadioGroup.js +36 -21
- 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 +78 -74
- 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 +21 -25
- package/es/components/forms/index.js +1 -1
- package/es/components/layout/Flex.js +9 -10
- package/es/components/layout/Flow.js +9 -10
- package/es/components/layout/Grid.js +10 -10
- package/es/components/layout/Prefix.js +18 -20
- package/es/components/layout/Space.js +18 -22
- package/es/components/layout/Suffix.js +18 -20
- package/es/components/navigation/LegacyTabs/LegacyTabs.js +41 -61
- package/es/components/navigation/Link/Link.js +1 -1
- package/es/components/organisms/FileTabs/FileTabs.js +50 -70
- 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 +1 -1
- package/es/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/es/components/overlays/AlertDialog/index.js +1 -1
- package/es/components/overlays/AlertDialog/types.js +1 -1
- package/es/components/overlays/Dialog/Dialog.js +63 -61
- 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 +32 -32
- 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 +26 -23
- package/es/components/overlays/Modal/Tray.js +24 -24
- package/es/components/overlays/Modal/Underlay.js +31 -25
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/Notification/Notification.js +10 -53
- package/es/components/overlays/OverlayWrapper.js +1 -1
- package/es/components/overlays/Tooltip/Tooltip.js +57 -65
- 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 +46 -45
- package/es/components/pickers/Menu/Menu.js +10 -4
- 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 +7 -7
- 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 +14 -13
- package/es/components/pickers/Select/Select.js +115 -116
- 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 +4 -4
- package/es/components/status/Spin/Spin.js +2 -2
- package/es/data/themes.js +1 -1
- package/es/index.js +1 -1
- package/es/provider.js +1 -1
- package/es/providers/StyleProvider.js +1 -1
- package/es/services/notification.js +1 -1
- package/es/shared/form.js +1 -1
- package/es/shared/index.js +1 -1
- package/es/stories/FormFieldArgs.js +1 -1
- package/es/stories/components/ConfirmDeletionDialogForm.js +1 -1
- package/es/stories/components/DialogFormApp.js +1 -1
- package/es/stories/components/StyledButton.js +1 -1
- package/es/stories/lists/baseProps.js +1 -1
- package/es/styled/index.js +1 -1
- package/es/styled/styled.js +1 -1
- package/es/tasty/index.js +2 -2
- 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 +3 -7
- 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 -2
- package/es/tasty/utils/index.js +1 -1
- package/es/tasty/utils/mergeStyles.js +1 -1
- package/es/tasty/utils/modAttrs.js +1 -1
- package/es/tasty/utils/renderStyles.js +1 -1
- package/es/tasty/utils/responsive.js +1 -1
- package/es/tasty/utils/string.js +1 -1
- package/es/tasty/utils/styles.js +1 -1
- package/es/tasty/utils/warnings.js +1 -1
- package/es/test/index.js +1 -1
- package/es/test/render.js +1 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +1 -1
- package/es/tokens.js +1 -6
- 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 +1 -1
- package/es/utils/react/chain.js +1 -1
- package/es/utils/react/index.js +1 -1
- package/es/utils/react/interactions.js +1 -1
- package/es/utils/react/isTextOnly.js +1 -1
- package/es/utils/react/mapProps.js +1 -1
- package/es/utils/react/mergeProps.js +3 -4
- 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 +9 -13
- package/package.json +4 -4
- package/types/components/content/Tag/Tag.d.ts +1 -2
- package/types/components/overlays/Dialog/Dialog.d.ts +1 -2
- package/types/components/pickers/Menu/MenuItem.d.ts +1 -2
- package/types/components/pickers/Menu/MenuSection.d.ts +3 -8
- package/types/tasty/index.d.ts +1 -1
- package/types/tasty/tasty.d.ts +4 -8
- package/types/tokens.d.ts +0 -4
|
@@ -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-5cc6499
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -13,21 +13,13 @@ import { Action } from '../../actions/Action';
|
|
|
13
13
|
import { Space } from '../../layout/Space';
|
|
14
14
|
import { Flex } from '../../layout/Flex';
|
|
15
15
|
import { tasty } from '../../../tasty';
|
|
16
|
-
import styled from 'styled-components';
|
|
17
|
-
import { Flow } from '../../layout/Flow';
|
|
18
16
|
const FileTabsContext = createContext({
|
|
19
17
|
addTab() { },
|
|
20
18
|
removeTab() { },
|
|
21
19
|
setTab() { },
|
|
22
20
|
setDirtyTab() { },
|
|
23
21
|
});
|
|
24
|
-
const
|
|
25
|
-
styles: {
|
|
26
|
-
gap: '.5x',
|
|
27
|
-
flexShrink: 0,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const StyledTabsPanelElement = styled(TabsPanelElement) `
|
|
22
|
+
const TABS_PANEL_CSS = `
|
|
31
23
|
position: relative;
|
|
32
24
|
overflow: auto hidden;
|
|
33
25
|
top: 1px;
|
|
@@ -52,14 +44,7 @@ const StyledTabsPanelElement = styled(TabsPanelElement) `
|
|
|
52
44
|
height: 3px;
|
|
53
45
|
}
|
|
54
46
|
`;
|
|
55
|
-
const
|
|
56
|
-
styles: {
|
|
57
|
-
flow: 'column',
|
|
58
|
-
height: 'max 100%',
|
|
59
|
-
width: 'max 100%',
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
const StyledTabsContainerElement = styled(TabsContainerElement) `
|
|
47
|
+
const TABS_CONTAINER_CSS = `
|
|
63
48
|
position: relative;
|
|
64
49
|
|
|
65
50
|
&::before {
|
|
@@ -72,7 +57,7 @@ const StyledTabsContainerElement = styled(TabsContainerElement) `
|
|
|
72
57
|
pointer-events: none;
|
|
73
58
|
width: 32px;
|
|
74
59
|
height: 37px;
|
|
75
|
-
transition: all
|
|
60
|
+
transition: all .15s linear;
|
|
76
61
|
background-image: linear-gradient(
|
|
77
62
|
to left,
|
|
78
63
|
rgba(255, 255, 255, 0),
|
|
@@ -91,7 +76,7 @@ const StyledTabsContainerElement = styled(TabsContainerElement) `
|
|
|
91
76
|
width: 32px;
|
|
92
77
|
height: 37px;
|
|
93
78
|
pointer-events: none;
|
|
94
|
-
transition: all
|
|
79
|
+
transition: all .15s linear;
|
|
95
80
|
background-image: linear-gradient(
|
|
96
81
|
to right,
|
|
97
82
|
rgba(255, 255, 255, 0),
|
|
@@ -100,8 +85,7 @@ const StyledTabsContainerElement = styled(TabsContainerElement) `
|
|
|
100
85
|
z-index: 10;
|
|
101
86
|
}
|
|
102
87
|
|
|
103
|
-
&[data-is-left-fade]::before,
|
|
104
|
-
&[data-is-right-fade]::after {
|
|
88
|
+
&[data-is-left-fade]::before, &[data-is-right-fade]::after {
|
|
105
89
|
opacity: 1;
|
|
106
90
|
}
|
|
107
91
|
`;
|
|
@@ -118,40 +102,50 @@ const DirtyBadge = tasty({
|
|
|
118
102
|
radius: 'round',
|
|
119
103
|
},
|
|
120
104
|
});
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
disabled: 'left top right rgb(227, 227, 233)',
|
|
128
|
-
},
|
|
129
|
-
fill: {
|
|
130
|
-
'': '#dark.04',
|
|
131
|
-
hovered: '#dark.08',
|
|
132
|
-
'disabled, disabled & hover': '#white',
|
|
133
|
-
},
|
|
134
|
-
color: {
|
|
135
|
-
'': '#dark.75',
|
|
136
|
-
'disabled, hovered, hovered & disabled': '#dark',
|
|
137
|
-
},
|
|
138
|
-
cursor: {
|
|
139
|
-
'': 'pointer',
|
|
140
|
-
disabled: 'default',
|
|
141
|
-
},
|
|
142
|
-
fontWeight: 500,
|
|
143
|
-
opacity: 1,
|
|
144
|
-
preset: 'default',
|
|
145
|
-
outline: {
|
|
146
|
-
'': 'inset #purple-03.0',
|
|
147
|
-
'focused & focus-visible': 'inset #purple-03',
|
|
148
|
-
},
|
|
105
|
+
const TAB_STYLES = {
|
|
106
|
+
radius: '1r 1r 0 0',
|
|
107
|
+
padding: '1x 1.5x',
|
|
108
|
+
border: {
|
|
109
|
+
'': 'left top right #clear',
|
|
110
|
+
disabled: 'left top right rgb(227, 227, 233)',
|
|
149
111
|
},
|
|
150
|
-
|
|
151
|
-
|
|
112
|
+
fill: {
|
|
113
|
+
'': '#dark.04',
|
|
114
|
+
hovered: '#dark.08',
|
|
115
|
+
'disabled, disabled & hover': '#white',
|
|
116
|
+
},
|
|
117
|
+
color: {
|
|
118
|
+
'': '#dark.75',
|
|
119
|
+
'disabled, hovered, hovered & disabled': '#dark',
|
|
120
|
+
},
|
|
121
|
+
cursor: {
|
|
122
|
+
'': 'pointer',
|
|
123
|
+
disabled: 'default',
|
|
124
|
+
},
|
|
125
|
+
fontWeight: 500,
|
|
126
|
+
opacity: 1,
|
|
127
|
+
preset: 'default',
|
|
128
|
+
outline: {
|
|
129
|
+
'': 'inset #purple-03.0',
|
|
130
|
+
'focused & focus-visible': 'inset #purple-03',
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
const CLOSE_STYLES = {
|
|
134
|
+
color: {
|
|
135
|
+
'': '#dark.50',
|
|
136
|
+
hovered: '#dark',
|
|
137
|
+
},
|
|
138
|
+
padding: '0 .25x',
|
|
139
|
+
outline: {
|
|
140
|
+
'': '#purple-03.0',
|
|
141
|
+
'focused & focus-visible': '#purple-03',
|
|
142
|
+
},
|
|
143
|
+
radius: '1r',
|
|
144
|
+
};
|
|
145
|
+
const TAB_CSS = `
|
|
152
146
|
margin-bottom: var(--border-width);
|
|
153
147
|
transform: translate(0, 0);
|
|
154
|
-
transition: color
|
|
148
|
+
transition: color .2s linear, background-color .2s linear;
|
|
155
149
|
|
|
156
150
|
&[disabled] {
|
|
157
151
|
transform: translate(0, var(--border-width));
|
|
@@ -180,22 +174,8 @@ const StyledTabElement = styled(TabElement) `
|
|
|
180
174
|
}
|
|
181
175
|
}
|
|
182
176
|
`;
|
|
183
|
-
const CloseButton = tasty({
|
|
184
|
-
styles: {
|
|
185
|
-
color: {
|
|
186
|
-
'': '#dark.50',
|
|
187
|
-
hovered: '#dark',
|
|
188
|
-
},
|
|
189
|
-
padding: '0 .25x',
|
|
190
|
-
outline: {
|
|
191
|
-
'': '#purple-03.0',
|
|
192
|
-
'focused & focus-visible': '#purple-03',
|
|
193
|
-
},
|
|
194
|
-
radius: '1r',
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
177
|
const Tab = ({ isDirty, isDisabled, children, isClosable, onClose, ...props }) => {
|
|
198
|
-
return (_jsx(
|
|
178
|
+
return (_jsx(Action, { className: isDirty ? 'file-tab--dirty' : '', css: TAB_CSS, styles: TAB_STYLES, isDisabled: isDisabled, ...props, children: _jsxs(Space, { gap: ".75x", children: [_jsx(Block, { children: children }, void 0), (isClosable || isDirty) && (_jsxs(Flex, { placeItems: "center", style: { position: 'relative' }, children: [isClosable ? (_jsx(Action, { onPress: onClose, className: "file-tab-close", styles: CLOSE_STYLES, children: _jsx(CloseOutlined, {}, void 0) }, void 0)) : (_jsx("div", {}, void 0)), isDirty ? _jsx(DirtyBadge, { className: "file-tab-dirty-badge" }, void 0) : null] }, void 0))] }, void 0) }, void 0));
|
|
199
179
|
};
|
|
200
180
|
export function FileTabs({ defaultActiveKey, activeKey: activeKeyProp, onTabClick, onTabClose, paneStyles, isClosable = true, children, ...props }) {
|
|
201
181
|
const tabsRef = useRef(null);
|
|
@@ -289,13 +269,13 @@ export function FileTabs({ defaultActiveKey, activeKey: activeKeyProp, onTabClic
|
|
|
289
269
|
setTab(tab.id);
|
|
290
270
|
onTabClick && onTabClick(tab.id);
|
|
291
271
|
}
|
|
292
|
-
return (_jsx(
|
|
272
|
+
return (_jsx(Flex, { flow: "column", height: "max 100%", width: "max 100%", "data-is-left-fade": leftFade || null, "data-is-right-fade": rightFade || null, css: TABS_CONTAINER_CSS, ...props, children: _jsxs(FileTabsContext.Provider, { value: {
|
|
293
273
|
addTab,
|
|
294
274
|
setTab,
|
|
295
275
|
removeTab,
|
|
296
276
|
setDirtyTab,
|
|
297
277
|
currentTab: activeKey,
|
|
298
|
-
}, children: [_jsx(
|
|
278
|
+
}, children: [_jsx(Space, { ref: tabsRef, gap: ".5x", flexShrink: 0, css: TABS_PANEL_CSS, children: tabs.map((tab) => {
|
|
299
279
|
return (_jsx(Tab, { onPress: () => onPress(tab), onClose: () => isClosable && handleClose(tab), isClosable: isClosable, isDisabled: tab.id === activeKey || false, isDirty: tab.isDirty, children: tab.title }, tab.id));
|
|
300
280
|
}) }, void 0), _jsx(Flex, { flexGrow: 1, border: "top rgb(227, 227, 233)", ...(paneStyles || {}), children: children }, void 0)] }, void 0) }, void 0));
|
|
301
281
|
}
|
|
@@ -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-5cc6499
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -14,71 +14,70 @@ import { FocusScope } from '@react-aria/focus';
|
|
|
14
14
|
import { forwardRef } from 'react';
|
|
15
15
|
import { useDialog } from '@react-aria/dialog';
|
|
16
16
|
import { useMessageFormatter } from '@react-aria/i18n';
|
|
17
|
+
import { Base } from '../../Base';
|
|
17
18
|
import { CloseOutlined } from '@ant-design/icons';
|
|
18
|
-
import { BASE_STYLES, BLOCK_STYLES, DIMENSION_STYLES, extractStyles,
|
|
19
|
+
import { BASE_STYLES, BLOCK_STYLES, DIMENSION_STYLES, extractStyles, } from '../../../tasty';
|
|
19
20
|
import { mergeProps, SlotProvider } from '../../../utils/react';
|
|
21
|
+
import { useContextStyles } from '../../../providers/StyleProvider';
|
|
20
22
|
const STYLES_LIST = [...BASE_STYLES, ...DIMENSION_STYLES, ...BLOCK_STYLES];
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'[data-type="fullscreenTakeover"]': '100vw 100vw',
|
|
33
|
-
'[data-type="panel"]': '100vw 100vw',
|
|
34
|
-
},
|
|
35
|
-
height: {
|
|
36
|
-
'': 'max 90vh',
|
|
37
|
-
'[data-type="fullscreenTakeover"] | [data-type="panel"]': 'max 100vh',
|
|
38
|
-
},
|
|
39
|
-
gap: 0,
|
|
40
|
-
flow: 'column',
|
|
41
|
-
radius: {
|
|
42
|
-
'': '2r',
|
|
43
|
-
'[data-type="tray"]': '2r top',
|
|
44
|
-
'[data-type="fullscreenTakeover"] | [data-type="panel"]': '0r',
|
|
45
|
-
},
|
|
46
|
-
fill: '#white',
|
|
47
|
-
shadow: {
|
|
48
|
-
'': '0 20px 30px #shadow',
|
|
49
|
-
'[data-type="popover"]': '0px 4px 16px #shadow',
|
|
50
|
-
},
|
|
51
|
-
transform: {
|
|
52
|
-
'': false,
|
|
53
|
-
'[data-type="modal"]': 'translate(0, ((50vh - 50%) / -3))',
|
|
54
|
-
},
|
|
55
|
-
placeSelf: 'stretch',
|
|
56
|
-
'@dialog-heading-padding-v': {
|
|
57
|
-
'': '2x',
|
|
58
|
-
'[data-type="popover"]': '1x',
|
|
59
|
-
},
|
|
60
|
-
'@dialog-content-padding-v': {
|
|
61
|
-
'': '3x',
|
|
62
|
-
'[data-type="popover"]': '2x',
|
|
63
|
-
},
|
|
64
|
-
'@dialog-padding-h': {
|
|
65
|
-
'': '3x',
|
|
66
|
-
'[data-type="popover"]': '2x',
|
|
67
|
-
},
|
|
68
|
-
'@dialog-footer-v': {
|
|
69
|
-
'': '2x',
|
|
70
|
-
'[data-type="popover"]': '1x',
|
|
71
|
-
},
|
|
72
|
-
'@dialog-content-gap': '3x',
|
|
23
|
+
const DEFAULT_STYLES = {
|
|
24
|
+
pointerEvents: 'auto',
|
|
25
|
+
position: 'relative',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
placeItems: 'stretch',
|
|
28
|
+
placeContent: 'stretch',
|
|
29
|
+
width: {
|
|
30
|
+
'': '288px @dialog-size 90vw',
|
|
31
|
+
'[data-type="fullscreen"]': '90vw 90vw',
|
|
32
|
+
'[data-type="fullscreenTakeover"]': '100vw 100vw',
|
|
33
|
+
'[data-type="panel"]': '100vw 100vw',
|
|
73
34
|
},
|
|
74
|
-
|
|
35
|
+
height: {
|
|
36
|
+
'': 'max 90vh',
|
|
37
|
+
'[data-type="fullscreenTakeover"] | [data-type="panel"]': 'max 100vh',
|
|
38
|
+
},
|
|
39
|
+
gap: 0,
|
|
40
|
+
flow: 'column',
|
|
41
|
+
radius: {
|
|
42
|
+
'': '2r',
|
|
43
|
+
'[data-type="tray"]': '2r top',
|
|
44
|
+
'[data-type="fullscreenTakeover"] | [data-type="panel"]': '0r',
|
|
45
|
+
},
|
|
46
|
+
fill: '#white',
|
|
47
|
+
shadow: {
|
|
48
|
+
'': '0 20px 30px #shadow',
|
|
49
|
+
'[data-type="popover"]': '0px 4px 16px #shadow',
|
|
50
|
+
},
|
|
51
|
+
transform: {
|
|
52
|
+
'': false,
|
|
53
|
+
'[data-type="modal"]': 'translate(0, ((50vh - 50%) / -3))',
|
|
54
|
+
},
|
|
55
|
+
placeSelf: 'stretch',
|
|
56
|
+
'@dialog-heading-padding-v': {
|
|
57
|
+
'': '2x',
|
|
58
|
+
'[data-type="popover"]': '1x',
|
|
59
|
+
},
|
|
60
|
+
'@dialog-content-padding-v': {
|
|
61
|
+
'': '3x',
|
|
62
|
+
'[data-type="popover"]': '2x',
|
|
63
|
+
},
|
|
64
|
+
'@dialog-padding-h': {
|
|
65
|
+
'': '3x',
|
|
66
|
+
'[data-type="popover"]': '2x',
|
|
67
|
+
},
|
|
68
|
+
'@dialog-footer-v': {
|
|
69
|
+
'': '2x',
|
|
70
|
+
'[data-type="popover"]': '1x',
|
|
71
|
+
},
|
|
72
|
+
'@dialog-content-gap': '3x',
|
|
73
|
+
};
|
|
75
74
|
const CLOSE_BUTTON_STYLES = {
|
|
76
|
-
display: 'flex',
|
|
77
75
|
position: 'absolute',
|
|
78
76
|
top: '1x',
|
|
79
77
|
right: '1x',
|
|
80
78
|
width: '5x',
|
|
81
79
|
height: '5x',
|
|
80
|
+
display: 'flex',
|
|
82
81
|
placeContent: 'center',
|
|
83
82
|
};
|
|
84
83
|
const sizeMap = {
|
|
@@ -103,9 +102,14 @@ const intlMessages = {
|
|
|
103
102
|
*/
|
|
104
103
|
export const Dialog = forwardRef(function Dialog(props, ref) {
|
|
105
104
|
let { type = 'modal', ...contextProps } = useDialogContext();
|
|
106
|
-
let { qa, children, size = 'S', isDismissable = contextProps.isDismissable, onDismiss = contextProps.onClose, closeIcon,
|
|
105
|
+
let { qa, children, size = 'S', isDismissable = contextProps.isDismissable, onDismiss = contextProps.onClose, closeIcon, ...otherProps } = props;
|
|
107
106
|
size = sizeMap[size.toUpperCase()] || size;
|
|
108
|
-
const styles =
|
|
107
|
+
const styles = {
|
|
108
|
+
...DEFAULT_STYLES,
|
|
109
|
+
...useContextStyles('Dialog', props),
|
|
110
|
+
...extractStyles(otherProps, STYLES_LIST),
|
|
111
|
+
'@dialog-size': `${sizePxMap[size] || 288}px`,
|
|
112
|
+
};
|
|
109
113
|
let formatMessage = useMessageFormatter(intlMessages);
|
|
110
114
|
let domRef = useDOMRef(ref);
|
|
111
115
|
let { dialogProps, titleProps } = useDialog(mergeProps(contextProps, props), domRef);
|
|
@@ -156,10 +160,8 @@ export const Dialog = forwardRef(function Dialog(props, ref) {
|
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
162
|
};
|
|
159
|
-
return (_jsx(FocusScope, { contain: true, restoreFocus: true, children: _jsxs(
|
|
163
|
+
return (_jsx(FocusScope, { contain: true, restoreFocus: true, children: _jsxs(Base, { "data-id": "Dialog", "data-qa": qa || 'Dialog', styles: styles, as: "section", ...dialogProps, mods: {
|
|
160
164
|
dismissable: isDismissable,
|
|
161
|
-
}, style: {
|
|
162
|
-
'--dialog-size': `${sizePxMap[size] || 288}px`,
|
|
163
165
|
}, "data-type": type, "data-size": size, ref: domRef, children: [dismissButton, _jsxs(SlotProvider, { slots: slots, children: [isDismissable && (_jsx(Button, { qa: "ModalCloseButton", type: "neutral", styles: CLOSE_BUTTON_STYLES, icon: closeIcon || _jsx(CloseOutlined, {}, void 0), label: formatMessage('dismiss'), onPress: () => onDismiss && onDismiss() }, void 0)), children] }, void 0)] }, void 0) }, void 0));
|
|
164
166
|
});
|
|
165
167
|
|
|
@@ -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-5cc6499
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,8 +12,9 @@ import { Overlay } from './Overlay';
|
|
|
12
12
|
import { forwardRef } from 'react';
|
|
13
13
|
import { Underlay } from './Underlay';
|
|
14
14
|
import { useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';
|
|
15
|
-
import {
|
|
15
|
+
import { Base } from '../../Base';
|
|
16
16
|
import { mergeProps } from '../../../utils/react';
|
|
17
|
+
import { useContextStyles } from '../../../providers/StyleProvider';
|
|
17
18
|
export const OVERLAY_WRAPPER_STYLES = {
|
|
18
19
|
position: 'fixed',
|
|
19
20
|
display: 'grid',
|
|
@@ -31,36 +32,30 @@ export const OVERLAY_WRAPPER_STYLES = {
|
|
|
31
32
|
zIndex: 2,
|
|
32
33
|
transition: 'visibility 0ms linear .13s',
|
|
33
34
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
height: {
|
|
43
|
-
'': 'max (@cube-visual-viewport-height * .9)',
|
|
44
|
-
'[data-type="fullscreenTakeover"] | [data-type="panel"]': '@cube-visual-viewport-height @cube-visual-viewport-height',
|
|
45
|
-
'[data-type="fullscreen"]': '(@cube-visual-viewport-height * .9) (@cube-visual-viewport-height * .9)',
|
|
46
|
-
'[data-type="fullscreenTakeover"]': '@cube-visual-viewport-height @cube-visual-viewport-height',
|
|
47
|
-
},
|
|
48
|
-
width: {
|
|
49
|
-
width: '288px 90vw',
|
|
50
|
-
},
|
|
51
|
-
pointerEvents: 'none',
|
|
52
|
-
transition: 'opacity .25s linear, visibility 0ms linear, transform .25s ease-in-out',
|
|
53
|
-
transform: {
|
|
54
|
-
'': 'translate(0, 0) scale(1, 1)',
|
|
55
|
-
'[data-type="modal"] & !open': 'translate(0, -3x) scale(1, 1)',
|
|
56
|
-
'[data-type^="fullscreen"] & !open': 'translate(0, 0) scale(1.02, 1.02)',
|
|
57
|
-
},
|
|
58
|
-
opacity: {
|
|
59
|
-
'': 0,
|
|
60
|
-
open: 0.9999,
|
|
61
|
-
},
|
|
35
|
+
const MODAL_STYLES = {
|
|
36
|
+
display: 'grid',
|
|
37
|
+
zIndex: 2,
|
|
38
|
+
height: {
|
|
39
|
+
'': 'max (@cube-visual-viewport-height * .9)',
|
|
40
|
+
'[data-type="fullscreenTakeover"] | [data-type="panel"]': '@cube-visual-viewport-height @cube-visual-viewport-height',
|
|
41
|
+
'[data-type="fullscreen"]': '(@cube-visual-viewport-height * .9) (@cube-visual-viewport-height * .9)',
|
|
42
|
+
'[data-type="fullscreenTakeover"]': '@cube-visual-viewport-height @cube-visual-viewport-height',
|
|
62
43
|
},
|
|
63
|
-
|
|
44
|
+
width: {
|
|
45
|
+
width: '288px 90vw',
|
|
46
|
+
},
|
|
47
|
+
pointerEvents: 'none',
|
|
48
|
+
transition: 'opacity .25s linear, visibility 0ms linear, transform .25s ease-in-out',
|
|
49
|
+
transform: {
|
|
50
|
+
'': 'translate(0, 0) scale(1, 1)',
|
|
51
|
+
'[data-type="modal"] & !open': 'translate(0, -3x) scale(1, 1)',
|
|
52
|
+
'[data-type^="fullscreen"] & !open': 'translate(0, 0) scale(1.02, 1.02)',
|
|
53
|
+
},
|
|
54
|
+
opacity: {
|
|
55
|
+
'': 0,
|
|
56
|
+
open: 0.9999,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
64
59
|
function Modal(props, ref) {
|
|
65
60
|
let { qa, children, onClose, type, styles, ...otherProps } = props;
|
|
66
61
|
let domRef = useDOMRef(ref);
|
|
@@ -69,13 +64,18 @@ function Modal(props, ref) {
|
|
|
69
64
|
}
|
|
70
65
|
let ModalWrapper = forwardRef(function ModalWrapper(props, ref) {
|
|
71
66
|
let { qa, children, isOpen, type, placement, styles, overlayProps, ...otherProps } = props;
|
|
67
|
+
styles = {
|
|
68
|
+
...MODAL_STYLES,
|
|
69
|
+
...useContextStyles('Modal', props),
|
|
70
|
+
...styles,
|
|
71
|
+
};
|
|
72
72
|
usePreventScroll();
|
|
73
73
|
let { modalProps } = useModal();
|
|
74
74
|
let viewport = useViewportSize();
|
|
75
75
|
let style = {
|
|
76
76
|
'--cube-visual-viewport-height': viewport.height + 'px',
|
|
77
77
|
};
|
|
78
|
-
return (_jsx(
|
|
78
|
+
return (_jsx(Base, { qa: "ModalWrapper", mods: { open: isOpen }, "data-type": type, "data-placement": placement, styles: OVERLAY_WRAPPER_STYLES, style: style, children: _jsx(Base, { qa: qa || 'Modal', styles: styles, mods: { open: isOpen }, "data-type": type, "data-placement": placement, ...mergeProps(otherProps, overlayProps, modalProps), ref: ref, children: children }, void 0) }, void 0));
|
|
79
79
|
});
|
|
80
80
|
let _Modal = forwardRef(Modal);
|
|
81
81
|
export { _Modal as Modal };
|