@cube-dev/ui-kit 0.0.0-canary-d37d372 → 0.0.0-canary-5b7252a
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 +7 -3
- 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-effect-once.js +18 -0
- package/cjs/_internal/hooks/use-event.js +1 -1
- package/cjs/_internal/hooks/use-is-first-render.js +22 -0
- 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/hooks/use-update-effect.js +24 -0
- package/cjs/_internal/hooks/use-warn.js +46 -0
- package/cjs/_internal/index.js +1 -1
- package/cjs/components/Base.js +1 -1
- package/cjs/components/Block.js +1 -1
- package/cjs/components/GlobalStyles.js +1 -1
- package/cjs/components/GridProvider.js +1 -1
- package/cjs/components/HiddenInput.js +1 -1
- package/cjs/components/OpenTrasition.js +1 -1
- package/cjs/components/Root.js +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 → FieldWrapper/FieldWrapper.js} +19 -17
- package/cjs/components/forms/FieldWrapper/extract-field-wrapper-props.js +50 -0
- package/cjs/components/forms/FieldWrapper/index.js +24 -0
- package/cjs/components/{pickers/RangeSlider/Header.js → forms/FieldWrapper/types.js} +1 -6
- package/cjs/components/forms/FileInput/FileInput.js +3 -3
- package/cjs/components/forms/Form/Field/Field.js +137 -0
- package/cjs/components/forms/Form/Field/FieldContext.js +68 -0
- package/cjs/components/forms/Form/Field/index.js +24 -0
- package/cjs/components/forms/Form/Field/types.js +11 -0
- package/cjs/components/forms/Form/Form.js +2 -2
- package/cjs/components/forms/Form/{Field.js → LegacyField.js} +1 -1
- package/cjs/components/forms/Form/index.js +12 -1
- package/cjs/components/forms/Form/types.js +1 -1
- package/cjs/components/forms/Form/useForm.js +2 -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/SearchInput/SearchInput.js +1 -1
- package/cjs/components/forms/Switch/Switch.js +15 -12
- package/cjs/components/forms/TextArea/TextArea.js +30 -27
- package/cjs/components/forms/TextInput/TextInput.js +16 -9
- package/cjs/components/forms/TextInput/TextInputBase.js +8 -36
- package/cjs/components/forms/TextInput/index.js +23 -0
- 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 +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 +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 +12 -9
- 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 +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 +2 -20
- 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 +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 +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 +9 -1
- package/cjs/test/render.js +20 -13
- 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 +7 -3
- 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-effect-once.js +14 -0
- package/es/_internal/hooks/use-event.js +1 -1
- package/es/_internal/hooks/use-is-first-render.js +18 -0
- 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/hooks/use-update-effect.js +20 -0
- package/es/_internal/hooks/use-warn.js +23 -0
- package/es/_internal/index.js +1 -1
- package/es/components/Base.js +1 -1
- package/es/components/Block.js +1 -1
- package/es/components/GlobalStyles.js +1 -1
- package/es/components/GridProvider.js +1 -1
- package/es/components/HiddenInput.js +1 -1
- package/es/components/OpenTrasition.js +1 -1
- package/es/components/Root.js +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 → FieldWrapper/FieldWrapper.js} +19 -17
- package/es/components/forms/FieldWrapper/extract-field-wrapper-props.js +46 -0
- package/es/components/forms/FieldWrapper/index.js +12 -0
- package/es/components/forms/FieldWrapper/types.js +10 -0
- package/es/components/forms/FileInput/FileInput.js +2 -2
- package/es/components/forms/Form/Field/Field.js +133 -0
- package/es/components/forms/Form/Field/FieldContext.js +44 -0
- package/es/components/forms/Form/Field/index.js +12 -0
- package/es/components/forms/Form/Field/types.js +10 -0
- package/es/components/forms/Form/Form.js +2 -2
- package/es/components/forms/Form/{Field.js → LegacyField.js} +1 -1
- package/es/components/forms/Form/index.js +2 -1
- package/es/components/forms/Form/types.js +1 -1
- package/es/components/forms/Form/useForm.js +2 -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/SearchInput/SearchInput.js +1 -1
- package/es/components/forms/Switch/Switch.js +15 -12
- package/es/components/forms/TextArea/TextArea.js +30 -27
- package/es/components/forms/TextInput/TextInput.js +16 -9
- package/es/components/forms/TextInput/TextInputBase.js +9 -37
- package/es/components/forms/TextInput/index.js +11 -0
- 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 +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 +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 +12 -9
- 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 +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 -19
- 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 +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 +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 +5 -1
- package/es/test/render.js +18 -2
- 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 +1 -4
- package/types/_internal/hooks/index.d.ts +6 -2
- package/types/_internal/hooks/use-effect-once.d.ts +2 -0
- package/types/_internal/hooks/use-is-first-render.d.ts +1 -0
- package/types/_internal/hooks/use-update-effect.d.ts +2 -0
- package/types/_internal/hooks/use-warn.d.ts +2 -0
- package/types/components/forms/FieldWrapper/FieldWrapper.d.ts +7 -0
- package/types/components/forms/FieldWrapper/extract-field-wrapper-props.d.ts +9 -0
- package/types/components/forms/FieldWrapper/index.d.ts +3 -0
- package/types/components/forms/{FieldWrapper.d.ts → FieldWrapper/types.d.ts} +15 -20
- package/types/components/forms/Form/Field/Field.d.ts +4 -0
- package/types/components/forms/Form/Field/FieldContext.d.ts +29 -0
- package/types/components/forms/Form/Field/index.d.ts +3 -0
- package/types/components/forms/Form/Field/types.d.ts +25 -0
- package/types/components/forms/Form/{Field.d.ts → LegacyField.d.ts} +1 -1
- package/types/components/forms/Form/index.d.ts +1 -0
- package/types/components/forms/Form/useForm.d.ts +1 -1
- package/types/components/forms/Switch/Switch.d.ts +2 -3
- package/types/components/forms/TextArea/TextArea.d.ts +3 -4
- package/types/components/forms/TextInput/TextInput.d.ts +5 -0
- package/types/components/forms/TextInput/TextInputBase.d.ts +1 -2
- package/types/components/forms/TextInput/index.d.ts +2 -0
- package/types/components/pickers/ComboBox/ComboBox.d.ts +5 -5
- package/types/stories/FormFieldArgs.d.ts +0 -22
- package/types/test/index.d.ts +4 -0
- package/types/test/render.d.ts +58 -1
- package/cjs/components/pickers/RangeSlider/Gradation.js +0 -28
- package/cjs/components/pickers/RangeSlider/RangeInput.js +0 -37
- package/cjs/components/pickers/RangeSlider/RangeSlider.js +0 -99
- package/cjs/components/pickers/RangeSlider/Slide.js +0 -28
- package/cjs/components/pickers/RangeSlider/Thumb.js +0 -36
- package/cjs/components/pickers/RangeSlider/styled.js +0 -118
- package/es/components/pickers/RangeSlider/Gradation.js +0 -24
- package/es/components/pickers/RangeSlider/Header.js +0 -12
- package/es/components/pickers/RangeSlider/RangeInput.js +0 -33
- package/es/components/pickers/RangeSlider/RangeSlider.js +0 -96
- package/es/components/pickers/RangeSlider/Slide.js +0 -24
- package/es/components/pickers/RangeSlider/Thumb.js +0 -32
- package/es/components/pickers/RangeSlider/styled.js +0 -115
- package/types/components/pickers/RangeSlider/Gradation.d.ts +0 -8
- package/types/components/pickers/RangeSlider/Header.d.ts +0 -1
- package/types/components/pickers/RangeSlider/RangeInput.d.ts +0 -10
- package/types/components/pickers/RangeSlider/RangeSlider.d.ts +0 -18
- package/types/components/pickers/RangeSlider/Slide.d.ts +0 -9
- package/types/components/pickers/RangeSlider/Thumb.d.ts +0 -9
- package/types/components/pickers/RangeSlider/styled.d.ts +0 -8
package/types/test/render.d.ts
CHANGED
|
@@ -1,4 +1,61 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RenderOptions } from '@testing-library/react';
|
|
3
|
+
import { CubeFormInstance } from '../components/forms';
|
|
3
4
|
export declare function renderWithRoot(ui: React.ReactElement, options?: Omit<RenderOptions, 'queries' | 'wrapper'>): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>;
|
|
4
|
-
export
|
|
5
|
+
export declare function renderWithForm(ui: React.ReactElement, options?: Omit<RenderOptions, 'queries' | 'wrapper'>): {
|
|
6
|
+
readonly formInstance: CubeFormInstance<any, import("../components/forms/Form/useForm").CubeFormData<any>>;
|
|
7
|
+
readonly container: HTMLElement;
|
|
8
|
+
readonly baseElement: Element;
|
|
9
|
+
readonly debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|
|
10
|
+
readonly rerender: (ui: React.ReactElement<any, string | React.JSXElementConstructor<any>>) => void;
|
|
11
|
+
readonly unmount: () => void;
|
|
12
|
+
readonly asFragment: () => DocumentFragment;
|
|
13
|
+
readonly getByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
14
|
+
readonly getAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
15
|
+
readonly queryByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
16
|
+
readonly queryAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
17
|
+
readonly findByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
18
|
+
readonly findAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
19
|
+
readonly getByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
20
|
+
readonly getAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
21
|
+
readonly queryByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
22
|
+
readonly queryAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
23
|
+
readonly findByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
24
|
+
readonly findAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
25
|
+
readonly getByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
26
|
+
readonly getAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
27
|
+
readonly queryByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
28
|
+
readonly queryAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
29
|
+
readonly findByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
30
|
+
readonly findAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
31
|
+
readonly getByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
32
|
+
readonly getAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
33
|
+
readonly queryByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
34
|
+
readonly queryAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
35
|
+
readonly findByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
36
|
+
readonly findAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
37
|
+
readonly getByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
38
|
+
readonly getAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
39
|
+
readonly queryByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
40
|
+
readonly queryAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
41
|
+
readonly findByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
42
|
+
readonly findAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
43
|
+
readonly getByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
44
|
+
readonly getAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
45
|
+
readonly queryByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
46
|
+
readonly queryAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
47
|
+
readonly findByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
48
|
+
readonly findAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
49
|
+
readonly getByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement;
|
|
50
|
+
readonly getAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
51
|
+
readonly queryByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null;
|
|
52
|
+
readonly queryAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
53
|
+
readonly findByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
54
|
+
readonly findAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
55
|
+
readonly getByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
56
|
+
readonly getAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
57
|
+
readonly queryByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
58
|
+
readonly queryAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
59
|
+
readonly findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
60
|
+
readonly findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
61
|
+
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Gradation = void 0;
|
|
11
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
-
const styled_1 = require("./styled");
|
|
13
|
-
function Gradation(props) {
|
|
14
|
-
const { state, ranges, values = [] } = props;
|
|
15
|
-
if (!values.length) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const getIsActive = (value, idx) => {
|
|
19
|
-
const [minIdx, maxIdx] = ranges.map((range) => state.getThumbValue(range));
|
|
20
|
-
return idx >= minIdx && idx <= maxIdx;
|
|
21
|
-
};
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.StyledGradation, { children: values.map((value, idx) => ((0, jsx_runtime_1.jsx)(styled_1.StyledGrade, { mods: {
|
|
23
|
-
active: getIsActive(value, idx),
|
|
24
|
-
}, children: value }, value))) }, void 0));
|
|
25
|
-
}
|
|
26
|
-
exports.Gradation = Gradation;
|
|
27
|
-
|
|
28
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RangeInput = void 0;
|
|
11
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
const __1 = require("../../../");
|
|
14
|
-
function calculateWidth(max) {
|
|
15
|
-
if (typeof max === 'undefined') {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
const value = String(max).length;
|
|
19
|
-
const charWidth = 1.75;
|
|
20
|
-
return `${value * charWidth}x`;
|
|
21
|
-
}
|
|
22
|
-
function RangeInput(props) {
|
|
23
|
-
const { state, index, suffix, min, max, ...otherProps } = props;
|
|
24
|
-
const value = state.values[index];
|
|
25
|
-
const width = calculateWidth(max);
|
|
26
|
-
const onChange = (0, react_1.useCallback)((value) => {
|
|
27
|
-
state.setThumbValue(index, value);
|
|
28
|
-
}, [index, state]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(__1.NumberInput, { ...otherProps, hideStepper: true, size: "small", inputProps: {
|
|
30
|
-
maxLength: max && String(max).length,
|
|
31
|
-
}, inputStyles: {
|
|
32
|
-
width,
|
|
33
|
-
}, suffix: suffix && (0, jsx_runtime_1.jsx)(__1.Flow, { padding: "1.5x right", children: suffix }, void 0), value: value, minValue: state.getThumbMinValue(index), maxValue: state.getThumbMaxValue(index), onChange: onChange }, void 0));
|
|
34
|
-
}
|
|
35
|
-
exports.RangeInput = RangeInput;
|
|
36
|
-
|
|
37
|
-
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RangeSlider = void 0;
|
|
11
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
const slider_1 = require("@react-aria/slider");
|
|
14
|
-
const slider_2 = require("@react-stately/slider");
|
|
15
|
-
const FieldWrapper_1 = require("../../forms/FieldWrapper");
|
|
16
|
-
const tasty_1 = require("../../../tasty");
|
|
17
|
-
const Slide_1 = require("./Slide");
|
|
18
|
-
const Gradation_1 = require("./Gradation");
|
|
19
|
-
const Thumb_1 = require("./Thumb");
|
|
20
|
-
const RangeInput_1 = require("./RangeInput");
|
|
21
|
-
const styled_1 = require("./styled");
|
|
22
|
-
function getRanges(value) {
|
|
23
|
-
if (Array.isArray(value)) {
|
|
24
|
-
return value.length >= 2 ? [0, 1] : [0];
|
|
25
|
-
}
|
|
26
|
-
return [0];
|
|
27
|
-
}
|
|
28
|
-
function RangeSlider(props, ref) {
|
|
29
|
-
let { labelPosition, label, extra, styles, isRequired, validationState, message, description, requiredMark, labelSuffix, labelStyles, necessityIndicator, defaultValue, value, gradation, step = 1, isDisabled, orientation = 'horizontal', showInput, inputStyles, inputSuffix, inputSuffixPosition, minValue, maxValue, onChange, onChangeEnd, ...otherProps } = props;
|
|
30
|
-
const ranges = getRanges(defaultValue || value || [0, 1]);
|
|
31
|
-
const isSingle = ranges.length <= 1;
|
|
32
|
-
const trackRef = (0, react_1.useRef)(null);
|
|
33
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
34
|
-
const numberFormatter = new Intl.NumberFormat();
|
|
35
|
-
const baseProps = {
|
|
36
|
-
step,
|
|
37
|
-
orientation,
|
|
38
|
-
isDisabled,
|
|
39
|
-
onChange(range) {
|
|
40
|
-
if (onChange) {
|
|
41
|
-
onChange(Array.isArray(range) ? range : [range]);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
onChangeEnd(range) {
|
|
45
|
-
if (onChangeEnd) {
|
|
46
|
-
onChangeEnd(Array.isArray(range) ? range : [range]);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
const state = (0, slider_2.useSliderState)({
|
|
51
|
-
...props,
|
|
52
|
-
...baseProps,
|
|
53
|
-
numberFormatter,
|
|
54
|
-
});
|
|
55
|
-
const { groupProps, trackProps, labelProps } = (0, slider_1.useSlider)({
|
|
56
|
-
...props,
|
|
57
|
-
...baseProps,
|
|
58
|
-
}, state, trackRef);
|
|
59
|
-
const inputProps = {
|
|
60
|
-
min: minValue,
|
|
61
|
-
max: maxValue,
|
|
62
|
-
step,
|
|
63
|
-
state: state,
|
|
64
|
-
suffix: inputSuffix,
|
|
65
|
-
styles: inputStyles,
|
|
66
|
-
suffixPosition: inputSuffixPosition,
|
|
67
|
-
isDisabled,
|
|
68
|
-
};
|
|
69
|
-
const sliderField = ((0, jsx_runtime_1.jsxs)(styled_1.StyledSlider, { ...groupProps, mods: {
|
|
70
|
-
sideLabel: labelPosition === 'side',
|
|
71
|
-
inputs: showInput,
|
|
72
|
-
}, children: [!isSingle && showInput && (0, jsx_runtime_1.jsx)(RangeInput_1.RangeInput, { index: 0, ...inputProps }, void 0), (0, jsx_runtime_1.jsx)(styled_1.StyledContent, { children: (0, jsx_runtime_1.jsxs)(styled_1.StyledControls, { ...trackProps, ref: trackRef, children: [(0, jsx_runtime_1.jsx)(Slide_1.Slide, { state: state, ranges: ranges, isSingle: isSingle, isDisabled: isDisabled }, void 0), (0, jsx_runtime_1.jsx)(Gradation_1.Gradation, { state: state, ranges: ranges, values: gradation }, void 0), ranges.map((thumb) => ((0, jsx_runtime_1.jsx)(Thumb_1.Thumb, { index: thumb, state: state, inputRef: inputRef, trackRef: trackRef, isDisabled: isDisabled, defaultValue: defaultValue && defaultValue[thumb] }, thumb)))] }, void 0) }, void 0), showInput && (0, jsx_runtime_1.jsx)(RangeInput_1.RangeInput, { index: 1, ...inputProps }, void 0)] }, void 0));
|
|
73
|
-
styles = (0, tasty_1.extractStyles)(otherProps, tasty_1.OUTER_STYLES, styles);
|
|
74
|
-
return ((0, jsx_runtime_1.jsx)(FieldWrapper_1.FieldWrapper, { ...{
|
|
75
|
-
labelPosition,
|
|
76
|
-
label,
|
|
77
|
-
extra,
|
|
78
|
-
styles,
|
|
79
|
-
isRequired,
|
|
80
|
-
labelStyles,
|
|
81
|
-
necessityIndicator,
|
|
82
|
-
labelProps,
|
|
83
|
-
isDisabled,
|
|
84
|
-
validationState,
|
|
85
|
-
message,
|
|
86
|
-
description,
|
|
87
|
-
requiredMark,
|
|
88
|
-
labelSuffix,
|
|
89
|
-
Component: sliderField,
|
|
90
|
-
ref: ref,
|
|
91
|
-
} }, void 0));
|
|
92
|
-
}
|
|
93
|
-
const _RangeSlider = (0, react_1.forwardRef)(RangeSlider);
|
|
94
|
-
const __RangeSlider = Object.assign(_RangeSlider, {
|
|
95
|
-
cubeInputType: 'CheckboxGroup',
|
|
96
|
-
});
|
|
97
|
-
exports.RangeSlider = __RangeSlider;
|
|
98
|
-
|
|
99
|
-
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Slide = void 0;
|
|
11
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
const styled_1 = require("./styled");
|
|
14
|
-
function Slide(props) {
|
|
15
|
-
const { ranges, state, isDisabled, isSingle } = props;
|
|
16
|
-
const styles = {};
|
|
17
|
-
const mods = (0, react_1.useMemo)(() => ({
|
|
18
|
-
single: isSingle,
|
|
19
|
-
disabled: isDisabled,
|
|
20
|
-
}), [isDisabled, isSingle]);
|
|
21
|
-
ranges.forEach((rangeIndex) => {
|
|
22
|
-
styles[`@thumb-${rangeIndex}-value`] = state.getThumbPercent(rangeIndex);
|
|
23
|
-
});
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.StyledSlide, { mods: mods, children: (0, jsx_runtime_1.jsx)(styled_1.StyledSlideTrack, { styles: styles, mods: mods }, void 0) }, void 0));
|
|
25
|
-
}
|
|
26
|
-
exports.Slide = Slide;
|
|
27
|
-
|
|
28
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Thumb = void 0;
|
|
11
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
const slider_1 = require("@react-aria/slider");
|
|
14
|
-
const interactions_1 = require("@react-aria/interactions");
|
|
15
|
-
const visually_hidden_1 = require("@react-aria/visually-hidden");
|
|
16
|
-
const focus_1 = require("@react-aria/focus");
|
|
17
|
-
const react_2 = require("../../../utils/react");
|
|
18
|
-
const styled_1 = require("./styled");
|
|
19
|
-
function Thumb(props) {
|
|
20
|
-
const { state, isDisabled } = props;
|
|
21
|
-
const ref = (0, react_1.useRef)(null);
|
|
22
|
-
const { thumbProps, inputProps, isDragging, isFocused } = (0, slider_1.useSliderThumb)({
|
|
23
|
-
...props,
|
|
24
|
-
inputRef: ref,
|
|
25
|
-
}, state);
|
|
26
|
-
const { hoverProps, isHovered } = (0, interactions_1.useHover)({ isDisabled });
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(focus_1.FocusRing, { within: true, children: (0, jsx_runtime_1.jsx)(styled_1.StyledThumb, { mods: {
|
|
28
|
-
hovered: isHovered,
|
|
29
|
-
dragged: isDragging,
|
|
30
|
-
focused: isFocused,
|
|
31
|
-
disabled: isDisabled,
|
|
32
|
-
}, ...(0, react_2.mergeProps)(thumbProps, hoverProps), role: "presentation", children: (0, jsx_runtime_1.jsx)(visually_hidden_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...inputProps }, void 0) }, void 0) }, void 0) }, void 0));
|
|
33
|
-
}
|
|
34
|
-
exports.Thumb = Thumb;
|
|
35
|
-
|
|
36
|
-
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
5
|
-
* Released under the MIT license.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StyledContent = exports.StyledSlider = exports.StyledControls = exports.StyledGrade = exports.StyledGradation = exports.StyledSlideTrack = exports.StyledSlide = exports.StyledThumb = void 0;
|
|
11
|
-
const tasty_1 = require("../../../tasty");
|
|
12
|
-
exports.StyledThumb = (0, tasty_1.tasty)({
|
|
13
|
-
styles: {
|
|
14
|
-
top: '2x',
|
|
15
|
-
width: '2x',
|
|
16
|
-
height: '2x',
|
|
17
|
-
fill: {
|
|
18
|
-
'': '#purple',
|
|
19
|
-
hovered: '#6B4FEE',
|
|
20
|
-
dragged: '#purple',
|
|
21
|
-
disabled: '#dark-04',
|
|
22
|
-
},
|
|
23
|
-
cursor: {
|
|
24
|
-
hovered: 'pointer',
|
|
25
|
-
dragged: 'grab',
|
|
26
|
-
},
|
|
27
|
-
shadow: '0px 2px 4px #dark.2',
|
|
28
|
-
radius: '50%',
|
|
29
|
-
border: {
|
|
30
|
-
focused: '3px solid #CAC9FF',
|
|
31
|
-
dragged: '2px solid #665DE8;',
|
|
32
|
-
},
|
|
33
|
-
boxSizing: {
|
|
34
|
-
'': 'border-box',
|
|
35
|
-
focused: 'content-box',
|
|
36
|
-
dragged: 'border-box',
|
|
37
|
-
},
|
|
38
|
-
transition: 'theme',
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
exports.StyledSlide = (0, tasty_1.tasty)({
|
|
42
|
-
styles: {
|
|
43
|
-
top: '1.875x',
|
|
44
|
-
position: 'absolute',
|
|
45
|
-
fill: {
|
|
46
|
-
'': '#dark-05',
|
|
47
|
-
// disabled: '#dark-04',
|
|
48
|
-
},
|
|
49
|
-
height: '2px',
|
|
50
|
-
width: '100%',
|
|
51
|
-
radius: true,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
exports.StyledSlideTrack = (0, tasty_1.tasty)({
|
|
55
|
-
styles: {
|
|
56
|
-
position: 'absolute',
|
|
57
|
-
'@start-range': {
|
|
58
|
-
'': '@thumb-0-value',
|
|
59
|
-
single: '0',
|
|
60
|
-
},
|
|
61
|
-
'@end-range': {
|
|
62
|
-
'': '(1 - @thumb-1-value)',
|
|
63
|
-
single: '(1 - @thumb-0-value)',
|
|
64
|
-
},
|
|
65
|
-
left: '(@start-range * 100%)',
|
|
66
|
-
right: '(@end-range * 100%)',
|
|
67
|
-
height: '2px',
|
|
68
|
-
fill: {
|
|
69
|
-
'': '#purple',
|
|
70
|
-
disabled: '#dark-04',
|
|
71
|
-
},
|
|
72
|
-
radius: true,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
exports.StyledGradation = (0, tasty_1.tasty)({
|
|
76
|
-
styles: {},
|
|
77
|
-
});
|
|
78
|
-
exports.StyledGrade = (0, tasty_1.tasty)({
|
|
79
|
-
styles: {},
|
|
80
|
-
});
|
|
81
|
-
exports.StyledControls = (0, tasty_1.tasty)({
|
|
82
|
-
styles: {
|
|
83
|
-
position: 'relative',
|
|
84
|
-
width: '100% - 2x',
|
|
85
|
-
height: '4x',
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
exports.StyledSlider = (0, tasty_1.tasty)({
|
|
89
|
-
as: 'section',
|
|
90
|
-
styles: {
|
|
91
|
-
position: 'relative',
|
|
92
|
-
display: 'flex',
|
|
93
|
-
gap: {
|
|
94
|
-
'': '0',
|
|
95
|
-
inputs: '1x',
|
|
96
|
-
},
|
|
97
|
-
flexDirection: {
|
|
98
|
-
'': 'column',
|
|
99
|
-
inputs: 'row',
|
|
100
|
-
},
|
|
101
|
-
alignItems: 'center',
|
|
102
|
-
width: '100%',
|
|
103
|
-
padding: {
|
|
104
|
-
'': '0',
|
|
105
|
-
sideLabel: '0.75x top',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
exports.StyledContent = (0, tasty_1.tasty)({
|
|
110
|
-
styles: {
|
|
111
|
-
display: 'flex',
|
|
112
|
-
alignItems: 'center',
|
|
113
|
-
flexDirection: 'column',
|
|
114
|
-
width: '100%',
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
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
|
-
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
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) {
|
|
12
|
-
if (typeof max === 'undefined') {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
const value = String(max).length;
|
|
16
|
-
const charWidth = 1.75;
|
|
17
|
-
return `${value * charWidth}x`;
|
|
18
|
-
}
|
|
19
|
-
export function RangeInput(props) {
|
|
20
|
-
const { state, index, suffix, min, max, ...otherProps } = props;
|
|
21
|
-
const value = state.values[index];
|
|
22
|
-
const width = calculateWidth(max);
|
|
23
|
-
const onChange = useCallback((value) => {
|
|
24
|
-
state.setThumbValue(index, value);
|
|
25
|
-
}, [index, state]);
|
|
26
|
-
return (_jsx(NumberInput, { ...otherProps, hideStepper: true, size: "small", inputProps: {
|
|
27
|
-
maxLength: max && String(max).length,
|
|
28
|
-
}, inputStyles: {
|
|
29
|
-
width,
|
|
30
|
-
}, 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));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
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
|
-
function getRanges(value) {
|
|
20
|
-
if (Array.isArray(value)) {
|
|
21
|
-
return value.length >= 2 ? [0, 1] : [0];
|
|
22
|
-
}
|
|
23
|
-
return [0];
|
|
24
|
-
}
|
|
25
|
-
function RangeSlider(props, ref) {
|
|
26
|
-
let { labelPosition, label, extra, styles, isRequired, validationState, message, description, requiredMark, labelSuffix, labelStyles, necessityIndicator, defaultValue, value, gradation, step = 1, isDisabled, orientation = 'horizontal', showInput, inputStyles, inputSuffix, inputSuffixPosition, minValue, maxValue, onChange, onChangeEnd, ...otherProps } = props;
|
|
27
|
-
const ranges = getRanges(defaultValue || value || [0, 1]);
|
|
28
|
-
const isSingle = ranges.length <= 1;
|
|
29
|
-
const trackRef = useRef(null);
|
|
30
|
-
const inputRef = useRef(null);
|
|
31
|
-
const numberFormatter = new Intl.NumberFormat();
|
|
32
|
-
const baseProps = {
|
|
33
|
-
step,
|
|
34
|
-
orientation,
|
|
35
|
-
isDisabled,
|
|
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
|
-
min: minValue,
|
|
58
|
-
max: maxValue,
|
|
59
|
-
step,
|
|
60
|
-
state: state,
|
|
61
|
-
suffix: inputSuffix,
|
|
62
|
-
styles: inputStyles,
|
|
63
|
-
suffixPosition: inputSuffixPosition,
|
|
64
|
-
isDisabled,
|
|
65
|
-
};
|
|
66
|
-
const sliderField = (_jsxs(StyledSlider, { ...groupProps, mods: {
|
|
67
|
-
sideLabel: labelPosition === 'side',
|
|
68
|
-
inputs: showInput,
|
|
69
|
-
}, 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: defaultValue && defaultValue[thumb] }, thumb)))] }, void 0) }, void 0), showInput && _jsx(RangeInput, { index: 1, ...inputProps }, void 0)] }, void 0));
|
|
70
|
-
styles = extractStyles(otherProps, OUTER_STYLES, styles);
|
|
71
|
-
return (_jsx(FieldWrapper, { ...{
|
|
72
|
-
labelPosition,
|
|
73
|
-
label,
|
|
74
|
-
extra,
|
|
75
|
-
styles,
|
|
76
|
-
isRequired,
|
|
77
|
-
labelStyles,
|
|
78
|
-
necessityIndicator,
|
|
79
|
-
labelProps,
|
|
80
|
-
isDisabled,
|
|
81
|
-
validationState,
|
|
82
|
-
message,
|
|
83
|
-
description,
|
|
84
|
-
requiredMark,
|
|
85
|
-
labelSuffix,
|
|
86
|
-
Component: sliderField,
|
|
87
|
-
ref: ref,
|
|
88
|
-
} }, void 0));
|
|
89
|
-
}
|
|
90
|
-
const _RangeSlider = forwardRef(RangeSlider);
|
|
91
|
-
const __RangeSlider = Object.assign(_RangeSlider, {
|
|
92
|
-
cubeInputType: 'CheckboxGroup',
|
|
93
|
-
});
|
|
94
|
-
export { __RangeSlider as RangeSlider };
|
|
95
|
-
|
|
96
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
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 styles = {};
|
|
14
|
-
const mods = useMemo(() => ({
|
|
15
|
-
single: isSingle,
|
|
16
|
-
disabled: isDisabled,
|
|
17
|
-
}), [isDisabled, isSingle]);
|
|
18
|
-
ranges.forEach((rangeIndex) => {
|
|
19
|
-
styles[`@thumb-${rangeIndex}-value`] = state.getThumbPercent(rangeIndex);
|
|
20
|
-
});
|
|
21
|
-
return (_jsx(StyledSlide, { mods: mods, children: _jsx(StyledSlideTrack, { styles: styles, mods: mods }, void 0) }, void 0));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-d37d372
|
|
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: 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
|
-
|