@cube-dev/ui-kit 0.0.0-canary-90d1ee5 → 0.0.0-canary-4d72cd6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_internal/hooks/index.js +1 -1
- package/cjs/_internal/hooks/use-chained-callback.js +1 -1
- package/cjs/_internal/hooks/use-deprecation-warning.js +1 -1
- package/cjs/_internal/hooks/use-event.js +1 -1
- package/cjs/_internal/hooks/use-sync-ref.js +1 -1
- package/cjs/_internal/hooks/use-timer/index.js +1 -1
- package/cjs/_internal/hooks/use-timer/timer.js +1 -1
- package/cjs/_internal/hooks/use-timer/use-timer.js +1 -1
- package/cjs/_internal/index.js +1 -1
- package/cjs/components/Base.js +1 -1
- package/cjs/components/Block.js +1 -1
- package/cjs/components/GlobalStyles.js +1 -1
- package/cjs/components/GridProvider.js +1 -1
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +1 -1
- package/cjs/components/actions/Action.js +1 -1
- package/cjs/components/actions/Button/Button.js +1 -1
- package/cjs/components/actions/Button/Submit.js +1 -1
- package/cjs/components/actions/Button/index.js +1 -1
- package/cjs/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/cjs/components/actions/index.js +1 -1
- package/cjs/components/content/ActiveZone/ActiveZone.js +1 -1
- package/cjs/components/content/Alert/Alert.js +1 -1
- package/cjs/components/content/Alert/index.js +1 -1
- package/cjs/components/content/Alert/types.js +1 -1
- package/cjs/components/content/Alert/use-alert.js +1 -1
- package/cjs/components/content/Avatar/Avatar.js +1 -1
- package/cjs/components/content/Badge/Badge.js +1 -1
- package/cjs/components/content/Card/Card.js +1 -1
- package/cjs/components/content/Content.js +1 -1
- package/cjs/components/content/CopySnippet/CopySnippet.js +1 -1
- package/cjs/components/content/CopySnippet/index.js +1 -1
- package/cjs/components/content/Divider.js +1 -1
- package/cjs/components/content/Footer.js +1 -1
- package/cjs/components/content/Header.js +1 -1
- package/cjs/components/content/Paragraph.js +1 -1
- package/cjs/components/content/Placeholder/Placeholder.js +1 -1
- package/cjs/components/content/PrismCode/PrismCode.js +1 -1
- package/cjs/components/content/Result/Result.js +1 -1
- package/cjs/components/content/Skeleton/Skeleton.js +1 -1
- package/cjs/components/content/Tag/Tag.js +1 -1
- package/cjs/components/content/Text.js +1 -1
- package/cjs/components/content/Title.js +1 -1
- package/cjs/components/forms/Checkbox/Checkbox.js +1 -1
- package/cjs/components/forms/Checkbox/CheckboxGroup.js +1 -1
- package/cjs/components/forms/Checkbox/context.js +1 -1
- package/cjs/components/forms/FieldWrapper.js +1 -1
- package/cjs/components/forms/FileInput/FileInput.js +1 -1
- package/cjs/components/forms/Form/Field.js +1 -1
- package/cjs/components/forms/Form/Form.js +1 -1
- package/cjs/components/forms/Form/index.js +1 -1
- package/cjs/components/forms/Form/types.js +1 -1
- package/cjs/components/forms/Form/useForm.js +1 -1
- package/cjs/components/forms/Form/validation.js +1 -1
- package/cjs/components/forms/Input/Input.js +1 -1
- package/cjs/components/forms/Input/index.js +1 -1
- package/cjs/components/forms/Label.js +1 -1
- package/cjs/components/forms/NumberInput/NumberInput.js +3 -3
- package/cjs/components/forms/NumberInput/StepButton.js +1 -1
- package/cjs/components/forms/PasswordInput/PasswordInput.js +1 -1
- package/cjs/components/forms/RadioGroup/Radio.js +1 -1
- package/cjs/components/forms/RadioGroup/RadioGroup.js +1 -1
- package/cjs/components/forms/RadioGroup/context.js +1 -1
- package/cjs/components/forms/RangeSlider/Gradation.js +28 -0
- package/cjs/components/forms/RangeSlider/Header.js +16 -0
- package/cjs/components/forms/RangeSlider/RangeInput.js +39 -0
- package/cjs/components/forms/RangeSlider/RangeSlider.js +98 -0
- package/cjs/components/forms/RangeSlider/Slide.js +28 -0
- package/cjs/components/forms/RangeSlider/Thumb.js +36 -0
- package/cjs/components/forms/RangeSlider/helpers.js +62 -0
- package/cjs/components/forms/RangeSlider/styled.js +116 -0
- package/cjs/components/forms/SearchInput/SearchInput.js +1 -1
- package/cjs/components/forms/Switch/Switch.js +1 -1
- package/cjs/components/forms/TextArea/TextArea.js +1 -1
- package/cjs/components/forms/TextInput/TextInput.js +1 -1
- package/cjs/components/forms/TextInput/TextInputBase.js +1 -1
- package/cjs/components/forms/index.js +1 -1
- package/cjs/components/layout/Flex.js +1 -1
- package/cjs/components/layout/Flow.js +1 -1
- package/cjs/components/layout/Grid.js +1 -1
- package/cjs/components/layout/Prefix.js +1 -1
- package/cjs/components/layout/Space.js +1 -1
- package/cjs/components/layout/Suffix.js +1 -1
- package/cjs/components/navigation/LegacyTabs/LegacyTabs.js +1 -1
- package/cjs/components/navigation/Link/Link.js +1 -1
- package/cjs/components/organisms/FileTabs/FileTabs.js +1 -1
- package/cjs/components/organisms/Modal/Modal.js +1 -1
- package/cjs/components/organisms/StatsCard/StatsCard.js +1 -1
- package/cjs/components/other/Base64Upload/Base64Upload.js +1 -1
- package/cjs/components/other/CloudLogo/CloudLogo.js +1 -1
- package/cjs/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/cjs/components/overlays/AlertDialog/AlertDialogApiProvider.js +2 -10
- 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 +1 -1
- package/cjs/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/cjs/components/overlays/Dialog/context.js +1 -1
- package/cjs/components/overlays/Dialog/index.js +1 -1
- package/cjs/components/overlays/Modal/Modal.js +1 -1
- package/cjs/components/overlays/Modal/OpenTransition.js +1 -1
- package/cjs/components/overlays/Modal/Overlay.js +1 -1
- package/cjs/components/overlays/Modal/Popover.js +1 -1
- package/cjs/components/overlays/Modal/Tray.js +1 -1
- package/cjs/components/overlays/Modal/Underlay.js +1 -1
- package/cjs/components/overlays/Modal/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/FloatingNotification.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/NotificationsBar.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/TransitionComponent.js +1 -1
- package/cjs/components/overlays/NewNotifications/Bar/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +1 -1
- package/cjs/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/Notification.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationAction.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/NotificationView.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationView/types.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/NotificationsList.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/NotificationsList/types.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/types.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notification-list-item.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-api.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-list.js +1 -1
- package/cjs/components/overlays/NewNotifications/hooks/use-notifications-observer.js +1 -1
- package/cjs/components/overlays/NewNotifications/index.js +1 -1
- package/cjs/components/overlays/NewNotifications/types.js +1 -1
- package/cjs/components/overlays/Notification/Notification.js +1 -1
- package/cjs/components/overlays/OverlayWrapper.js +1 -1
- package/cjs/components/overlays/Toasts/Toast.js +1 -1
- package/cjs/components/overlays/Toasts/index.js +1 -1
- package/cjs/components/overlays/Toasts/types.js +1 -1
- package/cjs/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/cjs/components/overlays/Tooltip/Tooltip.js +1 -1
- package/cjs/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/cjs/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/cjs/components/overlays/Tooltip/context.js +1 -1
- package/cjs/components/pickers/ComboBox/ComboBox.js +1 -1
- package/cjs/components/pickers/Menu/Menu.js +1 -1
- package/cjs/components/pickers/Menu/MenuButton.js +1 -1
- package/cjs/components/pickers/Menu/MenuItem.js +1 -1
- package/cjs/components/pickers/Menu/MenuSection.js +1 -1
- package/cjs/components/pickers/Menu/MenuTrigger.js +1 -1
- package/cjs/components/pickers/Menu/context.js +1 -1
- package/cjs/components/pickers/Menu/styled.js +1 -1
- package/cjs/components/pickers/Select/Select.js +1 -1
- package/cjs/components/portal/Portal.js +1 -1
- package/cjs/components/portal/PortalProvider.js +1 -1
- package/cjs/components/portal/index.js +1 -1
- package/cjs/components/portal/storybook/templates/CustomRoot.js +1 -1
- package/cjs/components/portal/storybook/templates/PortalOrder.js +1 -1
- package/cjs/components/portal/storybook/templates/basic.js +1 -1
- package/cjs/components/portal/storybook/templates/index.js +1 -1
- package/cjs/components/portal/types.js +1 -1
- package/cjs/components/portal/usePortal.js +1 -1
- package/cjs/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/cjs/components/status/LoadingAnimation/index.js +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 +5 -3
- 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 +20 -2
- package/cjs/stories/components/ConfirmDeletionDialogForm.js +1 -1
- package/cjs/stories/components/DialogFormApp.js +1 -1
- package/cjs/stories/components/StyledButton.js +1 -1
- package/cjs/stories/lists/baseProps.js +1 -1
- package/cjs/styled/index.js +1 -1
- package/cjs/styled/styled.js +1 -1
- package/cjs/tasty/index.js +1 -1
- package/cjs/tasty/providers/BreakpointsProvider.js +1 -1
- package/cjs/tasty/styles/align.js +1 -1
- package/cjs/tasty/styles/border.js +1 -1
- package/cjs/tasty/styles/boxShadow.combinator.js +1 -1
- package/cjs/tasty/styles/color.js +1 -1
- package/cjs/tasty/styles/createStyle.js +1 -1
- package/cjs/tasty/styles/dimension.js +1 -1
- package/cjs/tasty/styles/display.js +1 -1
- package/cjs/tasty/styles/fill.js +1 -1
- package/cjs/tasty/styles/flow.js +1 -1
- package/cjs/tasty/styles/font.js +1 -1
- package/cjs/tasty/styles/fontStyle.js +1 -1
- package/cjs/tasty/styles/gap.js +1 -1
- package/cjs/tasty/styles/groupRadius.js +1 -1
- package/cjs/tasty/styles/height.js +1 -1
- package/cjs/tasty/styles/index.js +1 -1
- package/cjs/tasty/styles/justify.js +1 -1
- package/cjs/tasty/styles/list.js +1 -1
- package/cjs/tasty/styles/margin.js +1 -1
- package/cjs/tasty/styles/marginBlock.js +1 -1
- package/cjs/tasty/styles/marginInline.js +1 -1
- package/cjs/tasty/styles/outline.js +1 -1
- package/cjs/tasty/styles/padding.js +1 -1
- package/cjs/tasty/styles/paddingBlock.js +1 -1
- package/cjs/tasty/styles/paddingInline.js +1 -1
- package/cjs/tasty/styles/predefined.js +1 -1
- package/cjs/tasty/styles/preset.js +1 -1
- package/cjs/tasty/styles/radius.js +1 -1
- package/cjs/tasty/styles/reset.js +1 -1
- package/cjs/tasty/styles/shadow.js +8 -5
- 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 +1 -1
- package/cjs/tasty/types.js +1 -1
- package/cjs/tasty/utils/colors.js +1 -1
- package/cjs/tasty/utils/dotize.js +1 -1
- package/cjs/tasty/utils/filterBaseProps.js +1 -1
- package/cjs/tasty/utils/get-display-name.js +1 -1
- package/cjs/tasty/utils/index.js +1 -1
- package/cjs/tasty/utils/mergeStyles.js +1 -1
- package/cjs/tasty/utils/modAttrs.js +1 -1
- package/cjs/tasty/utils/renderStyles.js +1 -1
- package/cjs/tasty/utils/responsive.js +1 -1
- package/cjs/tasty/utils/string.js +1 -1
- package/cjs/tasty/utils/styles.js +1 -1
- package/cjs/tasty/utils/warnings.js +1 -1
- package/cjs/test/index.js +1 -1
- package/cjs/test/render.js +1 -1
- package/cjs/test/setup.js +1 -1
- package/cjs/test/utils/index.js +1 -1
- package/cjs/test/utils/wait.js +1 -1
- package/cjs/tokens.js +1 -1
- package/cjs/type-checks.js +1 -1
- package/cjs/utils/ResizeSensor.js +1 -1
- package/cjs/utils/modules.js +1 -1
- package/cjs/utils/promise.js +1 -1
- package/cjs/utils/random.js +1 -1
- package/cjs/utils/range.js +1 -1
- package/cjs/utils/react/Slots.js +1 -1
- package/cjs/utils/react/chain.js +1 -1
- package/cjs/utils/react/index.js +1 -1
- package/cjs/utils/react/interactions.js +1 -1
- package/cjs/utils/react/isTextOnly.js +1 -1
- package/cjs/utils/react/mapProps.js +1 -1
- package/cjs/utils/react/mergeProps.js +1 -1
- package/cjs/utils/react/nullableValue.js +1 -1
- package/cjs/utils/react/useCombinedRefs.js +1 -1
- package/cjs/utils/react/useId.js +1 -1
- package/cjs/utils/react/useLayoutEffect.js +1 -1
- package/cjs/utils/react/useViewportSize.js +1 -1
- package/cjs/utils/react/wrapNodeIfPlain.js +1 -1
- package/cjs/utils/transitions.js +1 -1
- package/cjs/utils/tree.js +1 -1
- package/cjs/utils/warnings.js +1 -1
- package/es/_internal/hooks/index.js +1 -1
- package/es/_internal/hooks/use-chained-callback.js +1 -1
- package/es/_internal/hooks/use-deprecation-warning.js +1 -1
- package/es/_internal/hooks/use-event.js +1 -1
- package/es/_internal/hooks/use-sync-ref.js +1 -1
- package/es/_internal/hooks/use-timer/index.js +1 -1
- package/es/_internal/hooks/use-timer/timer.js +1 -1
- package/es/_internal/hooks/use-timer/use-timer.js +1 -1
- package/es/_internal/index.js +1 -1
- package/es/components/Base.js +1 -1
- package/es/components/Block.js +1 -1
- package/es/components/GlobalStyles.js +1 -1
- package/es/components/GridProvider.js +1 -1
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +1 -1
- package/es/components/actions/Action.js +1 -1
- package/es/components/actions/Button/Button.js +1 -1
- package/es/components/actions/Button/Submit.js +1 -1
- package/es/components/actions/Button/index.js +1 -1
- package/es/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/es/components/actions/index.js +1 -1
- package/es/components/content/ActiveZone/ActiveZone.js +1 -1
- package/es/components/content/Alert/Alert.js +1 -1
- package/es/components/content/Alert/index.js +1 -1
- package/es/components/content/Alert/types.js +1 -1
- package/es/components/content/Alert/use-alert.js +1 -1
- package/es/components/content/Avatar/Avatar.js +1 -1
- package/es/components/content/Badge/Badge.js +1 -1
- package/es/components/content/Card/Card.js +1 -1
- package/es/components/content/Content.js +1 -1
- package/es/components/content/CopySnippet/CopySnippet.js +1 -1
- package/es/components/content/CopySnippet/index.js +1 -1
- package/es/components/content/Divider.js +1 -1
- package/es/components/content/Footer.js +1 -1
- package/es/components/content/Header.js +1 -1
- package/es/components/content/Paragraph.js +1 -1
- package/es/components/content/Placeholder/Placeholder.js +1 -1
- package/es/components/content/PrismCode/PrismCode.js +1 -1
- package/es/components/content/Result/Result.js +1 -1
- package/es/components/content/Skeleton/Skeleton.js +1 -1
- package/es/components/content/Tag/Tag.js +1 -1
- package/es/components/content/Text.js +1 -1
- package/es/components/content/Title.js +1 -1
- package/es/components/forms/Checkbox/Checkbox.js +1 -1
- package/es/components/forms/Checkbox/CheckboxGroup.js +1 -1
- package/es/components/forms/Checkbox/context.js +1 -1
- package/es/components/forms/FieldWrapper.js +1 -1
- package/es/components/forms/FileInput/FileInput.js +1 -1
- package/es/components/forms/Form/Field.js +1 -1
- package/es/components/forms/Form/Form.js +1 -1
- package/es/components/forms/Form/index.js +1 -1
- package/es/components/forms/Form/types.js +1 -1
- package/es/components/forms/Form/useForm.js +1 -1
- package/es/components/forms/Form/validation.js +1 -1
- package/es/components/forms/Input/Input.js +1 -1
- package/es/components/forms/Input/index.js +1 -1
- package/es/components/forms/Label.js +1 -1
- package/es/components/forms/NumberInput/NumberInput.js +3 -3
- package/es/components/forms/NumberInput/StepButton.js +1 -1
- package/es/components/forms/PasswordInput/PasswordInput.js +1 -1
- package/es/components/forms/RadioGroup/Radio.js +1 -1
- package/es/components/forms/RadioGroup/RadioGroup.js +1 -1
- package/es/components/forms/RadioGroup/context.js +1 -1
- package/es/components/forms/RangeSlider/Gradation.js +24 -0
- package/es/components/forms/RangeSlider/Header.js +12 -0
- package/es/components/forms/RangeSlider/RangeInput.js +35 -0
- package/es/components/forms/RangeSlider/RangeSlider.js +95 -0
- package/es/components/forms/RangeSlider/Slide.js +24 -0
- package/es/components/forms/RangeSlider/Thumb.js +32 -0
- package/es/components/forms/RangeSlider/helpers.js +54 -0
- package/es/components/forms/RangeSlider/styled.js +113 -0
- package/es/components/forms/SearchInput/SearchInput.js +1 -1
- package/es/components/forms/Switch/Switch.js +1 -1
- package/es/components/forms/TextArea/TextArea.js +1 -1
- package/es/components/forms/TextInput/TextInput.js +1 -1
- package/es/components/forms/TextInput/TextInputBase.js +1 -1
- package/es/components/forms/index.js +1 -1
- package/es/components/layout/Flex.js +1 -1
- package/es/components/layout/Flow.js +1 -1
- package/es/components/layout/Grid.js +1 -1
- package/es/components/layout/Prefix.js +1 -1
- package/es/components/layout/Space.js +1 -1
- package/es/components/layout/Suffix.js +1 -1
- package/es/components/navigation/LegacyTabs/LegacyTabs.js +1 -1
- package/es/components/navigation/Link/Link.js +1 -1
- package/es/components/organisms/FileTabs/FileTabs.js +1 -1
- package/es/components/organisms/Modal/Modal.js +1 -1
- package/es/components/organisms/StatsCard/StatsCard.js +1 -1
- package/es/components/other/Base64Upload/Base64Upload.js +1 -1
- package/es/components/other/CloudLogo/CloudLogo.js +1 -1
- package/es/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/es/components/overlays/AlertDialog/AlertDialogApiProvider.js +2 -10
- 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 +1 -1
- package/es/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/es/components/overlays/Dialog/context.js +1 -1
- package/es/components/overlays/Dialog/index.js +1 -1
- package/es/components/overlays/Modal/Modal.js +1 -1
- package/es/components/overlays/Modal/OpenTransition.js +1 -1
- package/es/components/overlays/Modal/Overlay.js +1 -1
- package/es/components/overlays/Modal/Popover.js +1 -1
- package/es/components/overlays/Modal/Tray.js +1 -1
- package/es/components/overlays/Modal/Underlay.js +1 -1
- package/es/components/overlays/Modal/index.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/FloatingNotification.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/NotificationsBar.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/TransitionComponent.js +1 -1
- package/es/components/overlays/NewNotifications/Bar/index.js +1 -1
- package/es/components/overlays/NewNotifications/Dialog/NotificationsDialogTrigger.js +1 -1
- package/es/components/overlays/NewNotifications/Dialog/index.js +1 -1
- package/es/components/overlays/NewNotifications/Notification.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationAction.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationCloseButton.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationDescription.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationFooter.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationHeader.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationIcon.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationProvider.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/NotificationView.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationView/types.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/NotificationsProvider.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsContext/use-notifications.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsList.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/index.js +1 -1
- package/es/components/overlays/NewNotifications/NotificationsList/types.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/index.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/types.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notification-list-item.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-api.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-list.js +1 -1
- package/es/components/overlays/NewNotifications/hooks/use-notifications-observer.js +1 -1
- package/es/components/overlays/NewNotifications/index.js +1 -1
- package/es/components/overlays/NewNotifications/types.js +1 -1
- package/es/components/overlays/Notification/Notification.js +1 -1
- package/es/components/overlays/OverlayWrapper.js +1 -1
- package/es/components/overlays/Toasts/Toast.js +1 -1
- package/es/components/overlays/Toasts/index.js +1 -1
- package/es/components/overlays/Toasts/types.js +1 -1
- package/es/components/overlays/Toasts/use-toasts-api.js +1 -1
- package/es/components/overlays/Tooltip/Tooltip.js +1 -1
- package/es/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/es/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/es/components/overlays/Tooltip/context.js +1 -1
- package/es/components/pickers/ComboBox/ComboBox.js +1 -1
- package/es/components/pickers/Menu/Menu.js +1 -1
- package/es/components/pickers/Menu/MenuButton.js +1 -1
- package/es/components/pickers/Menu/MenuItem.js +1 -1
- package/es/components/pickers/Menu/MenuSection.js +1 -1
- package/es/components/pickers/Menu/MenuTrigger.js +1 -1
- package/es/components/pickers/Menu/context.js +1 -1
- package/es/components/pickers/Menu/styled.js +1 -1
- package/es/components/pickers/Select/Select.js +1 -1
- package/es/components/portal/Portal.js +1 -1
- package/es/components/portal/PortalProvider.js +1 -1
- package/es/components/portal/index.js +1 -1
- package/es/components/portal/storybook/templates/CustomRoot.js +1 -1
- package/es/components/portal/storybook/templates/PortalOrder.js +1 -1
- package/es/components/portal/storybook/templates/basic.js +1 -1
- package/es/components/portal/storybook/templates/index.js +1 -1
- package/es/components/portal/types.js +1 -1
- package/es/components/portal/usePortal.js +1 -1
- package/es/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/es/components/status/LoadingAnimation/index.js +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 +2 -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 +19 -1
- package/es/stories/components/ConfirmDeletionDialogForm.js +1 -1
- package/es/stories/components/DialogFormApp.js +1 -1
- package/es/stories/components/StyledButton.js +1 -1
- package/es/stories/lists/baseProps.js +1 -1
- package/es/styled/index.js +1 -1
- package/es/styled/styled.js +1 -1
- package/es/tasty/index.js +1 -1
- package/es/tasty/providers/BreakpointsProvider.js +1 -1
- package/es/tasty/styles/align.js +1 -1
- package/es/tasty/styles/border.js +1 -1
- package/es/tasty/styles/boxShadow.combinator.js +1 -1
- package/es/tasty/styles/color.js +1 -1
- package/es/tasty/styles/createStyle.js +1 -1
- package/es/tasty/styles/dimension.js +1 -1
- package/es/tasty/styles/display.js +1 -1
- package/es/tasty/styles/fill.js +1 -1
- package/es/tasty/styles/flow.js +1 -1
- package/es/tasty/styles/font.js +1 -1
- package/es/tasty/styles/fontStyle.js +1 -1
- package/es/tasty/styles/gap.js +1 -1
- package/es/tasty/styles/groupRadius.js +1 -1
- package/es/tasty/styles/height.js +1 -1
- package/es/tasty/styles/index.js +1 -1
- package/es/tasty/styles/justify.js +1 -1
- package/es/tasty/styles/list.js +1 -1
- package/es/tasty/styles/margin.js +1 -1
- package/es/tasty/styles/marginBlock.js +1 -1
- package/es/tasty/styles/marginInline.js +1 -1
- package/es/tasty/styles/outline.js +1 -1
- package/es/tasty/styles/padding.js +1 -1
- package/es/tasty/styles/paddingBlock.js +1 -1
- package/es/tasty/styles/paddingInline.js +1 -1
- package/es/tasty/styles/predefined.js +1 -1
- package/es/tasty/styles/preset.js +1 -1
- package/es/tasty/styles/radius.js +1 -1
- package/es/tasty/styles/reset.js +1 -1
- package/es/tasty/styles/shadow.js +8 -5
- 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 +1 -1
- package/es/tasty/types.js +1 -1
- package/es/tasty/utils/colors.js +1 -1
- package/es/tasty/utils/dotize.js +1 -1
- package/es/tasty/utils/filterBaseProps.js +1 -1
- package/es/tasty/utils/get-display-name.js +1 -1
- package/es/tasty/utils/index.js +1 -1
- package/es/tasty/utils/mergeStyles.js +1 -1
- package/es/tasty/utils/modAttrs.js +1 -1
- package/es/tasty/utils/renderStyles.js +1 -1
- package/es/tasty/utils/responsive.js +1 -1
- package/es/tasty/utils/string.js +1 -1
- package/es/tasty/utils/styles.js +1 -1
- package/es/tasty/utils/warnings.js +1 -1
- package/es/test/index.js +1 -1
- package/es/test/render.js +1 -1
- package/es/test/setup.js +1 -1
- package/es/test/utils/index.js +1 -1
- package/es/test/utils/wait.js +1 -1
- package/es/tokens.js +1 -1
- package/es/type-checks.js +1 -1
- package/es/utils/ResizeSensor.js +1 -1
- package/es/utils/modules.js +1 -1
- package/es/utils/promise.js +1 -1
- package/es/utils/random.js +1 -1
- package/es/utils/range.js +1 -1
- package/es/utils/react/Slots.js +1 -1
- package/es/utils/react/chain.js +1 -1
- package/es/utils/react/index.js +1 -1
- package/es/utils/react/interactions.js +1 -1
- package/es/utils/react/isTextOnly.js +1 -1
- package/es/utils/react/mapProps.js +1 -1
- package/es/utils/react/mergeProps.js +1 -1
- package/es/utils/react/nullableValue.js +1 -1
- package/es/utils/react/useCombinedRefs.js +1 -1
- package/es/utils/react/useId.js +1 -1
- package/es/utils/react/useLayoutEffect.js +1 -1
- package/es/utils/react/useViewportSize.js +1 -1
- package/es/utils/react/wrapNodeIfPlain.js +1 -1
- package/es/utils/transitions.js +1 -1
- package/es/utils/tree.js +1 -1
- package/es/utils/warnings.js +1 -1
- package/package.json +4 -1
- package/types/components/forms/RangeSlider/Gradation.d.ts +8 -0
- package/types/components/forms/RangeSlider/Header.d.ts +1 -0
- package/types/components/forms/RangeSlider/RangeInput.d.ts +10 -0
- package/types/components/forms/RangeSlider/RangeSlider.d.ts +17 -0
- package/types/components/forms/RangeSlider/Slide.d.ts +9 -0
- package/types/components/forms/RangeSlider/Thumb.d.ts +9 -0
- package/types/components/forms/RangeSlider/helpers.d.ts +6 -0
- package/types/components/forms/RangeSlider/styled.d.ts +8 -0
- package/types/index.d.ts +2 -0
- package/types/stories/FormFieldArgs.d.ts +22 -0
- package/types/tasty/styles/shadow.d.ts +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { StyledGradation, StyledGrade } from './styled';
|
|
10
|
+
export function Gradation(props) {
|
|
11
|
+
const { state, ranges, values = [] } = props;
|
|
12
|
+
if (!values.length) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const getIsActive = (value, idx) => {
|
|
16
|
+
const [minIdx, maxIdx] = ranges.map((range) => state.getThumbValue(range));
|
|
17
|
+
return idx >= minIdx && idx <= maxIdx;
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(StyledGradation, { children: values.map((value, idx) => (_jsx(StyledGrade, { mods: {
|
|
20
|
+
active: getIsActive(value, idx),
|
|
21
|
+
}, children: value }, value))) }, void 0));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback } from 'react';
|
|
10
|
+
import { Flow, NumberInput } from '../../../';
|
|
11
|
+
function calculateWidth(max, hasSuffix) {
|
|
12
|
+
if (typeof max === 'undefined') {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const value = String(max).length;
|
|
16
|
+
// for 2 digit values 1.6 is better with suffix
|
|
17
|
+
const suffixWidth = value > 2 ? 1.6 : 1.75;
|
|
18
|
+
const charWidth = hasSuffix ? suffixWidth : 2;
|
|
19
|
+
return `${value * charWidth}x`;
|
|
20
|
+
}
|
|
21
|
+
export function RangeInput(props) {
|
|
22
|
+
const { state, index, suffix, min, max, ...otherProps } = props;
|
|
23
|
+
const value = state.values[index];
|
|
24
|
+
const width = calculateWidth(max, !!suffix);
|
|
25
|
+
const onChange = useCallback((value) => {
|
|
26
|
+
state.setThumbValue(index, value);
|
|
27
|
+
}, [index, state]);
|
|
28
|
+
return (_jsx(NumberInput, { ...otherProps, hideStepper: true, size: "small", inputProps: {
|
|
29
|
+
maxLength: max && String(max).length,
|
|
30
|
+
}, inputStyles: {
|
|
31
|
+
width,
|
|
32
|
+
}, suffix: suffix && _jsx(Flow, { padding: "1.5x right", children: suffix }, void 0), value: value, minValue: state.getThumbMinValue(index), maxValue: state.getThumbMaxValue(index), onChange: onChange }, void 0));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { forwardRef, useRef } from 'react';
|
|
10
|
+
import { useSlider } from '@react-aria/slider';
|
|
11
|
+
import { useSliderState } from '@react-stately/slider';
|
|
12
|
+
import { FieldWrapper } from '../../forms/FieldWrapper';
|
|
13
|
+
import { extractStyles, OUTER_STYLES, } from '../../../tasty';
|
|
14
|
+
import { Slide } from './Slide';
|
|
15
|
+
import { Gradation } from './Gradation';
|
|
16
|
+
import { Thumb } from './Thumb';
|
|
17
|
+
import { RangeInput } from './RangeInput';
|
|
18
|
+
import { StyledControls, StyledSlider, StyledContent } from './styled';
|
|
19
|
+
import { getMinMaxValue, getRanges, getValidValue, } from './helpers';
|
|
20
|
+
function RangeSlider(props, ref) {
|
|
21
|
+
let { labelPosition, label, extra, styles, isRequired, validationState, message, description, requiredMark, labelSuffix, labelStyles, necessityIndicator, defaultValue, value, gradation, step = 1, isDisabled, orientation = 'horizontal', showInput, inputStyles, inputSuffix, minValue, maxValue, onChange, onChangeEnd, ...otherProps } = props;
|
|
22
|
+
const [min, max] = getMinMaxValue(minValue, maxValue, value || defaultValue);
|
|
23
|
+
const ranges = getRanges(defaultValue || value || [0, 1]);
|
|
24
|
+
const isSingle = ranges.length <= 1;
|
|
25
|
+
const trackRef = useRef(null);
|
|
26
|
+
const inputRef = useRef(null);
|
|
27
|
+
const numberFormatter = new Intl.NumberFormat();
|
|
28
|
+
const baseProps = {
|
|
29
|
+
step,
|
|
30
|
+
orientation,
|
|
31
|
+
isDisabled,
|
|
32
|
+
minValue: min,
|
|
33
|
+
maxValue: max,
|
|
34
|
+
value: getValidValue(value, min, max),
|
|
35
|
+
defaultValue: getValidValue(defaultValue, min, max),
|
|
36
|
+
onChange(range) {
|
|
37
|
+
if (onChange) {
|
|
38
|
+
onChange(Array.isArray(range) ? range : [range]);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
onChangeEnd(range) {
|
|
42
|
+
if (onChangeEnd) {
|
|
43
|
+
onChangeEnd(Array.isArray(range) ? range : [range]);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const state = useSliderState({
|
|
48
|
+
...props,
|
|
49
|
+
...baseProps,
|
|
50
|
+
numberFormatter,
|
|
51
|
+
});
|
|
52
|
+
const { groupProps, trackProps, labelProps } = useSlider({
|
|
53
|
+
...props,
|
|
54
|
+
...baseProps,
|
|
55
|
+
}, state, trackRef);
|
|
56
|
+
const inputProps = {
|
|
57
|
+
step,
|
|
58
|
+
state,
|
|
59
|
+
isDisabled,
|
|
60
|
+
suffix: inputSuffix,
|
|
61
|
+
styles: inputStyles,
|
|
62
|
+
min: baseProps.minValue,
|
|
63
|
+
max: baseProps.maxValue,
|
|
64
|
+
};
|
|
65
|
+
const sliderField = (_jsxs(StyledSlider, { ...groupProps, mods: {
|
|
66
|
+
sideLabel: labelPosition === 'side',
|
|
67
|
+
inputs: showInput,
|
|
68
|
+
}, children: [!isSingle && showInput && _jsx(RangeInput, { index: 0, ...inputProps }, void 0), _jsx(StyledContent, { children: _jsxs(StyledControls, { ...trackProps, ref: trackRef, children: [_jsx(Slide, { state: state, ranges: ranges, isSingle: isSingle, isDisabled: isDisabled }, void 0), _jsx(Gradation, { state: state, ranges: ranges, values: gradation }, void 0), ranges.map((thumb) => (_jsx(Thumb, { index: thumb, state: state, inputRef: inputRef, trackRef: trackRef, isDisabled: isDisabled, defaultValue: baseProps.defaultValue && baseProps.defaultValue[thumb] }, thumb)))] }, void 0) }, void 0), showInput && _jsx(RangeInput, { index: 1, ...inputProps }, void 0)] }, void 0));
|
|
69
|
+
styles = extractStyles(otherProps, OUTER_STYLES, styles);
|
|
70
|
+
return (_jsx(FieldWrapper, { ...{
|
|
71
|
+
labelPosition,
|
|
72
|
+
label,
|
|
73
|
+
extra,
|
|
74
|
+
styles,
|
|
75
|
+
isRequired,
|
|
76
|
+
labelStyles,
|
|
77
|
+
necessityIndicator,
|
|
78
|
+
labelProps,
|
|
79
|
+
isDisabled,
|
|
80
|
+
validationState,
|
|
81
|
+
message,
|
|
82
|
+
description,
|
|
83
|
+
requiredMark,
|
|
84
|
+
labelSuffix,
|
|
85
|
+
Component: sliderField,
|
|
86
|
+
ref: ref,
|
|
87
|
+
} }, void 0));
|
|
88
|
+
}
|
|
89
|
+
const _RangeSlider = forwardRef(RangeSlider);
|
|
90
|
+
const __RangeSlider = Object.assign(_RangeSlider, {
|
|
91
|
+
cubeInputType: 'CheckboxGroup',
|
|
92
|
+
});
|
|
93
|
+
export { __RangeSlider as RangeSlider };
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useMemo } from 'react';
|
|
10
|
+
import { StyledSlide, StyledSlideTrack } from './styled';
|
|
11
|
+
export function Slide(props) {
|
|
12
|
+
const { ranges, state, isDisabled, isSingle } = props;
|
|
13
|
+
const style = {};
|
|
14
|
+
const mods = useMemo(() => ({
|
|
15
|
+
single: isSingle,
|
|
16
|
+
disabled: isDisabled,
|
|
17
|
+
}), [isDisabled, isSingle]);
|
|
18
|
+
ranges.forEach((rangeIndex) => {
|
|
19
|
+
style[`--thumb-${rangeIndex}-value`] = state.getThumbPercent(rangeIndex);
|
|
20
|
+
});
|
|
21
|
+
return (_jsx(StyledSlide, { mods: mods, children: _jsx(StyledSlideTrack, { style: style, mods: mods }, void 0) }, void 0));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useRef } from 'react';
|
|
10
|
+
import { useSliderThumb } from '@react-aria/slider';
|
|
11
|
+
import { useHover } from '@react-aria/interactions';
|
|
12
|
+
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
13
|
+
import { FocusRing } from '@react-aria/focus';
|
|
14
|
+
import { mergeProps } from '../../../utils/react';
|
|
15
|
+
import { StyledThumb } from './styled';
|
|
16
|
+
export function Thumb(props) {
|
|
17
|
+
const { state, isDisabled } = props;
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const { thumbProps, inputProps, isDragging, isFocused } = useSliderThumb({
|
|
20
|
+
...props,
|
|
21
|
+
inputRef: ref,
|
|
22
|
+
}, state);
|
|
23
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
24
|
+
return (_jsx(FocusRing, { within: true, children: _jsx(StyledThumb, { mods: {
|
|
25
|
+
hovered: isHovered,
|
|
26
|
+
dragged: isDragging,
|
|
27
|
+
focused: !isDragging && isFocused,
|
|
28
|
+
disabled: isDisabled,
|
|
29
|
+
}, ...mergeProps(thumbProps, hoverProps), role: "presentation", children: _jsx(VisuallyHidden, { children: _jsx("input", { ref: ref, ...inputProps }, void 0) }, void 0) }, void 0) }, void 0));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export function getRanges(value) {
|
|
9
|
+
if (Array.isArray(value)) {
|
|
10
|
+
return value.length >= 2 ? [0, 1] : [0];
|
|
11
|
+
}
|
|
12
|
+
return [0];
|
|
13
|
+
}
|
|
14
|
+
export function isNumber(val) {
|
|
15
|
+
return typeof val === 'number';
|
|
16
|
+
}
|
|
17
|
+
export function isValueValid(value) {
|
|
18
|
+
return (Array.isArray(value) &&
|
|
19
|
+
value.length === 2 &&
|
|
20
|
+
isNumber(value[0]) &&
|
|
21
|
+
isNumber(value[1]));
|
|
22
|
+
}
|
|
23
|
+
export function getValidValue(value, min, max) {
|
|
24
|
+
if (isValueValid(value)) {
|
|
25
|
+
// try to fix jumbled values
|
|
26
|
+
let minVal = Math.min(...value);
|
|
27
|
+
let maxVal = Math.max(...value);
|
|
28
|
+
// try to fix wrong min value
|
|
29
|
+
if (isNumber(min) && minVal < min) {
|
|
30
|
+
minVal = min;
|
|
31
|
+
}
|
|
32
|
+
// try to fix wrong max value
|
|
33
|
+
if (isNumber(max) && maxVal >= max) {
|
|
34
|
+
maxVal = max;
|
|
35
|
+
}
|
|
36
|
+
return [minVal, maxVal];
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
export function getMinMaxValue(min, max, value) {
|
|
41
|
+
if (isNumber(min) && isNumber(max)) {
|
|
42
|
+
if (isValueValid(value)) {
|
|
43
|
+
const minValue = Math.min(...value);
|
|
44
|
+
const maxValue = Math.max(...value);
|
|
45
|
+
// try to set min and max from value if they overflows
|
|
46
|
+
return [Math.min(min, max, minValue), Math.max(min, max, maxValue)];
|
|
47
|
+
}
|
|
48
|
+
// also try to fix jumbled min and max
|
|
49
|
+
return [Math.min(min, max), Math.max(min, max)];
|
|
50
|
+
}
|
|
51
|
+
return [min, max];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-4d72cd6
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { tasty } from '../../../tasty';
|
|
9
|
+
export const StyledThumb = tasty({
|
|
10
|
+
styles: {
|
|
11
|
+
top: '2x',
|
|
12
|
+
width: '2x',
|
|
13
|
+
height: '2x',
|
|
14
|
+
fill: {
|
|
15
|
+
'': '#purple',
|
|
16
|
+
hovered: '#purple-text',
|
|
17
|
+
dragged: '#purple',
|
|
18
|
+
disabled: '#dark-04',
|
|
19
|
+
},
|
|
20
|
+
cursor: {
|
|
21
|
+
hovered: 'pointer',
|
|
22
|
+
dragged: 'pointer',
|
|
23
|
+
},
|
|
24
|
+
shadow: {
|
|
25
|
+
'': '0px 2px 4px #dark.2',
|
|
26
|
+
dragged: 'inset 0 0 0 2px #purple-text, 0px 2px 4px #dark.2',
|
|
27
|
+
},
|
|
28
|
+
radius: '50%',
|
|
29
|
+
border: {
|
|
30
|
+
'': null,
|
|
31
|
+
focused: '3px solid #purple-04',
|
|
32
|
+
},
|
|
33
|
+
transition: 'theme',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
export const StyledSlide = tasty({
|
|
37
|
+
styles: {
|
|
38
|
+
top: '1.875x',
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
fill: {
|
|
41
|
+
'': '#dark-05',
|
|
42
|
+
// disabled: '#dark-04',
|
|
43
|
+
},
|
|
44
|
+
height: '2px',
|
|
45
|
+
width: '100%',
|
|
46
|
+
radius: true,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
export const StyledSlideTrack = tasty({
|
|
50
|
+
styles: {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
'@start-range': {
|
|
53
|
+
'': '@thumb-0-value',
|
|
54
|
+
single: '0',
|
|
55
|
+
},
|
|
56
|
+
'@end-range': {
|
|
57
|
+
'': '(1 - @thumb-1-value)',
|
|
58
|
+
single: '(1 - @thumb-0-value)',
|
|
59
|
+
},
|
|
60
|
+
left: '(@start-range * 100%)',
|
|
61
|
+
right: '(@end-range * 100%)',
|
|
62
|
+
height: '2px',
|
|
63
|
+
fill: {
|
|
64
|
+
'': '#purple',
|
|
65
|
+
disabled: '#dark-04',
|
|
66
|
+
},
|
|
67
|
+
radius: true,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
export const StyledGradation = tasty({
|
|
71
|
+
styles: {},
|
|
72
|
+
});
|
|
73
|
+
export const StyledGrade = tasty({
|
|
74
|
+
styles: {},
|
|
75
|
+
});
|
|
76
|
+
export const StyledControls = tasty({
|
|
77
|
+
styles: {
|
|
78
|
+
position: 'relative',
|
|
79
|
+
width: '100% - 2x',
|
|
80
|
+
height: '4x',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
export const StyledSlider = tasty({
|
|
84
|
+
as: 'section',
|
|
85
|
+
styles: {
|
|
86
|
+
position: 'relative',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
gap: {
|
|
89
|
+
'': '0',
|
|
90
|
+
inputs: '1x',
|
|
91
|
+
},
|
|
92
|
+
flexDirection: {
|
|
93
|
+
'': 'column',
|
|
94
|
+
inputs: 'row',
|
|
95
|
+
},
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
width: '100%',
|
|
98
|
+
padding: {
|
|
99
|
+
'': '0',
|
|
100
|
+
sideLabel: '0.75x top',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
export const StyledContent = tasty({
|
|
105
|
+
styles: {
|
|
106
|
+
display: 'flex',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
flexDirection: 'column',
|
|
109
|
+
width: '100%',
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
|
|
@@ -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-4d72cd6
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -18,11 +18,10 @@ export function AlertDialogApiProvider(props) {
|
|
|
18
18
|
const id = useRef(0);
|
|
19
19
|
const api = useMemo(() => ({
|
|
20
20
|
open: (dialogProps, params = {}) => {
|
|
21
|
-
const { onDismiss, ...restProps } = dialogProps;
|
|
22
21
|
const { cancelToken } = params;
|
|
23
22
|
const currentId = ++id.current;
|
|
24
23
|
const currentDialog = {
|
|
25
|
-
props:
|
|
24
|
+
props: dialogProps,
|
|
26
25
|
meta: { id: currentId, isClosed: false, isVisible: true },
|
|
27
26
|
};
|
|
28
27
|
const close = () => {
|
|
@@ -51,13 +50,6 @@ export function AlertDialogApiProvider(props) {
|
|
|
51
50
|
reject(reason);
|
|
52
51
|
};
|
|
53
52
|
});
|
|
54
|
-
currentDialog.props = {
|
|
55
|
-
...restProps,
|
|
56
|
-
onDismiss: (e) => {
|
|
57
|
-
onDismiss?.(e);
|
|
58
|
-
currentDialog.meta.reject(undefined);
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
53
|
setOpenedDialog((openedDialog) => {
|
|
62
54
|
// we already have opened dialog, so we reject opening another
|
|
63
55
|
if (openedDialog !== null) {
|