@channel.io/bezier-react 2.6.1 → 2.6.2
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/dist/cjs/components/AlphaAvatar/Avatar.js.map +1 -1
- package/dist/cjs/components/AlphaAvatar/AvatarSizeContext.js.map +1 -1
- package/dist/cjs/components/AlphaAvatar/useProgressiveImage.js.map +1 -1
- package/dist/cjs/components/AlphaAvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/cjs/components/AlphaButton/Button.js +4 -1
- package/dist/cjs/components/AlphaButton/Button.js.map +1 -1
- package/dist/cjs/components/AlphaDialogPrimitive/DialogPrimitive.js.map +1 -1
- package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js +5 -2
- package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js.map +1 -1
- package/dist/cjs/components/AlphaFloatingIconButton/FloatingIconButton.js +5 -2
- package/dist/cjs/components/AlphaFloatingIconButton/FloatingIconButton.js.map +1 -1
- package/dist/cjs/components/AlphaIconButton/IconButton.js +5 -2
- package/dist/cjs/components/AlphaIconButton/IconButton.js.map +1 -1
- package/dist/cjs/components/AlphaLoader/Loader.js.map +1 -1
- package/dist/cjs/components/AlphaStatusBadge/StatusBadge.js.map +1 -1
- package/dist/cjs/components/AlphaToggleButton/ToggleButton.js.map +1 -1
- package/dist/cjs/components/AlphaToggleButton/ToggleButtonContext.js.map +1 -1
- package/dist/cjs/components/AlphaToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/dist/cjs/components/AlphaToggleEmojiButtonGroup/ToggleEmojiButtonGroup.js.map +1 -1
- package/dist/cjs/components/AlphaToggleEmojiButtonGroup/useToggleEmojiButtonSize.js.map +1 -1
- package/dist/cjs/components/AlphaTooltipPrimitive/TooltipPrimitive.js.map +1 -1
- package/dist/cjs/components/AppProvider/AppProvider.js.map +1 -1
- package/dist/cjs/components/AutoFocus/AutoFocus.js.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/Avatar/useProgressiveImage.js.map +1 -1
- package/dist/cjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/cjs/components/Badge/Badge.js.map +1 -1
- package/dist/cjs/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/components/BaseButton/BaseButton.js.map +1 -1
- package/dist/cjs/components/BaseTagBadge/BaseTagBadge.js.map +1 -1
- package/dist/cjs/components/Box/Box.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +2 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/cjs/components/Center/Center.js.map +1 -1
- package/dist/cjs/components/CheckableAvatar/CheckableAvatar.js.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/ConfirmModal/ConfirmModal.js.map +1 -1
- package/dist/cjs/components/Divider/Divider.js.map +1 -1
- package/dist/cjs/components/Emoji/Emoji.js.map +1 -1
- package/dist/cjs/components/FeatureProvider/FeatureProvider.js.map +1 -1
- package/dist/cjs/components/FeatureProvider/FeatureProvider.types.js.map +1 -1
- package/dist/cjs/components/FeatureProvider/SmoothCornersFeature/SmoothCornersFeature.js.map +1 -1
- package/dist/cjs/components/FeatureProvider/SmoothCornersFeature/smoothCornersScript.js.map +1 -1
- package/dist/cjs/components/FormControl/FormControl.js.map +1 -1
- package/dist/cjs/components/FormGroup/FormGroup.js.map +1 -1
- package/dist/cjs/components/FormHelperText/FormHelperText.js.map +1 -1
- package/dist/cjs/components/FormLabel/FormLabel.js.map +1 -1
- package/dist/cjs/components/Help/Help.js.map +1 -1
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/KeyValueItem/KeyValueItem.js.map +1 -1
- package/dist/cjs/components/LegacyIcon/LegacyIcon.js.map +1 -1
- package/dist/cjs/components/LegacyIcon/utils.js.map +1 -1
- package/dist/cjs/components/LegacyStack/LegacyHStack/LegacyHStack.js.map +1 -1
- package/dist/cjs/components/LegacyStack/LegacySpacer/LegacySpacer.js.map +1 -1
- package/dist/cjs/components/LegacyStack/LegacyStack/LegacyStack.js.map +1 -1
- package/dist/cjs/components/LegacyStack/LegacyStackItem/LegacyStackItem.js.map +1 -1
- package/dist/cjs/components/LegacyStack/LegacyVStack/LegacyVStack.js.map +1 -1
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.js.map +1 -1
- package/dist/cjs/components/LegacyTooltip/LegacyTooltipContent.js.map +1 -1
- package/dist/cjs/components/LegacyTooltip/utils.js.map +1 -1
- package/dist/cjs/components/ListItem/ListItem.js.map +1 -1
- package/dist/cjs/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/NavGroup/NavGroup.js.map +1 -1
- package/dist/cjs/components/NavItem/NavItem.js.map +1 -1
- package/dist/cjs/components/OutlineItem/OutlineItem.js.map +1 -1
- package/dist/cjs/components/Overlay/Overlay.js.map +1 -1
- package/dist/cjs/components/Overlay/utils.js.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/cjs/components/SectionLabel/SectionLabel.js.map +1 -1
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/cjs/components/Select/Select.js.map +1 -1
- package/dist/cjs/components/Slider/Slider.js.map +1 -1
- package/dist/cjs/components/SmoothCornersBox/SmoothCornersBox.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Stack/Stack.js.map +1 -1
- package/dist/cjs/components/Status/Status.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/Text/Text.js.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/cjs/components/Toast/Toast.js.map +1 -1
- package/dist/cjs/components/Toast/ToastService.js.map +1 -1
- package/dist/cjs/components/Toast/useToastContextValues.js.map +1 -1
- package/dist/cjs/components/TokenProvider/TokenProvider.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/cjs/components/WindowProvider/WindowProvider.js.map +1 -1
- package/dist/cjs/hooks/useEventHandler.js.map +1 -1
- package/dist/cjs/hooks/useId.js.map +1 -1
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useKeyboardActionLockerWhileComposing.js.map +1 -1
- package/dist/cjs/hooks/useMergeRefs.js.map +1 -1
- package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/dist/cjs/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -1
- package/dist/cjs/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
- package/dist/cjs/node_modules/classnames/index.js.map +1 -1
- package/dist/cjs/node_modules/get-nonce/dist/es2015/index.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -1
- package/dist/cjs/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
- package/dist/cjs/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
- package/dist/cjs/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
- package/dist/cjs/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
- package/dist/cjs/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js.map +1 -1
- package/dist/cjs/node_modules/ssr-window/ssr-window.esm.js.map +1 -1
- package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/cjs/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -1
- package/dist/cjs/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/dist/cjs/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/dist/cjs/node_modules/use-composed-ref/dist/use-composed-ref.esm.js.map +1 -1
- package/dist/cjs/node_modules/use-latest/dist/use-latest.esm.js.map +1 -1
- package/dist/cjs/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -1
- package/dist/cjs/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/cjs/node_modules/uuid/dist/esm-browser/native.js.map +1 -1
- package/dist/cjs/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/cjs/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/cjs/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/esm/darkTheme.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/esm/global.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/esm/index.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/esm/lightTheme.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/props-helpers.js.map +1 -1
- package/dist/cjs/utils/aria.js.map +1 -1
- package/dist/cjs/utils/array.js.map +1 -1
- package/dist/cjs/utils/assert.js.map +1 -1
- package/dist/cjs/utils/number.js.map +1 -1
- package/dist/cjs/utils/object.js.map +1 -1
- package/dist/cjs/utils/react.js.map +1 -1
- package/dist/cjs/utils/string.js.map +1 -1
- package/dist/cjs/utils/style.js.map +1 -1
- package/dist/cjs/utils/type.js.map +1 -1
- package/dist/esm/components/AlphaAvatar/Avatar.mjs.map +1 -1
- package/dist/esm/components/AlphaAvatar/AvatarSizeContext.mjs.map +1 -1
- package/dist/esm/components/AlphaAvatar/useProgressiveImage.mjs.map +1 -1
- package/dist/esm/components/AlphaAvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/esm/components/AlphaButton/Button.mjs +4 -1
- package/dist/esm/components/AlphaButton/Button.mjs.map +1 -1
- package/dist/esm/components/AlphaDialogPrimitive/DialogPrimitive.mjs.map +1 -1
- package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs +5 -2
- package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs.map +1 -1
- package/dist/esm/components/AlphaFloatingIconButton/FloatingIconButton.mjs +5 -2
- package/dist/esm/components/AlphaFloatingIconButton/FloatingIconButton.mjs.map +1 -1
- package/dist/esm/components/AlphaIconButton/IconButton.mjs +5 -2
- package/dist/esm/components/AlphaIconButton/IconButton.mjs.map +1 -1
- package/dist/esm/components/AlphaLoader/Loader.mjs.map +1 -1
- package/dist/esm/components/AlphaStatusBadge/StatusBadge.mjs.map +1 -1
- package/dist/esm/components/AlphaToggleButton/ToggleButton.mjs.map +1 -1
- package/dist/esm/components/AlphaToggleButton/ToggleButtonContext.mjs.map +1 -1
- package/dist/esm/components/AlphaToggleButtonGroup/ToggleButtonGroup.mjs.map +1 -1
- package/dist/esm/components/AlphaToggleEmojiButtonGroup/ToggleEmojiButtonGroup.mjs.map +1 -1
- package/dist/esm/components/AlphaToggleEmojiButtonGroup/useToggleEmojiButtonSize.mjs.map +1 -1
- package/dist/esm/components/AlphaTooltipPrimitive/TooltipPrimitive.mjs.map +1 -1
- package/dist/esm/components/AppProvider/AppProvider.mjs.map +1 -1
- package/dist/esm/components/AutoFocus/AutoFocus.mjs.map +1 -1
- package/dist/esm/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/esm/components/Avatar/useProgressiveImage.mjs.map +1 -1
- package/dist/esm/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/esm/components/Badge/Badge.mjs.map +1 -1
- package/dist/esm/components/Banner/Banner.mjs.map +1 -1
- package/dist/esm/components/BaseButton/BaseButton.mjs.map +1 -1
- package/dist/esm/components/BaseTagBadge/BaseTagBadge.mjs.map +1 -1
- package/dist/esm/components/Box/Box.mjs.map +1 -1
- package/dist/esm/components/Button/Button.mjs +2 -1
- package/dist/esm/components/Button/Button.mjs.map +1 -1
- package/dist/esm/components/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/dist/esm/components/Center/Center.mjs.map +1 -1
- package/dist/esm/components/CheckableAvatar/CheckableAvatar.mjs.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/esm/components/ConfirmModal/ConfirmModal.mjs.map +1 -1
- package/dist/esm/components/Divider/Divider.mjs.map +1 -1
- package/dist/esm/components/Emoji/Emoji.mjs.map +1 -1
- package/dist/esm/components/FeatureProvider/FeatureProvider.mjs.map +1 -1
- package/dist/esm/components/FeatureProvider/FeatureProvider.types.mjs.map +1 -1
- package/dist/esm/components/FeatureProvider/SmoothCornersFeature/SmoothCornersFeature.mjs.map +1 -1
- package/dist/esm/components/FeatureProvider/SmoothCornersFeature/smoothCornersScript.mjs.map +1 -1
- package/dist/esm/components/FormControl/FormControl.mjs.map +1 -1
- package/dist/esm/components/FormGroup/FormGroup.mjs.map +1 -1
- package/dist/esm/components/FormHelperText/FormHelperText.mjs.map +1 -1
- package/dist/esm/components/FormLabel/FormLabel.mjs.map +1 -1
- package/dist/esm/components/Help/Help.mjs.map +1 -1
- package/dist/esm/components/Icon/Icon.mjs.map +1 -1
- package/dist/esm/components/KeyValueItem/KeyValueItem.mjs.map +1 -1
- package/dist/esm/components/LegacyIcon/LegacyIcon.mjs.map +1 -1
- package/dist/esm/components/LegacyIcon/utils.mjs.map +1 -1
- package/dist/esm/components/LegacyStack/LegacyHStack/LegacyHStack.mjs.map +1 -1
- package/dist/esm/components/LegacyStack/LegacySpacer/LegacySpacer.mjs.map +1 -1
- package/dist/esm/components/LegacyStack/LegacyStack/LegacyStack.mjs.map +1 -1
- package/dist/esm/components/LegacyStack/LegacyStackItem/LegacyStackItem.mjs.map +1 -1
- package/dist/esm/components/LegacyStack/LegacyVStack/LegacyVStack.mjs.map +1 -1
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.mjs.map +1 -1
- package/dist/esm/components/LegacyTooltip/LegacyTooltipContent.mjs.map +1 -1
- package/dist/esm/components/LegacyTooltip/utils.mjs.map +1 -1
- package/dist/esm/components/ListItem/ListItem.mjs.map +1 -1
- package/dist/esm/components/Modal/Modal.mjs.map +1 -1
- package/dist/esm/components/NavGroup/NavGroup.mjs.map +1 -1
- package/dist/esm/components/NavItem/NavItem.mjs.map +1 -1
- package/dist/esm/components/OutlineItem/OutlineItem.mjs.map +1 -1
- package/dist/esm/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/esm/components/Overlay/utils.mjs.map +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/esm/components/SectionLabel/SectionLabel.mjs.map +1 -1
- package/dist/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/esm/components/Select/Select.mjs.map +1 -1
- package/dist/esm/components/Slider/Slider.mjs.map +1 -1
- package/dist/esm/components/SmoothCornersBox/SmoothCornersBox.mjs.map +1 -1
- package/dist/esm/components/Spinner/Spinner.mjs.map +1 -1
- package/dist/esm/components/Stack/Stack.mjs.map +1 -1
- package/dist/esm/components/Status/Status.mjs.map +1 -1
- package/dist/esm/components/Switch/Switch.mjs.map +1 -1
- package/dist/esm/components/Tabs/Tabs.mjs.map +1 -1
- package/dist/esm/components/Tag/Tag.mjs.map +1 -1
- package/dist/esm/components/Text/Text.mjs.map +1 -1
- package/dist/esm/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/esm/components/TextField/TextField.mjs.map +1 -1
- package/dist/esm/components/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/dist/esm/components/Toast/Toast.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastService.mjs.map +1 -1
- package/dist/esm/components/Toast/useToastContextValues.mjs.map +1 -1
- package/dist/esm/components/TokenProvider/TokenProvider.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
- package/dist/esm/components/WindowProvider/WindowProvider.mjs.map +1 -1
- package/dist/esm/hooks/useEventHandler.mjs.map +1 -1
- package/dist/esm/hooks/useId.mjs.map +1 -1
- package/dist/esm/hooks/useIsMounted.mjs.map +1 -1
- package/dist/esm/hooks/useKeyboardActionLockerWhileComposing.mjs.map +1 -1
- package/dist/esm/hooks/useMergeRefs.mjs.map +1 -1
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.mjs.map +1 -1
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.map +1 -1
- package/dist/esm/node_modules/aria-hidden/dist/es2015/index.mjs.map +1 -1
- package/dist/esm/node_modules/classnames/index.mjs.map +1 -1
- package/dist/esm/node_modules/get-nonce/dist/es2015/index.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll/dist/es2015/Combination.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll/dist/es2015/UI.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs.map +1 -1
- package/dist/esm/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs.map +1 -1
- package/dist/esm/node_modules/react-style-singleton/dist/es2015/component.mjs.map +1 -1
- package/dist/esm/node_modules/react-style-singleton/dist/es2015/hook.mjs.map +1 -1
- package/dist/esm/node_modules/react-style-singleton/dist/es2015/singleton.mjs.map +1 -1
- package/dist/esm/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.mjs.map +1 -1
- package/dist/esm/node_modules/ssr-window/ssr-window.esm.mjs.map +1 -1
- package/dist/esm/node_modules/tslib/tslib.es6.mjs.map +1 -1
- package/dist/esm/node_modules/use-callback-ref/dist/es2015/assignRef.mjs.map +1 -1
- package/dist/esm/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs.map +1 -1
- package/dist/esm/node_modules/use-callback-ref/dist/es2015/useRef.mjs.map +1 -1
- package/dist/esm/node_modules/use-composed-ref/dist/use-composed-ref.esm.mjs.map +1 -1
- package/dist/esm/node_modules/use-latest/dist/use-latest.esm.mjs.map +1 -1
- package/dist/esm/node_modules/use-sidecar/dist/es2015/exports.mjs.map +1 -1
- package/dist/esm/node_modules/use-sidecar/dist/es2015/medium.mjs.map +1 -1
- package/dist/esm/node_modules/uuid/dist/esm-browser/native.mjs.map +1 -1
- package/dist/esm/node_modules/uuid/dist/esm-browser/rng.mjs.map +1 -1
- package/dist/esm/node_modules/uuid/dist/esm-browser/stringify.mjs.map +1 -1
- package/dist/esm/node_modules/uuid/dist/esm-browser/v4.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/esm/darkTheme.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/esm/global.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/esm/index.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/esm/lightTheme.mjs.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/esm/types/props-helpers.mjs.map +1 -1
- package/dist/esm/utils/aria.mjs.map +1 -1
- package/dist/esm/utils/array.mjs.map +1 -1
- package/dist/esm/utils/assert.mjs.map +1 -1
- package/dist/esm/utils/number.mjs.map +1 -1
- package/dist/esm/utils/object.mjs.map +1 -1
- package/dist/esm/utils/react.mjs.map +1 -1
- package/dist/esm/utils/string.mjs.map +1 -1
- package/dist/esm/utils/style.mjs.map +1 -1
- package/dist/esm/utils/type.mjs.map +1 -1
- package/dist/types/components/AlphaButton/Button.d.ts.map +1 -1
- package/dist/types/components/AlphaButton/Button.types.d.ts +1 -1
- package/dist/types/components/AlphaFloatingButton/FloatingButton.d.ts.map +1 -1
- package/dist/types/components/AlphaFloatingButton/FloatingButton.types.d.ts +1 -1
- package/dist/types/components/AlphaFloatingIconButton/FloatingIconButton.d.ts.map +1 -1
- package/dist/types/components/AlphaFloatingIconButton/FloatingIconButton.types.d.ts +1 -1
- package/dist/types/components/AlphaIconButton/IconButton.d.ts.map +1 -1
- package/dist/types/components/AlphaIconButton/IconButton.types.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Button/Button.types.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/AlphaButton/Button.module.scss +5 -5
- package/src/components/AlphaButton/Button.tsx +4 -0
- package/src/components/AlphaButton/Button.types.ts +1 -1
- package/src/components/AlphaFloatingButton/FloatingButton.tsx +4 -1
- package/src/components/AlphaFloatingButton/FloatingButton.types.ts +1 -1
- package/src/components/AlphaFloatingIconButton/FloatingIconButton.tsx +4 -1
- package/src/components/AlphaFloatingIconButton/FloatingIconButton.types.ts +1 -1
- package/src/components/AlphaIconButton/IconButton.module.scss +5 -5
- package/src/components/AlphaIconButton/IconButton.tsx +5 -1
- package/src/components/AlphaIconButton/IconButton.types.ts +1 -1
- package/src/components/AlphaToggleButton/ToggleButton.module.scss +1 -1
- package/src/components/Button/Button.tsx +4 -2
- package/src/components/Button/Button.types.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothCornersScript.js","sources":["../../../../../src/components/FeatureProvider/SmoothCornersFeature/smoothCornersScript.ts"],"sourcesContent":["export const smoothCornersScript = `\nclass SmoothCorners {\n static get inputProperties() {\n return [\n 'border-image-source',\n '--smooth-corners',\n '--smooth-corners-shadow',\n '--smooth-corners-bg-color',\n '--smooth-corners-padding',\n '--smooth-corners-radius-unit',\n ]\n }\n\n constructor() {\n this.superellipseCache = new Map()\n }\n\n trimPX(pixel) {\n return parseInt(pixel.replace('px', ''), 10)\n }\n\n splitValueAndUnit(value) {\n const regex = /([\\\\d.\\\\-+]+)\\\\s*(\\\\D*)/\n const matches = value.match(regex)\n return matches ? [matches[1], matches[2]] : [value, '']\n }\n\n superellipse(...args) {\n const sanitizedArgs = this.sanitizeSuperellipseArgs(...args)\n\n const cacheKey = this.getSuperellipseCacheKey(sanitizedArgs)\n\n if (this.superellipseCache.has(cacheKey)) {\n return [...this.superellipseCache.get(cacheKey)]\n }\n\n const result = this.computeSuperellipse(...sanitizedArgs)\n\n this.superellipseCache.set(cacheKey, result)\n\n return [...result]\n }\n\n sanitizeSuperellipseArgs(a, b, nX, nY) {\n if (nX > 100) { nX = 100 }\n if (nY > 100) { nY = 100 }\n if (nX < 0.00000000001) { nX = 0.00000000001 }\n if (nY < 0.00000000001) { nY = 0.00000000001 }\n\n return [a, b, nX, nY]\n }\n\n computeSuperellipse(a, b, nX, nY) {\n const nX2 = 2 / nX\n const nY2 = 2 / nY\n const steps = 360\n const step = (2 * Math.PI) / steps\n const points = t => {\n const cosT = Math.cos(t)\n const sinT = Math.sin(t)\n return {\n x: Math.abs(cosT) ** nX2 * a * Math.sign(cosT),\n y: Math.abs(sinT) ** nY2 * b * Math.sign(sinT),\n }\n }\n\n return Array.from({ length: steps + 1 }, (_, i) => points(i * step))\n }\n\n getSuperellipseCacheKey(args) {\n return args.join(':')\n }\n\n paint(ctx, geom, properties) {\n const backgroundImage = properties\n .get('border-image-source')\n\n const backgroundColor = properties\n .get('--smooth-corners-bg-color')\n .toString()\n\n const padding = properties\n .get('--smooth-corners-padding')\n .toString()\n\n const [offsetX, offsetY, blur, spread, color] = properties\n .get('--smooth-corners-shadow')\n .toString()\n .split(/,s*/)\n\n const halfWidth = geom.width / 2\n const halfHeight = geom.height / 2\n\n const baseN = properties\n .get('--smooth-corners')\n .toString()\n\n const targetWidth = geom.width - (2 * this.trimPX(padding))\n const targetHeight = geom.height - (2 * this.trimPX(padding))\n\n const [rValue, rUnit] = this.splitValueAndUnit(baseN)\n const targetR = rUnit === '%'\n ? (Number(rValue) / 100) * Math.min(targetWidth, targetHeight)\n : Number(rValue)\n\n const targetNX = targetWidth / targetR\n const targetNY = targetHeight / targetR\n\n const smooth = this.superellipse(\n halfWidth - this.trimPX(padding),\n halfHeight - this.trimPX(padding),\n parseFloat(targetNX, 10),\n parseFloat(targetNY, 10),\n )\n\n ctx.setTransform(1, 0, 0, 1, halfWidth, halfHeight)\n ctx.beginPath()\n\n ctx.shadowColor = null\n ctx.shadowOffsetX = 0\n ctx.shadowOffsetY = 0\n ctx.shadowBlur = 0\n\n const trimedX = this.trimPX(offsetX) * 2\n const trimedY = this.trimPX(offsetY) * 2\n const trimedBlur = this.trimPX(blur)\n const trimedSpread = this.trimPX(spread)\n\n if (trimedBlur === 0) {\n ctx.strokeStyle = color\n ctx.lineWidth = trimedSpread * 2\n } else {\n ctx.shadowColor = color\n ctx.shadowOffsetX = trimedX\n ctx.shadowOffsetY = trimedY\n ctx.shadowBlur = trimedBlur * 2\n }\n\n smooth.forEach(({ x, y }, index) => {\n if (index === 0) {\n ctx.moveTo(x, y)\n } else {\n ctx.lineTo(x, y)\n }\n })\n\n if (trimedBlur === 0) {\n ctx.stroke()\n }\n\n if (backgroundColor) {\n ctx.fillStyle = backgroundColor\n ctx.fill()\n }\n\n if (backgroundImage instanceof CSSImageValue) {\n smooth.forEach(({ x, y }, index) => {\n if (index === 0) {\n ctx.moveTo(x, y)\n } else {\n ctx.lineTo(x, y)\n }\n })\n\n ctx.closePath()\n ctx.clip()\n\n ctx.drawImage(backgroundImage, -(targetWidth / 2), -(targetHeight / 2), targetWidth, targetHeight)\n }\n\n ctx.closePath()\n }\n}\n\ntry {\n registerPaint('smooth-corners', SmoothCorners)\n} catch (e) {\n // If the paint already exists, don't make it error.\n}\n`\n"],"names":["smoothCornersScript"],"mappings":";;AAAO,MAAMA,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"smoothCornersScript.js","sources":["../../../../../src/components/FeatureProvider/SmoothCornersFeature/smoothCornersScript.ts"],"sourcesContent":["export const smoothCornersScript = `\nclass SmoothCorners {\n static get inputProperties() {\n return [\n 'border-image-source',\n '--smooth-corners',\n '--smooth-corners-shadow',\n '--smooth-corners-bg-color',\n '--smooth-corners-padding',\n '--smooth-corners-radius-unit',\n ]\n }\n\n constructor() {\n this.superellipseCache = new Map()\n }\n\n trimPX(pixel) {\n return parseInt(pixel.replace('px', ''), 10)\n }\n\n splitValueAndUnit(value) {\n const regex = /([\\\\d.\\\\-+]+)\\\\s*(\\\\D*)/\n const matches = value.match(regex)\n return matches ? [matches[1], matches[2]] : [value, '']\n }\n\n superellipse(...args) {\n const sanitizedArgs = this.sanitizeSuperellipseArgs(...args)\n\n const cacheKey = this.getSuperellipseCacheKey(sanitizedArgs)\n\n if (this.superellipseCache.has(cacheKey)) {\n return [...this.superellipseCache.get(cacheKey)]\n }\n\n const result = this.computeSuperellipse(...sanitizedArgs)\n\n this.superellipseCache.set(cacheKey, result)\n\n return [...result]\n }\n\n sanitizeSuperellipseArgs(a, b, nX, nY) {\n if (nX > 100) { nX = 100 }\n if (nY > 100) { nY = 100 }\n if (nX < 0.00000000001) { nX = 0.00000000001 }\n if (nY < 0.00000000001) { nY = 0.00000000001 }\n\n return [a, b, nX, nY]\n }\n\n computeSuperellipse(a, b, nX, nY) {\n const nX2 = 2 / nX\n const nY2 = 2 / nY\n const steps = 360\n const step = (2 * Math.PI) / steps\n const points = t => {\n const cosT = Math.cos(t)\n const sinT = Math.sin(t)\n return {\n x: Math.abs(cosT) ** nX2 * a * Math.sign(cosT),\n y: Math.abs(sinT) ** nY2 * b * Math.sign(sinT),\n }\n }\n\n return Array.from({ length: steps + 1 }, (_, i) => points(i * step))\n }\n\n getSuperellipseCacheKey(args) {\n return args.join(':')\n }\n\n paint(ctx, geom, properties) {\n const backgroundImage = properties\n .get('border-image-source')\n\n const backgroundColor = properties\n .get('--smooth-corners-bg-color')\n .toString()\n\n const padding = properties\n .get('--smooth-corners-padding')\n .toString()\n\n const [offsetX, offsetY, blur, spread, color] = properties\n .get('--smooth-corners-shadow')\n .toString()\n .split(/,s*/)\n\n const halfWidth = geom.width / 2\n const halfHeight = geom.height / 2\n\n const baseN = properties\n .get('--smooth-corners')\n .toString()\n\n const targetWidth = geom.width - (2 * this.trimPX(padding))\n const targetHeight = geom.height - (2 * this.trimPX(padding))\n\n const [rValue, rUnit] = this.splitValueAndUnit(baseN)\n const targetR = rUnit === '%'\n ? (Number(rValue) / 100) * Math.min(targetWidth, targetHeight)\n : Number(rValue)\n\n const targetNX = targetWidth / targetR\n const targetNY = targetHeight / targetR\n\n const smooth = this.superellipse(\n halfWidth - this.trimPX(padding),\n halfHeight - this.trimPX(padding),\n parseFloat(targetNX, 10),\n parseFloat(targetNY, 10),\n )\n\n ctx.setTransform(1, 0, 0, 1, halfWidth, halfHeight)\n ctx.beginPath()\n\n ctx.shadowColor = null\n ctx.shadowOffsetX = 0\n ctx.shadowOffsetY = 0\n ctx.shadowBlur = 0\n\n const trimedX = this.trimPX(offsetX) * 2\n const trimedY = this.trimPX(offsetY) * 2\n const trimedBlur = this.trimPX(blur)\n const trimedSpread = this.trimPX(spread)\n\n if (trimedBlur === 0) {\n ctx.strokeStyle = color\n ctx.lineWidth = trimedSpread * 2\n } else {\n ctx.shadowColor = color\n ctx.shadowOffsetX = trimedX\n ctx.shadowOffsetY = trimedY\n ctx.shadowBlur = trimedBlur * 2\n }\n\n smooth.forEach(({ x, y }, index) => {\n if (index === 0) {\n ctx.moveTo(x, y)\n } else {\n ctx.lineTo(x, y)\n }\n })\n\n if (trimedBlur === 0) {\n ctx.stroke()\n }\n\n if (backgroundColor) {\n ctx.fillStyle = backgroundColor\n ctx.fill()\n }\n\n if (backgroundImage instanceof CSSImageValue) {\n smooth.forEach(({ x, y }, index) => {\n if (index === 0) {\n ctx.moveTo(x, y)\n } else {\n ctx.lineTo(x, y)\n }\n })\n\n ctx.closePath()\n ctx.clip()\n\n ctx.drawImage(backgroundImage, -(targetWidth / 2), -(targetHeight / 2), targetWidth, targetHeight)\n }\n\n ctx.closePath()\n }\n}\n\ntry {\n registerPaint('smooth-corners', SmoothCorners)\n} catch (e) {\n // If the paint already exists, don't make it error.\n}\n`\n"],"names":["smoothCornersScript"],"mappings":";;AAAO,MAAMA,mBAAmB,GAAG;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","sources":["../../../../src/components/FormControl/FormControl.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef, useCallback, useMemo, useState } from 'react'\n\nimport classNames from 'classnames'\n\nimport useId from '~/src/hooks/useId'\nimport {\n type FormFieldProps,\n type FormFieldSize,\n type SizeProps,\n} from '~/src/types/props'\nimport { getFormFieldSizeClassName } from '~/src/types/props-helpers'\nimport { ariaAttr } from '~/src/utils/aria'\nimport { createContext } from '~/src/utils/react'\nimport { isNil } from '~/src/utils/type'\n\nimport { Stack } from '~/src/components/Stack'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlContextValue,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\n\nimport styles from './FormControl.module.scss'\n\nconst [FormControlContextProvider, useFormControlContext] = createContext<\n FormControlContextValue | undefined\n>(undefined)\n\nexport { useFormControlContext }\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container(\n { labelPosition, children, className, ...rest },\n forwardedRef\n) {\n switch (labelPosition) {\n case 'top':\n return (\n <Stack\n className={className}\n ref={forwardedRef}\n direction=\"vertical\"\n {...rest}\n >\n {children}\n </Stack>\n )\n\n case 'left':\n default:\n return (\n <div\n ref={forwardedRef as React.ForwardedRef<HTMLDivElement>}\n className={classNames(styles.Grid, className)}\n {...rest}\n >\n {children}\n </div>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(\n function FormControl(\n {\n children,\n id: idProp,\n labelPosition = 'top',\n size = 'm',\n hasError,\n required,\n readOnly,\n disabled,\n ...rest\n },\n forwardedRef\n ) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(\n null\n )\n const [errorMessageNode, setErrorMessageNode] =\n useState<HTMLElement | null>(null)\n\n const id = useId(idProp, 'field')\n const groupId = `${id}-group`\n const labelId = `${id}-label`\n const helperTextId = `${id}-help-text`\n const errorMessageId = `${id}-error-message`\n\n const fieldId = groupNode ? undefined : id\n\n const describerId = useMemo(() => {\n if (errorMessageNode) {\n return errorMessageId\n }\n if (helperTextNode) {\n return helperTextId\n }\n return undefined\n }, [errorMessageNode, helperTextNode, errorMessageId, helperTextId])\n\n const getGroupProps = useCallback<GroupPropsGetter>(\n (ownProps) => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }),\n [groupId, labelId, describerId]\n )\n\n const getLabelProps = useCallback<LabelPropsGetter>(\n (ownProps) => ({\n id: labelId,\n htmlFor: fieldId,\n className: classNames(\n styles.FormLabelWrapper,\n styles[`position-${labelPosition}`],\n getFormFieldSizeClassName(size)\n ),\n typo: labelPosition === 'top' ? '13' : '14',\n ...ownProps,\n }),\n [fieldId, labelId, labelPosition, size]\n )\n\n const getFieldProps = useCallback<FieldPropsGetter>(\n (ownProps) => ({\n id: fieldId,\n size,\n 'aria-describedby': groupNode ? undefined : describerId,\n hasError,\n required,\n readOnly,\n disabled,\n ...ownProps,\n }),\n [\n fieldId,\n describerId,\n size,\n hasError,\n required,\n readOnly,\n disabled,\n groupNode,\n ]\n )\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(\n (ownProps) => ({\n id: helperTextId,\n visible: isNil(hasError) || !hasError,\n ref: setHelperTextNode,\n className: classNames(\n styles.FormHelperTextWrapper,\n labelPosition === 'left' && styles['position-left']\n ),\n ...ownProps,\n }),\n [helperTextId, labelPosition, hasError]\n )\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(\n (ownProps) => ({\n id: errorMessageId,\n visible: isNil(hasError) || hasError,\n ref: setErrorMessageNode,\n className: classNames(\n styles.FormHelperTextWrapper,\n labelPosition === 'left' && styles['position-left']\n ),\n ...ownProps,\n }),\n [errorMessageId, labelPosition, hasError]\n )\n\n const contextValue = useMemo(\n () => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n hasError,\n required,\n readOnly,\n disabled,\n }),\n [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n hasError,\n required,\n readOnly,\n disabled,\n ]\n )\n\n if (!children) {\n return null\n }\n\n return (\n <FormControlContextProvider value={contextValue}>\n <Container\n {...rest}\n ref={forwardedRef}\n labelPosition={labelPosition}\n data-testid={FORM_CONTROL_TEST_ID}\n >\n {children}\n </Container>\n </FormControlContextProvider>\n )\n }\n)\n\nexport function useFormFieldProps<\n Props extends FormFieldProps & SizeProps<FormFieldSize>,\n>(props?: Props) {\n const contextValue = useFormControlContext()\n\n const formFieldProps = useMemo(() => {\n const mergedProps = contextValue?.getFieldProps(props) ?? { ...props }\n\n const {\n disabled = false,\n readOnly = false,\n required = false,\n hasError = false,\n size = undefined,\n ...rest\n } = mergedProps\n\n return {\n ...rest,\n 'aria-disabled': ariaAttr(disabled),\n 'aria-invalid': ariaAttr(hasError),\n 'aria-required': ariaAttr(required),\n 'aria-readonly': ariaAttr(readOnly),\n size,\n disabled,\n hasError,\n required,\n readOnly,\n }\n }, [props, contextValue])\n\n return formFieldProps as typeof formFieldProps & Props\n}\n"],"names":["FormControlContextProvider","useFormControlContext","createContext","undefined","FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","className","rest","forwardedRef","React","createElement","Stack","Object","assign","ref","direction","classNames","styles","Grid","FormControl","id","idProp","size","hasError","required","readOnly","disabled","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","describerId","useMemo","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","FormLabelWrapper","getFormFieldSizeClassName","typo","getFieldProps","getHelperTextProps","visible","isNil","FormHelperTextWrapper","getErrorMessageProps","contextValue","value","useFormFieldProps","props","formFieldProps","_contextValue$getFiel","mergedProps","ariaAttr"],"mappings":";;;;;;;;;;;;AAgCM,MAAA,CAACA,0BAA0B,EAAEC,qBAAqB,CAAC,GAAGC,mBAAa,CAEvEC,SAAS,EAAC;AAIL,MAAMC,oBAAoB,GAAG,sBAAqB;AAEzD,MAAMC,SAAS,gBAAGC,gBAAU,CAA8B,SAASD,SAASA,CAC1E;EAAEE,aAAa;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC,IAAAA;AAAK,CAAC,EAC/CC,YAAY,EACZ;AACA,EAAA,QAAQJ,aAAa;AACnB,IAAA,KAAK,KAAK;MACR,oBACEK,KAAA,CAAAC,aAAA,CAACC,WAAK,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACJP,QAAAA,SAAS,EAAEA,SAAU;AACrBQ,QAAAA,GAAG,EAAEN,YAAa;AAClBO,QAA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,CAAAA,GAAAA,YAAY,CAAEN,aAAa,CAACS,KAAK,CAAC,cAAAE,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI;MAAE,GAAGF,KAAAA;KAAO,CAAA;IAEtE,MAAM;AACJjC,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,IAAI,GAAGtB,SAAS;MAChB,GAAGO,IAAAA;AACL,KAAC,GAAGuD,WAAW,CAAA;IAEf,OAAO;AACL,MAAA,GAAGvD,IAAI;AACP,MAAA,eAAe,EAAEwD,aAAQ,CAACrC,QAAQ,CAAC;AACnC,MAAA,cAAc,EAAEqC,aAAQ,CAACxC,QAAQ,CAAC;AAClC,MAAA,eAAe,EAAEwC,aAAQ,CAACvC,QAAQ,CAAC;AACnC,MAAA,eAAe,EAAEuC,aAAQ,CAACtC,QAAQ,CAAC;MACnCH,IAAI;MACJI,QAAQ;MACRH,QAAQ;MACRC,QAAQ;AACRC,MAAAA,QAAAA;KACD,CAAA;AACH,GAAC,EAAE,CAACkC,KAAK,EAAEH,YAAY,CAAC,CAAC,CAAA;AAEzB,EAAA,OAAOI,cAAc,CAAA;AACvB;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"FormControl.js","sources":["../../../../src/components/FormControl/FormControl.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef, useCallback, useMemo, useState } from 'react'\n\nimport classNames from 'classnames'\n\nimport useId from '~/src/hooks/useId'\nimport {\n type FormFieldProps,\n type FormFieldSize,\n type SizeProps,\n} from '~/src/types/props'\nimport { getFormFieldSizeClassName } from '~/src/types/props-helpers'\nimport { ariaAttr } from '~/src/utils/aria'\nimport { createContext } from '~/src/utils/react'\nimport { isNil } from '~/src/utils/type'\n\nimport { Stack } from '~/src/components/Stack'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlContextValue,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\n\nimport styles from './FormControl.module.scss'\n\nconst [FormControlContextProvider, useFormControlContext] = createContext<\n FormControlContextValue | undefined\n>(undefined)\n\nexport { useFormControlContext }\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container(\n { labelPosition, children, className, ...rest },\n forwardedRef\n) {\n switch (labelPosition) {\n case 'top':\n return (\n <Stack\n className={className}\n ref={forwardedRef}\n direction=\"vertical\"\n {...rest}\n >\n {children}\n </Stack>\n )\n\n case 'left':\n default:\n return (\n <div\n ref={forwardedRef as React.ForwardedRef<HTMLDivElement>}\n className={classNames(styles.Grid, className)}\n {...rest}\n >\n {children}\n </div>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(\n function FormControl(\n {\n children,\n id: idProp,\n labelPosition = 'top',\n size = 'm',\n hasError,\n required,\n readOnly,\n disabled,\n ...rest\n },\n forwardedRef\n ) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(\n null\n )\n const [errorMessageNode, setErrorMessageNode] =\n useState<HTMLElement | null>(null)\n\n const id = useId(idProp, 'field')\n const groupId = `${id}-group`\n const labelId = `${id}-label`\n const helperTextId = `${id}-help-text`\n const errorMessageId = `${id}-error-message`\n\n const fieldId = groupNode ? undefined : id\n\n const describerId = useMemo(() => {\n if (errorMessageNode) {\n return errorMessageId\n }\n if (helperTextNode) {\n return helperTextId\n }\n return undefined\n }, [errorMessageNode, helperTextNode, errorMessageId, helperTextId])\n\n const getGroupProps = useCallback<GroupPropsGetter>(\n (ownProps) => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }),\n [groupId, labelId, describerId]\n )\n\n const getLabelProps = useCallback<LabelPropsGetter>(\n (ownProps) => ({\n id: labelId,\n htmlFor: fieldId,\n className: classNames(\n styles.FormLabelWrapper,\n styles[`position-${labelPosition}`],\n getFormFieldSizeClassName(size)\n ),\n typo: labelPosition === 'top' ? '13' : '14',\n ...ownProps,\n }),\n [fieldId, labelId, labelPosition, size]\n )\n\n const getFieldProps = useCallback<FieldPropsGetter>(\n (ownProps) => ({\n id: fieldId,\n size,\n 'aria-describedby': groupNode ? undefined : describerId,\n hasError,\n required,\n readOnly,\n disabled,\n ...ownProps,\n }),\n [\n fieldId,\n describerId,\n size,\n hasError,\n required,\n readOnly,\n disabled,\n groupNode,\n ]\n )\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(\n (ownProps) => ({\n id: helperTextId,\n visible: isNil(hasError) || !hasError,\n ref: setHelperTextNode,\n className: classNames(\n styles.FormHelperTextWrapper,\n labelPosition === 'left' && styles['position-left']\n ),\n ...ownProps,\n }),\n [helperTextId, labelPosition, hasError]\n )\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(\n (ownProps) => ({\n id: errorMessageId,\n visible: isNil(hasError) || hasError,\n ref: setErrorMessageNode,\n className: classNames(\n styles.FormHelperTextWrapper,\n labelPosition === 'left' && styles['position-left']\n ),\n ...ownProps,\n }),\n [errorMessageId, labelPosition, hasError]\n )\n\n const contextValue = useMemo(\n () => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n hasError,\n required,\n readOnly,\n disabled,\n }),\n [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n hasError,\n required,\n readOnly,\n disabled,\n ]\n )\n\n if (!children) {\n return null\n }\n\n return (\n <FormControlContextProvider value={contextValue}>\n <Container\n {...rest}\n ref={forwardedRef}\n labelPosition={labelPosition}\n data-testid={FORM_CONTROL_TEST_ID}\n >\n {children}\n </Container>\n </FormControlContextProvider>\n )\n }\n)\n\nexport function useFormFieldProps<\n Props extends FormFieldProps & SizeProps<FormFieldSize>,\n>(props?: Props) {\n const contextValue = useFormControlContext()\n\n const formFieldProps = useMemo(() => {\n const mergedProps = contextValue?.getFieldProps(props) ?? { ...props }\n\n const {\n disabled = false,\n readOnly = false,\n required = false,\n hasError = false,\n size = undefined,\n ...rest\n } = mergedProps\n\n return {\n ...rest,\n 'aria-disabled': ariaAttr(disabled),\n 'aria-invalid': ariaAttr(hasError),\n 'aria-required': ariaAttr(required),\n 'aria-readonly': ariaAttr(readOnly),\n size,\n disabled,\n hasError,\n required,\n readOnly,\n }\n }, [props, contextValue])\n\n return formFieldProps as typeof formFieldProps & Props\n}\n"],"names":["FormControlContextProvider","useFormControlContext","createContext","undefined","FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","className","rest","forwardedRef","React","createElement","Stack","Object","assign","ref","direction","classNames","styles","Grid","FormControl","id","idProp","size","hasError","required","readOnly","disabled","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","describerId","useMemo","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","FormLabelWrapper","getFormFieldSizeClassName","typo","getFieldProps","getHelperTextProps","visible","isNil","FormHelperTextWrapper","getErrorMessageProps","contextValue","value","useFormFieldProps","props","formFieldProps","_contextValue$getFiel","mergedProps","ariaAttr"],"mappings":";;;;;;;;;;;;AAgCM,MAAA,CAACA,0BAA0B,EAAEC,qBAAqB,CAAC,GAAGC,mBAAa,CAEvEC,SAAS;AAIJ,MAAMC,oBAAoB,GAAG;AAEpC,MAAMC,SAAS,gBAAGC,gBAAU,CAA8B,SAASD,SAASA,CAC1E;EAAEE,aAAa;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC;AAAK,CAAC,EAC/CC,YAAY,EACZ;AACA,EAAA,QAAQJ,aAAa;AACn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AA,GAAI;MAAE,GAAGF;KAAO;IAEtE,MAAM;AACJjC,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,QAAQ,GAAG,KAAK;AAChBD,MAAAA,IAAI,GAAGtB,SAAS;MAChB,GAAGO;AACL,KAAC,GAAGuD,WAAW;IAEf,OAAO;AACL,MAAA,GAAGvD,IAAI;AACP,MAAA,eAAe,EAAEwD,aAAQ,CAACrC,QAAQ,CAAC;AACnC,MAAA,cAAc,EAAEqC,aAAQ,CAACxC,QAAQ,CAAC;AAClC,MAAA,eAAe,EAAEwC,aAAQ,CAACvC,QAAQ,CAAC;AACnC,MAAA,eAAe,EAAEuC,aAAQ,CAACtC,QAAQ,CAAC;MACnCH,IAAI;MACJI,QAAQ;MACRH,QAAQ;MACRC,QAAQ;AACRC,MAAAA;KACD;AACH,GAAC,EAAE,CAACkC,KAAK,EAAEH,YAAY,CAAC,CAAC;AAEzB,EAAA,OAAOI,cAAc;AACvB;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup.js","sources":["../../../../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/function'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Stack } from '~/src/components/Stack'\n\nimport { type FormGroupProps } from './FormGroup.types'\n\nconst FORM_GROUP_TEST_ID = 'bezier-form-group'\n\nexport const FormGroup = forwardRef<HTMLDivElement, FormGroupProps>(\n function FormGroup(\n { spacing = 6, direction = 'vertical', role = 'group', children, ...rest },\n forwardedRef\n ) {\n const contextValue = useFormControlContext()\n\n const { ref, ...ownProps } = contextValue?.getGroupProps(rest) ?? {\n ref: noop,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n return (\n <Stack\n data-testid={FORM_GROUP_TEST_ID}\n ref={mergedRef}\n wrap\n justify=\"start\"\n align=\"stretch\"\n spacing={spacing}\n direction={direction}\n role={role}\n {...ownProps}\n >\n {children}\n </Stack>\n )\n }\n)\n"],"names":["FORM_GROUP_TEST_ID","FormGroup","forwardRef","spacing","direction","role","children","rest","forwardedRef","_contextValue$getGrou","contextValue","useFormControlContext","ref","ownProps","getGroupProps","noop","mergedRef","useMergeRefs","React","createElement","Stack","Object","assign","wrap","justify","align"],"mappings":";;;;;;;;AAYA,MAAMA,kBAAkB,GAAG,mBAAmB
|
|
1
|
+
{"version":3,"file":"FormGroup.js","sources":["../../../../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/function'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Stack } from '~/src/components/Stack'\n\nimport { type FormGroupProps } from './FormGroup.types'\n\nconst FORM_GROUP_TEST_ID = 'bezier-form-group'\n\nexport const FormGroup = forwardRef<HTMLDivElement, FormGroupProps>(\n function FormGroup(\n { spacing = 6, direction = 'vertical', role = 'group', children, ...rest },\n forwardedRef\n ) {\n const contextValue = useFormControlContext()\n\n const { ref, ...ownProps } = contextValue?.getGroupProps(rest) ?? {\n ref: noop,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n return (\n <Stack\n data-testid={FORM_GROUP_TEST_ID}\n ref={mergedRef}\n wrap\n justify=\"start\"\n align=\"stretch\"\n spacing={spacing}\n direction={direction}\n role={role}\n {...ownProps}\n >\n {children}\n </Stack>\n )\n }\n)\n"],"names":["FORM_GROUP_TEST_ID","FormGroup","forwardRef","spacing","direction","role","children","rest","forwardedRef","_contextValue$getGrou","contextValue","useFormControlContext","ref","ownProps","getGroupProps","noop","mergedRef","useMergeRefs","React","createElement","Stack","Object","assign","wrap","justify","align"],"mappings":";;;;;;;;AAYA,MAAMA,kBAAkB,GAAG,mBAAmB;MAEjCC,SAAS,gBAAGC,gBAAU,CACjC,SAASD,SAASA,CAChB;AAAEE,EAAAA,OAAO,GAAG,CAAC;AAAEC,EAAAA,SAAS,GAAG,UAAU;AAAEC,EAAAA,IAAI,GAAG,OAAO;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EAC1EC,YAAY,EACZ;AAAA,EAAA,IAAAC,qBAAA;AACA,EAAA,MAAMC,YAAY,GAAGC,iCAAqB,EAAE;EAE5C,MAAM;IAAEC,GAAG;IAAE,GAAGC;AAAS,GAAC,IAAAJ,qBAAA,GAAGC,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAZA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,YAAY,CAAEI,aAAa,CAACP,IAAI,CAAC,cAAAE,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI;AAChEG,IAAAA,GAAG,EAAEG,cAAI;IACT,GAAGR;GACJ;AAED,EAAA,MAAMS,SAAS,GAAGC,oBAAY,CAACL,GAAG,EAAEJ,YAAY,CAAC;EAEjD,oBACEU,KAAA,CAAAC,aAAA,CAACC,WAAK,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACJ,IAAA,aAAA,EAAatB,kBAAmB;AAChCY,IAAAA,GAAG,EAAEI,SAAU;IACfO,IAAI,EAAA,IAAA;AACJC,IAAAA,OAAO,EAAC,OAAO;AACfC,IAAAA,KAAK,EAAC,SAAS;AACftB,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,IAAI,EAAEA;GACFQ,EAAAA,QAAQ,CAEXP,EAAAA,QACI,CAAC;AAEZ,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHelperText.js","sources":["../../../../src/components/FormHelperText/FormHelperText.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/function'\nimport { isEmpty } from '~/src/utils/type'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Text } from '~/src/components/Text'\n\nimport type {\n BaseHelperTextProps,\n FormErrorMessageProps,\n FormHelperTextProps,\n} from './FormHelperText.types'\n\nimport styles from './FormHelperText.module.scss'\n\nexport const FORM_HELPER_TEXT_TEST_ID = 'bezier-form-helper-text'\nexport const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-form-error-message'\n\nconst BaseHelperText = forwardRef<HTMLSpanElement, BaseHelperTextProps>(\n function BaseHelperText(props, forwardedRef) {\n const { type, typo = '13', children, className, ...rest } = props\n\n const contextValue = useFormControlContext()\n const getProps =\n type === 'info'\n ? contextValue?.getHelperTextProps\n : contextValue?.getErrorMessageProps\n\n const {\n visible,\n ref,\n className: formControlClassName,\n ...ownProps\n } = getProps?.(rest) ?? {\n visible: true,\n ref: noop,\n className: undefined,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n if (isEmpty(children) || !visible) {\n return null\n }\n\n return (\n <Text\n ref={mergedRef}\n as=\"p\"\n className={classNames(\n styles.FormHelperText,\n formControlClassName,\n className\n )}\n typo={typo}\n align=\"left\"\n {...ownProps}\n >\n {children}\n </Text>\n )\n }\n)\n\n/**\n * `FormHelperText` is a component to show the description of the input element.\n * `FormControl` component can handle its layout by `position` props.\n * @example\n * ```tsx\n * <FormControl position=\"top\">\n * <FormLabel>\n * Password\n * </FormLabel>\n * <TextField />\n * <FormHelperText>\n * Please use at least 6 characters\n * </FormHelperText>\n * </FormControl>\n * ```\n */\nexport const FormHelperText = forwardRef<HTMLSpanElement, FormHelperTextProps>(\n function FormHelperText(props, forwardedRef) {\n const { color = 'txt-black-dark', children, ...rest } = props\n\n return (\n <BaseHelperText\n type=\"info\"\n ref={forwardedRef}\n color={color}\n data-testid={FORM_HELPER_TEXT_TEST_ID}\n {...rest}\n >\n {children}\n </BaseHelperText>\n )\n }\n)\n\n/**\n * `FormErrorMessage` is a component to show error message when form values are invalid.\n * It should be used with `FormControl` component.\n * @example\n * ```tsx\n * <FormControl>\n * <FormLabel>\n * Password\n * </FormLabel>\n * <TextField />\n * <FormErrorMessage>\n * Password should be at least 6 characters\n * </FormErrorMessage>\n * </FormControl>\n * ```\n */\nexport const FormErrorMessage = forwardRef<\n HTMLSpanElement,\n FormErrorMessageProps\n>(function FormErrorMessage(props, forwardedRef) {\n const { color = 'bgtxt-orange-normal', children, ...rest } = props\n\n return (\n <BaseHelperText\n aria-live=\"polite\"\n type=\"error\"\n ref={forwardedRef}\n color={color}\n data-testid={FORM_ERROR_MESSAGE_TEST_ID}\n {...rest}\n >\n {children}\n </BaseHelperText>\n )\n})\n"],"names":["FORM_HELPER_TEXT_TEST_ID","FORM_ERROR_MESSAGE_TEST_ID","BaseHelperText","forwardRef","props","forwardedRef","_getProps","type","typo","children","className","rest","contextValue","useFormControlContext","getProps","getHelperTextProps","getErrorMessageProps","visible","ref","formControlClassName","ownProps","noop","undefined","mergedRef","useMergeRefs","isEmpty","React","createElement","Text","Object","assign","as","classNames","styles","FormHelperText","align","color","FormErrorMessage"],"mappings":";;;;;;;;;;;AAqBO,MAAMA,wBAAwB,GAAG
|
|
1
|
+
{"version":3,"file":"FormHelperText.js","sources":["../../../../src/components/FormHelperText/FormHelperText.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/function'\nimport { isEmpty } from '~/src/utils/type'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Text } from '~/src/components/Text'\n\nimport type {\n BaseHelperTextProps,\n FormErrorMessageProps,\n FormHelperTextProps,\n} from './FormHelperText.types'\n\nimport styles from './FormHelperText.module.scss'\n\nexport const FORM_HELPER_TEXT_TEST_ID = 'bezier-form-helper-text'\nexport const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-form-error-message'\n\nconst BaseHelperText = forwardRef<HTMLSpanElement, BaseHelperTextProps>(\n function BaseHelperText(props, forwardedRef) {\n const { type, typo = '13', children, className, ...rest } = props\n\n const contextValue = useFormControlContext()\n const getProps =\n type === 'info'\n ? contextValue?.getHelperTextProps\n : contextValue?.getErrorMessageProps\n\n const {\n visible,\n ref,\n className: formControlClassName,\n ...ownProps\n } = getProps?.(rest) ?? {\n visible: true,\n ref: noop,\n className: undefined,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n if (isEmpty(children) || !visible) {\n return null\n }\n\n return (\n <Text\n ref={mergedRef}\n as=\"p\"\n className={classNames(\n styles.FormHelperText,\n formControlClassName,\n className\n )}\n typo={typo}\n align=\"left\"\n {...ownProps}\n >\n {children}\n </Text>\n )\n }\n)\n\n/**\n * `FormHelperText` is a component to show the description of the input element.\n * `FormControl` component can handle its layout by `position` props.\n * @example\n * ```tsx\n * <FormControl position=\"top\">\n * <FormLabel>\n * Password\n * </FormLabel>\n * <TextField />\n * <FormHelperText>\n * Please use at least 6 characters\n * </FormHelperText>\n * </FormControl>\n * ```\n */\nexport const FormHelperText = forwardRef<HTMLSpanElement, FormHelperTextProps>(\n function FormHelperText(props, forwardedRef) {\n const { color = 'txt-black-dark', children, ...rest } = props\n\n return (\n <BaseHelperText\n type=\"info\"\n ref={forwardedRef}\n color={color}\n data-testid={FORM_HELPER_TEXT_TEST_ID}\n {...rest}\n >\n {children}\n </BaseHelperText>\n )\n }\n)\n\n/**\n * `FormErrorMessage` is a component to show error message when form values are invalid.\n * It should be used with `FormControl` component.\n * @example\n * ```tsx\n * <FormControl>\n * <FormLabel>\n * Password\n * </FormLabel>\n * <TextField />\n * <FormErrorMessage>\n * Password should be at least 6 characters\n * </FormErrorMessage>\n * </FormControl>\n * ```\n */\nexport const FormErrorMessage = forwardRef<\n HTMLSpanElement,\n FormErrorMessageProps\n>(function FormErrorMessage(props, forwardedRef) {\n const { color = 'bgtxt-orange-normal', children, ...rest } = props\n\n return (\n <BaseHelperText\n aria-live=\"polite\"\n type=\"error\"\n ref={forwardedRef}\n color={color}\n data-testid={FORM_ERROR_MESSAGE_TEST_ID}\n {...rest}\n >\n {children}\n </BaseHelperText>\n )\n})\n"],"names":["FORM_HELPER_TEXT_TEST_ID","FORM_ERROR_MESSAGE_TEST_ID","BaseHelperText","forwardRef","props","forwardedRef","_getProps","type","typo","children","className","rest","contextValue","useFormControlContext","getProps","getHelperTextProps","getErrorMessageProps","visible","ref","formControlClassName","ownProps","noop","undefined","mergedRef","useMergeRefs","isEmpty","React","createElement","Text","Object","assign","as","classNames","styles","FormHelperText","align","color","FormErrorMessage"],"mappings":";;;;;;;;;;;AAqBO,MAAMA,wBAAwB,GAAG;AACjC,MAAMC,0BAA0B,GAAG;AAE1C,MAAMC,cAAc,gBAAGC,gBAAU,CAC/B,SAASD,cAAcA,CAACE,KAAK,EAAEC,YAAY,EAAE;AAAA,EAAA,IAAAC,SAAA;EAC3C,MAAM;UAAEC,MAAI;AAAEC,IAAAA,IAAI,GAAG,IAAI;IAAEC,QAAQ;IAAEC,SAAS;IAAE,GAAGC;AAAK,GAAC,GAAGP,KAAK;AAEjE,EAAA,MAAMQ,YAAY,GAAGC,iCAAqB,EAAE;EAC5C,MAAMC,QAAQ,GACZP,MAAI,KAAK,MAAM,GACXK,YAAY,aAAZA,YAAY,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAZA,YAAY,CAAEG,kBAAkB,GAChCH,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAZA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,YAAY,CAAEI,oBAAoB;EAExC,MAAM;IACJC,OAAO;IACPC,GAAG;AACHR,IAAAA,SAAS,EAAES,oBAAoB;IAC/B,GAAGC;AACL,GAAC,GAAAd,CAAAA,SAAA,GAAGQ,QAAQ,aAARA,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAARA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AAAA,QACa,CAAC;AAErB,CACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM4B,gBAAgB,gBAAGlC,gBAAU,CAGxC,SAASkC,gBAAgBA,CAACjC,KAAK,EAAEC,YAAY,EAAE;EAC/C,MAAM;AAAE+B,IAAAA,KAAK,GAAG,qBAAqB;IAAE3B,QAAQ;IAAE,GAAGE;AAAK,GAAC,GAAGP,KAAK;EAElE,oBACEsB,KAAA,CAAAC,aAAA,CAACzB,cAAc,EAAA2B,MAAA,CAAAC,MAAA,CAAA;AACb,IAAA,WAAA,EAAU,QAAQ;AAClBvB,IAAAA,IAAI,EAAC,OAAO;AACZW,IAAAA,GAAG,EAAEb,YAAa;AAClB+B,IAAAA,KAAK,EAAEA,KAAM;IACb,aAAanC,EAAAA;GACTU,EAAAA,IAAI,CAEPF,EAAAA,QACa,CAAC;AAErB,CAAC;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","sources":["../../../../src/components/FormLabel/FormLabel.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport { isEmpty } from '~/src/utils/type'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Help } from '~/src/components/Help'\nimport { HELP_DISPLAY_NAME } from '~/src/components/Help/Help'\nimport { LegacyHStack, LegacyStackItem } from '~/src/components/LegacyStack'\nimport { Text } from '~/src/components/Text'\n\nimport { type FormLabelProps } from './FormLabel.types'\n\nimport styles from './FormLabel.module.scss'\n\nexport const FORM_LABEL_TEST_ID = 'bezier-form-label'\n\n/**\n * `FormLabel` is a component to show label.\n * `FormControl` component can handle its layout by `position` props.\n * @example\n * ```tsx\n * <FormControl position=\"top\">\n * <FormLabel>\n * Name\n * </FormLabel>\n * <TextField />\n * </FormControl>\n * ```\n */\nexport const FormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n function FormLabel(props, forwardedRef) {\n const {\n help,\n bold = true,\n color = 'txt-black-darkest',\n className,\n children,\n ...rest\n } = props\n\n const contextValue = useFormControlContext()\n const { className: formControlClassName, ...ownProps } =\n contextValue?.getLabelProps(rest) ?? {\n typo: '13',\n className: undefined,\n ...rest,\n }\n\n const HelpComponent = (() => {\n if (isEmpty(help)) {\n return null\n }\n\n if (React.isValidElement(help)) {\n // FIXME(@bora): string, JSXElementCostructor 타입에 displayName 속성이 존재하지 않음, 임시로 any 타입으로 설정\n const { displayName } = help?.type as any\n if (displayName === HELP_DISPLAY_NAME) {\n return help\n }\n }\n\n return <Help>{help}</Help>\n })()\n\n const LabelComponent = (\n <Text\n className={classNames(\n styles.LabelText,\n !HelpComponent && formControlClassName,\n className\n )}\n ref={forwardedRef}\n as=\"label\"\n align=\"left\"\n bold={bold}\n color={color}\n data-testid={FORM_LABEL_TEST_ID}\n {...ownProps}\n >\n {children}\n </Text>\n )\n\n if (isEmpty(children)) {\n return null\n }\n\n return !HelpComponent ? (\n LabelComponent\n ) : (\n <LegacyHStack\n align=\"center\"\n spacing={6}\n className={formControlClassName}\n >\n <LegacyStackItem\n shrink\n weight={1}\n >\n {LabelComponent}\n </LegacyStackItem>\n <LegacyStackItem>{HelpComponent}</LegacyStackItem>\n </LegacyHStack>\n )\n }\n)\n"],"names":["FORM_LABEL_TEST_ID","FormLabel","forwardRef","props","forwardedRef","_contextValue$getLabe","help","bold","color","className","children","rest","contextValue","useFormControlContext","formControlClassName","ownProps","getLabelProps","typo","undefined","HelpComponent","isEmpty","React","isValidElement","displayName","type","HELP_DISPLAY_NAME","createElement","Help","LabelComponent","Text","Object","assign","classNames","styles","LabelText","ref","as","align","LegacyHStack","spacing","LegacyStackItem","shrink","weight"],"mappings":";;;;;;;;;;;;AAkBO,MAAMA,kBAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sources":["../../../../src/components/FormLabel/FormLabel.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport { isEmpty } from '~/src/utils/type'\n\nimport { useFormControlContext } from '~/src/components/FormControl'\nimport { Help } from '~/src/components/Help'\nimport { HELP_DISPLAY_NAME } from '~/src/components/Help/Help'\nimport { LegacyHStack, LegacyStackItem } from '~/src/components/LegacyStack'\nimport { Text } from '~/src/components/Text'\n\nimport { type FormLabelProps } from './FormLabel.types'\n\nimport styles from './FormLabel.module.scss'\n\nexport const FORM_LABEL_TEST_ID = 'bezier-form-label'\n\n/**\n * `FormLabel` is a component to show label.\n * `FormControl` component can handle its layout by `position` props.\n * @example\n * ```tsx\n * <FormControl position=\"top\">\n * <FormLabel>\n * Name\n * </FormLabel>\n * <TextField />\n * </FormControl>\n * ```\n */\nexport const FormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n function FormLabel(props, forwardedRef) {\n const {\n help,\n bold = true,\n color = 'txt-black-darkest',\n className,\n children,\n ...rest\n } = props\n\n const contextValue = useFormControlContext()\n const { className: formControlClassName, ...ownProps } =\n contextValue?.getLabelProps(rest) ?? {\n typo: '13',\n className: undefined,\n ...rest,\n }\n\n const HelpComponent = (() => {\n if (isEmpty(help)) {\n return null\n }\n\n if (React.isValidElement(help)) {\n // FIXME(@bora): string, JSXElementCostructor 타입에 displayName 속성이 존재하지 않음, 임시로 any 타입으로 설정\n const { displayName } = help?.type as any\n if (displayName === HELP_DISPLAY_NAME) {\n return help\n }\n }\n\n return <Help>{help}</Help>\n })()\n\n const LabelComponent = (\n <Text\n className={classNames(\n styles.LabelText,\n !HelpComponent && formControlClassName,\n className\n )}\n ref={forwardedRef}\n as=\"label\"\n align=\"left\"\n bold={bold}\n color={color}\n data-testid={FORM_LABEL_TEST_ID}\n {...ownProps}\n >\n {children}\n </Text>\n )\n\n if (isEmpty(children)) {\n return null\n }\n\n return !HelpComponent ? (\n LabelComponent\n ) : (\n <LegacyHStack\n align=\"center\"\n spacing={6}\n className={formControlClassName}\n >\n <LegacyStackItem\n shrink\n weight={1}\n >\n {LabelComponent}\n </LegacyStackItem>\n <LegacyStackItem>{HelpComponent}</LegacyStackItem>\n </LegacyHStack>\n )\n }\n)\n"],"names":["FORM_LABEL_TEST_ID","FormLabel","forwardRef","props","forwardedRef","_contextValue$getLabe","help","bold","color","className","children","rest","contextValue","useFormControlContext","formControlClassName","ownProps","getLabelProps","typo","undefined","HelpComponent","isEmpty","React","isValidElement","displayName","type","HELP_DISPLAY_NAME","createElement","Help","LabelComponent","Text","Object","assign","classNames","styles","LabelText","ref","as","align","LegacyHStack","spacing","LegacyStackItem","shrink","weight"],"mappings":";;;;;;;;;;;;AAkBO,MAAMA,kBAAkB,GAAG;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,SAAS,gBAAGC,gBAAU,CACjC,SAASD,SAASA,CAACE,KAAK,EAAEC,YAAY,EAAE;AAAA,EAAA,IAAAC,qBAAA;EACtC,MAAM;IACJC,IAAI;AACJC,IAAAA,IAAI,GAAG,IAAI;AACXC,IAAAA,KAAK,GAAG,mBAAmB;IAC3BC,SAAS;IACTC,QAAQ;IACR,GAAGC;AACL,GAAC,GAAGR,KAAK;AAET,EAAA,MAAMS,YAAY,GAAGC,iCAAqB,EAAE;EAC5C,MAAM;AAAEJ,IAAAA,SAAS,EAAEK,oBAAoB;IAAE,GAAGC;AAAS,GAAC,IAAAV,qBAAA,GACpDO,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAZA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,YAAY,CAAEI,aAAa,CAACL,IAAI,CAAC,cAAAN,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI;AACnCY,IAAAA,IAAI,EAAE,IAAI;AACVR,IAAAA,SAAS,EAAES,SAAS;IACpB,GAAGP;GACJ;EAEH,MAAMQ,aAAa,GAAG,CAAC,MAAM;AAC3B,IAAA,IAAIC,YAAO,CAACd,IAAI,CAAC,EAAE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EPd,EAAAA,cACc,CAAC,eAClBP,KAAA,CAAAK,aAAA,CAACc,+BAAe,EAAA,IAAA,EAAErB,aAA+B,CACrC,CACf;AACH,CACF;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Help.js","sources":["../../../../src/components/Help/Help.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { HelpFilledIcon } from '@channel.io/bezier-icons'\n\nimport { isEmpty } from '~/src/utils/type'\n\nimport { Icon } from '~/src/components/Icon'\nimport { Tooltip } from '~/src/components/Tooltip'\n\nimport { type HelpProps } from './Help.types'\n\nimport styles from './Help.module.scss'\n\nexport const HELP_TEST_ID = 'bezier-help'\nexport const HELP_DISPLAY_NAME = 'Help'\n\nexport const Help = forwardRef<HTMLDivElement, HelpProps>(function Help(\n { children, ...rest },\n forwardedRef\n) {\n if (isEmpty(children)) {\n return null\n }\n\n return (\n <Tooltip\n {...rest}\n ref={forwardedRef}\n content={children}\n >\n <div className={styles.Help}>\n <Icon\n className={styles.Icon}\n source={HelpFilledIcon}\n size=\"xs\"\n color=\"txt-black-dark\"\n data-testid={HELP_TEST_ID}\n />\n </div>\n </Tooltip>\n )\n})\n\nHelp.displayName = HELP_DISPLAY_NAME\n"],"names":["HELP_TEST_ID","HELP_DISPLAY_NAME","Help","forwardRef","children","rest","forwardedRef","isEmpty","React","createElement","Tooltip","Object","assign","ref","content","className","styles","Icon","source","HelpFilledIcon","size","color","displayName"],"mappings":";;;;;;;;;AAeO,MAAMA,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"Help.js","sources":["../../../../src/components/Help/Help.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { HelpFilledIcon } from '@channel.io/bezier-icons'\n\nimport { isEmpty } from '~/src/utils/type'\n\nimport { Icon } from '~/src/components/Icon'\nimport { Tooltip } from '~/src/components/Tooltip'\n\nimport { type HelpProps } from './Help.types'\n\nimport styles from './Help.module.scss'\n\nexport const HELP_TEST_ID = 'bezier-help'\nexport const HELP_DISPLAY_NAME = 'Help'\n\nexport const Help = forwardRef<HTMLDivElement, HelpProps>(function Help(\n { children, ...rest },\n forwardedRef\n) {\n if (isEmpty(children)) {\n return null\n }\n\n return (\n <Tooltip\n {...rest}\n ref={forwardedRef}\n content={children}\n >\n <div className={styles.Help}>\n <Icon\n className={styles.Icon}\n source={HelpFilledIcon}\n size=\"xs\"\n color=\"txt-black-dark\"\n data-testid={HELP_TEST_ID}\n />\n </div>\n </Tooltip>\n )\n})\n\nHelp.displayName = HELP_DISPLAY_NAME\n"],"names":["HELP_TEST_ID","HELP_DISPLAY_NAME","Help","forwardRef","children","rest","forwardedRef","isEmpty","React","createElement","Tooltip","Object","assign","ref","content","className","styles","Icon","source","HelpFilledIcon","size","color","displayName"],"mappings":";;;;;;;;;AAeO,MAAMA,YAAY,GAAG;AACrB,MAAMC,iBAAiB,GAAG;MAEpBC,IAAI,gBAAGC,gBAAU,CAA4B,SAASD,IAAIA,CACrE;EAAEE,QAAQ;EAAE,GAAGC;AAAK,CAAC,EACrBC,YAAY,EACZ;AACA,EAAA,IAAIC,YAAO,CAACH,QAAQ,CAAC,EAAE;AACrB,IAAA,OAAO,IAAI;AACb;EAEA,oBACEI,KAAA,CAAAC,aAAA,CAACC,eAAO,EAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,EACFP,IAAI,EAAA;AACRQ,IAAAA,GAAG,EAAEP,YAAa;AAClBQ,IAAAA,OAAO,EAAEV;GAETI,CAAAA,eAAAA,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKM,SAAS,EAAEC,mBAAM,CAACd;AAAK,GAAA,eAC1BM,KAAA,CAAAC,aAAA,CAACQ,SAAI,EAAA;IACHF,SAAS,EAAEC,mBAAM,CAACC,IAAK;AACvBC,IAAAA,MAAM,EAAEC,0BAAe;AACvBC,IAAAA,IAAI,EAAC,IAAI;AACTC,IAAAA,KAAK,EAAC,gBAAgB;IACtB,aAAarB,EAAAA;GACd,CACE,CACE,CAAC;AAEd,CAAC;AAEDE,IAAI,CAACoB,WAAW,GAAGrB,iBAAiB;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef, memo } from 'react'\n\nimport classNames from 'classnames'\n\nimport { getMarginStyles, splitByMarginProps } from '~/src/types/props-helpers'\nimport { tokenCssVar } from '~/src/utils/style'\n\nimport { type IconProps } from './Icon.types'\n\nimport styles from './Icon.module.scss'\n\nexport const ICON_TEST_ID = 'bezier-icon'\n\nexport const Icon = memo(\n forwardRef<SVGSVGElement, IconProps>(function Icon(props, forwardedRef) {\n const [marginProps, marginRest] = splitByMarginProps(props)\n const marginStyles = getMarginStyles(marginProps)\n\n const {\n className,\n size = 'm',\n color,\n source: SourceElement,\n style,\n ...rest\n } = marginRest\n\n return (\n <SourceElement\n ref={forwardedRef}\n style={\n {\n '--b-icon-color': tokenCssVar(color),\n ...marginStyles.style,\n ...style,\n } as React.CSSProperties\n }\n className={classNames(\n styles.Icon,\n styles[`size-${size}`],\n marginStyles.className,\n className\n )}\n data-testid={ICON_TEST_ID}\n {...rest}\n />\n )\n })\n)\n"],"names":["ICON_TEST_ID","Icon","memo","forwardRef","props","forwardedRef","marginProps","marginRest","splitByMarginProps","marginStyles","getMarginStyles","className","size","color","source","SourceElement","style","rest","React","createElement","Object","assign","ref","tokenCssVar","classNames","styles"],"mappings":";;;;;;;;AAaO,MAAMA,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef, memo } from 'react'\n\nimport classNames from 'classnames'\n\nimport { getMarginStyles, splitByMarginProps } from '~/src/types/props-helpers'\nimport { tokenCssVar } from '~/src/utils/style'\n\nimport { type IconProps } from './Icon.types'\n\nimport styles from './Icon.module.scss'\n\nexport const ICON_TEST_ID = 'bezier-icon'\n\nexport const Icon = memo(\n forwardRef<SVGSVGElement, IconProps>(function Icon(props, forwardedRef) {\n const [marginProps, marginRest] = splitByMarginProps(props)\n const marginStyles = getMarginStyles(marginProps)\n\n const {\n className,\n size = 'm',\n color,\n source: SourceElement,\n style,\n ...rest\n } = marginRest\n\n return (\n <SourceElement\n ref={forwardedRef}\n style={\n {\n '--b-icon-color': tokenCssVar(color),\n ...marginStyles.style,\n ...style,\n } as React.CSSProperties\n }\n className={classNames(\n styles.Icon,\n styles[`size-${size}`],\n marginStyles.className,\n className\n )}\n data-testid={ICON_TEST_ID}\n {...rest}\n />\n )\n })\n)\n"],"names":["ICON_TEST_ID","Icon","memo","forwardRef","props","forwardedRef","marginProps","marginRest","splitByMarginProps","marginStyles","getMarginStyles","className","size","color","source","SourceElement","style","rest","React","createElement","Object","assign","ref","tokenCssVar","classNames","styles"],"mappings":";;;;;;;;AAaO,MAAMA,YAAY,GAAG;AAEfC,MAAAA,IAAI,gBAAGC,UAAI,cACtBC,gBAAU,CAA2B,SAASF,IAAIA,CAACG,KAAK,EAAEC,YAAY,EAAE;EACtE,MAAM,CAACC,WAAW,EAAEC,UAAU,CAAC,GAAGC,+BAAkB,CAACJ,KAAK,CAAC;AAC3D,EAAA,MAAMK,YAAY,GAAGC,4BAAe,CAACJ,WAAW,CAAC;EAEjD,MAAM;IACJK,SAAS;AACTC,IAAAA,IAAI,GAAG,GAAG;IACVC,KAAK;AACLC,IAAAA,MAAM,EAAEC,aAAa;WACrBC,OAAK;IACL,GAAGC;AACL,GAAC,GAAGV,UAAU;EAEd,oBACEW,KAAA,CAAAC,aAAA,CAACJ,aAAa,EAAAK,MAAA,CAAAC,MAAA,CAAA;AACZC,IAAAA,GAAG,EAAEjB,YAAa;AAClBW,IAAAA,KAAK,EACH;AACE,MAAA,gBAAgB,EAAEO,iBAAW,CAACV,KAAK,CAAC;MACpC,GAAGJ,YAAY,CAACO,KAAK;MACrB,GAAGA;KAEN;AACDL,IAAAA,SAAS,EAAEa,aAAU,CACnBC,mBAAM,CAACxB,IAAI,EACXwB,mBAAM,CAAC,QAAQb,IAAI,CAAA,CAAE,CAAC,EACtBH,YAAY,CAACE,SAAS,EACtBA,SACF,CAAE;IACF,aAAaX,EAAAA;GACTiB,EAAAA,IAAI,CACT,CAAC;AAEN,CAAC,CACH;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueItem.js","sources":["../../../../src/components/KeyValueItem/KeyValueItem.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { isBezierIcon } from '@channel.io/bezier-icons'\nimport classNames from 'classnames'\n\nimport { isArray, isEmpty, isNil } from '~/src/utils/type'\n\nimport { Button } from '~/src/components/Button'\nimport { Icon } from '~/src/components/Icon'\nimport { Text, type TextProps } from '~/src/components/Text'\nimport { Tooltip } from '~/src/components/Tooltip'\n\nimport {\n type ItemActionWithIcon,\n type KeyValueItemAction,\n type KeyValueItemProps,\n} from './KeyValueItem.types'\n\nimport styles from './KeyValueItem.module.scss'\n\nexport const KEY_VALUE_ITEM_TEST_ID = 'bezier-key-value-item'\nexport const KEY_VALUE_ITEM_KEY_ICON_TEST_ID = 'bezier-key-value-item-key-icon'\n\nfunction KeyItem({\n icon,\n children,\n}: {\n icon: KeyValueItemProps['keyIcon']\n children: React.ReactNode\n}) {\n return (\n <div className={styles.KeyItem}>\n {isBezierIcon(icon) ? (\n <Icon\n size=\"s\"\n source={icon}\n color=\"txt-black-dark\"\n data-testid={KEY_VALUE_ITEM_KEY_ICON_TEST_ID}\n />\n ) : (\n icon\n )}\n\n <Text\n className={styles.KeyText}\n bold\n typo=\"12\"\n color=\"txt-black-dark\"\n truncated\n >\n {children}\n </Text>\n </div>\n )\n}\n\nfunction ValueItem({ truncated, children }: TextProps) {\n return (\n <Text\n className={styles.ValueItem}\n typo=\"14\"\n truncated={truncated}\n >\n {children}\n </Text>\n )\n}\n\nfunction isItemActionWithIcon(args: object): args is ItemActionWithIcon {\n return 'icon' in args\n}\n\nfunction ActionButton({ children }: { children: KeyValueItemAction }) {\n if (!isItemActionWithIcon(children)) {\n return children\n }\n\n const withTooltip = !isEmpty(children.tooltip)\n const Wrapper = withTooltip ? Tooltip : React.Fragment\n\n return (\n <Wrapper {...(withTooltip ? { content: children.tooltip } : {})}>\n <Button\n size=\"xs\"\n leftContent={children.icon}\n styleVariant=\"tertiary\"\n colorVariant=\"monochrome-light\"\n onClick={children.onClick}\n />\n </Wrapper>\n )\n}\n\nfunction ActionButtonGroup({\n children,\n}: {\n children: KeyValueItemProps['actions']\n}) {\n if (isNil(children) || isEmpty(children)) {\n return null\n }\n\n return (\n <div className={styles.ItemAction}>\n {isArray(children) ? (\n children.map((action, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <ActionButton key={index}>{action}</ActionButton>\n ))\n ) : (\n <ActionButton>{children}</ActionButton>\n )}\n </div>\n )\n}\n\nexport const KeyValueItem = forwardRef<HTMLDivElement, KeyValueItemProps>(\n function KeyValueListItem(\n {\n className,\n keyIcon,\n keyContent,\n actions,\n children,\n onClickKey,\n onClickValue,\n ...rest\n },\n forwardedRef\n ) {\n return (\n <div\n className={classNames(\n styles.KeyValueItem,\n styles.singleline,\n className\n )}\n ref={forwardedRef}\n data-testid={KEY_VALUE_ITEM_TEST_ID}\n {...rest}\n >\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.KeyItemWrapper,\n onClickKey && styles.clickable\n )}\n onClick={onClickKey}\n >\n <KeyItem icon={keyIcon}>{keyContent}</KeyItem>\n </div>\n\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.ValueItemWrapper,\n onClickValue && styles.clickable\n )}\n onClick={onClickValue}\n >\n <ValueItem truncated>{children}</ValueItem>\n\n <ActionButtonGroup>{actions}</ActionButtonGroup>\n </div>\n </div>\n )\n }\n)\n\nexport const KeyValueMultiLineItem = forwardRef<\n HTMLDivElement,\n KeyValueItemProps\n>(function KeyValueMultiLineListItem(\n {\n children,\n className,\n keyIcon,\n keyContent,\n actions,\n onClickKey,\n onClickValue,\n ...rest\n },\n forwardedRef\n) {\n return (\n <div\n className={classNames(styles.KeyValueItem, styles.multiline, className)}\n ref={forwardedRef}\n data-testid={KEY_VALUE_ITEM_TEST_ID}\n {...rest}\n >\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.KeyItemWrapper,\n onClickKey && styles.clickable\n )}\n onClick={onClickKey}\n >\n <KeyItem icon={keyIcon}>{keyContent}</KeyItem>\n\n <ActionButtonGroup>{actions}</ActionButtonGroup>\n </div>\n\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.ValueItemWrapper,\n onClickValue && styles.clickable\n )}\n onClick={onClickValue}\n >\n <ValueItem>{children}</ValueItem>\n </div>\n </div>\n )\n})\n"],"names":["KEY_VALUE_ITEM_TEST_ID","KEY_VALUE_ITEM_KEY_ICON_TEST_ID","KeyItem","icon","children","React","createElement","className","styles","isBezierIcon","Icon","size","source","color","Text","KeyText","bold","typo","truncated","ValueItem","isItemActionWithIcon","args","ActionButton","withTooltip","isEmpty","tooltip","Wrapper","Tooltip","Fragment","content","Button","leftContent","styleVariant","colorVariant","onClick","ActionButtonGroup","isNil","ItemAction","isArray","map","action","index","key","KeyValueItem","forwardRef","KeyValueListItem","keyIcon","keyContent","actions","onClickKey","onClickValue","rest","forwardedRef","Object","assign","classNames","singleline","ref","ItemWrapper","KeyItemWrapper","clickable","ValueItemWrapper","KeyValueMultiLineItem","KeyValueMultiLineListItem","multiline"],"mappings":";;;;;;;;;;;;AAsBO,MAAMA,sBAAsB,GAAG,wBAAuB;AACtD,MAAMC,+BAA+B,GAAG,iCAAgC;AAE/E,SAASC,OAAOA,CAAC;EACfC,IAAI;AACJC,EAAAA,QAAAA;AAIF,CAAC,EAAE;EACD,oBACEC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKC,SAAS,EAAEC,2BAAM,CAACN,OAAAA;GACpBO,EAAAA,wBAAY,CAACN,IAAI,CAAC,gBACjBE,KAAA,CAAAC,aAAA,CAACI,SAAI,EAAA;AACHC,IAAAA,IAAI,EAAC,GAAG;AACRC,IAAAA,MAAM,EAAET,IAAK;AACbU,IAAAA,KAAK,EAAC,gBAAgB;IACtB,aAAaZ,EAAAA,+BAAAA;GACd,CAAC,GAEFE,IACD,eAEDE,KAAA,CAAAC,aAAA,CAACQ,SAAI,EAAA;IACHP,SAAS,EAAEC,2BAAM,CAACO,OAAQ;IAC1BC,IAAI,EAAA,IAAA;AACJC,IAAAA,IAAI,EAAC,IAAI;AACTJ,IAAAA,KAAK,EAAC,gBAAgB;IACtBK,SAAS,EAAA,IAAA;GAERd,EAAAA,QACG,CACH,CAAC,CAAA;AAEV,CAAA;AAEA,SAASe,SAASA,CAAC;EAAED,SAAS;AAAEd,EAAAA,QAAAA;AAAoB,CAAC,EAAE;AACrD,EAAA,oBACEC,KAAA,CAAAC,aAAA,CAACQ,SA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ACC,IAAAA,IAAI,EAAE2C,OAAAA;AAAQ,GAAA,EAAEC,UAAoB,CAAC,eAE9C1C,KAAA,CAAAC,aAAA,CAAC6B,iBAAiB,EAAA,IAAA,EAAEa,OAA2B,CAC5C,CAAC,eAON3C,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAEgD,aAAU,CACnB/C,2BAAM,CAACkD,WAAW,EAClBlD,2BAAM,CAACqD,gBAAgB,EACvBX,YAAY,IAAI1C,2BAAM,CAACoD,SACzB,CAAE;AACF1B,IAAAA,OAAO,EAAEgB,YAAAA;GAET7C,eAAAA,KAAA,CAAAC,aAAA,CAACa,SAAS,EAAEf,IAAAA,EAAAA,QAAoB,CAC7B,CACF,CAAC,CAAA;AAEV,CAAC;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"KeyValueItem.js","sources":["../../../../src/components/KeyValueItem/KeyValueItem.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { isBezierIcon } from '@channel.io/bezier-icons'\nimport classNames from 'classnames'\n\nimport { isArray, isEmpty, isNil } from '~/src/utils/type'\n\nimport { Button } from '~/src/components/Button'\nimport { Icon } from '~/src/components/Icon'\nimport { Text, type TextProps } from '~/src/components/Text'\nimport { Tooltip } from '~/src/components/Tooltip'\n\nimport {\n type ItemActionWithIcon,\n type KeyValueItemAction,\n type KeyValueItemProps,\n} from './KeyValueItem.types'\n\nimport styles from './KeyValueItem.module.scss'\n\nexport const KEY_VALUE_ITEM_TEST_ID = 'bezier-key-value-item'\nexport const KEY_VALUE_ITEM_KEY_ICON_TEST_ID = 'bezier-key-value-item-key-icon'\n\nfunction KeyItem({\n icon,\n children,\n}: {\n icon: KeyValueItemProps['keyIcon']\n children: React.ReactNode\n}) {\n return (\n <div className={styles.KeyItem}>\n {isBezierIcon(icon) ? (\n <Icon\n size=\"s\"\n source={icon}\n color=\"txt-black-dark\"\n data-testid={KEY_VALUE_ITEM_KEY_ICON_TEST_ID}\n />\n ) : (\n icon\n )}\n\n <Text\n className={styles.KeyText}\n bold\n typo=\"12\"\n color=\"txt-black-dark\"\n truncated\n >\n {children}\n </Text>\n </div>\n )\n}\n\nfunction ValueItem({ truncated, children }: TextProps) {\n return (\n <Text\n className={styles.ValueItem}\n typo=\"14\"\n truncated={truncated}\n >\n {children}\n </Text>\n )\n}\n\nfunction isItemActionWithIcon(args: object): args is ItemActionWithIcon {\n return 'icon' in args\n}\n\nfunction ActionButton({ children }: { children: KeyValueItemAction }) {\n if (!isItemActionWithIcon(children)) {\n return children\n }\n\n const withTooltip = !isEmpty(children.tooltip)\n const Wrapper = withTooltip ? Tooltip : React.Fragment\n\n return (\n <Wrapper {...(withTooltip ? { content: children.tooltip } : {})}>\n <Button\n size=\"xs\"\n leftContent={children.icon}\n styleVariant=\"tertiary\"\n colorVariant=\"monochrome-light\"\n onClick={children.onClick}\n />\n </Wrapper>\n )\n}\n\nfunction ActionButtonGroup({\n children,\n}: {\n children: KeyValueItemProps['actions']\n}) {\n if (isNil(children) || isEmpty(children)) {\n return null\n }\n\n return (\n <div className={styles.ItemAction}>\n {isArray(children) ? (\n children.map((action, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <ActionButton key={index}>{action}</ActionButton>\n ))\n ) : (\n <ActionButton>{children}</ActionButton>\n )}\n </div>\n )\n}\n\nexport const KeyValueItem = forwardRef<HTMLDivElement, KeyValueItemProps>(\n function KeyValueListItem(\n {\n className,\n keyIcon,\n keyContent,\n actions,\n children,\n onClickKey,\n onClickValue,\n ...rest\n },\n forwardedRef\n ) {\n return (\n <div\n className={classNames(\n styles.KeyValueItem,\n styles.singleline,\n className\n )}\n ref={forwardedRef}\n data-testid={KEY_VALUE_ITEM_TEST_ID}\n {...rest}\n >\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.KeyItemWrapper,\n onClickKey && styles.clickable\n )}\n onClick={onClickKey}\n >\n <KeyItem icon={keyIcon}>{keyContent}</KeyItem>\n </div>\n\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.ValueItemWrapper,\n onClickValue && styles.clickable\n )}\n onClick={onClickValue}\n >\n <ValueItem truncated>{children}</ValueItem>\n\n <ActionButtonGroup>{actions}</ActionButtonGroup>\n </div>\n </div>\n )\n }\n)\n\nexport const KeyValueMultiLineItem = forwardRef<\n HTMLDivElement,\n KeyValueItemProps\n>(function KeyValueMultiLineListItem(\n {\n children,\n className,\n keyIcon,\n keyContent,\n actions,\n onClickKey,\n onClickValue,\n ...rest\n },\n forwardedRef\n) {\n return (\n <div\n className={classNames(styles.KeyValueItem, styles.multiline, className)}\n ref={forwardedRef}\n data-testid={KEY_VALUE_ITEM_TEST_ID}\n {...rest}\n >\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.KeyItemWrapper,\n onClickKey && styles.clickable\n )}\n onClick={onClickKey}\n >\n <KeyItem icon={keyIcon}>{keyContent}</KeyItem>\n\n <ActionButtonGroup>{actions}</ActionButtonGroup>\n </div>\n\n {/* Since it allows for click interaction, it should be interactive content,\n but since it has a button element nested inside it, this is bad HTML markup.\n It's difficult to fix this without changing the design,\n so we keep the legacy code that uses the div element. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={classNames(\n styles.ItemWrapper,\n styles.ValueItemWrapper,\n onClickValue && styles.clickable\n )}\n onClick={onClickValue}\n >\n <ValueItem>{children}</ValueItem>\n </div>\n </div>\n )\n})\n"],"names":["KEY_VALUE_ITEM_TEST_ID","KEY_VALUE_ITEM_KEY_ICON_TEST_ID","KeyItem","icon","children","React","createElement","className","styles","isBezierIcon","Icon","size","source","color","Text","KeyText","bold","typo","truncated","ValueItem","isItemActionWithIcon","args","ActionButton","withTooltip","isEmpty","tooltip","Wrapper","Tooltip","Fragment","content","Button","leftContent","styleVariant","colorVariant","onClick","ActionButtonGroup","isNil","ItemAction","isArray","map","action","index","key","KeyValueItem","forwardRef","KeyValueListItem","keyIcon","keyContent","actions","onClickKey","onClickValue","rest","forwardedRef","Object","assign","classNames","singleline","ref","ItemWrapper","KeyItemWrapper","clickable","ValueItemWrapper","KeyValueMultiLineItem","KeyValueMultiLineListItem","multiline"],"mappings":";;;;;;;;;;;;AAsBO,MAAMA,sBAAsB,GAAG;AAC/B,MAAMC,+BAA+B,GAAG;AAE/C,SAASC,OAAOA,CAAC;EACfC,IAAI;AACJC,EAAAA;AAIF,CAAC,EAAE;EACD,oBACEC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKC,SAAS,EAAEC,2BAAM,CAACN;GACpBO,EAAAA,wBAAY,CAACN,IAAI,CAAC,gBACjBE,KAAA,CAAAC,aAAA,CAACI,SAAI,EAAA;AACHC,IAAAA,IAAI,EAAC,GAAG;AACRC,IAAAA,MAAM,EAAET,IAAK;AACbU,IAAAA,KAAK,EAAC,gBAAgB;IACtB,aAAaZ,EAAAA;GACd,CAAC,GAEFE,IACD,eAEDE,KAAA,CAAAC,aAAA,CAACQ,SAAI,EAAA;IACHP,SAAS,EAAEC,2BAAM,CAACO,OAAQ;IAC1BC,IAAI,EAAA,IAAA;AACJC,IAAAA,IAAI,EAAC,IAAI;AACTJ,IAAAA,KAAK,E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Q,GAAA,EAAEC,UAAoB,CAAC,eAE9C1C,KAAA,CAAAC,aAAA,CAAC6B,iBAAiB,EAAA,IAAA,EAAEa,OAA2B,CAC5C,CAAC,eAON3C,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAEgD,aAAU,CACnB/C,2BAAM,CAACkD,WAAW,EAClBlD,2BAAM,CAACqD,gBAAgB,EACvBX,YAAY,IAAI1C,2BAAM,CAACoD,SACzB,CAAE;AACF1B,IAAAA,OAAO,EAAEgB;GAET7C,eAAAA,KAAA,CAAAC,aAAA,CAACa,SAAS,EAAEf,IAAAA,EAAAA,QAAoB,CAC7B,CACF,CAAC;AAEV,CAAC;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyIcon.js","sources":["../../../../src/components/LegacyIcon/LegacyIcon.tsx"],"sourcesContent":["'use client'\n\nimport React, { memo } from 'react'\n\nimport { icons } from '@channel.io/bezier-icons'\n\nimport { Icon } from '~/src/components/Icon'\n\nimport { type LegacyIconProps } from './LegacyIcon.types'\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const LegacyIcon = memo(({ name, ...rest }: LegacyIconProps) => {\n const IconSource = icons[name]\n\n if (!IconSource) {\n return null\n }\n\n return (\n <Icon\n source={IconSource}\n {...rest}\n />\n )\n})\n"],"names":["LegacyIcon","memo","name","rest","IconSource","icons","React","createElement","Icon","Object","assign","source"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,UAAU,gBAAGC,UAAI,CAAC,CAAC;EAAEC,IAAI;EAAE,GAAGC
|
|
1
|
+
{"version":3,"file":"LegacyIcon.js","sources":["../../../../src/components/LegacyIcon/LegacyIcon.tsx"],"sourcesContent":["'use client'\n\nimport React, { memo } from 'react'\n\nimport { icons } from '@channel.io/bezier-icons'\n\nimport { Icon } from '~/src/components/Icon'\n\nimport { type LegacyIconProps } from './LegacyIcon.types'\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const LegacyIcon = memo(({ name, ...rest }: LegacyIconProps) => {\n const IconSource = icons[name]\n\n if (!IconSource) {\n return null\n }\n\n return (\n <Icon\n source={IconSource}\n {...rest}\n />\n )\n})\n"],"names":["LegacyIcon","memo","name","rest","IconSource","icons","React","createElement","Icon","Object","assign","source"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,UAAU,gBAAGC,UAAI,CAAC,CAAC;EAAEC,IAAI;EAAE,GAAGC;AAAsB,CAAC,KAAK;AACrE,EAAA,MAAMC,UAAU,GAAGC,iBAAK,CAACH,IAAI,CAAC;EAE9B,IAAI,CAACE,UAAU,EAAE;AACf,IAAA,OAAO,IAAI;AACb;EAEA,oBACEE,KAAA,CAAAC,aAAA,CAACC,SAAI,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACHC,IAAAA,MAAM,EAAEP;GACJD,EAAAA,IAAI,CACT,CAAC;AAEN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyIcon/utils.ts"],"sourcesContent":["import { type IconName, icons } from '@channel.io/bezier-icons'\n\nconst iconNames = new Set(Object.keys(icons))\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const isIconName = (name: any): name is IconName => iconNames.has(name)\n"],"names":["iconNames","Set","Object","keys","icons","isIconName","name","has"],"mappings":";;;;AAEA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAACC,MAAM,CAACC,IAAI,CAACC,iBAAK,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyIcon/utils.ts"],"sourcesContent":["import { type IconName, icons } from '@channel.io/bezier-icons'\n\nconst iconNames = new Set(Object.keys(icons))\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const isIconName = (name: any): name is IconName => iconNames.has(name)\n"],"names":["iconNames","Set","Object","keys","icons","isIconName","name","has"],"mappings":";;;;AAEA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAACC,MAAM,CAACC,IAAI,CAACC,iBAAK,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAIC,IAAS,IAAuBN,SAAS,CAACO,GAAG,CAACD,IAAI;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyHStack.js","sources":["../../../../../src/components/LegacyStack/LegacyHStack/LegacyHStack.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStack } from '~/src/components/LegacyStack/LegacyStack'\n\nimport type LegacyHStackProps from './LegacyHStack.types'\n\n/**\n * @deprecated Use `HStack` instead.\n *\n * A container for horizontal flex layout.\n */\nexport const LegacyHStack = forwardRef<HTMLElement, LegacyHStackProps>(\n function HStack(props, forwardedRef) {\n return (\n <LegacyStack\n ref={forwardedRef}\n direction=\"horizontal\"\n {...props}\n />\n )\n }\n)\n"],"names":["LegacyHStack","forwardRef","HStack","props","forwardedRef","React","createElement","LegacyStack","Object","assign","ref","direction"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,uBAAW,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACVC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,SAAS,EAAC
|
|
1
|
+
{"version":3,"file":"LegacyHStack.js","sources":["../../../../../src/components/LegacyStack/LegacyHStack/LegacyHStack.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStack } from '~/src/components/LegacyStack/LegacyStack'\n\nimport type LegacyHStackProps from './LegacyHStack.types'\n\n/**\n * @deprecated Use `HStack` instead.\n *\n * A container for horizontal flex layout.\n */\nexport const LegacyHStack = forwardRef<HTMLElement, LegacyHStackProps>(\n function HStack(props, forwardedRef) {\n return (\n <LegacyStack\n ref={forwardedRef}\n direction=\"horizontal\"\n {...props}\n />\n )\n }\n)\n"],"names":["LegacyHStack","forwardRef","HStack","props","forwardedRef","React","createElement","LegacyStack","Object","assign","ref","direction"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,uBAAW,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACVC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,SAAS,EAAC;GACNR,EAAAA,KAAK,CACV,CAAC;AAEN,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacySpacer.js","sources":["../../../../../src/components/LegacyStack/LegacySpacer/LegacySpacer.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStackItem } from '~/src/components/LegacyStack/LegacyStackItem'\n\nimport type LegacySpacerProps from './LegacySpacer.types'\n\n/**\n * @deprecated Use `Stack` and `justify` prop instead.\n */\nexport const LegacySpacer = forwardRef<HTMLElement, LegacySpacerProps>(\n function Spacer(props, forwardedRef) {\n return (\n <LegacyStackItem\n ref={forwardedRef}\n size={0}\n weight={1}\n grow\n shrink\n {...props}\n />\n )\n }\n)\n"],"names":["LegacySpacer","forwardRef","Spacer","props","forwardedRef","React","createElement","LegacyStackItem","Object","assign","ref","size","weight","grow","shrink"],"mappings":";;;;;AAQA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,+BAAe,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACdC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,IAAI,EAAE,CAAE;AACRC,IAAAA,MAAM,EAAE,CAAE;IACVC,IAAI,EAAA,IAAA;IACJC,MAAM,EAAA
|
|
1
|
+
{"version":3,"file":"LegacySpacer.js","sources":["../../../../../src/components/LegacyStack/LegacySpacer/LegacySpacer.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStackItem } from '~/src/components/LegacyStack/LegacyStackItem'\n\nimport type LegacySpacerProps from './LegacySpacer.types'\n\n/**\n * @deprecated Use `Stack` and `justify` prop instead.\n */\nexport const LegacySpacer = forwardRef<HTMLElement, LegacySpacerProps>(\n function Spacer(props, forwardedRef) {\n return (\n <LegacyStackItem\n ref={forwardedRef}\n size={0}\n weight={1}\n grow\n shrink\n {...props}\n />\n )\n }\n)\n"],"names":["LegacySpacer","forwardRef","Spacer","props","forwardedRef","React","createElement","LegacyStackItem","Object","assign","ref","size","weight","grow","shrink"],"mappings":";;;;;AAQA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,+BAAe,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACdC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,IAAI,EAAE,CAAE;AACRC,IAAAA,MAAM,EAAE,CAAE;IACVC,IAAI,EAAA,IAAA;IACJC,MAAM,EAAA;GACFX,EAAAA,KAAK,CACV,CAAC;AAEN,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyStack.js","sources":["../../../../../src/components/LegacyStack/LegacyStack/LegacyStack.tsx"],"sourcesContent":["'use client'\n\nimport React, {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n} from 'react'\n\nimport classNames from 'classnames'\n\nimport type LegacyStackProps from './LegacyStack.types'\n\nimport styles from './LegacyStack.module.scss'\n\n/**\n * @deprecated Use `Stack` instead.\n *\n * `Stack` provides an abstraction of **flex layout** so that\n * rendering of child elements **linearly** can be done\n * with simplified options.\n *\n * `Stack` always fills the parent element.\n *\n * Be reminded to list `StackItem`s to be direct child of `Stack`.\n * @example\n *\n * ```tsx\n * <Stack direction=\"horizontal\" spacing={8}>\n * <StackItem>{ ... }</StackItem>\n * <StackItem>{ ... }</StackItem>\n * </Stack>\n * ```\n */\nexport const LegacyStack = forwardRef<HTMLElement, LegacyStackProps>(\n function Stack(\n {\n as = 'div',\n className,\n children,\n direction,\n justify = 'start',\n align = 'stretch',\n spacing = 0,\n ...rest\n },\n forwardedRef\n ) {\n const Comp = as\n const firstValidElementIdx = useRef(-1)\n\n return (\n <Comp\n className={classNames(\n styles.LegacyStack,\n styles[`direction-${direction}`],\n styles[`justify-${justify}`],\n styles[`align-${align}`],\n className\n )}\n ref={forwardedRef}\n data-testid=\"bezier-legacy-stack\"\n {...rest}\n >\n {Children.map(children, (element, index) => {\n if (!isValidElement(element)) {\n return element\n }\n\n /**\n * NOTE: this assumes that this element is `StackItem`.\n *\n * Even if the child is not a `StackItem` component,\n * it could forward the prop to `StackItem` deeper in the tree,\n * or implement a custom behavior compatible with `StackItemProps`.\n */\n if (firstValidElementIdx.current === -1) {\n firstValidElementIdx.current = index\n }\n return cloneElement(element, {\n ...element.props,\n direction,\n marginBefore:\n element.props.marginBefore ??\n (index > firstValidElementIdx.current ? spacing : 0),\n })\n })}\n </Comp>\n )\n }\n)\n"],"names":["LegacyStack","forwardRef","Stack","as","className","children","direction","justify","align","spacing","rest","forwardedRef","Comp","firstValidElementIdx","useRef","React","createElement","Object","assign","classNames","styles","ref","Children","map","element","index","_element$props$margin","isValidElement","current","cloneElement","props","marginBefore"],"mappings":";;;;;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACaA,WAAW,gBAAGC,gBAAU,CACnC,SAASC,KAAKA,CACZ;AACEC,EAAAA,EAAE,GAAG,KAAK;EACVC,SAAS;EACTC,QAAQ;EACRC,SAAS;AACTC,EAAAA,OAAO,GAAG,OAAO;AACjBC,EAAAA,KAAK,GAAG,SAAS;AACjBC,EAAAA,OAAO,GAAG,CAAC;EACX,GAAGC
|
|
1
|
+
{"version":3,"file":"LegacyStack.js","sources":["../../../../../src/components/LegacyStack/LegacyStack/LegacyStack.tsx"],"sourcesContent":["'use client'\n\nimport React, {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n} from 'react'\n\nimport classNames from 'classnames'\n\nimport type LegacyStackProps from './LegacyStack.types'\n\nimport styles from './LegacyStack.module.scss'\n\n/**\n * @deprecated Use `Stack` instead.\n *\n * `Stack` provides an abstraction of **flex layout** so that\n * rendering of child elements **linearly** can be done\n * with simplified options.\n *\n * `Stack` always fills the parent element.\n *\n * Be reminded to list `StackItem`s to be direct child of `Stack`.\n * @example\n *\n * ```tsx\n * <Stack direction=\"horizontal\" spacing={8}>\n * <StackItem>{ ... }</StackItem>\n * <StackItem>{ ... }</StackItem>\n * </Stack>\n * ```\n */\nexport const LegacyStack = forwardRef<HTMLElement, LegacyStackProps>(\n function Stack(\n {\n as = 'div',\n className,\n children,\n direction,\n justify = 'start',\n align = 'stretch',\n spacing = 0,\n ...rest\n },\n forwardedRef\n ) {\n const Comp = as\n const firstValidElementIdx = useRef(-1)\n\n return (\n <Comp\n className={classNames(\n styles.LegacyStack,\n styles[`direction-${direction}`],\n styles[`justify-${justify}`],\n styles[`align-${align}`],\n className\n )}\n ref={forwardedRef}\n data-testid=\"bezier-legacy-stack\"\n {...rest}\n >\n {Children.map(children, (element, index) => {\n if (!isValidElement(element)) {\n return element\n }\n\n /**\n * NOTE: this assumes that this element is `StackItem`.\n *\n * Even if the child is not a `StackItem` component,\n * it could forward the prop to `StackItem` deeper in the tree,\n * or implement a custom behavior compatible with `StackItemProps`.\n */\n if (firstValidElementIdx.current === -1) {\n firstValidElementIdx.current = index\n }\n return cloneElement(element, {\n ...element.props,\n direction,\n marginBefore:\n element.props.marginBefore ??\n (index > firstValidElementIdx.current ? spacing : 0),\n })\n })}\n </Comp>\n )\n }\n)\n"],"names":["LegacyStack","forwardRef","Stack","as","className","children","direction","justify","align","spacing","rest","forwardedRef","Comp","firstValidElementIdx","useRef","React","createElement","Object","assign","classNames","styles","ref","Children","map","element","index","_element$props$margin","isValidElement","current","cloneElement","props","marginBefore"],"mappings":";;;;;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACaA,WAAW,gBAAGC,gBAAU,CACnC,SAASC,KAAKA,CACZ;AACEC,EAAAA,EAAE,GAAG,KAAK;EACVC,SAAS;EACTC,QAAQ;EACRC,SAAS;AACTC,EAAAA,OAAO,GAAG,OAAO;AACjBC,EAAAA,KAAK,GAAG,SAAS;AACjBC,EAAAA,OAAO,GAAG,CAAC;EACX,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;EACA,MAAMC,IAAI,GAAGT,EAAE;AACf,EAAA,MAAMU,oBAAoB,GAAGC,YAAM,CAAC,CAAC,CAAC,CAAC;EAEvC,oBACEC,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,MAAA,CAAAC,MAAA,CAAA;AACHd,IAAAA,SAAS,EAAEe,aAAU,CACnBC,0BAAM,CAACpB,WAAW,EAClBoB,0BAAM,CAAC,CAAA,UAAA,EAAad,SAAS,CAAA,CAAE,CAAC,EAChCc,0BAAM,CAAC,CAAWb,QAAAA,EAAAA,OAAO,CAAE,CAAA,CAAC,EAC5Ba,0BAAM,CAAC,CAAA,MAAA,EAASZ,KAAK,CAAA,CAAE,CAAC,EACxBJ,SACF,CAAE;AACFiB,IAAAA,GAAG,EAAEV,YAAa;IAClB,aAAY,EAAA;AAAqB,GAAA,EAC7BD,IAAI,CAAA,EAEPY,cAAQ,CAACC,GAAG,CAAClB,QAAQ,EAAE,CAACmB,OAAO,EAAEC,KAAK,KAAK;AAAA,IAAA,IAAAC,qBAAA;AAC1C,IAAA,IAAI,eAACC,oBAAc,CAACH,OAAO,CAAC,EAAE;AAC5B,MAAA,OAAOA,OAAO;AAChB;;AAEA;AACV;AACA;AACA;AACA;AACA;AACA;AACU,IAAA,IAAIX,oBAAoB,CAACe,OAAO,KAAK,CAAC,CAAC,EAAE;MACvCf,oBAAoB,CAACe,OAAO,GAAGH,KAAK;AACtC;IACA,oBAAOI,kBAAY,CAACL,OAAO,EAAE;MAC3B,GAAGA,OAAO,CAACM,KAAK;MAChBxB,SAAS;MACTyB,YAAY,EAAA,CAAAL,qBAAA,GACVF,OAAO,CAACM,KAAK,CAACC,YAAY,MAAAL,IAAAA,IAAAA,qBAAA,cAAAA,qBAAA,GACzBD,KAAK,GAAGZ,oBAAoB,CAACe,OAAO,GAAGnB,OAAO,GAAG;AACtD,KAAC,CAAC;AACJ,GAAC,CACG,CAAC;AAEX,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyStackItem.js","sources":["../../../../../src/components/LegacyStack/LegacyStackItem/LegacyStackItem.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport { isInteger, isNil } from '~/src/utils/type'\n\nimport type LegacyStackItemProps from './LegacyStackItem.types'\n\nimport styles from './LegacyStackItem.module.scss'\n\nconst sanitizeWeight = (weight: number): number => {\n if (weight < 0) {\n return 0\n }\n if (!isInteger(weight)) {\n return 0\n }\n return weight\n}\n\n/**\n * @deprecated Use layout components(`Box`, `Stack`) that support flex item related properties (`shrink`, `grow`) instead.\n * @example\n *\n * ```\n * <Stack>\n * <Stack grow={1} shrink={1} {...}>\n * { ... }\n * </Stack>\n * <Box grow={0} shrink={0} {...} />\n * </Stack>\n * ```\n *\n *\n * `StackItem` is used along `Stack`.\n * It inherits the default settings from `Stack`,\n * but allows to override some props to customize the behavior\n * of particular item.\n *\n * If you are not using `StackItem` as the direct child of `Stack`,\n * be reminded to forward props in `StackItemProps` to `StackItem` component,\n * or manually implement the behavior compatible with `StackItem`.\n */\nexport const LegacyStackItem = forwardRef<HTMLElement, LegacyStackItemProps>(\n function StackItem(\n {\n as = 'div',\n children,\n style,\n className,\n direction,\n justify,\n align,\n size,\n weight = 0,\n grow = false,\n shrink = false,\n marginBefore = 0,\n marginAfter = 0,\n ...rest\n },\n forwardedRef\n ) {\n const Comp = as\n\n return (\n <Comp\n ref={forwardedRef}\n style={{\n ...style,\n '--b-main-axis-size': isNil(size) ? 'initial' : `${size}px`,\n '--b-grow-weight': grow ? sanitizeWeight(weight) : '0',\n '--b-shrink-weight': shrink ? sanitizeWeight(weight) : '0',\n '--b-margin-before': `${marginBefore}px`,\n '--b-margin-after': `${marginAfter}px`,\n }}\n className={classNames(\n styles.LegacyStackItem,\n styles[`direction-${direction}`],\n styles[`justify-${justify}`],\n styles[`align-${align}`],\n className\n )}\n data-testid=\"bezier-legacy-stack-item\"\n {...rest}\n >\n {children}\n </Comp>\n )\n }\n)\n"],"names":["sanitizeWeight","weight","isInteger","LegacyStackItem","forwardRef","StackItem","as","children","style","className","direction","justify","align","size","grow","shrink","marginBefore","marginAfter","rest","forwardedRef","Comp","React","createElement","Object","assign","ref","isNil","classNames","styles"],"mappings":";;;;;;;AAYA,MAAMA,cAAc,GAAIC,MAAc,IAAa;EACjD,IAAIA,MAAM,GAAG,CAAC,EAAE;AACd,IAAA,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"LegacyStackItem.js","sources":["../../../../../src/components/LegacyStack/LegacyStackItem/LegacyStackItem.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport classNames from 'classnames'\n\nimport { isInteger, isNil } from '~/src/utils/type'\n\nimport type LegacyStackItemProps from './LegacyStackItem.types'\n\nimport styles from './LegacyStackItem.module.scss'\n\nconst sanitizeWeight = (weight: number): number => {\n if (weight < 0) {\n return 0\n }\n if (!isInteger(weight)) {\n return 0\n }\n return weight\n}\n\n/**\n * @deprecated Use layout components(`Box`, `Stack`) that support flex item related properties (`shrink`, `grow`) instead.\n * @example\n *\n * ```\n * <Stack>\n * <Stack grow={1} shrink={1} {...}>\n * { ... }\n * </Stack>\n * <Box grow={0} shrink={0} {...} />\n * </Stack>\n * ```\n *\n *\n * `StackItem` is used along `Stack`.\n * It inherits the default settings from `Stack`,\n * but allows to override some props to customize the behavior\n * of particular item.\n *\n * If you are not using `StackItem` as the direct child of `Stack`,\n * be reminded to forward props in `StackItemProps` to `StackItem` component,\n * or manually implement the behavior compatible with `StackItem`.\n */\nexport const LegacyStackItem = forwardRef<HTMLElement, LegacyStackItemProps>(\n function StackItem(\n {\n as = 'div',\n children,\n style,\n className,\n direction,\n justify,\n align,\n size,\n weight = 0,\n grow = false,\n shrink = false,\n marginBefore = 0,\n marginAfter = 0,\n ...rest\n },\n forwardedRef\n ) {\n const Comp = as\n\n return (\n <Comp\n ref={forwardedRef}\n style={{\n ...style,\n '--b-main-axis-size': isNil(size) ? 'initial' : `${size}px`,\n '--b-grow-weight': grow ? sanitizeWeight(weight) : '0',\n '--b-shrink-weight': shrink ? sanitizeWeight(weight) : '0',\n '--b-margin-before': `${marginBefore}px`,\n '--b-margin-after': `${marginAfter}px`,\n }}\n className={classNames(\n styles.LegacyStackItem,\n styles[`direction-${direction}`],\n styles[`justify-${justify}`],\n styles[`align-${align}`],\n className\n )}\n data-testid=\"bezier-legacy-stack-item\"\n {...rest}\n >\n {children}\n </Comp>\n )\n }\n)\n"],"names":["sanitizeWeight","weight","isInteger","LegacyStackItem","forwardRef","StackItem","as","children","style","className","direction","justify","align","size","grow","shrink","marginBefore","marginAfter","rest","forwardedRef","Comp","React","createElement","Object","assign","ref","isNil","classNames","styles"],"mappings":";;;;;;;AAYA,MAAMA,cAAc,GAAIC,MAAc,IAAa;EACjD,IAAIA,MAAM,GAAG,CAAC,EAAE;AACd,IAAA,OAAO,CAAC;AACV;AACA,EAAA,IAAI,CAACC,cAAS,CAACD,MAAM,CAAC,EAAE;AACtB,IAAA,OAAO,CAAC;AACV;AACA,EAAA,OAAOA,MAAM;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACaE,eAAe,gBAAGC,gBAAU,CACvC,SAASC,SAASA,CAChB;AACEC,EAAAA,EAAE,GAAG,KAAK;EACVC,QAAQ;EACRC,KAAK;EACLC,SAAS;EACTC,SAAS;EACTC,OAAO;EACPC,KAAK;EACLC,IAAI;AACJZ,EAAAA,MAAM,GAAG,CAAC;AACVa,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,MAAM,GAAG,KAAK;AACdC,EAAAA,YAAY,GAAG,CAAC;AAChBC,EAAAA,WAAW,GAAG,CAAC;EACf,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;EACA,MAAMC,IAAI,GAAGd,EAAE;EAEf,oBACEe,KAAA,CAAAC,aAAA,CAACF,IAAI,EAAAG,MAAA,CAAAC,MAAA,CAAA;AACHC,IAAAA,GAAG,EAAEN,YAAa;AAClBX,IAAAA,KAAK,EAAE;AACL,MAAA,GAAGA,KAAK;MACR,oBAAoB,EAAEkB,UAAK,CAACb,IAAI,CAAC,GAAG,SAAS,GAAG,CAAGA,EAAAA,IAAI,CAAI,EAAA,CAAA;MAC3D,iBAAiB,EAAEC,IAAI,GAAGd,cAAc,CAACC,MAAM,CAAC,GAAG,GAAG;MACtD,mBAAmB,EAAEc,MAAM,GAAGf,cAAc,CAACC,MAAM,CAAC,GAAG,GAAG;MAC1D,mBAAmB,EAAE,CAAGe,EAAAA,YAAY,CAAI,EAAA,CAAA;MACxC,kBAAkB,EAAE,GAAGC,WAAW,CAAA,EAAA;KAClC;AACFR,IAAAA,SAAS,EAAEkB,aAAU,CACnBC,8BAAM,CAACzB,eAAe,EACtByB,8BAAM,CAAC,CAAA,UAAA,EAAalB,SAAS,CAAA,CAAE,CAAC,EAChCkB,8BAAM,CAAC,CAAWjB,QAAAA,EAAAA,OAAO,CAAE,CAAA,CAAC,EAC5BiB,8BAAM,CAAC,CAAA,MAAA,EAAShB,KAAK,CAAA,CAAE,CAAC,EACxBH,SACF,CAAE;IACF,aAAY,EAAA;GACRS,EAAAA,IAAI,CAEPX,EAAAA,QACG,CAAC;AAEX,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyVStack.js","sources":["../../../../../src/components/LegacyStack/LegacyVStack/LegacyVStack.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStack } from '~/src/components/LegacyStack/LegacyStack'\n\nimport type LegacyVStackProps from './LegacyVStack.types'\n\n/**\n * @deprecated Use `VStack` instead.\n *\n * A container for vertical flex layout.\n */\nexport const LegacyVStack = forwardRef<HTMLElement, LegacyVStackProps>(\n function VStack(props, forwardedRef) {\n return (\n <LegacyStack\n ref={forwardedRef}\n direction=\"vertical\"\n {...props}\n />\n )\n }\n)\n"],"names":["LegacyVStack","forwardRef","VStack","props","forwardedRef","React","createElement","LegacyStack","Object","assign","ref","direction"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,uBAAW,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACVC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,SAAS,EAAC
|
|
1
|
+
{"version":3,"file":"LegacyVStack.js","sources":["../../../../../src/components/LegacyStack/LegacyVStack/LegacyVStack.tsx"],"sourcesContent":["'use client'\n\nimport React, { forwardRef } from 'react'\n\nimport { LegacyStack } from '~/src/components/LegacyStack/LegacyStack'\n\nimport type LegacyVStackProps from './LegacyVStack.types'\n\n/**\n * @deprecated Use `VStack` instead.\n *\n * A container for vertical flex layout.\n */\nexport const LegacyVStack = forwardRef<HTMLElement, LegacyVStackProps>(\n function VStack(props, forwardedRef) {\n return (\n <LegacyStack\n ref={forwardedRef}\n direction=\"vertical\"\n {...props}\n />\n )\n }\n)\n"],"names":["LegacyVStack","forwardRef","VStack","props","forwardedRef","React","createElement","LegacyStack","Object","assign","ref","direction"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,gBAAGC,gBAAU,CACpC,SAASC,MAAMA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACnC,oBACEC,KAAA,CAAAC,aAAA,CAACC,uBAAW,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACVC,IAAAA,GAAG,EAAEN,YAAa;AAClBO,IAAAA,SAAS,EAAC;GACNR,EAAAA,KAAK,CACV,CAAC;AAEN,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyTooltip.js","sources":["../../../../src/components/LegacyTooltip/LegacyTooltip.tsx"],"sourcesContent":["'use client'\n\nimport React, {\n type Ref,\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport classNames from 'classnames'\n\nimport { useWindow } from '~/src/components/WindowProvider'\n\nimport { type LegacyTooltipProps } from './LegacyTooltip.types'\nimport { LegacyTooltipContent } from './LegacyTooltipContent'\n\nimport styles from './LegacyTooltip.module.scss'\n\nexport const TOOLTIP_TEST_ID = 'bezier-tooltip'\nexport const TOOLTIP_CONTENT_TEST_ID = 'bezier-tooltip-content'\n\n/**\n * @deprecated Use `Tooltip` instead. It may be removed in the next major version.\n */\nexport const LegacyTooltip = memo(\n forwardRef(function LegacyTooltip(\n {\n as,\n contentTestId = TOOLTIP_CONTENT_TEST_ID,\n className,\n contentStyle,\n contentClassName,\n contentWrapperStyle,\n contentWrapperClassName,\n content = null,\n lazy = false, // optional prop 에서 추후 default behavior 를 lazy 하게 바꿀 예정\n placement = 'bottom-center',\n disabled = false,\n offset = 4,\n keepInContainer = false,\n allowHover = false,\n delayShow = 0,\n delayHide = 0,\n children,\n ...otherProps\n }: LegacyTooltipProps,\n forwardedRef: Ref<any>\n ) {\n const { window } = useWindow()\n\n const [show, setShow] = useState(false)\n const [didMount, setDidMount] = useState(show)\n\n const tooltipContainerRef = useRef<HTMLDivElement>(null)\n const timerRef = useRef<ReturnType<Window['setTimeout']>>()\n\n useEffect(\n function hideTooltipContentWhenDisabled() {\n if (disabled) {\n setShow(false)\n }\n },\n [disabled]\n )\n\n useEffect(\n function updateDidMount() {\n setDidMount((prev) => prev || show)\n },\n [show]\n )\n\n const handleMouseEnter = useCallback(() => {\n if (disabled) {\n return\n }\n\n if (timerRef.current) {\n clearTimeout(timerRef.current)\n }\n\n timerRef.current = window.setTimeout(() => {\n setShow(true)\n }, delayShow)\n }, [delayShow, disabled, window])\n\n const handleMouseLeave = useCallback(() => {\n if (disabled) {\n return\n }\n\n if (timerRef.current) {\n clearTimeout(timerRef.current)\n }\n\n timerRef.current = window.setTimeout(() => {\n setShow(false)\n }, delayHide)\n }, [delayHide, disabled, window])\n\n const TooltipComponent = useMemo(() => {\n if (!lazy || didMount) {\n return (\n <LegacyTooltipContent\n as={as}\n content={content}\n contentStyle={contentStyle}\n contentClassName={contentClassName}\n contentWrapperStyle={contentWrapperStyle}\n contentWrapperClassName={contentWrapperClassName}\n disabled={disabled}\n placement={placement}\n offset={offset}\n allowHover={allowHover}\n keepInContainer={keepInContainer}\n tooltipContainer={tooltipContainerRef.current}\n forwardedRef={forwardedRef}\n data-testid={contentTestId}\n />\n )\n }\n\n return null\n }, [\n lazy,\n didMount,\n as,\n content,\n contentStyle,\n contentClassName,\n contentWrapperStyle,\n contentWrapperClassName,\n disabled,\n placement,\n offset,\n allowHover,\n keepInContainer,\n forwardedRef,\n contentTestId,\n ])\n\n if (!children) {\n return null\n }\n\n return (\n <div\n ref={tooltipContainerRef}\n className={classNames(styles.LegacyTooltip, className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n data-testid={TOOLTIP_TEST_ID}\n {...otherProps}\n >\n {children}\n {show && TooltipComponent}\n </div>\n )\n })\n)\n"],"names":["TOOLTIP_TEST_ID","TOOLTIP_CONTENT_TEST_ID","LegacyTooltip","memo","forwardRef","as","contentTestId","className","contentStyle","contentClassName","contentWrapperStyle","contentWrapperClassName","content","lazy","placement","disabled","offset","keepInContainer","allowHover","delayShow","delayHide","children","otherProps","forwardedRef","window","useWindow","show","setShow","useState","didMount","setDidMount","tooltipContainerRef","useRef","timerRef","useEffect","hideTooltipContentWhenDisabled","updateDidMount","prev","handleMouseEnter","useCallback","current","clearTimeout","setTimeout","handleMouseLeave","TooltipComponent","useMemo","React","createElement","LegacyTooltipContent","tooltipContainer","Object","assign","ref","classNames","styles","onMouseEnter","onMouseLeave"],"mappings":";;;;;;;;AAsBO,MAAMA,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"LegacyTooltip.js","sources":["../../../../src/components/LegacyTooltip/LegacyTooltip.tsx"],"sourcesContent":["'use client'\n\nimport React, {\n type Ref,\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport classNames from 'classnames'\n\nimport { useWindow } from '~/src/components/WindowProvider'\n\nimport { type LegacyTooltipProps } from './LegacyTooltip.types'\nimport { LegacyTooltipContent } from './LegacyTooltipContent'\n\nimport styles from './LegacyTooltip.module.scss'\n\nexport const TOOLTIP_TEST_ID = 'bezier-tooltip'\nexport const TOOLTIP_CONTENT_TEST_ID = 'bezier-tooltip-content'\n\n/**\n * @deprecated Use `Tooltip` instead. It may be removed in the next major version.\n */\nexport const LegacyTooltip = memo(\n forwardRef(function LegacyTooltip(\n {\n as,\n contentTestId = TOOLTIP_CONTENT_TEST_ID,\n className,\n contentStyle,\n contentClassName,\n contentWrapperStyle,\n contentWrapperClassName,\n content = null,\n lazy = false, // optional prop 에서 추후 default behavior 를 lazy 하게 바꿀 예정\n placement = 'bottom-center',\n disabled = false,\n offset = 4,\n keepInContainer = false,\n allowHover = false,\n delayShow = 0,\n delayHide = 0,\n children,\n ...otherProps\n }: LegacyTooltipProps,\n forwardedRef: Ref<any>\n ) {\n const { window } = useWindow()\n\n const [show, setShow] = useState(false)\n const [didMount, setDidMount] = useState(show)\n\n const tooltipContainerRef = useRef<HTMLDivElement>(null)\n const timerRef = useRef<ReturnType<Window['setTimeout']>>()\n\n useEffect(\n function hideTooltipContentWhenDisabled() {\n if (disabled) {\n setShow(false)\n }\n },\n [disabled]\n )\n\n useEffect(\n function updateDidMount() {\n setDidMount((prev) => prev || show)\n },\n [show]\n )\n\n const handleMouseEnter = useCallback(() => {\n if (disabled) {\n return\n }\n\n if (timerRef.current) {\n clearTimeout(timerRef.current)\n }\n\n timerRef.current = window.setTimeout(() => {\n setShow(true)\n }, delayShow)\n }, [delayShow, disabled, window])\n\n const handleMouseLeave = useCallback(() => {\n if (disabled) {\n return\n }\n\n if (timerRef.current) {\n clearTimeout(timerRef.current)\n }\n\n timerRef.current = window.setTimeout(() => {\n setShow(false)\n }, delayHide)\n }, [delayHide, disabled, window])\n\n const TooltipComponent = useMemo(() => {\n if (!lazy || didMount) {\n return (\n <LegacyTooltipContent\n as={as}\n content={content}\n contentStyle={contentStyle}\n contentClassName={contentClassName}\n contentWrapperStyle={contentWrapperStyle}\n contentWrapperClassName={contentWrapperClassName}\n disabled={disabled}\n placement={placement}\n offset={offset}\n allowHover={allowHover}\n keepInContainer={keepInContainer}\n tooltipContainer={tooltipContainerRef.current}\n forwardedRef={forwardedRef}\n data-testid={contentTestId}\n />\n )\n }\n\n return null\n }, [\n lazy,\n didMount,\n as,\n content,\n contentStyle,\n contentClassName,\n contentWrapperStyle,\n contentWrapperClassName,\n disabled,\n placement,\n offset,\n allowHover,\n keepInContainer,\n forwardedRef,\n contentTestId,\n ])\n\n if (!children) {\n return null\n }\n\n return (\n <div\n ref={tooltipContainerRef}\n className={classNames(styles.LegacyTooltip, className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n data-testid={TOOLTIP_TEST_ID}\n {...otherProps}\n >\n {children}\n {show && TooltipComponent}\n </div>\n )\n })\n)\n"],"names":["TOOLTIP_TEST_ID","TOOLTIP_CONTENT_TEST_ID","LegacyTooltip","memo","forwardRef","as","contentTestId","className","contentStyle","contentClassName","contentWrapperStyle","contentWrapperClassName","content","lazy","placement","disabled","offset","keepInContainer","allowHover","delayShow","delayHide","children","otherProps","forwardedRef","window","useWindow","show","setShow","useState","didMount","setDidMount","tooltipContainerRef","useRef","timerRef","useEffect","hideTooltipContentWhenDisabled","updateDidMount","prev","handleMouseEnter","useCallback","current","clearTimeout","setTimeout","handleMouseLeave","TooltipComponent","useMemo","React","createElement","LegacyTooltipContent","tooltipContainer","Object","assign","ref","classNames","styles","onMouseEnter","onMouseLeave"],"mappings":";;;;;;;;AAsBO,MAAMA,eAAe,GAAG;AACxB,MAAMC,uBAAuB,GAAG;;AAEvC;AACA;AACA;AACO,MAAMC,aAAa,gBAAGC,UAAI,cAC/BC,gBAAU,CAAC,SAASF,aAAaA,CAC/B;EACEG,EAAE;AACFC,EAAAA,aAAa,GAAGL,uBAAuB;EACvCM,SAAS;EACTC,YAAY;EACZC,gBAAgB;EAChBC,mBAAmB;EACnBC,uBAAuB;AACvBC,EAAAA,OAAO,GAAG,IAAI;AACdC,EAAAA,IAAI,GAAG,KAAK;AAAE;AACdC,EAAAA,SAAS,GAAG,eAAe;AAC3BC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,MAAM,GAAG,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AS,EACTE,MAAM,EACNE,UAAU,EACVD,eAAe,EACfM,YAAY,EACZjB,aAAa,CACd,CAAC;EAEF,IAAI,CAACe,QAAQ,EAAE;AACb,IAAA,OAAO,IAAI;AACb;AAEA,EAAA,oBACEyB,KAAA,CAAAC,aAAA,CAAAG,KAAAA,EAAAA,MAAA,CAAAC,MAAA,CAAA;AACEC,IAAAA,GAAG,EAAErB,mBAAoB;IACzBxB,SAAS,EAAE8C,aAAU,CAACC,4BAAM,CAACpD,aAAa,EAAEK,SAAS,CAAE;AACvDgD,IAAAA,YAAY,EAAEjB,gBAAiB;AAC/BkB,IAAAA,YAAY,EAAEb,gBAAiB;IAC/B,aAAa3C,EAAAA;AAAgB,GAAA,EACzBsB,UAAU,CAEbD,EAAAA,QAAQ,EACRK,IAAI,IAAIkB,gBACN,CAAC;AAEV,CAAC,CACH;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyTooltipContent.js","sources":["../../../../src/components/LegacyTooltip/LegacyTooltipContent.tsx"],"sourcesContent":["'use client'\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\n\nimport classNames from 'classnames'\n\nimport useEventHandler from '~/src/hooks/useEventHandler'\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { isArray, isEmpty, isString } from '~/src/utils/type'\n\nimport { Text } from '~/src/components/Text'\nimport { InvertedThemeProvider } from '~/src/components/ThemeProvider'\nimport { useRootElement } from '~/src/components/WindowProvider'\n\nimport { type LegacyTooltipContentProps } from './LegacyTooltip.types'\nimport { getReplacement, getTooltipStyle } from './utils'\n\nimport styles from './LegacyTooltip.module.scss'\n\nfunction getNewLineComponent(strContent: string) {\n return strContent.split('\\n').map((str, index) => {\n if (index === 0) {\n return (\n <Text\n key={str}\n typo=\"14\"\n >\n {str}\n </Text>\n )\n }\n\n return (\n <React.Fragment key={str}>\n <br />\n <Text typo=\"14\">{str}</Text>\n </React.Fragment>\n )\n })\n}\n\nfunction getContentComponent(content?: React.ReactNode) {\n if (isArray(content)) {\n return content.map((item) => {\n if (isString(item)) {\n return getNewLineComponent(item)\n }\n\n return item\n })\n }\n\n if (isString(content)) {\n return getNewLineComponent(content)\n }\n\n return content\n}\n\nexport const LegacyTooltipContent: React.FC<LegacyTooltipContentProps> = ({\n as,\n content,\n contentStyle,\n contentClassName,\n contentWrapperClassName,\n contentWrapperStyle: givenContentWrapperStyle,\n disabled = false,\n keepInContainer = false,\n placement = 'bottom-center',\n tooltipContainer,\n offset = 4,\n allowHover = false,\n forwardedRef,\n ...rest\n}) => {\n const rootElement = useRootElement()\n\n const tooltipRef = useRef<HTMLDivElement>(null)\n const tooltipWrapperRef = useRef<HTMLDivElement>(null)\n const mergedRef = useMergeRefs<HTMLDivElement>(tooltipRef, forwardedRef)\n const [replacement, setReplacement] = useState(placement)\n\n const handleClickTooltip = useCallback(\n (event: HTMLElementEventMap['click']) => {\n event.stopPropagation()\n },\n []\n )\n\n useEventHandler(tooltipRef.current, 'click', handleClickTooltip)\n\n useEffect(() => {\n if (!tooltipRef.current) {\n return\n }\n const newPlacement = getReplacement({\n tooltip: tooltipRef.current,\n keepInContainer,\n placement,\n rootElement,\n })\n setReplacement(newPlacement)\n }, [rootElement, keepInContainer, placement])\n\n const ContentComponent = useMemo(\n () => getContentComponent(content),\n [content]\n )\n\n const contentWrapperStyle = useMemo(() => {\n if (tooltipContainer) {\n return {\n ...givenContentWrapperStyle,\n ...getTooltipStyle({\n tooltipContainer,\n placement: replacement,\n offset,\n allowHover,\n }),\n }\n }\n\n return {}\n }, [\n tooltipContainer,\n givenContentWrapperStyle,\n replacement,\n offset,\n allowHover,\n ])\n\n const Comp = as ?? 'div'\n\n return ReactDOM.createPortal(\n <InvertedThemeProvider>\n <div\n style={contentWrapperStyle}\n className={classNames(\n styles.LegacyTooltipContentWrapper,\n (disabled || isEmpty(content)) && styles.disabled,\n contentWrapperClassName\n )}\n ref={tooltipWrapperRef}\n >\n <Comp\n style={contentStyle}\n className={classNames(styles.LegacyTooltipContent, contentClassName)}\n ref={mergedRef}\n {...rest}\n >\n <Text\n color=\"txt-black-darkest\"\n truncated={20}\n typo=\"13\"\n >\n {ContentComponent}\n </Text>\n </Comp>\n </div>\n </InvertedThemeProvider>,\n rootElement\n )\n}\n"],"names":["getNewLineComponent","strContent","split","map","str","index","React","createElement","Text","key","typo","Fragment","getContentComponent","content","isArray","item","isString","LegacyTooltipContent","as","contentStyle","contentClassName","contentWrapperClassName","contentWrapperStyle","givenContentWrapperStyle","disabled","keepInContainer","placement","tooltipContainer","offset","allowHover","forwardedRef","rest","rootElement","useRootElement","tooltipRef","useRef","tooltipWrapperRef","mergedRef","useMergeRefs","replacement","setReplacement","useState","handleClickTooltip","useCallback","event","stopPropagation","useEventHandler","current","useEffect","newPlacement","getReplacement","tooltip","ContentComponent","useMemo","getTooltipStyle","Comp","ReactDOM","createPortal","InvertedThemeProvider","style","className","classNames","styles","LegacyTooltipContentWrapper","isEmpty","ref","Object","assign","color","truncated"],"mappings":";;;;;;;;;;;;;;AAoBA,SAASA,mBAAmBA,CAACC,UAAkB,EAAE;AAC/C,EAAA,OAAOA,UAAU,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK;IAChD,IAAIA,KAAK,KAAK,CAAC,EAAE;AACf,MAAA,oBACEC,KAAA,CAAAC,aAAA,CAACC,SAAI,EAAA;AACHC,QAAAA,GAAG,EAAEL,GAAI;AACTM,QAAAA,IAAI,EAAC
|
|
1
|
+
{"version":3,"file":"LegacyTooltipContent.js","sources":["../../../../src/components/LegacyTooltip/LegacyTooltipContent.tsx"],"sourcesContent":["'use client'\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\n\nimport classNames from 'classnames'\n\nimport useEventHandler from '~/src/hooks/useEventHandler'\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { isArray, isEmpty, isString } from '~/src/utils/type'\n\nimport { Text } from '~/src/components/Text'\nimport { InvertedThemeProvider } from '~/src/components/ThemeProvider'\nimport { useRootElement } from '~/src/components/WindowProvider'\n\nimport { type LegacyTooltipContentProps } from './LegacyTooltip.types'\nimport { getReplacement, getTooltipStyle } from './utils'\n\nimport styles from './LegacyTooltip.module.scss'\n\nfunction getNewLineComponent(strContent: string) {\n return strContent.split('\\n').map((str, index) => {\n if (index === 0) {\n return (\n <Text\n key={str}\n typo=\"14\"\n >\n {str}\n </Text>\n )\n }\n\n return (\n <React.Fragment key={str}>\n <br />\n <Text typo=\"14\">{str}</Text>\n </React.Fragment>\n )\n })\n}\n\nfunction getContentComponent(content?: React.ReactNode) {\n if (isArray(content)) {\n return content.map((item) => {\n if (isString(item)) {\n return getNewLineComponent(item)\n }\n\n return item\n })\n }\n\n if (isString(content)) {\n return getNewLineComponent(content)\n }\n\n return content\n}\n\nexport const LegacyTooltipContent: React.FC<LegacyTooltipContentProps> = ({\n as,\n content,\n contentStyle,\n contentClassName,\n contentWrapperClassName,\n contentWrapperStyle: givenContentWrapperStyle,\n disabled = false,\n keepInContainer = false,\n placement = 'bottom-center',\n tooltipContainer,\n offset = 4,\n allowHover = false,\n forwardedRef,\n ...rest\n}) => {\n const rootElement = useRootElement()\n\n const tooltipRef = useRef<HTMLDivElement>(null)\n const tooltipWrapperRef = useRef<HTMLDivElement>(null)\n const mergedRef = useMergeRefs<HTMLDivElement>(tooltipRef, forwardedRef)\n const [replacement, setReplacement] = useState(placement)\n\n const handleClickTooltip = useCallback(\n (event: HTMLElementEventMap['click']) => {\n event.stopPropagation()\n },\n []\n )\n\n useEventHandler(tooltipRef.current, 'click', handleClickTooltip)\n\n useEffect(() => {\n if (!tooltipRef.current) {\n return\n }\n const newPlacement = getReplacement({\n tooltip: tooltipRef.current,\n keepInContainer,\n placement,\n rootElement,\n })\n setReplacement(newPlacement)\n }, [rootElement, keepInContainer, placement])\n\n const ContentComponent = useMemo(\n () => getContentComponent(content),\n [content]\n )\n\n const contentWrapperStyle = useMemo(() => {\n if (tooltipContainer) {\n return {\n ...givenContentWrapperStyle,\n ...getTooltipStyle({\n tooltipContainer,\n placement: replacement,\n offset,\n allowHover,\n }),\n }\n }\n\n return {}\n }, [\n tooltipContainer,\n givenContentWrapperStyle,\n replacement,\n offset,\n allowHover,\n ])\n\n const Comp = as ?? 'div'\n\n return ReactDOM.createPortal(\n <InvertedThemeProvider>\n <div\n style={contentWrapperStyle}\n className={classNames(\n styles.LegacyTooltipContentWrapper,\n (disabled || isEmpty(content)) && styles.disabled,\n contentWrapperClassName\n )}\n ref={tooltipWrapperRef}\n >\n <Comp\n style={contentStyle}\n className={classNames(styles.LegacyTooltipContent, contentClassName)}\n ref={mergedRef}\n {...rest}\n >\n <Text\n color=\"txt-black-darkest\"\n truncated={20}\n typo=\"13\"\n >\n {ContentComponent}\n </Text>\n </Comp>\n </div>\n </InvertedThemeProvider>,\n rootElement\n )\n}\n"],"names":["getNewLineComponent","strContent","split","map","str","index","React","createElement","Text","key","typo","Fragment","getContentComponent","content","isArray","item","isString","LegacyTooltipContent","as","contentStyle","contentClassName","contentWrapperClassName","contentWrapperStyle","givenContentWrapperStyle","disabled","keepInContainer","placement","tooltipContainer","offset","allowHover","forwardedRef","rest","rootElement","useRootElement","tooltipRef","useRef","tooltipWrapperRef","mergedRef","useMergeRefs","replacement","setReplacement","useState","handleClickTooltip","useCallback","event","stopPropagation","useEventHandler","current","useEffect","newPlacement","getReplacement","tooltip","ContentComponent","useMemo","getTooltipStyle","Comp","ReactDOM","createPortal","InvertedThemeProvider","style","className","classNames","styles","LegacyTooltipContentWrapper","isEmpty","ref","Object","assign","color","truncated"],"mappings":";;;;;;;;;;;;;;AAoBA,SAASA,mBAAmBA,CAACC,UAAkB,EAAE;AAC/C,EAAA,OAAOA,UAAU,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK;IAChD,IAAIA,KAAK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AACX,GAAC,EAAE,CACDF,gBAAgB,EAChBJ,wBAAwB,EACxBgB,WAAW,EACXX,MAAM,EACNC,UAAU,CACX,CAAC;EAEF,MAAM0B,IAAI,GAAGrC,EAAE,KAAA,IAAA,IAAFA,EAAE,KAAFA,KAAAA,CAAAA,GAAAA,EAAE,GAAI,KAAK;AAExB,EAAA,oBAAOsC,QAAQ,CAACC,YAAY,cAC1BnD,KAAA,CAAAC,aAAA,CAACmD,mCAAqB,EAAA,IAAA,eACpBpD,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEoD,IAAAA,KAAK,EAAErC,mBAAoB;IAC3BsC,SAAS,EAAEC,aAAU,CACnBC,4BAAM,CAACC,2BAA2B,EAClC,CAACvC,QAAQ,IAAIwC,YAAO,CAACnD,OAAO,CAAC,KAAKiD,4BAAM,CAACtC,QAAQ,EACjDH,uBACF,CAAE;AACF4C,IAAAA,GAAG,EAAE7B;GAEL9B,eAAAA,KAAA,CAAAC,aAAA,CAACgD,IAAI,EAAAW,MAAA,CAAAC,MAAA,CAAA;AACHR,IAAAA,KAAK,EAAExC,YAAa;IACpByC,SAAS,EAAEC,aAAU,CAACC,4BAAM,CAAC7C,oBAAoB,EAAEG,gBAAgB,CAAE;AACrE6C,IAAAA,GAAG,EAAE5B;AAAU,GAAA,EACXN,IAAI,CAERzB,eAAAA,KAAA,CAAAC,aAAA,CAACC,SAAI,EAAA;AACH4D,IAAAA,KAAK,EAAC,mBAAmB;AACzBC,IAAAA,SAAS,EAAE,EAAG;AACd3D,IAAAA,IAAI,EAAC;AAAI,GAAA,EAER0C,gBACG,CACF,CACH,CACgB,CAAC,EACxBpB,WACF,CAAC;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyTooltip/utils.ts"],"sourcesContent":["import {\n type GetReplacement,\n type GetTooltipStyle,\n type LegacyTooltipPosition,\n} from './LegacyTooltip.types'\n\nexport function getReplacement({\n tooltip,\n keepInContainer,\n placement,\n rootElement,\n}: GetReplacement): LegacyTooltipPosition {\n if (!keepInContainer) {\n return placement\n }\n\n const {\n width: tooltipWidth,\n height: tooltipHeight,\n top: tooltipTop,\n left: tooltipLeft,\n } = tooltip.getBoundingClientRect()\n\n const {\n width: rootWidth,\n height: rootHeight,\n top: rootTop,\n left: rootLeft,\n } = rootElement.getBoundingClientRect()\n\n const isOverTop = tooltipTop < rootTop\n const isOverBottom = tooltipTop + tooltipHeight > rootTop + rootHeight\n const isOverLeft = tooltipLeft < rootLeft\n const isOverRight = tooltipLeft + tooltipWidth > rootLeft + rootWidth\n\n if (isOverTop) {\n if (isOverLeft) {\n return 'bottom-left'\n }\n if (isOverRight) {\n return 'bottom-right'\n }\n return 'bottom-center'\n }\n\n if (isOverBottom) {\n if (isOverLeft) {\n return 'top-left'\n }\n if (isOverRight) {\n return 'top-right'\n }\n return 'top-center'\n }\n\n if (isOverLeft) {\n if (isOverTop) {\n return 'right-top'\n }\n if (isOverBottom) {\n return 'right-bottom'\n }\n return 'right-center'\n }\n\n if (isOverRight) {\n if (isOverTop) {\n return 'left-top'\n }\n if (isOverBottom) {\n return 'left-bottom'\n }\n return 'left-center'\n }\n\n return placement\n}\n\nexport function getTooltipStyle({\n tooltipContainer,\n placement,\n offset,\n allowHover,\n}: GetTooltipStyle) {\n const {\n top: containerTop,\n left: containerLeft,\n width: containerWidth,\n height: containerHeight,\n } = tooltipContainer.getBoundingClientRect()\n\n let top = containerTop\n let left = containerLeft\n let translateX = 0\n let translateY = 0\n\n let offsetTop = 0\n let offsetRight = 0\n let offsetBottom = 0\n let offsetLeft = 0\n let offsetStyle = {}\n\n switch (placement) {\n case 'top-center':\n case 'top-left':\n case 'top-right':\n translateY = -100\n offsetBottom = offset\n break\n case 'right-center':\n case 'right-top':\n case 'right-bottom':\n left += containerWidth\n offsetLeft = offset\n break\n case 'bottom-center':\n case 'bottom-left':\n case 'bottom-right':\n top += containerHeight\n offsetTop = offset\n break\n case 'left-center':\n case 'left-top':\n case 'left-bottom':\n translateX = -100\n offsetRight = offset\n break\n }\n\n switch (placement) {\n case 'top-center':\n case 'bottom-center':\n translateX = -50\n left += containerWidth / 2\n break\n case 'top-right':\n case 'bottom-right':\n translateX = -100\n left += containerWidth\n break\n case 'right-center':\n case 'left-center':\n translateY = -50\n top += containerHeight / 2\n break\n case 'right-bottom':\n case 'left-bottom':\n translateY = -100\n top += containerHeight\n break\n }\n\n if (allowHover) {\n offsetStyle = {\n paddingTop: offsetTop,\n paddingRight: offsetRight,\n paddingBottom: offsetBottom,\n paddingLeft: offsetLeft,\n }\n } else {\n top += offsetTop - offsetBottom\n left += offsetLeft - offsetRight\n }\n\n return {\n position: 'fixed',\n top,\n left,\n transform: `translate(${translateX}%, ${translateY}%)`,\n ...offsetStyle,\n }\n}\n"],"names":["getReplacement","tooltip","keepInContainer","placement","rootElement","width","tooltipWidth","height","tooltipHeight","top","tooltipTop","left","tooltipLeft","getBoundingClientRect","rootWidth","rootHeight","rootTop","rootLeft","isOverTop","isOverBottom","isOverLeft","isOverRight","getTooltipStyle","tooltipContainer","offset","allowHover","containerTop","containerLeft","containerWidth","containerHeight","translateX","translateY","offsetTop","offsetRight","offsetBottom","offsetLeft","offsetStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","position","transform"],"mappings":";;AAMO,SAASA,cAAcA,CAAC;EAC7BC,OAAO;EACPC,eAAe;EACfC,SAAS;AACTC,EAAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyTooltip/utils.ts"],"sourcesContent":["import {\n type GetReplacement,\n type GetTooltipStyle,\n type LegacyTooltipPosition,\n} from './LegacyTooltip.types'\n\nexport function getReplacement({\n tooltip,\n keepInContainer,\n placement,\n rootElement,\n}: GetReplacement): LegacyTooltipPosition {\n if (!keepInContainer) {\n return placement\n }\n\n const {\n width: tooltipWidth,\n height: tooltipHeight,\n top: tooltipTop,\n left: tooltipLeft,\n } = tooltip.getBoundingClientRect()\n\n const {\n width: rootWidth,\n height: rootHeight,\n top: rootTop,\n left: rootLeft,\n } = rootElement.getBoundingClientRect()\n\n const isOverTop = tooltipTop < rootTop\n const isOverBottom = tooltipTop + tooltipHeight > rootTop + rootHeight\n const isOverLeft = tooltipLeft < rootLeft\n const isOverRight = tooltipLeft + tooltipWidth > rootLeft + rootWidth\n\n if (isOverTop) {\n if (isOverLeft) {\n return 'bottom-left'\n }\n if (isOverRight) {\n return 'bottom-right'\n }\n return 'bottom-center'\n }\n\n if (isOverBottom) {\n if (isOverLeft) {\n return 'top-left'\n }\n if (isOverRight) {\n return 'top-right'\n }\n return 'top-center'\n }\n\n if (isOverLeft) {\n if (isOverTop) {\n return 'right-top'\n }\n if (isOverBottom) {\n return 'right-bottom'\n }\n return 'right-center'\n }\n\n if (isOverRight) {\n if (isOverTop) {\n return 'left-top'\n }\n if (isOverBottom) {\n return 'left-bottom'\n }\n return 'left-center'\n }\n\n return placement\n}\n\nexport function getTooltipStyle({\n tooltipContainer,\n placement,\n offset,\n allowHover,\n}: GetTooltipStyle) {\n const {\n top: containerTop,\n left: containerLeft,\n width: containerWidth,\n height: containerHeight,\n } = tooltipContainer.getBoundingClientRect()\n\n let top = containerTop\n let left = containerLeft\n let translateX = 0\n let translateY = 0\n\n let offsetTop = 0\n let offsetRight = 0\n let offsetBottom = 0\n let offsetLeft = 0\n let offsetStyle = {}\n\n switch (placement) {\n case 'top-center':\n case 'top-left':\n case 'top-right':\n translateY = -100\n offsetBottom = offset\n break\n case 'right-center':\n case 'right-top':\n case 'right-bottom':\n left += containerWidth\n offsetLeft = offset\n break\n case 'bottom-center':\n case 'bottom-left':\n case 'bottom-right':\n top += containerHeight\n offsetTop = offset\n break\n case 'left-center':\n case 'left-top':\n case 'left-bottom':\n translateX = -100\n offsetRight = offset\n break\n }\n\n switch (placement) {\n case 'top-center':\n case 'bottom-center':\n translateX = -50\n left += containerWidth / 2\n break\n case 'top-right':\n case 'bottom-right':\n translateX = -100\n left += containerWidth\n break\n case 'right-center':\n case 'left-center':\n translateY = -50\n top += containerHeight / 2\n break\n case 'right-bottom':\n case 'left-bottom':\n translateY = -100\n top += containerHeight\n break\n }\n\n if (allowHover) {\n offsetStyle = {\n paddingTop: offsetTop,\n paddingRight: offsetRight,\n paddingBottom: offsetBottom,\n paddingLeft: offsetLeft,\n }\n } else {\n top += offsetTop - offsetBottom\n left += offsetLeft - offsetRight\n }\n\n return {\n position: 'fixed',\n top,\n left,\n transform: `translate(${translateX}%, ${translateY}%)`,\n ...offsetStyle,\n }\n}\n"],"names":["getReplacement","tooltip","keepInContainer","placement","rootElement","width","tooltipWidth","height","tooltipHeight","top","tooltipTop","left","tooltipLeft","getBoundingClientRect","rootWidth","rootHeight","rootTop","rootLeft","isOverTop","isOverBottom","isOverLeft","isOverRight","getTooltipStyle","tooltipContainer","offset","allowHover","containerTop","containerLeft","containerWidth","containerHeight","translateX","translateY","offsetTop","offsetRight","offsetBottom","offsetLeft","offsetStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","position","transform"],"mappings":";;AAMO,SAASA,cAAcA,CAAC;EAC7BC,OAAO;EACPC,eAAe;EACfC,SAAS;AACTC,EAAAA;AACc,CAAC,EAAyB;EACxC,IAAI,CAACF,eAAe,EAAE;AACpB,IAAA,OAAOC,SAAS;AAClB;EAEA,MAAM;AACJE,IAAAA,KAAK,EAAEC,YAAY;AACnBC,IAAAA,MAAM,EAAEC,aAAa;AACrBC,IAAAA,GAAG,EAAEC,UAAU;AACfC,IAAAA,IAAI,EAAEC;AACR,GAAC,GAAGX,OAAO,CAACY,qBAAqB,EAAE;EAEnC,MAAM;AACJR,IAAAA,KAAK,EAAES,SAAS;AAChBP,IAAAA,MAAM,EAAEQ,UAAU;AAClBN,IAAAA,GAAG,EAAEO,OAAO;AACZL,IAAAA,IAAI,EAAEM;AACR,GAAC,GAAGb,WAAW,CAACS,qBAAqB,EAAE;AAEvC,EAAA,MAAMK,SAAS,GAAGR,UAAU,GAAGM,OAAO;EACtC,MAAMG,YAA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