@cube-dev/ui-kit 0.0.0-canary-423c3d2 → 0.0.0-canary-ed2a55b
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 +8 -7
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +6 -3
- package/cjs/components/actions/Action.js +2 -3
- package/cjs/components/actions/Button/Button.js +2 -5
- 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 +9 -11
- package/cjs/components/actions/index.js +1 -1
- package/cjs/components/content/ActiveZone/ActiveZone.js +2 -3
- package/cjs/components/content/Alert/Alert.js +6 -8
- 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 +2 -3
- package/cjs/components/content/Badge/Badge.js +3 -3
- package/cjs/components/content/Card/Card.js +15 -13
- package/cjs/components/content/Content.js +3 -3
- package/cjs/components/content/CopySnippet/CopySnippet.js +57 -21
- 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 +36 -18
- 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 +11 -13
- package/cjs/components/content/Text.js +3 -3
- package/cjs/components/content/Title.js +3 -3
- package/cjs/components/forms/Checkbox/Checkbox.js +57 -61
- package/cjs/components/forms/Checkbox/CheckboxGroup.js +21 -35
- package/cjs/components/forms/Checkbox/context.js +1 -1
- package/cjs/components/forms/FieldWrapper.js +4 -4
- package/cjs/components/forms/FileInput/FileInput.js +45 -49
- package/cjs/components/forms/Form/Field.js +1 -1
- package/cjs/components/forms/Form/Form.js +13 -11
- 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 +4 -6
- 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 +95 -92
- package/cjs/components/forms/RadioGroup/RadioGroup.js +20 -35
- 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 +72 -76
- 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 +24 -20
- package/cjs/components/forms/index.js +1 -1
- package/cjs/components/layout/Flex.js +9 -8
- package/cjs/components/layout/Flow.js +9 -8
- package/cjs/components/layout/Grid.js +9 -9
- package/cjs/components/layout/Prefix.js +19 -17
- package/cjs/components/layout/Space.js +21 -17
- package/cjs/components/layout/Suffix.js +19 -17
- package/cjs/components/navigation/LegacyTabs/LegacyTabs.js +64 -41
- package/cjs/components/navigation/Link/Link.js +1 -1
- package/cjs/components/organisms/FileTabs/FileTabs.js +73 -50
- 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 +60 -62
- 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 +23 -26
- package/cjs/components/overlays/Modal/Tray.js +24 -24
- package/cjs/components/overlays/Modal/Underlay.js +25 -31
- package/cjs/components/overlays/Modal/index.js +1 -1
- package/cjs/components/overlays/Notification/Notification.js +53 -10
- package/cjs/components/overlays/OverlayWrapper.js +1 -1
- package/cjs/components/overlays/Tooltip/Tooltip.js +69 -58
- 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 +44 -45
- package/cjs/components/pickers/Menu/Menu.js +4 -10
- 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 +10 -11
- package/cjs/components/pickers/Select/Select.js +117 -113
- 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 +3 -2
- 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 +8 -3
- package/cjs/tasty/types.js +1 -1
- package/cjs/tasty/utils/colors.js +1 -1
- package/cjs/tasty/utils/dotize.js +1 -1
- package/cjs/tasty/utils/filterBaseProps.js +2 -1
- package/cjs/tasty/utils/index.js +1 -1
- package/cjs/tasty/utils/mergeStyles.js +1 -1
- package/cjs/tasty/utils/modAttrs.js +1 -1
- package/cjs/tasty/utils/renderStyles.js +1 -1
- package/cjs/tasty/utils/responsive.js +1 -1
- package/cjs/tasty/utils/string.js +1 -1
- package/cjs/tasty/utils/styles.js +1 -1
- package/cjs/tasty/utils/warnings.js +1 -1
- package/cjs/test/index.js +1 -1
- package/cjs/test/render.js +1 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +1 -1
- package/cjs/tokens.js +6 -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 +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 +4 -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 +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 +13 -9
- 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 +8 -7
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +7 -4
- package/es/components/actions/Action.js +3 -4
- package/es/components/actions/Button/Button.js +2 -5
- 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 +9 -11
- package/es/components/actions/index.js +1 -1
- package/es/components/content/ActiveZone/ActiveZone.js +3 -4
- package/es/components/content/Alert/Alert.js +6 -8
- package/es/components/content/Alert/index.js +1 -1
- package/es/components/content/Alert/types.js +1 -1
- package/es/components/content/Alert/use-alert.js +1 -1
- package/es/components/content/Avatar/Avatar.js +3 -4
- package/es/components/content/Badge/Badge.js +3 -3
- package/es/components/content/Card/Card.js +16 -14
- package/es/components/content/Content.js +3 -3
- package/es/components/content/CopySnippet/CopySnippet.js +57 -21
- 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 +34 -19
- 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 +11 -13
- package/es/components/content/Text.js +3 -3
- package/es/components/content/Title.js +3 -3
- package/es/components/forms/Checkbox/Checkbox.js +58 -62
- package/es/components/forms/Checkbox/CheckboxGroup.js +22 -36
- package/es/components/forms/Checkbox/context.js +1 -1
- package/es/components/forms/FieldWrapper.js +4 -4
- package/es/components/forms/FileInput/FileInput.js +46 -50
- package/es/components/forms/Form/Field.js +1 -1
- package/es/components/forms/Form/Form.js +14 -12
- 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 +4 -6
- 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 +96 -93
- package/es/components/forms/RadioGroup/RadioGroup.js +21 -36
- 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 +74 -78
- 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 +25 -21
- package/es/components/forms/index.js +1 -1
- package/es/components/layout/Flex.js +10 -9
- package/es/components/layout/Flow.js +10 -9
- package/es/components/layout/Grid.js +10 -10
- package/es/components/layout/Prefix.js +20 -18
- package/es/components/layout/Space.js +22 -18
- package/es/components/layout/Suffix.js +20 -18
- package/es/components/navigation/LegacyTabs/LegacyTabs.js +61 -41
- package/es/components/navigation/Link/Link.js +1 -1
- package/es/components/organisms/FileTabs/FileTabs.js +70 -50
- 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 +61 -63
- 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 +23 -26
- package/es/components/overlays/Modal/Tray.js +24 -24
- package/es/components/overlays/Modal/Underlay.js +25 -31
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/Notification/Notification.js +53 -10
- package/es/components/overlays/OverlayWrapper.js +1 -1
- package/es/components/overlays/Tooltip/Tooltip.js +68 -60
- 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 +45 -46
- package/es/components/pickers/Menu/Menu.js +4 -10
- 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 +10 -11
- package/es/components/pickers/Select/Select.js +116 -115
- 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 +7 -3
- package/es/tasty/types.js +1 -1
- package/es/tasty/utils/colors.js +1 -1
- package/es/tasty/utils/dotize.js +1 -1
- package/es/tasty/utils/filterBaseProps.js +2 -1
- package/es/tasty/utils/index.js +1 -1
- package/es/tasty/utils/mergeStyles.js +1 -1
- package/es/tasty/utils/modAttrs.js +1 -1
- package/es/tasty/utils/renderStyles.js +1 -1
- package/es/tasty/utils/responsive.js +1 -1
- package/es/tasty/utils/string.js +1 -1
- package/es/tasty/utils/styles.js +1 -1
- package/es/tasty/utils/warnings.js +1 -1
- package/es/test/index.js +1 -1
- package/es/test/render.js +1 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +1 -1
- package/es/tokens.js +6 -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 +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 +4 -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 +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 +13 -9
- package/package.json +4 -4
- package/types/components/content/Tag/Tag.d.ts +2 -1
- package/types/components/overlays/Dialog/Dialog.d.ts +2 -1
- package/types/components/overlays/Tooltip/Tooltip.d.ts +2 -1
- package/types/components/pickers/Menu/MenuItem.d.ts +2 -1
- package/types/components/pickers/Menu/MenuSection.d.ts +8 -3
- package/types/tasty/index.d.ts +1 -1
- package/types/tasty/tasty.d.ts +8 -4
- package/types/tokens.d.ts +4 -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-ed2a55b
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -11,8 +11,7 @@ import { forwardRef, useRef } from 'react';
|
|
|
11
11
|
import { useHover } from '@react-aria/interactions';
|
|
12
12
|
import { useRadio } from '@react-aria/radio';
|
|
13
13
|
import { useRadioProvider } from './context';
|
|
14
|
-
import {
|
|
15
|
-
import { Base } from '../../Base';
|
|
14
|
+
import { extractStyles, filterBaseProps, OUTER_STYLES, tasty, } from '../../../tasty';
|
|
16
15
|
import { useFocus } from '../../../utils/react/interactions';
|
|
17
16
|
import { mergeProps } from '../../../utils/react';
|
|
18
17
|
import { useProviderProps } from '../../../provider';
|
|
@@ -20,102 +19,110 @@ import { INLINE_LABEL_STYLES } from '../Label';
|
|
|
20
19
|
import { HiddenInput } from '../../HiddenInput';
|
|
21
20
|
import { RadioGroup } from './RadioGroup';
|
|
22
21
|
import { useFormProps } from '../Form/Form';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
radius: true,
|
|
35
|
-
fill: {
|
|
36
|
-
'': '#white',
|
|
37
|
-
hovered: '#purple-text.04',
|
|
38
|
-
disabled: '#dark.04',
|
|
22
|
+
const RadioWrapperElement = tasty({
|
|
23
|
+
as: 'label',
|
|
24
|
+
qa: 'RadioWrapper',
|
|
25
|
+
styles: {
|
|
26
|
+
position: 'relative',
|
|
27
|
+
display: 'grid',
|
|
28
|
+
placeItems: 'center start',
|
|
29
|
+
gap: '1x',
|
|
30
|
+
flow: 'column',
|
|
31
|
+
preset: 'default',
|
|
32
|
+
width: 'min-content',
|
|
39
33
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
color: {
|
|
74
|
-
checked: '#purple-text',
|
|
75
|
-
'invalid & checked': '#danger-text',
|
|
76
|
-
'disabled | !checked': '#clear',
|
|
77
|
-
'disabled & checked': '#dark.12',
|
|
34
|
+
});
|
|
35
|
+
const RadioButtonElement = tasty({
|
|
36
|
+
styles: {
|
|
37
|
+
radius: true,
|
|
38
|
+
fill: {
|
|
39
|
+
'': '#white',
|
|
40
|
+
hovered: '#purple-text.04',
|
|
41
|
+
disabled: '#dark.04',
|
|
42
|
+
},
|
|
43
|
+
color: {
|
|
44
|
+
'': '#dark.85',
|
|
45
|
+
invalid: '#danger-text',
|
|
46
|
+
disabled: '#dark.40',
|
|
47
|
+
},
|
|
48
|
+
fontWeight: 500,
|
|
49
|
+
preset: 'default',
|
|
50
|
+
border: {
|
|
51
|
+
'': true,
|
|
52
|
+
checked: '#purple-text',
|
|
53
|
+
'invalid & checked': '#danger-text',
|
|
54
|
+
'disabled & checked': '#dark.40',
|
|
55
|
+
disabled: '#border',
|
|
56
|
+
},
|
|
57
|
+
padding: '(1x - 1bw) (1.5x - 1bw)',
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
opacity: {
|
|
60
|
+
'': 1,
|
|
61
|
+
disabled: 0.5,
|
|
62
|
+
},
|
|
63
|
+
outline: {
|
|
64
|
+
'': '#purple-03.0',
|
|
65
|
+
focused: '#purple-03',
|
|
66
|
+
},
|
|
78
67
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
});
|
|
69
|
+
const RadioNormalElement = tasty({
|
|
70
|
+
styles: {
|
|
71
|
+
display: 'grid',
|
|
72
|
+
placeItems: 'center',
|
|
73
|
+
radius: 'round',
|
|
74
|
+
fill: {
|
|
75
|
+
'': '#white',
|
|
76
|
+
disabled: '#dark.04',
|
|
77
|
+
},
|
|
78
|
+
color: {
|
|
79
|
+
checked: '#purple-text',
|
|
80
|
+
'invalid & checked': '#danger-text',
|
|
81
|
+
'disabled | !checked': '#clear',
|
|
82
|
+
'disabled & checked': '#dark.12',
|
|
83
|
+
},
|
|
84
|
+
border: {
|
|
85
|
+
'': '#dark.30',
|
|
86
|
+
checked: '#purple-text',
|
|
87
|
+
invalid: '#danger-text.50',
|
|
88
|
+
disabled: '#dark.12',
|
|
89
|
+
},
|
|
90
|
+
width: '2x',
|
|
91
|
+
height: '2x',
|
|
92
|
+
outline: {
|
|
93
|
+
'': '#purple-03.0',
|
|
94
|
+
focused: '#purple-03',
|
|
95
|
+
},
|
|
96
|
+
transition: 'theme',
|
|
97
|
+
RadioCircle: {
|
|
98
|
+
display: 'block',
|
|
99
|
+
radius: 'round',
|
|
100
|
+
width: '1x',
|
|
101
|
+
height: '1x',
|
|
102
|
+
fill: 'currentColor',
|
|
103
|
+
transition: 'theme',
|
|
104
|
+
},
|
|
84
105
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
106
|
+
});
|
|
107
|
+
const RadioCircleElement = _jsx("div", { "data-element": "RadioCircle" }, void 0);
|
|
108
|
+
const RadioLabelElement = tasty({
|
|
109
|
+
qa: 'RadioLabel',
|
|
110
|
+
styles: {
|
|
111
|
+
...INLINE_LABEL_STYLES,
|
|
112
|
+
fontWeight: 400,
|
|
90
113
|
},
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
const CIRCLE_STYLES = {
|
|
94
|
-
radius: 'round',
|
|
95
|
-
width: '1x',
|
|
96
|
-
height: '1x',
|
|
97
|
-
fill: 'currentColor',
|
|
98
|
-
transition: 'theme',
|
|
99
|
-
};
|
|
114
|
+
});
|
|
100
115
|
function Radio(props, ref) {
|
|
101
116
|
props = useProviderProps(props);
|
|
102
117
|
props = useFormProps(props);
|
|
103
118
|
let { qa, isDisabled, validationState, children, label, autoFocus, labelStyles, labelProps, inputStyles, type, 'aria-label': ariaLabel, ...otherProps } = props;
|
|
104
119
|
let isButton = type === 'button';
|
|
105
120
|
label = label || children;
|
|
106
|
-
let styles = extractStyles(otherProps, OUTER_STYLES
|
|
107
|
-
|
|
108
|
-
...useContextStyles('Radio_Wrapper', props),
|
|
109
|
-
});
|
|
110
|
-
inputStyles = extractStyles(otherProps, BLOCK_STYLES, {
|
|
111
|
-
...(isButton ? BUTTON_STYLES : INPUT_STYLES),
|
|
112
|
-
...useContextStyles(isButton ? 'RadioButton' : 'Radio', props),
|
|
113
|
-
...inputStyles,
|
|
114
|
-
});
|
|
121
|
+
let styles = extractStyles(otherProps, OUTER_STYLES);
|
|
122
|
+
const RadioElement = isButton ? RadioButtonElement : RadioNormalElement;
|
|
115
123
|
labelStyles = {
|
|
116
124
|
...INLINE_LABEL_STYLES,
|
|
117
125
|
fontWeight: 400,
|
|
118
|
-
...useContextStyles('Radio_Label', props),
|
|
119
126
|
...labelStyles,
|
|
120
127
|
};
|
|
121
128
|
let state = useRadioProvider();
|
|
@@ -130,23 +137,19 @@ function Radio(props, ref) {
|
|
|
130
137
|
...props,
|
|
131
138
|
isDisabled,
|
|
132
139
|
}, state, inputRef);
|
|
133
|
-
return (_jsxs(
|
|
140
|
+
return (_jsxs(RadioWrapperElement, { styles: styles, ...hoverProps, ref: domRef, mods: {
|
|
134
141
|
disabled: isDisabled,
|
|
135
142
|
invalid: validationState === 'invalid',
|
|
136
143
|
hovered: isHovered,
|
|
137
144
|
button: isButton,
|
|
138
|
-
}, children: [_jsx(HiddenInput, { "data-qa": qa || 'Radio', "aria-label": ariaLabel, ...mergeProps(inputProps, focusProps), isButton: isButton, ref: inputRef }, void 0), _jsx(
|
|
145
|
+
}, children: [_jsx(HiddenInput, { "data-qa": qa || 'Radio', "aria-label": ariaLabel, ...mergeProps(inputProps, focusProps), isButton: isButton, ref: inputRef }, void 0), _jsx(RadioElement, { mods: {
|
|
139
146
|
checked: inputProps.checked,
|
|
140
147
|
invalid: validationState === 'invalid',
|
|
141
148
|
valid: validationState === 'valid',
|
|
142
149
|
disabled: isDisabled,
|
|
143
150
|
hovered: isHovered,
|
|
144
151
|
focused: isFocused,
|
|
145
|
-
}, styles: inputStyles, children: !isButton ? (_jsx(
|
|
146
|
-
checked: inputProps.checked,
|
|
147
|
-
invalid: validationState === 'invalid',
|
|
148
|
-
valid: validationState === 'valid',
|
|
149
|
-
} }, void 0)) : (children) }, void 0), label && !isButton && (_jsx(Base, { qa: "RadioLabel", styles: labelStyles, mods: {
|
|
152
|
+
}, styles: inputStyles, children: !isButton ? RadioCircleElement : children }, void 0), label && !isButton && (_jsx(RadioLabelElement, { mods: {
|
|
150
153
|
invalid: validationState === 'invalid',
|
|
151
154
|
valid: validationState === 'valid',
|
|
152
155
|
disabled: isDisabled,
|
|
@@ -1,64 +1,49 @@
|
|
|
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-ed2a55b
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { forwardRef } from 'react';
|
|
10
10
|
import { useDOMRef } from '@react-spectrum/utils';
|
|
11
|
-
import { LABEL_STYLES } from '../Label';
|
|
12
11
|
import { useProviderProps } from '../../../provider';
|
|
13
12
|
import { useRadioGroup } from '@react-aria/radio';
|
|
14
13
|
import { useRadioGroupState } from '@react-stately/radio';
|
|
15
14
|
import { FormContext, useFormProps } from '../Form/Form';
|
|
16
15
|
import { RadioContext } from './context';
|
|
17
|
-
import { BLOCK_STYLES, extractStyles, OUTER_STYLES, } from '../../../tasty';
|
|
18
|
-
import { Base } from '../../Base';
|
|
16
|
+
import { BLOCK_STYLES, extractStyles, OUTER_STYLES, tasty, } from '../../../tasty';
|
|
19
17
|
import { FieldWrapper } from '../FieldWrapper';
|
|
20
18
|
import { castNullableStringValue, } from '../../../utils/react/nullableValue';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
const RadioGroupElement = tasty({
|
|
20
|
+
qa: 'RadioGroup',
|
|
21
|
+
styles: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
placeItems: 'start',
|
|
24
|
+
placeContent: 'start',
|
|
25
|
+
flow: {
|
|
26
|
+
'': 'column',
|
|
27
|
+
horizontal: 'row wrap',
|
|
28
|
+
},
|
|
29
|
+
gap: {
|
|
30
|
+
'': '1x',
|
|
31
|
+
horizontal: '1x 2x',
|
|
32
|
+
},
|
|
33
|
+
padding: '(1x - 1bw) 0',
|
|
29
34
|
},
|
|
30
|
-
|
|
31
|
-
'': '1x',
|
|
32
|
-
horizontal: '1x 2x',
|
|
33
|
-
},
|
|
34
|
-
padding: '(1x - 1bw) 0',
|
|
35
|
-
};
|
|
35
|
+
});
|
|
36
36
|
function RadioGroup(props, ref) {
|
|
37
37
|
props = castNullableStringValue(props);
|
|
38
38
|
props = useProviderProps(props);
|
|
39
39
|
props = useFormProps(props);
|
|
40
40
|
let { isDisabled, isRequired, necessityIndicator, label, extra, labelPosition = 'top', validationState, children, orientation = 'vertical', message, description, labelStyles, requiredMark = true, tooltip, isHidden, styles, groupStyles, ...otherProps } = props;
|
|
41
41
|
let domRef = useDOMRef(ref);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
let labelContextStyles = useContextStyles('RadioGroup_Label', props);
|
|
45
|
-
styles = extractStyles(otherProps, OUTER_STYLES, {
|
|
46
|
-
...wrapperContextStyles,
|
|
47
|
-
...styles,
|
|
48
|
-
});
|
|
49
|
-
groupStyles = extractStyles(otherProps, BLOCK_STYLES, {
|
|
50
|
-
...GROUP_STYLES,
|
|
51
|
-
...groupContextStyles,
|
|
52
|
-
...groupStyles,
|
|
53
|
-
});
|
|
54
|
-
labelStyles = {
|
|
55
|
-
...LABEL_STYLES,
|
|
56
|
-
...labelContextStyles,
|
|
57
|
-
...labelStyles,
|
|
58
|
-
};
|
|
42
|
+
styles = extractStyles(otherProps, OUTER_STYLES, styles);
|
|
43
|
+
groupStyles = extractStyles(otherProps, BLOCK_STYLES, groupStyles);
|
|
59
44
|
let state = useRadioGroupState(props);
|
|
60
45
|
let { radioGroupProps: fieldProps, labelProps } = useRadioGroup(props, state);
|
|
61
|
-
let radioGroup = (_jsx(
|
|
46
|
+
let radioGroup = (_jsx(RadioGroupElement, { styles: groupStyles, mods: {
|
|
62
47
|
horizontal: orientation === 'horizontal',
|
|
63
48
|
}, children: _jsx(FormContext.Provider, { value: {
|
|
64
49
|
isRequired,
|
|
@@ -1,19 +1,18 @@
|
|
|
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-ed2a55b
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
9
|
import { useFocusableRef } from '@react-spectrum/utils';
|
|
10
|
-
import { forwardRef, useRef } from 'react';
|
|
10
|
+
import { forwardRef, useMemo, useRef } from 'react';
|
|
11
11
|
import { useSwitch } from '@react-aria/switch';
|
|
12
12
|
import { useHover } from '@react-aria/interactions';
|
|
13
13
|
import { useToggleState } from '@react-stately/toggle';
|
|
14
14
|
import { useProviderProps } from '../../../provider';
|
|
15
|
-
import { BLOCK_STYLES, extractStyles, filterBaseProps, OUTER_STYLES, } from '../../../tasty';
|
|
16
|
-
import { Base } from '../../Base';
|
|
15
|
+
import { BLOCK_STYLES, Element, extractStyles, filterBaseProps, OUTER_STYLES, tasty, } from '../../../tasty';
|
|
17
16
|
import { useFocus } from '../../../utils/react/interactions';
|
|
18
17
|
import { mergeProps } from '../../../utils/react';
|
|
19
18
|
import { HiddenInput } from '../../HiddenInput';
|
|
@@ -22,100 +21,97 @@ import { LoadingOutlined } from '@ant-design/icons';
|
|
|
22
21
|
import { useFormProps } from '../Form/Form';
|
|
23
22
|
import { FieldWrapper } from '../FieldWrapper';
|
|
24
23
|
import { castNullableIsSelected, } from '../../../utils/react/nullableValue';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
placeItems: 'center',
|
|
40
|
-
radius: 'round',
|
|
41
|
-
fill: {
|
|
42
|
-
'': '#dark.50',
|
|
43
|
-
checked: '#purple',
|
|
44
|
-
disabled: '#dark.12',
|
|
24
|
+
const BaseSwitchWrapperElement = tasty({
|
|
25
|
+
qa: 'SwitchWrapper',
|
|
26
|
+
});
|
|
27
|
+
const SwitchWrapperElement = tasty({
|
|
28
|
+
qa: 'SwitchWrapper',
|
|
29
|
+
styles: {
|
|
30
|
+
position: 'relative',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
placeItems: 'center start',
|
|
33
|
+
gap: '1x',
|
|
34
|
+
flow: 'row',
|
|
35
|
+
preset: 'input',
|
|
36
|
+
width: 'min-content',
|
|
37
|
+
cursor: 'pointer',
|
|
45
38
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
});
|
|
40
|
+
const SwitchElement = tasty({
|
|
41
|
+
styles: {
|
|
42
|
+
position: 'relative',
|
|
43
|
+
display: 'grid',
|
|
44
|
+
placeItems: 'center',
|
|
45
|
+
radius: 'round',
|
|
46
|
+
fill: {
|
|
47
|
+
'': '#dark.50',
|
|
48
|
+
checked: '#purple',
|
|
49
|
+
disabled: '#dark.12',
|
|
50
|
+
},
|
|
51
|
+
color: '#white',
|
|
52
|
+
border: false,
|
|
53
|
+
width: '5.25x 5.25x',
|
|
54
|
+
height: '3x 3x',
|
|
55
|
+
outline: {
|
|
56
|
+
'': '#purple-03.0',
|
|
57
|
+
focused: '#purple-03',
|
|
58
|
+
},
|
|
59
|
+
transition: 'theme',
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
marginTop: {
|
|
62
|
+
'': null,
|
|
63
|
+
'inside-form & side-label': '-3px',
|
|
64
|
+
},
|
|
65
|
+
placeSelf: {
|
|
66
|
+
'': null,
|
|
67
|
+
'inside-form & side-label': 'start',
|
|
68
|
+
},
|
|
53
69
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
});
|
|
71
|
+
const SwitchThumbElement = tasty({
|
|
72
|
+
'aria-hidden': 'true',
|
|
73
|
+
styles: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
width: '2.5x',
|
|
76
|
+
height: '2.5x',
|
|
77
|
+
radius: 'round',
|
|
78
|
+
fill: 'currentColor',
|
|
79
|
+
shadow: '0px 2px 4px #dark.20;',
|
|
80
|
+
top: '.25x',
|
|
81
|
+
left: {
|
|
82
|
+
'': '.25x',
|
|
83
|
+
checked: '2.5x',
|
|
84
|
+
},
|
|
85
|
+
transition: 'left',
|
|
86
|
+
cursor: 'pointer',
|
|
68
87
|
},
|
|
69
|
-
|
|
70
|
-
cursor: 'pointer',
|
|
71
|
-
};
|
|
88
|
+
});
|
|
72
89
|
function Switch(props, ref) {
|
|
73
90
|
props = castNullableIsSelected(props);
|
|
74
91
|
props = useProviderProps(props);
|
|
75
92
|
props = useFormProps(props);
|
|
76
93
|
let { qa, isDisabled = false, autoFocus, children, label, extra, labelProps, labelStyles, thumbStyles, isLoading, insideForm, validationState, message, description, labelPosition, inputStyles, requiredMark = true, tooltip, ...otherProps } = props;
|
|
77
94
|
label = label || children;
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let thumbContextStyles = useContextStyles('Switch_Thumb', props);
|
|
82
|
-
let styles = extractStyles(props, OUTER_STYLES, {
|
|
83
|
-
...(insideForm ? {} : STYLES),
|
|
84
|
-
...wrapperContextStyles,
|
|
85
|
-
});
|
|
86
|
-
inputStyles = extractStyles(props, BLOCK_STYLES, {
|
|
87
|
-
...INPUT_STYLES,
|
|
88
|
-
...inputContextStyles,
|
|
89
|
-
...(insideForm && labelPosition === 'side'
|
|
90
|
-
? {
|
|
91
|
-
marginTop: '-3px',
|
|
92
|
-
placeSelf: 'start',
|
|
93
|
-
}
|
|
94
|
-
: null),
|
|
95
|
-
...inputStyles,
|
|
96
|
-
});
|
|
97
|
-
thumbStyles = {
|
|
98
|
-
...THUMB_STYLES,
|
|
99
|
-
...thumbContextStyles,
|
|
100
|
-
...thumbStyles,
|
|
101
|
-
};
|
|
102
|
-
labelStyles = {
|
|
95
|
+
let styles = extractStyles(props, OUTER_STYLES);
|
|
96
|
+
inputStyles = extractStyles(props, BLOCK_STYLES, inputStyles);
|
|
97
|
+
labelStyles = useMemo(() => ({
|
|
103
98
|
...(insideForm ? LABEL_STYLES : INLINE_LABEL_STYLES),
|
|
104
|
-
...labelContextStyles,
|
|
105
99
|
...labelStyles,
|
|
106
|
-
};
|
|
100
|
+
}), [insideForm, labelStyles]);
|
|
107
101
|
let { isFocused, focusProps } = useFocus({ isDisabled }, true);
|
|
108
102
|
let { hoverProps, isHovered } = useHover({ isDisabled });
|
|
109
103
|
let inputRef = useRef(null);
|
|
110
104
|
let domRef = useFocusableRef(ref, inputRef);
|
|
111
105
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
112
106
|
let { inputProps } = useSwitch(props, useToggleState(props), inputRef);
|
|
113
|
-
const switchField = (_jsxs(
|
|
107
|
+
const switchField = (_jsxs(BaseSwitchWrapperElement, { qa: qa || 'Switch', children: [_jsx(HiddenInput, { "data-qa": "HiddenInput", ...mergeProps(inputProps, focusProps), ref: inputRef }, void 0), _jsx(SwitchElement, { mods: {
|
|
108
|
+
'inside-form': insideForm,
|
|
109
|
+
'side-label': labelPosition === 'side',
|
|
114
110
|
checked: inputProps.checked,
|
|
115
111
|
disabled: isDisabled,
|
|
116
112
|
hovered: isHovered,
|
|
117
113
|
focused: isFocused,
|
|
118
|
-
}, styles: inputStyles, children: _jsx(
|
|
114
|
+
}, styles: inputStyles, children: _jsx(SwitchThumbElement, { styles: thumbStyles, mods: {
|
|
119
115
|
checked: inputProps.checked,
|
|
120
116
|
} }, void 0) }, void 0)] }, void 0));
|
|
121
117
|
if (insideForm) {
|
|
@@ -137,7 +133,7 @@ function Switch(props, ref) {
|
|
|
137
133
|
ref: domRef,
|
|
138
134
|
} }, void 0));
|
|
139
135
|
}
|
|
140
|
-
return (_jsxs(
|
|
136
|
+
return (_jsxs(SwitchWrapperElement, { as: "label", styles: styles, ...hoverProps, ...filterBaseProps(otherProps), ref: domRef, children: [switchField, label && (_jsxs(Element, { styles: labelStyles, mods: {
|
|
141
137
|
disabled: isDisabled,
|
|
142
138
|
}, ...filterBaseProps(labelProps), children: [label, isLoading ? (_jsxs(_Fragment, { children: [label ? _jsx(_Fragment, { children: "\u00A0" }, void 0) : null, _jsx(LoadingOutlined, {}, void 0)] }, void 0)) : null] }, void 0))] }, void 0));
|
|
143
139
|
}
|