@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
|
@@ -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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -11,14 +11,14 @@ exports.FieldWrapper = void 0;
|
|
|
11
11
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
12
|
const react_1 = require("react");
|
|
13
13
|
const icons_1 = require("@ant-design/icons");
|
|
14
|
-
const Paragraph_1 = require("
|
|
15
|
-
const tasty_1 = require("
|
|
16
|
-
const TooltipProvider_1 = require("
|
|
17
|
-
const Text_1 = require("
|
|
18
|
-
const react_2 = require("
|
|
19
|
-
const Space_1 = require("
|
|
20
|
-
const Flex_1 = require("
|
|
21
|
-
const Label_1 = require("
|
|
14
|
+
const Paragraph_1 = require("../../content/Paragraph");
|
|
15
|
+
const tasty_1 = require("../../../tasty");
|
|
16
|
+
const TooltipProvider_1 = require("../../overlays/Tooltip/TooltipProvider");
|
|
17
|
+
const Text_1 = require("../../content/Text");
|
|
18
|
+
const react_2 = require("../../../utils/react");
|
|
19
|
+
const Space_1 = require("../../layout/Space");
|
|
20
|
+
const Flex_1 = require("../../layout/Flex");
|
|
21
|
+
const Label_1 = require("../Label");
|
|
22
22
|
const FieldElement = (0, tasty_1.tasty)({
|
|
23
23
|
qa: 'Field',
|
|
24
24
|
styles: {
|
|
@@ -53,6 +53,9 @@ const FieldElement = (0, tasty_1.tasty)({
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
|
+
if (process.env.NODE_ENV === 'development') {
|
|
57
|
+
FieldElement.displayName = 'FieldWrapperElement';
|
|
58
|
+
}
|
|
56
59
|
const MessageElement = (0, tasty_1.tasty)({
|
|
57
60
|
qa: 'Field_Message',
|
|
58
61
|
styles: {
|
|
@@ -68,7 +71,11 @@ const MessageElement = (0, tasty_1.tasty)({
|
|
|
68
71
|
userSelect: 'none',
|
|
69
72
|
},
|
|
70
73
|
});
|
|
71
|
-
|
|
74
|
+
/**
|
|
75
|
+
* A wrapper for form fields to provide additional decoration for inputs.
|
|
76
|
+
* @internal Do not use this component directly.
|
|
77
|
+
*/
|
|
78
|
+
exports.FieldWrapper = (0, react_1.forwardRef)(function FieldWrapper(props, ref) {
|
|
72
79
|
const { as, labelPosition = 'top', label, extra, styles, isRequired, isDisabled, labelStyles, necessityIndicator, labelProps, fieldProps, message, messageStyles, description, Component, validationState, requiredMark = true, tooltip, isHidden, labelSuffix, } = props;
|
|
73
80
|
const labelComponent = label ? ((0, jsx_runtime_1.jsx)(Label_1.Label, { as: as === 'label' ? 'div' : 'label', styles: labelStyles, labelPosition: labelPosition, isRequired: requiredMark ? isRequired : false, isDisabled: isDisabled, necessityIndicator: necessityIndicator, validationState: validationState, "aria-label": label, ...labelProps, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { placeContent: "baseline space-between", width: "100%", children: [(0, jsx_runtime_1.jsxs)(Space_1.Space, { placeItems: "center", gap: "0.25x", children: [(0, jsx_runtime_1.jsx)("div", { children: label }, void 0), tooltip ? ((0, jsx_runtime_1.jsx)(TooltipProvider_1.TooltipProvider, { activeWrap: true, title: tooltip, width: "initial max-content 40x", children: (0, jsx_runtime_1.jsx)(icons_1.InfoCircleOutlined, { style: { color: 'var(--primary-color)', margin: '0 4px' } }, void 0) }, void 0)) : null, (0, jsx_runtime_1.jsx)("div", { children: labelSuffix }, void 0)] }, void 0), extra && (0, jsx_runtime_1.jsx)(Text_1.Text, { preset: "t3", children: extra }, void 0)] }, void 0) }, void 0)) : null;
|
|
74
81
|
let descriptionComponent = description ? ((0, jsx_runtime_1.jsx)("div", { "data-element": "Description", children: (0, react_2.wrapNodeIfPlain)(description, () => ((0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { children: description }, void 0))) }, void 0)) : null;
|
|
@@ -78,12 +85,7 @@ function FieldWrapper(props, ref) {
|
|
|
78
85
|
invalid: validationState === 'invalid',
|
|
79
86
|
valid: validationState === 'valid',
|
|
80
87
|
};
|
|
81
|
-
return ((0, jsx_runtime_1.jsxs)(FieldElement, { ref: ref, as: as
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* A wrapper for form fields to provide additional decoration for inputs.
|
|
85
|
-
*/
|
|
86
|
-
const _FieldWrapper = (0, react_1.forwardRef)(FieldWrapper);
|
|
87
|
-
exports.FieldWrapper = _FieldWrapper;
|
|
88
|
+
return ((0, jsx_runtime_1.jsxs)(FieldElement, { ref: ref, as: as ?? 'div', mods: mods, isHidden: isHidden, styles: styles, ...fieldProps, children: [labelComponent || descriptionComponent ? ((0, jsx_runtime_1.jsxs)("div", { "data-element": "LabelArea", children: [labelComponent, descriptionComponent] }, void 0)) : null, (0, jsx_runtime_1.jsxs)("div", { "data-element": "InputArea", children: [Component, message && !isDisabled && ((0, jsx_runtime_1.jsx)(MessageElement, { mods: mods, styles: messageStyles, role: validationState === 'invalid' ? 'alert' : undefined, children: message }, void 0))] }, void 0)] }, void 0));
|
|
89
|
+
});
|
|
88
90
|
|
|
89
91
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.extractFieldWrapperProps = void 0;
|
|
11
|
+
const createFieldWrapperPropsKeys = (arr) => new Set(arr);
|
|
12
|
+
const fieldWrapperPropsKeys = createFieldWrapperPropsKeys([
|
|
13
|
+
'as',
|
|
14
|
+
'validationState',
|
|
15
|
+
'styles',
|
|
16
|
+
'isRequired',
|
|
17
|
+
'isDisabled',
|
|
18
|
+
'fieldProps',
|
|
19
|
+
'isHidden',
|
|
20
|
+
'label',
|
|
21
|
+
'labelPosition',
|
|
22
|
+
'labelSuffix',
|
|
23
|
+
'labelStyles',
|
|
24
|
+
'labelProps',
|
|
25
|
+
'description',
|
|
26
|
+
'requiredMark',
|
|
27
|
+
'tooltip',
|
|
28
|
+
'extra',
|
|
29
|
+
'necessityLabel',
|
|
30
|
+
'necessityIndicator',
|
|
31
|
+
'message',
|
|
32
|
+
'messageStyles',
|
|
33
|
+
'Component',
|
|
34
|
+
]);
|
|
35
|
+
function extractFieldWrapperProps(props) {
|
|
36
|
+
const fieldWrapperProps = {};
|
|
37
|
+
const rest = {};
|
|
38
|
+
for (const [key, prop] of Object.entries(props)) {
|
|
39
|
+
if (fieldWrapperPropsKeys.has(key)) {
|
|
40
|
+
fieldWrapperProps[key] = prop;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
rest[key] = prop;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { fieldWrapperProps, rest };
|
|
47
|
+
}
|
|
48
|
+
exports.extractFieldWrapperProps = extractFieldWrapperProps;
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./FieldWrapper"), exports);
|
|
21
|
+
__exportStar(require("./extract-field-wrapper-props"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
23
|
+
|
|
24
|
+
|
|
@@ -1,16 +1,11 @@
|
|
|
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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Header = void 0;
|
|
11
|
-
function Header() {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
exports.Header = Header;
|
|
15
10
|
|
|
16
11
|
|
|
@@ -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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,10 +12,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
const react_1 = require("react");
|
|
13
13
|
const utils_1 = require("@react-spectrum/utils");
|
|
14
14
|
const provider_1 = require("../../../provider");
|
|
15
|
-
const
|
|
15
|
+
const actions_1 = require("../../actions");
|
|
16
16
|
const tasty_1 = require("../../../tasty");
|
|
17
17
|
const FieldWrapper_1 = require("../FieldWrapper");
|
|
18
|
-
const FileInputElement = (0, tasty_1.tasty)(
|
|
18
|
+
const FileInputElement = (0, tasty_1.tasty)(actions_1.Action, {
|
|
19
19
|
styles: {
|
|
20
20
|
display: 'inline-flex',
|
|
21
21
|
position: 'relative',
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Field = void 0;
|
|
11
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const Form_1 = require("../Form");
|
|
14
|
+
const _internal_1 = require("../../../../_internal");
|
|
15
|
+
const FieldContext_1 = require("./FieldContext");
|
|
16
|
+
const ID_MAP = {};
|
|
17
|
+
function createId(name) {
|
|
18
|
+
if (!name)
|
|
19
|
+
return;
|
|
20
|
+
if (!ID_MAP[name]) {
|
|
21
|
+
ID_MAP[name] = [];
|
|
22
|
+
}
|
|
23
|
+
let i = 0;
|
|
24
|
+
let id;
|
|
25
|
+
do {
|
|
26
|
+
id = i ? `${name}_${i}` : name;
|
|
27
|
+
i++;
|
|
28
|
+
} while (ID_MAP[name].includes(id));
|
|
29
|
+
ID_MAP[name].push(id);
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
function removeId(name, id) {
|
|
33
|
+
if (!ID_MAP[name])
|
|
34
|
+
return;
|
|
35
|
+
ID_MAP[name] = ID_MAP[name].filter((_id) => _id !== id);
|
|
36
|
+
}
|
|
37
|
+
function Field(props) {
|
|
38
|
+
props = (0, Form_1.useFormProps)(props);
|
|
39
|
+
let { defaultValue, id, idPrefix, children, name, form, rules, validateTrigger, validationState, shouldUpdate, } = props;
|
|
40
|
+
const nonInput = !name;
|
|
41
|
+
const fieldName = name != null ? (Array.isArray(name) ? name.join('.') : name) : '';
|
|
42
|
+
const [fieldId, setFieldId] = (0, react_1.useState)(id ?? (idPrefix ? `${idPrefix}_${fieldName}` : fieldName));
|
|
43
|
+
let field = form?.getFieldInstance(fieldName);
|
|
44
|
+
if (!field) {
|
|
45
|
+
field = form?.createField(fieldName, true);
|
|
46
|
+
}
|
|
47
|
+
(0, _internal_1.useWarn)(!form, 'Form Field requires declared form instance if field name is specified');
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
|
+
let newId;
|
|
50
|
+
if (!id && !nonInput) {
|
|
51
|
+
newId = createId(fieldId);
|
|
52
|
+
setFieldId(newId);
|
|
53
|
+
}
|
|
54
|
+
return () => {
|
|
55
|
+
if (!id) {
|
|
56
|
+
removeId(idPrefix ? `${idPrefix}_${fieldName}` : fieldName, newId);
|
|
57
|
+
}
|
|
58
|
+
if (fieldName && form) {
|
|
59
|
+
form.removeField(fieldName);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
if (field) {
|
|
64
|
+
field.rules = rules;
|
|
65
|
+
if (defaultValue !== null && !field.touched) {
|
|
66
|
+
form?.setFieldValue(fieldName, defaultValue, false, true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
let isRequired = rules && !!rules.find((rule) => rule.required);
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
if (!form)
|
|
72
|
+
return;
|
|
73
|
+
if (field) {
|
|
74
|
+
form.forceReRender();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
form.createField(fieldName);
|
|
78
|
+
}
|
|
79
|
+
}, [field]);
|
|
80
|
+
const onBlurHandler = (0, _internal_1.useEvent)(() => {
|
|
81
|
+
if (validateTrigger === 'onBlur') {
|
|
82
|
+
// We need a timeout so the change event can be done.
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
form?.validateField(fieldName).catch(() => { }); // do nothing on fail
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const onChangeHandler = (0, _internal_1.useEvent)((value, dontTouch) => {
|
|
89
|
+
const field = form?.getFieldInstance(fieldName);
|
|
90
|
+
if (shouldUpdate) {
|
|
91
|
+
const fieldsValue = form?.getFieldsValue();
|
|
92
|
+
// check if we should update the value of the field
|
|
93
|
+
const shouldNotBeUpdated = typeof shouldUpdate === 'boolean'
|
|
94
|
+
? !shouldUpdate
|
|
95
|
+
: !shouldUpdate(fieldsValue, {
|
|
96
|
+
...fieldsValue,
|
|
97
|
+
[fieldName]: value,
|
|
98
|
+
});
|
|
99
|
+
if (shouldNotBeUpdated) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
form?.setFieldValue(fieldName, value, !dontTouch, false, dontTouch);
|
|
104
|
+
if (!dontTouch &&
|
|
105
|
+
(validateTrigger === 'onChange' || field?.errors?.length)) {
|
|
106
|
+
form?.validateField(fieldName).catch(() => { }); // do nothing on fail
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
const contextValue = (0, react_1.useMemo)(() => ({
|
|
110
|
+
id: fieldId,
|
|
111
|
+
name: fieldName,
|
|
112
|
+
value: field?.inputValue,
|
|
113
|
+
validateTrigger,
|
|
114
|
+
validationState: validationState ?? (field?.errors?.length ? 'invalid' : undefined),
|
|
115
|
+
...(isRequired && { isRequired }),
|
|
116
|
+
...(field?.errors?.length && { message: field.errors[0] }),
|
|
117
|
+
onBlur: onBlurHandler,
|
|
118
|
+
onChange: onChangeHandler,
|
|
119
|
+
}), [
|
|
120
|
+
field?.errors,
|
|
121
|
+
field?.inputValue,
|
|
122
|
+
fieldId,
|
|
123
|
+
fieldName,
|
|
124
|
+
isRequired,
|
|
125
|
+
onBlurHandler,
|
|
126
|
+
onChangeHandler,
|
|
127
|
+
validateTrigger,
|
|
128
|
+
validationState,
|
|
129
|
+
]);
|
|
130
|
+
if (!form || !children) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
return ((0, jsx_runtime_1.jsx)(FieldContext_1.FieldProvider, { value: contextValue, children: typeof children === 'function' ? children(form) : children }, void 0));
|
|
134
|
+
}
|
|
135
|
+
exports.Field = Field;
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.useFieldProps = exports.FieldProvider = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
const React = __importStar(require("react"));
|
|
32
|
+
const _internal_1 = require("../../../../_internal");
|
|
33
|
+
const Form_1 = require("../Form");
|
|
34
|
+
const FieldContext = React.createContext(null);
|
|
35
|
+
function FieldProvider(props) {
|
|
36
|
+
const { children, value } = props;
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(FieldContext.Provider, { value: value, children: children }, void 0));
|
|
38
|
+
}
|
|
39
|
+
exports.FieldProvider = FieldProvider;
|
|
40
|
+
function useFieldProps(props, params = {}) {
|
|
41
|
+
const { valuePropsMapper, defaultValidationTrigger = 'onBlur' } = params;
|
|
42
|
+
props = (0, Form_1.useFormProps)(props);
|
|
43
|
+
const fieldContext = React.useContext(FieldContext);
|
|
44
|
+
const onBlurChained = (0, _internal_1.useChainedCallback)(fieldContext?.onBlur, props.onBlur);
|
|
45
|
+
const onChangeEvent = (0, _internal_1.useEvent)((value, dontTouch) => {
|
|
46
|
+
return fieldContext?.onChange?.(value, dontTouch, fieldContext?.validateTrigger ?? defaultValidationTrigger);
|
|
47
|
+
});
|
|
48
|
+
if (fieldContext === null) {
|
|
49
|
+
return props;
|
|
50
|
+
}
|
|
51
|
+
const { validateTrigger = defaultValidationTrigger, value, onChange, ...rest } = fieldContext;
|
|
52
|
+
return {
|
|
53
|
+
...props,
|
|
54
|
+
...(valuePropsMapper?.({
|
|
55
|
+
value: fieldContext.value,
|
|
56
|
+
onChange: onChangeEvent,
|
|
57
|
+
}) ?? {
|
|
58
|
+
value: fieldContext.value,
|
|
59
|
+
onChange: onChangeEvent,
|
|
60
|
+
}),
|
|
61
|
+
...rest,
|
|
62
|
+
validateTrigger,
|
|
63
|
+
onBlur: onBlurChained,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
exports.useFieldProps = useFieldProps;
|
|
67
|
+
|
|
68
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* author: Cube Dev Team
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
|
+
* Released under the MIT license.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./Field"), exports);
|
|
21
|
+
__exportStar(require("./FieldContext"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
23
|
+
|
|
24
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license MIT
|
|
3
3
|
* author: Cube Dev Team
|
|
4
|
-
* @cube-dev/ui-kit v0.0.0-canary-
|
|
4
|
+
* @cube-dev/ui-kit v0.0.0-canary-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -82,7 +82,7 @@ function Form(props, ref) {
|
|
|
82
82
|
// onSubmit(Object.fromEntries(new FormData(e.target).entries()));
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
[form] = (0, useForm_1.useForm)(form, ref
|
|
85
|
+
[form] = (0, useForm_1.useForm)(form, ref?.current, {
|
|
86
86
|
onSubmit: onSubmitCallback,
|
|
87
87
|
onValuesChange,
|
|
88
88
|
});
|
|
@@ -1,11 +1,21 @@
|
|
|
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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
9
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
20
|
exports.FormContext = exports.useForm = exports.Field = exports.Form = exports.useFormProps = void 0;
|
|
11
21
|
const Field_1 = require("./Field");
|
|
@@ -17,5 +27,6 @@ Object.defineProperty(exports, "useFormProps", { enumerable: true, get: function
|
|
|
17
27
|
Object.defineProperty(exports, "FormContext", { enumerable: true, get: function () { return Form_1.FormContext; } });
|
|
18
28
|
const Form = Object.assign(Form_1.Form, { Item: Field_1.Field, useForm: useForm_1.useForm });
|
|
19
29
|
exports.Form = Form;
|
|
30
|
+
__exportStar(require("./Field"), exports);
|
|
20
31
|
|
|
21
32
|
|
|
@@ -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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -215,6 +215,7 @@ class CubeFormInstance {
|
|
|
215
215
|
if (!skipRender) {
|
|
216
216
|
this.forceReRender();
|
|
217
217
|
}
|
|
218
|
+
return this.fields[name];
|
|
218
219
|
}
|
|
219
220
|
removeField(name, skipRender) {
|
|
220
221
|
if (this.fields[name]) {
|
|
@@ -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-5b7252a
|
|
5
5
|
* Released under the MIT license.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -32,13 +32,13 @@ function NumberInput(props, ref) {
|
|
|
32
32
|
props = (0, nullableValue_1.castNullableNumberValue)(props);
|
|
33
33
|
props = (0, provider_1.useProviderProps)(props);
|
|
34
34
|
props = (0, Form_1.useFormProps)(props);
|
|
35
|
-
let { hideStepper,
|
|
35
|
+
let { hideStepper, value, defaultValue, onChange, ...otherProps } = props;
|
|
36
36
|
let showStepper = !hideStepper;
|
|
37
37
|
let { locale } = (0, i18n_1.useLocale)();
|
|
38
38
|
let state = (0, numberfield_1.useNumberFieldState)({ ...props, locale });
|
|
39
39
|
let inputRef = (0, react_1.useRef)(null);
|
|
40
40
|
let { groupProps, labelProps, inputProps, incrementButtonProps, decrementButtonProps, } = (0, numberfield_2.useNumberField)(props, state, inputRef);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(TextInputBase_1.TextInputBase, { ...otherProps, ref: ref, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, wrapperProps: groupProps, suffixPosition:
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(TextInputBase_1.TextInputBase, { ...otherProps, ref: ref, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, wrapperProps: groupProps, suffixPosition: "after", suffix: showStepper ? ((0, jsx_runtime_1.jsxs)(StepperContainer, { children: [(0, jsx_runtime_1.jsx)(StepButton_1.StepButton, { direction: "up", ...incrementButtonProps }, void 0), (0, jsx_runtime_1.jsx)(StepButton_1.StepButton, { direction: "down", ...decrementButtonProps }, void 0)] }, void 0)) : null }, void 0));
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|