@channel.io/bezier-react 1.7.0 → 1.7.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/_virtual/_rollupPluginBabelHelpers.js +35 -0
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/cjs/components/Banner/Banner.const.js +4 -2
- package/dist/cjs/components/Banner/Banner.const.js.map +1 -1
- package/dist/cjs/components/Forms/FormControl/FormControl.js +1 -1
- package/dist/cjs/components/Forms/FormControl/FormControl.js.map +1 -1
- package/dist/cjs/components/Forms/FormControl/FormControlContext.js +4 -3
- package/dist/cjs/components/Forms/FormControl/FormControlContext.js.map +1 -1
- package/dist/cjs/components/Forms/FormGroup/FormGroup.js +2 -2
- package/dist/cjs/components/Forms/FormGroup/FormGroup.js.map +1 -1
- package/dist/cjs/components/Forms/FormHelperText/FormHelperText.js +2 -2
- package/dist/cjs/components/Forms/FormHelperText/FormHelperText.js.map +1 -1
- package/dist/cjs/components/Forms/FormLabel/FormLabel.js +2 -2
- package/dist/cjs/components/Forms/FormLabel/FormLabel.js.map +1 -1
- package/dist/cjs/components/Forms/Inputs/mixins.js +41 -22
- package/dist/cjs/components/Forms/Inputs/mixins.js.map +1 -1
- package/dist/cjs/components/Forms/SegmentedControl/SegmentedControlContext.js +3 -15
- package/dist/cjs/components/Forms/SegmentedControl/SegmentedControlContext.js.map +1 -1
- package/dist/cjs/components/Forms/useFormFieldProps.js +2 -2
- package/dist/cjs/components/Forms/useFormFieldProps.js.map +1 -1
- package/dist/cjs/components/ListItem/ListItem.styled.js +1 -1
- package/dist/cjs/components/ListItem/utils.js +20 -8
- package/dist/cjs/components/ListItem/utils.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/Modal.types.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/ModalAnimation.styled.js +57 -11
- package/dist/cjs/components/Modals/Modal/ModalAnimation.styled.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/ModalContent.js +1 -1
- package/dist/cjs/components/Modals/Modal/ModalContent.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/ModalContentContext.js +4 -6
- package/dist/cjs/components/Modals/Modal/ModalContentContext.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/ModalHeader.js +1 -1
- package/dist/cjs/components/Modals/Modal/ModalHeader.js.map +1 -1
- package/dist/cjs/components/OutlineItem/OutlineItem.js +2 -3
- package/dist/cjs/components/OutlineItem/OutlineItem.js.map +1 -1
- package/dist/cjs/components/OutlineItem/OutlineItemContext.js +9 -5
- package/dist/cjs/components/OutlineItem/OutlineItemContext.js.map +1 -1
- package/dist/cjs/components/Overlay/utils.js +6 -2
- package/dist/cjs/components/Overlay/utils.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.styled.js +1 -1
- package/dist/cjs/components/Tabs/TabAction.js +1 -1
- package/dist/cjs/components/Tabs/TabAction.js.map +1 -1
- package/dist/cjs/components/Tabs/TabItem.js +1 -1
- package/dist/cjs/components/Tabs/TabItem.js.map +1 -1
- package/dist/cjs/components/Tabs/TabList.js +1 -1
- package/dist/cjs/components/Tabs/TabList.js.map +1 -1
- package/dist/cjs/components/Tabs/TabListContext.js +4 -6
- package/dist/cjs/components/Tabs/TabListContext.js.map +1 -1
- package/dist/cjs/components/Toast/ToastContext.js +4 -6
- package/dist/cjs/components/Toast/ToastContext.js.map +1 -1
- package/dist/cjs/components/Toast/ToastProvider.js +2 -5
- package/dist/cjs/components/Toast/ToastProvider.js.map +1 -1
- package/dist/cjs/components/Toast/ToastService.js +9 -9
- package/dist/cjs/components/Toast/ToastService.js.map +1 -1
- package/dist/cjs/components/Toast/useToast.js +2 -3
- package/dist/cjs/components/Toast/useToast.js.map +1 -1
- package/dist/cjs/components/Toast/utils.js +11 -5
- package/dist/cjs/components/Toast/utils.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +4 -16
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.styled.js +3 -56
- package/dist/cjs/components/Tooltip/Tooltip.styled.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.types.js.map +1 -1
- package/dist/cjs/features/FeatureProvider.js +4 -3
- package/dist/cjs/features/FeatureProvider.js.map +1 -1
- package/dist/cjs/features/SmoothCornersFeature/SmoothCornersFeature.js +2 -2
- package/dist/cjs/features/SmoothCornersFeature/SmoothCornersFeature.js.map +1 -1
- package/dist/cjs/index.js +1 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +21 -0
- package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/dist/cjs/node_modules/@radix-ui/react-checkbox/dist/index.js +4 -4
- package/dist/cjs/node_modules/@radix-ui/react-dialog/dist/index.js +12 -12
- package/dist/cjs/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +2 -2
- package/dist/cjs/node_modules/@radix-ui/react-focus-scope/dist/index.js +2 -2
- package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js +3 -3
- package/dist/cjs/node_modules/@radix-ui/react-portal/dist/index.js +2 -2
- package/dist/cjs/node_modules/@radix-ui/react-primitive/dist/index.js +2 -2
- package/dist/cjs/node_modules/@radix-ui/react-radio-group/dist/index.js +7 -7
- package/dist/cjs/node_modules/@radix-ui/react-roving-focus/dist/index.js +4 -4
- package/dist/cjs/node_modules/@radix-ui/react-separator/dist/index.js +2 -2
- package/dist/cjs/node_modules/@radix-ui/react-slider/dist/index.js +10 -10
- package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js +3 -3
- package/dist/cjs/node_modules/@radix-ui/react-switch/dist/index.js +4 -4
- package/dist/cjs/node_modules/@radix-ui/react-tabs/dist/index.js +7 -7
- package/dist/cjs/node_modules/@radix-ui/react-toggle-group/dist/index.js +0 -1
- package/dist/cjs/node_modules/@radix-ui/react-toggle-group/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@radix-ui/react-toolbar/dist/index.js +7 -7
- package/dist/cjs/node_modules/@radix-ui/react-tooltip/dist/index.js +7 -7
- package/dist/cjs/node_modules/@radix-ui/react-visually-hidden/dist/index.js +2 -2
- package/dist/cjs/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js +4 -4
- package/dist/cjs/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js.map +1 -1
- package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.js +21 -0
- package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +19 -0
- package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
- package/dist/cjs/utils/reactUtils.js +21 -0
- package/dist/cjs/utils/reactUtils.js.map +1 -1
- package/dist/cjs/utils/styleUtils.js +26 -2
- package/dist/cjs/utils/styleUtils.js.map +1 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.mjs +31 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
- package/dist/esm/components/Banner/Banner.const.mjs +4 -2
- package/dist/esm/components/Banner/Banner.const.mjs.map +1 -1
- package/dist/esm/components/Forms/FormControl/FormControl.mjs +2 -2
- package/dist/esm/components/Forms/FormControl/FormControl.mjs.map +1 -1
- package/dist/esm/components/Forms/FormControl/FormControlContext.mjs +3 -3
- package/dist/esm/components/Forms/FormControl/FormControlContext.mjs.map +1 -1
- package/dist/esm/components/Forms/FormGroup/FormGroup.mjs +1 -1
- package/dist/esm/components/Forms/FormGroup/FormGroup.mjs.map +1 -1
- package/dist/esm/components/Forms/FormHelperText/FormHelperText.mjs +1 -1
- package/dist/esm/components/Forms/FormHelperText/FormHelperText.mjs.map +1 -1
- package/dist/esm/components/Forms/FormLabel/FormLabel.mjs +1 -1
- package/dist/esm/components/Forms/FormLabel/FormLabel.mjs.map +1 -1
- package/dist/esm/components/Forms/Inputs/mixins.mjs +41 -22
- package/dist/esm/components/Forms/Inputs/mixins.mjs.map +1 -1
- package/dist/esm/components/Forms/SegmentedControl/SegmentedControlContext.mjs +3 -15
- package/dist/esm/components/Forms/SegmentedControl/SegmentedControlContext.mjs.map +1 -1
- package/dist/esm/components/Forms/useFormFieldProps.mjs +1 -1
- package/dist/esm/components/Forms/useFormFieldProps.mjs.map +1 -1
- package/dist/esm/components/ListItem/ListItem.styled.mjs +1 -1
- package/dist/esm/components/ListItem/utils.mjs +20 -8
- package/dist/esm/components/ListItem/utils.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/Modal.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/Modal.types.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/ModalAnimation.styled.mjs +57 -11
- package/dist/esm/components/Modals/Modal/ModalAnimation.styled.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/ModalContent.mjs +2 -2
- package/dist/esm/components/Modals/Modal/ModalContent.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/ModalContentContext.mjs +3 -4
- package/dist/esm/components/Modals/Modal/ModalContentContext.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/ModalHeader.mjs +3 -3
- package/dist/esm/components/Modals/Modal/ModalHeader.mjs.map +1 -1
- package/dist/esm/components/OutlineItem/OutlineItem.mjs +2 -3
- package/dist/esm/components/OutlineItem/OutlineItem.mjs.map +1 -1
- package/dist/esm/components/OutlineItem/OutlineItemContext.mjs +8 -3
- package/dist/esm/components/OutlineItem/OutlineItemContext.mjs.map +1 -1
- package/dist/esm/components/Overlay/utils.mjs +6 -2
- package/dist/esm/components/Overlay/utils.mjs.map +1 -1
- package/dist/esm/components/Spinner/Spinner.styled.mjs +1 -1
- package/dist/esm/components/Tabs/TabAction.mjs +3 -3
- package/dist/esm/components/Tabs/TabAction.mjs.map +1 -1
- package/dist/esm/components/Tabs/TabItem.mjs +3 -3
- package/dist/esm/components/Tabs/TabItem.mjs.map +1 -1
- package/dist/esm/components/Tabs/TabList.mjs +2 -2
- package/dist/esm/components/Tabs/TabList.mjs.map +1 -1
- package/dist/esm/components/Tabs/TabListContext.mjs +3 -4
- package/dist/esm/components/Tabs/TabListContext.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastContext.mjs +3 -4
- package/dist/esm/components/Toast/ToastContext.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastProvider.mjs +3 -6
- package/dist/esm/components/Toast/ToastProvider.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastService.mjs +1 -1
- package/dist/esm/components/Toast/useToast.mjs +3 -4
- package/dist/esm/components/Toast/useToast.mjs.map +1 -1
- package/dist/esm/components/Toast/utils.mjs +11 -5
- package/dist/esm/components/Toast/utils.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.mjs +4 -16
- package/dist/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.styled.mjs +3 -56
- package/dist/esm/components/Tooltip/Tooltip.styled.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.types.mjs.map +1 -1
- package/dist/esm/features/FeatureProvider.mjs +5 -4
- package/dist/esm/features/FeatureProvider.mjs.map +1 -1
- package/dist/esm/features/SmoothCornersFeature/SmoothCornersFeature.mjs +1 -1
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.mjs +17 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.mjs.map +1 -0
- package/dist/esm/node_modules/@radix-ui/react-checkbox/dist/index.mjs +4 -4
- package/dist/esm/node_modules/@radix-ui/react-dialog/dist/index.mjs +12 -12
- package/dist/esm/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-popper/dist/index.mjs +3 -3
- package/dist/esm/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-primitive/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-radio-group/dist/index.mjs +7 -7
- package/dist/esm/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +4 -4
- package/dist/esm/node_modules/@radix-ui/react-separator/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-slider/dist/index.mjs +10 -10
- package/dist/esm/node_modules/@radix-ui/react-slot/dist/index.mjs +3 -3
- package/dist/esm/node_modules/@radix-ui/react-switch/dist/index.mjs +4 -4
- package/dist/esm/node_modules/@radix-ui/react-tabs/dist/index.mjs +7 -7
- package/dist/esm/node_modules/@radix-ui/react-toggle-group/dist/index.mjs +0 -1
- package/dist/esm/node_modules/@radix-ui/react-toggle-group/dist/index.mjs.map +1 -1
- package/dist/esm/node_modules/@radix-ui/react-toolbar/dist/index.mjs +7 -7
- package/dist/esm/node_modules/@radix-ui/react-tooltip/dist/index.mjs +7 -7
- package/dist/esm/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +2 -2
- package/dist/esm/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.mjs +3 -3
- package/dist/esm/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.mjs.map +1 -1
- package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.mjs +17 -0
- package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.mjs.map +1 -0
- package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs +15 -0
- package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs.map +1 -0
- package/dist/esm/utils/reactUtils.mjs +21 -1
- package/dist/esm/utils/reactUtils.mjs.map +1 -1
- package/dist/esm/utils/styleUtils.mjs +26 -2
- package/dist/esm/utils/styleUtils.mjs.map +1 -1
- package/dist/types/components/Forms/FormControl/FormControlContext.d.ts +1 -1
- package/dist/types/components/Forms/FormControl/FormControlContext.d.ts.map +1 -1
- package/dist/types/components/Forms/FormControl/index.d.ts +1 -1
- package/dist/types/components/Forms/FormControl/index.d.ts.map +1 -1
- package/dist/types/components/Forms/SegmentedControl/SegmentedControlContext.d.ts +3 -3
- package/dist/types/components/Forms/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/types/components/Forms/index.d.ts +1 -2
- package/dist/types/components/Forms/index.d.ts.map +1 -1
- package/dist/types/components/Forms/useFormFieldProps.d.ts.map +1 -1
- package/dist/types/components/Modals/Modal/Modal.types.d.ts +1 -1
- package/dist/types/components/Modals/Modal/Modal.types.d.ts.map +1 -1
- package/dist/types/components/Modals/Modal/ModalContentContext.d.ts +2 -3
- package/dist/types/components/Modals/Modal/ModalContentContext.d.ts.map +1 -1
- package/dist/types/components/Modals/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/types/components/OutlineItem/OutlineItem.d.ts.map +1 -1
- package/dist/types/components/OutlineItem/OutlineItemContext.d.ts +4 -10
- package/dist/types/components/OutlineItem/OutlineItemContext.d.ts.map +1 -1
- package/dist/types/components/Tabs/TabAction.d.ts.map +1 -1
- package/dist/types/components/Tabs/TabItem.d.ts.map +1 -1
- package/dist/types/components/Tabs/TabListContext.d.ts +1 -2
- package/dist/types/components/Tabs/TabListContext.d.ts.map +1 -1
- package/dist/types/components/Toast/ToastContext.d.ts +1 -2
- package/dist/types/components/Toast/ToastContext.d.ts.map +1 -1
- package/dist/types/components/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/types/components/Toast/useToast.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.styled.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.types.d.ts +3 -3
- package/dist/types/features/FeatureProvider.d.ts.map +1 -1
- package/dist/types/utils/reactUtils.d.ts +14 -0
- package/dist/types/utils/reactUtils.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/components/Forms/FormControl/FormControl.tsx +3 -3
- package/src/components/Forms/FormControl/FormControlContext.ts +5 -2
- package/src/components/Forms/FormControl/index.ts +1 -1
- package/src/components/Forms/FormGroup/FormGroup.tsx +1 -1
- package/src/components/Forms/FormHelperText/FormHelperText.tsx +1 -1
- package/src/components/Forms/FormLabel/FormLabel.tsx +1 -1
- package/src/components/Forms/SegmentedControl/SegmentedControlContext.ts +3 -26
- package/src/components/Forms/Slider/Slider.test.tsx +11 -4
- package/src/components/Forms/index.ts +0 -2
- package/src/components/Forms/useFormFieldProps.ts +1 -2
- package/src/components/KeyValueListItem/KeyValueListItem.test.tsx +4 -1
- package/src/components/Modals/Modal/Modal.stories.tsx +1 -1
- package/src/components/Modals/Modal/Modal.tsx +0 -1
- package/src/components/Modals/Modal/Modal.types.ts +1 -1
- package/src/components/Modals/Modal/ModalContent.tsx +3 -3
- package/src/components/Modals/Modal/ModalContentContext.ts +5 -4
- package/src/components/Modals/Modal/ModalHeader.tsx +3 -6
- package/src/components/OutlineItem/OutlineItem.tsx +6 -4
- package/src/components/OutlineItem/OutlineItemContext.ts +16 -5
- package/src/components/Tabs/TabAction.tsx +3 -6
- package/src/components/Tabs/TabItem.tsx +3 -6
- package/src/components/Tabs/TabList.tsx +3 -3
- package/src/components/Tabs/TabListContext.ts +5 -4
- package/src/components/Toast/ToastContext.ts +5 -5
- package/src/components/Toast/ToastProvider.tsx +3 -5
- package/src/components/Toast/useToast.ts +3 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.styled.ts +0 -77
- package/src/components/Tooltip/Tooltip.test.tsx +8 -2
- package/src/components/Tooltip/Tooltip.tsx +4 -27
- package/src/components/Tooltip/Tooltip.types.ts +3 -3
- package/src/components/Tooltip/index.ts +0 -1
- package/src/features/FeatureProvider.tsx +9 -6
- package/src/utils/reactUtils.ts +41 -0
- package/dist/cjs/components/Forms/useFormControlContext.js +0 -13
- package/dist/cjs/components/Forms/useFormControlContext.js.map +0 -1
- package/dist/cjs/components/OutlineItem/useOutlineItemContext.js +0 -16
- package/dist/cjs/components/OutlineItem/useOutlineItemContext.js.map +0 -1
- package/dist/esm/components/Forms/useFormControlContext.mjs +0 -9
- package/dist/esm/components/Forms/useFormControlContext.mjs.map +0 -1
- package/dist/esm/components/OutlineItem/useOutlineItemContext.mjs +0 -12
- package/dist/esm/components/OutlineItem/useOutlineItemContext.mjs.map +0 -1
- package/dist/types/components/Forms/useFormControlContext.d.ts +0 -3
- package/dist/types/components/Forms/useFormControlContext.d.ts.map +0 -1
- package/dist/types/components/OutlineItem/useOutlineItemContext.d.ts +0 -4
- package/dist/types/components/OutlineItem/useOutlineItemContext.d.ts.map +0 -1
- package/src/components/Forms/useFormControlContext.ts +0 -9
- package/src/components/OutlineItem/useOutlineItemContext.ts +0 -16
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _defineProperty(obj, key, value) {
|
|
4
|
+
key = _toPropertyKey(key);
|
|
5
|
+
if (key in obj) {
|
|
6
|
+
Object.defineProperty(obj, key, {
|
|
7
|
+
value: value,
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
obj[key] = value;
|
|
14
|
+
}
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
function _toPrimitive(input, hint) {
|
|
18
|
+
if (typeof input !== "object" || input === null) return input;
|
|
19
|
+
var prim = input[Symbol.toPrimitive];
|
|
20
|
+
if (prim !== undefined) {
|
|
21
|
+
var res = prim.call(input, hint || "default");
|
|
22
|
+
if (typeof res !== "object") return res;
|
|
23
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
24
|
+
}
|
|
25
|
+
return (hint === "string" ? String : Number)(input);
|
|
26
|
+
}
|
|
27
|
+
function _toPropertyKey(arg) {
|
|
28
|
+
var key = _toPrimitive(arg, "string");
|
|
29
|
+
return typeof key === "symbol" ? key : String(key);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.defineProperty = _defineProperty;
|
|
33
|
+
exports.toPrimitive = _toPrimitive;
|
|
34
|
+
exports.toPropertyKey = _toPropertyKey;
|
|
35
|
+
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -41,9 +41,11 @@ const TEXT_COLORS = {
|
|
|
41
41
|
[Banner_types.BannerVariant.Alt]: 'txt-black-darker'
|
|
42
42
|
};
|
|
43
43
|
const ELEVATIONS = {
|
|
44
|
-
[Banner_types.BannerVariant.Alt]: FoundationStyledComponent.css
|
|
44
|
+
[Banner_types.BannerVariant.Alt]: FoundationStyledComponent.css`
|
|
45
|
+
${({
|
|
45
46
|
foundation
|
|
46
|
-
}) => foundation?.elevation?.ev2()
|
|
47
|
+
}) => foundation?.elevation?.ev2()}
|
|
48
|
+
`
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
exports.ACTION_BUTTON_COLOR_VARIANTS = ACTION_BUTTON_COLOR_VARIANTS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.const.js","sources":["../../../../src/components/Banner/Banner.const.ts"],"sourcesContent":["import {\n type SemanticNames,\n css,\n} from '~/src/foundation'\n\nimport type { InjectedInterpolation } from '~/src/types/Foundation'\n\nimport { ButtonColorVariant } from '~/src/components/Button'\n\nimport { BannerVariant } from './Banner.types'\n\nexport const BACKGROUND_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'bg-black-lighter',\n [BannerVariant.Blue]: 'bgtxt-blue-lightest',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-lightest',\n [BannerVariant.Green]: 'bgtxt-green-lightest',\n [BannerVariant.Orange]: 'bgtxt-orange-lightest',\n [BannerVariant.Red]: 'bgtxt-red-lightest',\n [BannerVariant.Alt]: 'bg-grey-lighter',\n}\n\nexport const DEFAULT_ICON_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'bgtxt-red-normal',\n}\n\nexport const ACTION_BUTTON_COLOR_VARIANTS: Record<BannerVariant, ButtonColorVariant> = {\n [BannerVariant.Default]: ButtonColorVariant.MonochromeDark,\n [BannerVariant.Blue]: ButtonColorVariant.Blue,\n [BannerVariant.Cobalt]: ButtonColorVariant.Cobalt,\n [BannerVariant.Green]: ButtonColorVariant.Green,\n [BannerVariant.Orange]: ButtonColorVariant.Orange,\n [BannerVariant.Red]: ButtonColorVariant.Red,\n [BannerVariant.Alt]: ButtonColorVariant.MonochromeDark,\n}\n\nexport const TEXT_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'txt-black-darker',\n}\n\nexport const ELEVATIONS: { [key in BannerVariant]?: InjectedInterpolation } = {\n [BannerVariant.Alt]: css`\n ${({ foundation }) => foundation?.elevation?.ev2()}\n `,\n}\n"],"names":["BACKGROUND_COLORS","BannerVariant","Default","Blue","Cobalt","Green","Orange","Red","Alt","DEFAULT_ICON_COLORS","ACTION_BUTTON_COLOR_VARIANTS","ButtonColorVariant","MonochromeDark","TEXT_COLORS","ELEVATIONS","css","foundation","elevation","ev2"],"mappings":";;;;;;AAWO,MAAMA,iBAAuD,GAAG;AACrE,EAAA,CAACC,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,qBAAqB;AAC3C,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,sBAAsB;AAC7C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,oBAAoB;EACzC,CAACN,0BAAa,CAACO,GAAG,GAAG,iBAAA;AACvB,EAAC;AAEM,MAAMC,mBAAyD,GAAG;AACvE,EAAA,CAACR,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,kBAAkB;EACvC,CAACN,0BAAa,CAACO,GAAG,GAAG,kBAAA;AACvB,EAAC;AAEM,MAAME,4BAAuE,GAAG;AACrF,EAAA,CAACT,0BAAa,CAACC,OAAO,GAAGS,+BAAkB,CAACC,cAAc;AAC1D,EAAA,CAACX,0BAAa,CAACE,IAAI,GAAGQ,+BAAkB,CAACR,IAAI;AAC7C,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAGO,+BAAkB,CAACP,MAAM;AACjD,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAGM,+BAAkB,CAACN,KAAK;AAC/C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAGK,+BAAkB,CAACL,MAAM;AACjD,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAGI,+BAAkB,CAACJ,GAAG;AAC3C,EAAA,CAACN,0BAAa,CAACO,GAAG,GAAGG,+BAAkB,CAACC,cAAAA;AAC1C,EAAC;AAEM,MAAMC,WAAiD,GAAG;AAC/D,EAAA,CAACZ,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,kBAAkB;EACvC,CAACN,0BAAa,CAACO,GAAG,GAAG,kBAAA;AACvB,EAAC;AAEM,MAAMM,UAA8D,GAAG;AAC5E,EAAA,CAACb,0BAAa,CAACO,GAAG,GAAGO,
|
|
1
|
+
{"version":3,"file":"Banner.const.js","sources":["../../../../src/components/Banner/Banner.const.ts"],"sourcesContent":["import {\n type SemanticNames,\n css,\n} from '~/src/foundation'\n\nimport type { InjectedInterpolation } from '~/src/types/Foundation'\n\nimport { ButtonColorVariant } from '~/src/components/Button'\n\nimport { BannerVariant } from './Banner.types'\n\nexport const BACKGROUND_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'bg-black-lighter',\n [BannerVariant.Blue]: 'bgtxt-blue-lightest',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-lightest',\n [BannerVariant.Green]: 'bgtxt-green-lightest',\n [BannerVariant.Orange]: 'bgtxt-orange-lightest',\n [BannerVariant.Red]: 'bgtxt-red-lightest',\n [BannerVariant.Alt]: 'bg-grey-lighter',\n}\n\nexport const DEFAULT_ICON_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'bgtxt-red-normal',\n}\n\nexport const ACTION_BUTTON_COLOR_VARIANTS: Record<BannerVariant, ButtonColorVariant> = {\n [BannerVariant.Default]: ButtonColorVariant.MonochromeDark,\n [BannerVariant.Blue]: ButtonColorVariant.Blue,\n [BannerVariant.Cobalt]: ButtonColorVariant.Cobalt,\n [BannerVariant.Green]: ButtonColorVariant.Green,\n [BannerVariant.Orange]: ButtonColorVariant.Orange,\n [BannerVariant.Red]: ButtonColorVariant.Red,\n [BannerVariant.Alt]: ButtonColorVariant.MonochromeDark,\n}\n\nexport const TEXT_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'txt-black-darker',\n}\n\nexport const ELEVATIONS: { [key in BannerVariant]?: InjectedInterpolation } = {\n [BannerVariant.Alt]: css`\n ${({ foundation }) => foundation?.elevation?.ev2()}\n `,\n}\n"],"names":["BACKGROUND_COLORS","BannerVariant","Default","Blue","Cobalt","Green","Orange","Red","Alt","DEFAULT_ICON_COLORS","ACTION_BUTTON_COLOR_VARIANTS","ButtonColorVariant","MonochromeDark","TEXT_COLORS","ELEVATIONS","css","foundation","elevation","ev2"],"mappings":";;;;;;AAWO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A,CAACN,0BAAa,CAACO,GAAG,GAAGG,+BAAkB,CAACC,cAAAA;AAC1C,EAAC;AAEM,MAAMC,WAAiD,GAAG;AAC/D,EAAA,CAACZ,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,kBAAkB;EACvC,CAACN,0BAAa,CAACO,GAAG,GAAG,kBAAA;AACvB,EAAC;AAEM,MAAMM,UAA8D,GAAG;AAC5E,EAAA,CAACb,0BAAa,CAACO,GAAG,GAAGO,6BAAI,CAAA;AAC3B,IAAA,EAAM,CAAC;AAAEC,IAAAA,UAAAA;AAAW,GAAC,KAAKA,UAAU,EAAEC,SAAS,EAAEC,GAAG,EAAG,CAAA;AACvD,EAAA,CAAA;AACA;;;;;;;;"}
|
|
@@ -114,7 +114,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl({
|
|
|
114
114
|
if (!children) {
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
return /*#__PURE__*/React.createElement(FormControlContext.
|
|
117
|
+
return /*#__PURE__*/React.createElement(FormControlContext.FormControlContextProvider, {
|
|
118
118
|
value: contextValue
|
|
119
119
|
}, /*#__PURE__*/React.createElement(Container, Object.assign({}, bezierProps, {
|
|
120
120
|
ref: forwardedRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","sources":["../../../../../src/components/Forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useId from '~/src/hooks/useId'\nimport {\n omitBezierComponentProps,\n pickBezierComponentProps,\n} from '~/src/utils/propsUtils'\nimport { isNil } from '~/src/utils/typeUtils'\n\nimport { AlphaStack } from '~/src/components/AlphaStack'\n\n// eslint-disable-next-line no-restricted-imports\nimport FormFieldSize from '../FormFieldSize'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\nimport { FormControlContext } from './FormControlContext'\n\nimport * as Styled from './FormControl.styled'\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-react-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container({\n labelPosition,\n children,\n testId,\n ...rest\n}, forwardedRef) {\n switch (labelPosition) {\n case 'top':\n return (\n <AlphaStack\n ref={forwardedRef}\n direction=\"vertical\"\n testId={testId}\n {...rest}\n >\n { children }\n </AlphaStack>\n )\n\n case 'left':\n default:\n return (\n <Styled.Grid\n ref={forwardedRef}\n data-testid={testId}\n {...rest}\n >\n { children }\n </Styled.Grid>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(function FormControl({\n id: idProp,\n testId = FORM_CONTROL_TEST_ID,\n labelPosition = 'top',\n leftLabelWrapperHeight = FormFieldSize.M,\n style,\n children,\n ...rest\n}, forwardedRef) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(null)\n const [errorMessageNode, setErrorMessageNode] = 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) { return errorMessageId }\n if (helperTextNode) { return helperTextId }\n return undefined\n }, [\n errorMessageNode,\n helperTextNode,\n errorMessageId,\n helperTextId,\n ])\n\n const bezierProps = useMemo(() => pickBezierComponentProps(rest), [rest])\n const formCommonProps = useMemo(() => omitBezierComponentProps(rest), [rest])\n\n const getGroupProps = useCallback<GroupPropsGetter>(ownProps => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }), [\n groupId,\n labelId,\n describerId,\n ])\n\n const getLabelProps = useCallback<LabelPropsGetter>(ownProps => ({\n id: labelId,\n htmlFor: fieldId,\n typo: labelPosition === 'top' ? Typography.Size13 : Typography.Size14,\n Wrapper: labelPosition === 'top'\n ? Styled.TopLabelWrapper\n : Styled.LeftLabelWrapper,\n ...ownProps,\n }), [\n fieldId,\n labelId,\n labelPosition,\n ])\n\n const getFieldProps = useCallback<FieldPropsGetter>(ownProps => ({\n id: fieldId,\n 'aria-describedby': groupNode ? undefined : describerId,\n ...formCommonProps,\n ...ownProps,\n }), [\n fieldId,\n describerId,\n formCommonProps,\n groupNode,\n ])\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(ownProps => ({\n id: helperTextId,\n visible: isNil(formCommonProps?.hasError) || !formCommonProps?.hasError,\n ref: setHelperTextNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n helperTextId,\n labelPosition,\n formCommonProps,\n ])\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(ownProps => ({\n id: errorMessageId,\n visible: isNil(formCommonProps?.hasError) || formCommonProps?.hasError,\n ref: setErrorMessageNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n errorMessageId,\n labelPosition,\n formCommonProps,\n ])\n\n const contextValue = useMemo(() => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n ...formCommonProps,\n }), [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n formCommonProps,\n ])\n\n const containerStyle = useMemo(() => ({\n ...style,\n '--bezier-form-control-left-label-wrapper-height': `${leftLabelWrapperHeight}px`,\n } as React.CSSProperties), [\n style,\n leftLabelWrapperHeight,\n ])\n\n if (!children) { return null }\n\n return (\n <FormControlContext.Provider value={contextValue}>\n <Container\n {...bezierProps}\n ref={forwardedRef}\n style={containerStyle}\n testId={testId}\n labelPosition={labelPosition}\n >\n { children }\n </Container>\n </FormControlContext.Provider>\n )\n})\n"],"names":["FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","testId","rest","forwardedRef","React","createElement","AlphaStack","Object","assign","ref","direction","Styled","FormControl","id","idProp","leftLabelWrapperHeight","FormFieldSize","M","style","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","undefined","describerId","useMemo","bezierProps","pickBezierComponentProps","formCommonProps","omitBezierComponentProps","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","typo","Typography","Size13","Size14","Wrapper","getFieldProps","getHelperTextProps","visible","isNil","hasError","getErrorMessageProps","contextValue","containerStyle","FormControlContext","Provider","value"],"mappings":";;;;;;;;;;;;AAkCO,MAAMA,oBAAoB,GAAG,4BAA2B;AAE/D,MAAMC,SAAS,gBAAGC,gBAAU,CAA8B,SAASD,SAASA,CAAC;EAC3EE,aAAa;EACbC,QAAQ;EACRC,MAAM;EACN,GAAGC,IAAAA;AACL,CAAC,EAAEC,YAAY,EAAE;AACf,EAAA,QAAQJ,aAAa;AACnB,IAAA,KAAK,KAAK;MACR,oBACEK,KAAA,CAAAC,aAAA,CAACC,qBAAU,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACTC,QAAAA,GAAG,EAAEN,YAAa;AAClBO,QAAAA,SAAS,EAAC,UAAU;AACpBT,QAAAA,MAAM,EAA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rB,aAAO,CAAC,OAAO;IAClCrB,EAAE;IACFe,OAAO;IACPC,YAAY;IACZC,cAAc;IACdS,aAAa;IACbG,aAAa;IACbO,aAAa;IACbC,kBAAkB;IAClBI,oBAAoB;IACpB,GAAGjB,eAAAA;GACJ,CAAC,EAAE,CACFxB,EAAE,EACFe,OAAO,EACPC,YAAY,EACZC,cAAc,EACdS,aAAa,EACbG,aAAa,EACbO,aAAa,EACbC,kBAAkB,EAClBI,oBAAoB,EACpBjB,eAAe,CAChB,CAAC,CAAA;AAEF,EAAA,MAAMmB,cAAc,GAAGtB,aAAO,CAAC,OAAO;AACpC,IAAA,GAAGhB,KAAK;IACR,iDAAiD,EAAG,GAAEH,sBAAuB,CAAA,EAAA,CAAA;AAC/E,GAAC,CAAwB,EAAE,CACzBG,KAAK,EACLH,sBAAsB,CACvB,CAAC,CAAA;EAEF,IAAI,CAACf,QAAQ,EAAE;AAAE,IAAA,OAAO,IAAI,CAAA;AAAC,GAAA;AAE7B,EAAA,oBACEI,KAAA,CAAAC,aAAA,CAACoD,qCAAkB,CAACC,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,YAAAA;GAClCnD,eAAAA,KAAA,CAAAC,aAAA,CAACR,SAAS,EAAAU,MAAA,CAAAC,MAAA,CAAA,EAAA,EACJ2B,WAAW,EAAA;AACf1B,IAAAA,GAAG,EAAEN,YAAa;AAClBe,IAAAA,KAAK,EAAEsC,cAAe;AACtBvD,IAAAA,MAAM,EAAEA,MAAO;AACfF,IAAAA,aAAa,EAAEA,aAAAA;GAEbC,CAAAA,EAAAA,QACO,CACgB,CAAC,CAAA;AAElC,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"FormControl.js","sources":["../../../../../src/components/Forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useId from '~/src/hooks/useId'\nimport {\n omitBezierComponentProps,\n pickBezierComponentProps,\n} from '~/src/utils/propsUtils'\nimport { isNil } from '~/src/utils/typeUtils'\n\nimport { AlphaStack } from '~/src/components/AlphaStack'\n\n// eslint-disable-next-line no-restricted-imports\nimport FormFieldSize from '../FormFieldSize'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\nimport { FormControlContextProvider } from './FormControlContext'\n\nimport * as Styled from './FormControl.styled'\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-react-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container({\n labelPosition,\n children,\n testId,\n ...rest\n}, forwardedRef) {\n switch (labelPosition) {\n case 'top':\n return (\n <AlphaStack\n ref={forwardedRef}\n direction=\"vertical\"\n testId={testId}\n {...rest}\n >\n { children }\n </AlphaStack>\n )\n\n case 'left':\n default:\n return (\n <Styled.Grid\n ref={forwardedRef}\n data-testid={testId}\n {...rest}\n >\n { children }\n </Styled.Grid>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(function FormControl({\n id: idProp,\n testId = FORM_CONTROL_TEST_ID,\n labelPosition = 'top',\n leftLabelWrapperHeight = FormFieldSize.M,\n style,\n children,\n ...rest\n}, forwardedRef) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(null)\n const [errorMessageNode, setErrorMessageNode] = 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) { return errorMessageId }\n if (helperTextNode) { return helperTextId }\n return undefined\n }, [\n errorMessageNode,\n helperTextNode,\n errorMessageId,\n helperTextId,\n ])\n\n const bezierProps = useMemo(() => pickBezierComponentProps(rest), [rest])\n const formCommonProps = useMemo(() => omitBezierComponentProps(rest), [rest])\n\n const getGroupProps = useCallback<GroupPropsGetter>(ownProps => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }), [\n groupId,\n labelId,\n describerId,\n ])\n\n const getLabelProps = useCallback<LabelPropsGetter>(ownProps => ({\n id: labelId,\n htmlFor: fieldId,\n typo: labelPosition === 'top' ? Typography.Size13 : Typography.Size14,\n Wrapper: labelPosition === 'top'\n ? Styled.TopLabelWrapper\n : Styled.LeftLabelWrapper,\n ...ownProps,\n }), [\n fieldId,\n labelId,\n labelPosition,\n ])\n\n const getFieldProps = useCallback<FieldPropsGetter>(ownProps => ({\n id: fieldId,\n 'aria-describedby': groupNode ? undefined : describerId,\n ...formCommonProps,\n ...ownProps,\n }), [\n fieldId,\n describerId,\n formCommonProps,\n groupNode,\n ])\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(ownProps => ({\n id: helperTextId,\n visible: isNil(formCommonProps?.hasError) || !formCommonProps?.hasError,\n ref: setHelperTextNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n helperTextId,\n labelPosition,\n formCommonProps,\n ])\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(ownProps => ({\n id: errorMessageId,\n visible: isNil(formCommonProps?.hasError) || formCommonProps?.hasError,\n ref: setErrorMessageNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n errorMessageId,\n labelPosition,\n formCommonProps,\n ])\n\n const contextValue = useMemo(() => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n ...formCommonProps,\n }), [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n formCommonProps,\n ])\n\n const containerStyle = useMemo(() => ({\n ...style,\n '--bezier-form-control-left-label-wrapper-height': `${leftLabelWrapperHeight}px`,\n } as React.CSSProperties), [\n style,\n leftLabelWrapperHeight,\n ])\n\n if (!children) { return null }\n\n return (\n <FormControlContextProvider value={contextValue}>\n <Container\n {...bezierProps}\n ref={forwardedRef}\n style={containerStyle}\n testId={testId}\n labelPosition={labelPosition}\n >\n { children }\n </Container>\n </FormControlContextProvider>\n )\n})\n"],"names":["FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","testId","rest","forwardedRef","React","createElement","AlphaStack","Object","assign","ref","direction","Styled","FormControl","id","idProp","leftLabelWrapperHeight","FormFieldSize","M","style","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","undefined","describerId","useMemo","bezierProps","pickBezierComponentProps","formCommonProps","omitBezierComponentProps","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","typo","Typography","Size13","Size14","Wrapper","getFieldProps","getHelperTextProps","visible","isNil","hasError","getErrorMessageProps","contextValue","containerStyle","FormControlContextProvider","value"],"mappings":";;;;;;;;;;;;AAkCO,MAAMA,oBAAoB,GAAG,4BAA2B;AAE/D,MAAMC,SAAS,gBAAGC,gBAAU,CAA8B,SAASD,SAASA,CAAC;EAC3EE,aAAa;EACbC,QAAQ;EACRC,MAAM;EACN,GAAGC,IAAAA;AACL,CAAC,EAAEC,YAAY,EAAE;AACf,EAAA,QAAQJ,aAAa;AACnB,IAAA,KAAK,KAAK;MACR,oBACEK,KAAA,CAAAC,aAAA,CAACC,qBAAU,EAAAC,MAAA,CAAAC,MAAA,CAAA;AACTC,QAAAA,GAAG,EAAEN,YAAa;AAClBO,QAAAA,SAAS,EAAC,UAAU;AACpBT,QAAAA,MAAM,EAAEA,MAAAA;OACJC,E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AO;IAClCrB,EAAE;IACFe,OAAO;IACPC,YAAY;IACZC,cAAc;IACdS,aAAa;IACbG,aAAa;IACbO,aAAa;IACbC,kBAAkB;IAClBI,oBAAoB;IACpB,GAAGjB,eAAAA;GACJ,CAAC,EAAE,CACFxB,EAAE,EACFe,OAAO,EACPC,YAAY,EACZC,cAAc,EACdS,aAAa,EACbG,aAAa,EACbO,aAAa,EACbC,kBAAkB,EAClBI,oBAAoB,EACpBjB,eAAe,CAChB,CAAC,CAAA;AAEF,EAAA,MAAMmB,cAAc,GAAGtB,aAAO,CAAC,OAAO;AACpC,IAAA,GAAGhB,KAAK;IACR,iDAAiD,EAAG,GAAEH,sBAAuB,CAAA,EAAA,CAAA;AAC/E,GAAC,CAAwB,EAAE,CACzBG,KAAK,EACLH,sBAAsB,CACvB,CAAC,CAAA;EAEF,IAAI,CAACf,QAAQ,EAAE;AAAE,IAAA,OAAO,IAAI,CAAA;AAAC,GAAA;AAE7B,EAAA,oBACEI,KAAA,CAAAC,aAAA,CAACoD,6CAA0B,EAAA;AAACC,IAAAA,KAAK,EAAEH,YAAAA;GACjCnD,eAAAA,KAAA,CAAAC,aAAA,CAACR,SAAS,EAAAU,MAAA,CAAAC,MAAA,CAAA,EAAA,EACJ2B,WAAW,EAAA;AACf1B,IAAAA,GAAG,EAAEN,YAAa;AAClBe,IAAAA,KAAK,EAAEsC,cAAe;AACtBvD,IAAAA,MAAM,EAAEA,MAAO;AACfF,IAAAA,aAAa,EAAEA,aAAAA;GAEbC,CAAAA,EAAAA,QACO,CACe,CAAC,CAAA;AAEjC,CAAC;;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var reactUtils = require('../../../utils/reactUtils.js');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const [FormControlContextProvider, useFormControlContext] = reactUtils.createContext(undefined);
|
|
6
6
|
|
|
7
|
-
exports.
|
|
7
|
+
exports.FormControlContextProvider = FormControlContextProvider;
|
|
8
|
+
exports.useFormControlContext = useFormControlContext;
|
|
8
9
|
//# sourceMappingURL=FormControlContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControlContext.js","sources":["../../../../../src/components/Forms/FormControl/FormControlContext.ts"],"sourcesContent":["import { createContext } from '
|
|
1
|
+
{"version":3,"file":"FormControlContext.js","sources":["../../../../../src/components/Forms/FormControl/FormControlContext.ts"],"sourcesContent":["import { createContext } from '~/src/utils/reactUtils'\n\nimport { type FormControlContextValue } from '~/src/components/Forms/FormControl'\n\nexport const [\n FormControlContextProvider,\n useFormControlContext,\n] = createContext<FormControlContextValue | undefined>(undefined)\n"],"names":["FormControlContextProvider","useFormControlContext","createContext","undefined"],"mappings":";;;;AAIO,MAAM,CACXA,0BAA0B,EAC1BC,qBAAqB,CACtB,GAAGC,wBAAa,CAAsCC,SAAS;;;;;"}
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var useMergeRefs = require('../../../hooks/useMergeRefs.js');
|
|
7
7
|
var functionUtils = require('../../../utils/functionUtils.js');
|
|
8
|
-
var useFormControlContext = require('../useFormControlContext.js');
|
|
9
8
|
var FormGroup_styled = require('./FormGroup.styled.js');
|
|
9
|
+
var FormControlContext = require('../FormControl/FormControlContext.js');
|
|
10
10
|
|
|
11
11
|
const FORM_GROUP_TEST_ID = 'bezier-react-form-group';
|
|
12
12
|
function FormGroup({
|
|
@@ -17,7 +17,7 @@ function FormGroup({
|
|
|
17
17
|
children,
|
|
18
18
|
...rest
|
|
19
19
|
}, forwardedRef) {
|
|
20
|
-
const contextValue = useFormControlContext
|
|
20
|
+
const contextValue = FormControlContext.useFormControlContext();
|
|
21
21
|
const {
|
|
22
22
|
ref,
|
|
23
23
|
...ownProps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup.js","sources":["../../../../../src/components/Forms/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\n\nimport useFormControlContext from '~/src/components/Forms/
|
|
1
|
+
{"version":3,"file":"FormGroup.js","sources":["../../../../../src/components/Forms/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\nimport type FormGroupProps from './FormGroup.types'\n\nimport * as Styled from './FormGroup.styled'\n\nconst FORM_GROUP_TEST_ID = 'bezier-react-form-group'\n\nfunction FormGroup({\n testId = FORM_GROUP_TEST_ID,\n spacing = 6,\n direction = 'vertical',\n role = 'group',\n children,\n ...rest\n}: FormGroupProps,\nforwardedRef: React.Ref<HTMLDivElement>,\n) {\n const contextValue = useFormControlContext()\n\n const {\n ref,\n ...ownProps\n } = contextValue?.getGroupProps(rest) ?? {\n ref: noop,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n return (\n <Styled.Stack\n {...ownProps}\n data-testid={testId}\n ref={mergedRef}\n justify=\"start\"\n align=\"stretch\"\n spacing={spacing}\n direction={direction}\n role={role}\n >\n { children }\n </Styled.Stack>\n )\n}\n\nexport default forwardRef(FormGroup)\n"],"names":["FORM_GROUP_TEST_ID","FormGroup","testId","spacing","direction","role","children","rest","forwardedRef","contextValue","useFormControlContext","ref","ownProps","getGroupProps","noop","mergedRef","useMergeRefs","React","createElement","Styled","Object","assign","justify","align","forwardRef"],"mappings":";;;;;;;;;;AAWA,MAAMA,kBAAkB,GAAG,yBAAyB,CAAA;AAEpD,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;AAC3BG,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,SAAS,GAAG,UAAU;AACtBC,EAAAA,IAAI,GAAG,OAAO;EACdC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAuC,EACrC;AACA,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;EAE5C,MAAM;IACJC,GAAG;IACH,GAAGC,QAAAA;AACL,GAAC,GAAGH,YAAY,EAAEI,aAAa,CAACN,IAAI,CAAC,IAAI;AACvCI,IAAAA,GAAG,EAAEG,kBAAI;IACT,GAAGP,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMQ,SAAS,GAAGC,oBAAY,CAACL,GAAG,EAAEH,YAAY,CAAC,CAAA;AAEjD,EAAA,oBACES,KAAA,CAAAC,aAAA,CAACC,sBAAY,EAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,EACPT,QAAQ,EAAA;AACZ,IAAA,aAAA,EAAaV,MAAO;AACpBS,IAAAA,GAAG,EAAEI,SAAU;AACfO,IAAAA,OAAO,EAAC,OAAO;AACfC,IAAAA,KAAK,EAAC,SAAS;AACfpB,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,IAAI,EAAEA,IAAAA;AAAK,GAAA,CAAA,EAETC,QACU,CAAC,CAAA;AAEnB,CAAA;AAEA,kBAAekB,aAAAA,gBAAU,CAACvB,SAAS,CAAC;;;;"}
|
|
@@ -4,8 +4,8 @@ var React = require('react');
|
|
|
4
4
|
var useMergeRefs = require('../../../hooks/useMergeRefs.js');
|
|
5
5
|
var functionUtils = require('../../../utils/functionUtils.js');
|
|
6
6
|
var typeUtils = require('../../../utils/typeUtils.js');
|
|
7
|
-
var useFormControlContext = require('../useFormControlContext.js');
|
|
8
7
|
var FormHelperText_styled = require('./FormHelperText.styled.js');
|
|
8
|
+
var FormControlContext = require('../FormControl/FormControlContext.js');
|
|
9
9
|
var Typography = require('../../../foundation/Typography.js');
|
|
10
10
|
|
|
11
11
|
const FORM_HELPER_TEXT_TEST_ID = 'bezier-react-form-helper-text';
|
|
@@ -17,7 +17,7 @@ const BaseHelperText = /*#__PURE__*/React.forwardRef(({
|
|
|
17
17
|
children,
|
|
18
18
|
...rest
|
|
19
19
|
}, forwardedRef) => {
|
|
20
|
-
const contextValue = useFormControlContext
|
|
20
|
+
const contextValue = FormControlContext.useFormControlContext();
|
|
21
21
|
const getProps = type === 'info' ? contextValue?.getHelperTextProps : contextValue?.getErrorMessageProps;
|
|
22
22
|
const {
|
|
23
23
|
visible,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHelperText.js","sources":["../../../../../src/components/Forms/FormHelperText/FormHelperText.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport useFormControlContext from '~/src/components/Forms/
|
|
1
|
+
{"version":3,"file":"FormHelperText.js","sources":["../../../../../src/components/Forms/FormHelperText/FormHelperText.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\nimport type {\n BaseHelperTextProps,\n FormErrorMessageProps,\n FormHelperTextProps,\n} from './FormHelperText.types'\n\nimport * as Styled from './FormHelperText.styled'\n\ntype ForwardedRef = React.Ref<HTMLParamElement>\n\nexport const FORM_HELPER_TEXT_TEST_ID = 'bezier-react-form-helper-text'\nexport const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-react-form-error-message'\n\nconst BaseHelperText = forwardRef(({\n as = 'p',\n type,\n typo = Typography.Size13,\n children,\n ...rest\n}: BaseHelperTextProps,\nforwardedRef: ForwardedRef,\n) => {\n const contextValue = useFormControlContext()\n const getProps = type === 'info'\n ? contextValue?.getHelperTextProps\n : contextValue?.getErrorMessageProps\n\n const {\n visible,\n ref,\n Wrapper,\n ...ownProps\n } = getProps?.(rest) ?? {\n visible: true,\n ref: noop,\n Wrapper: React.Fragment,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n const shouldRendered = useMemo(() => (\n !isEmpty(children) && visible\n ), [\n visible,\n children,\n ])\n\n if (!shouldRendered) { return null }\n\n return (\n <Wrapper>\n <Styled.HelperText\n {...ownProps}\n ref={mergedRef}\n forwardedAs={as}\n typo={typo}\n >\n { children }\n </Styled.HelperText>\n </Wrapper>\n )\n})\n\nexport const FormHelperText = forwardRef(({\n testId = FORM_HELPER_TEXT_TEST_ID,\n color = 'txt-black-dark',\n children,\n ...rest\n}: FormHelperTextProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n type=\"info\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n\nexport const FormErrorMessage = forwardRef(({\n testId = FORM_ERROR_MESSAGE_TEST_ID,\n color = 'bgtxt-orange-normal',\n children,\n ...rest\n}: FormErrorMessageProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n aria-live=\"polite\"\n type=\"error\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n"],"names":["FORM_HELPER_TEXT_TEST_ID","FORM_ERROR_MESSAGE_TEST_ID","BaseHelperText","forwardRef","as","type","typo","Typography","Size13","children","rest","forwardedRef","contextValue","useFormControlContext","getProps","getHelperTextProps","getErrorMessageProps","visible","ref","Wrapper","ownProps","noop","React","Fragment","mergedRef","useMergeRefs","shouldRendered","useMemo","isEmpty","createElement","Styled","Object","assign","forwardedAs","FormHelperText","testId","color","FormErrorMessage"],"mappings":";;;;;;;;;;AAuBO,MAAMA,wBAAwB,GAAG,gCAA+B;AAChE,MAAMC,0BAA0B,GAAG,kCAAi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C,CAAC,CAAA;AAEWyB,MAAAA,cAAc,gBAAG/B,gBAAU,CAAC,CAAC;AACxCgC,EAAAA,MAAM,GAAGnC,wBAAwB;AACjCoC,EAAAA,KAAK,GAAG,gBAAgB;EACxB3B,QAAQ;EACR,GAAGC,IAAAA;AACgB,CAAC,EACtBC,YAA0B,kBAExBW,KAAA,CAAAO,aAAA,CAAC3B,cAAc,EAAA6B,MAAA,CAAAC,MAAA,KACTtB,IAAI,EAAA;AACRL,EAAAA,IAAI,EAAC,MAAM;AACXa,EAAAA,GAAG,EAAEP,YAAa;AAClBwB,EAAAA,MAAM,EAAEA,MAAO;AACfC,EAAAA,KAAK,EAAEA,KAAAA;AAAM,CAEX3B,CAAAA,EAAAA,QACY,CACjB,EAAC;AAEW4B,MAAAA,gBAAgB,gBAAGlC,gBAAU,CAAC,CAAC;AAC1CgC,EAAAA,MAAM,GAAGlC,0BAA0B;AACnCmC,EAAAA,KAAK,GAAG,qBAAqB;EAC7B3B,QAAQ;EACR,GAAGC,IAAAA;AACkB,CAAC,EACxBC,YAA0B,kBAExBW,KAAA,CAAAO,aAAA,CAAC3B,cAAc,EAAA6B,MAAA,CAAAC,MAAA,KACTtB,IAAI,EAAA;AACR,EAAA,WAAA,EAAU,QAAQ;AAClBL,EAAAA,IAAI,EAAC,OAAO;AACZa,EAAAA,GAAG,EAAEP,YAAa;AAClBwB,EAAAA,MAAM,EAAEA,MAAO;AACfC,EAAAA,KAAK,EAAEA,KAAAA;AAAM,CAEX3B,CAAAA,EAAAA,QACY,CACjB;;;;;;;"}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var typeUtils = require('../../../utils/typeUtils.js');
|
|
7
|
-
var useFormControlContext = require('../useFormControlContext.js');
|
|
8
7
|
var Help = require('../../Help/Help.js');
|
|
9
8
|
var FormLabel_styled = require('./FormLabel.styled.js');
|
|
9
|
+
var FormControlContext = require('../FormControl/FormControlContext.js');
|
|
10
10
|
var Typography = require('../../../foundation/Typography.js');
|
|
11
11
|
var HStack = require('../../Stack/HStack/HStack.js');
|
|
12
12
|
var StackItem = require('../../Stack/StackItem/StackItem.js');
|
|
@@ -21,7 +21,7 @@ function FormLabel({
|
|
|
21
21
|
children,
|
|
22
22
|
...rest
|
|
23
23
|
}, forwardedRef) {
|
|
24
|
-
const contextValue = useFormControlContext
|
|
24
|
+
const contextValue = FormControlContext.useFormControlContext();
|
|
25
25
|
const {
|
|
26
26
|
Wrapper,
|
|
27
27
|
typo,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","sources":["../../../../../src/components/Forms/FormLabel/FormLabel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport useFormControlContext from '~/src/components/Forms/
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sources":["../../../../../src/components/Forms/FormLabel/FormLabel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\nimport { Help } from '~/src/components/Help'\nimport { HELP_DISPLAY_NAME } from '~/src/components/Help/Help'\nimport {\n HStack,\n StackItem,\n} from '~/src/components/Stack'\n\nimport type FormLabelProps from './FormLabel.types'\n\nimport * as Styled from './FormLabel.styled'\n\nexport const FORM_LABEL_TEST_ID = 'bezier-react-form-label'\n\nfunction FormLabel({\n testId = FORM_LABEL_TEST_ID,\n help,\n as = 'label',\n bold = true,\n color = 'txt-black-darkest',\n children,\n ...rest\n}: FormLabelProps,\nforwardedRef: React.Ref<HTMLLabelElement>,\n) {\n const contextValue = useFormControlContext()\n\n const { Wrapper, typo, ...ownProps } = contextValue?.getLabelProps(rest) ?? {\n Wrapper: React.Fragment,\n typo: Typography.Size13,\n ...rest,\n }\n\n const LabelComponent = useMemo(() => (\n <Styled.Label\n {...ownProps}\n ref={forwardedRef}\n testId={testId}\n forwardedAs={as}\n bold={bold}\n typo={typo}\n color={color}\n >\n { children }\n </Styled.Label>\n ), [\n as,\n typo,\n bold,\n color,\n testId,\n children,\n forwardedRef,\n ownProps,\n ])\n\n const HelpComponent = useMemo(() => {\n if (isEmpty(help)) { return null }\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 (\n <Help>\n { help }\n </Help>\n )\n }, [help])\n\n if (isEmpty(children)) { return null }\n\n return (\n <Wrapper>\n { !HelpComponent\n ? LabelComponent\n : (\n <HStack align=\"center\" spacing={6}>\n <StackItem shrink weight={1}>\n { LabelComponent }\n </StackItem>\n <StackItem>\n { HelpComponent }\n </StackItem>\n </HStack>\n ) }\n </Wrapper>\n )\n}\n\nexport default forwardRef(FormLabel)\n"],"names":["FORM_LABEL_TEST_ID","FormLabel","testId","help","as","bold","color","children","rest","forwardedRef","contextValue","useFormControlContext","Wrapper","typo","ownProps","getLabelProps","React","Fragment","Typography","Size13","LabelComponent","useMemo","createElement","Styled","Object","assign","ref","forwardedAs","HelpComponent","isEmpty","isValidElement","displayName","type","HELP_DISPLAY_NAME","Help","HStack","align","spacing","StackItem","shrink","weight","forwardRef"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,kBAAkB,GAAG,0BAAyB;AAE3D,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;EAC3BG,IAAI;AACJC,EAAAA,EAAE,GAAG,OAAO;AACZC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,KAAK,GAAG,mBAAmB;EAC3BC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAyC,EACvC;A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B,IACE,CAAC,CAAA;AAEX,GAAC,EAAE,CAACA,IAAI,CAAC,CAAC,CAAA;AAEV,EAAA,IAAI0B,iBAAO,CAACtB,QAAQ,CAAC,EAAE;AAAE,IAAA,OAAO,IAAI,CAAA;AAAC,GAAA;AAErC,EAAA,oBACES,KAAA,CAAAM,aAAA,CAACV,OAAO,EACJ,IAAA,EAAA,CAACgB,aAAa,GACZR,cAAc,gBAEdJ,KAAA,CAAAM,aAAA,CAACa,aAAM,EAAA;AAACC,IAAAA,KAAK,EAAC,QAAQ;AAACC,IAAAA,OAAO,EAAE,CAAA;AAAE,GAAA,eAChCrB,KAAA,CAAAM,aAAA,CAACgB,mBAAS,EAAA;IAACC,MAAM,EAAA,IAAA;AAACC,IAAAA,MAAM,EAAE,CAAA;AAAE,GAAA,EACxBpB,cACO,CAAC,eACZJ,KAAA,CAAAM,aAAA,CAACgB,mBAAS,EACNV,IAAAA,EAAAA,aACO,CACL,CAEL,CAAC,CAAA;AAEd,CAAA;AAEA,kBAAea,aAAAA,gBAAU,CAACxC,SAAS,CAAC;;;;;"}
|
|
@@ -2,29 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
var FoundationStyledComponent = require('../../../foundation/FoundationStyledComponent.js');
|
|
4
4
|
|
|
5
|
-
const inputTextStyle =
|
|
5
|
+
const inputTextStyle = FoundationStyledComponent.css`
|
|
6
|
+
color: ${({
|
|
6
7
|
foundation
|
|
7
|
-
}) => foundation?.theme?.['txt-black-darkest']
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
foundation
|
|
12
|
-
}) => foundation?.theme?.['txt-black-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
foundation
|
|
25
|
-
}) => foundation?.theme?.['
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
}) => foundation?.theme?.['txt-black-darkest']};
|
|
9
|
+
|
|
10
|
+
${props => props?.readOnly && FoundationStyledComponent.css`
|
|
11
|
+
color: ${({
|
|
12
|
+
foundation
|
|
13
|
+
}) => foundation?.theme?.['txt-black-darker']};
|
|
14
|
+
`}
|
|
15
|
+
`;
|
|
16
|
+
const inputPlaceholderStyle = FoundationStyledComponent.css`
|
|
17
|
+
&::placeholder {
|
|
18
|
+
color: ${({
|
|
19
|
+
foundation
|
|
20
|
+
}) => foundation?.theme?.['txt-black-dark']};
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const inputWrapperStyle = FoundationStyledComponent.css`
|
|
24
|
+
box-shadow: 0 1px 2px ${({
|
|
25
|
+
foundation
|
|
26
|
+
}) => foundation?.theme?.['bg-black-lighter']},
|
|
27
|
+
inset 0 0 0 1px ${({
|
|
28
|
+
foundation
|
|
29
|
+
}) => foundation?.theme?.['bg-black-dark']};
|
|
30
|
+
`;
|
|
31
|
+
const focusedInputWrapperStyle = FoundationStyledComponent.css`
|
|
32
|
+
box-shadow: 0 0 0 3px ${({
|
|
33
|
+
foundation
|
|
34
|
+
}) => foundation?.theme?.['bgtxt-blue-light']},
|
|
35
|
+
inset 0 0 0 1px ${({
|
|
36
|
+
foundation
|
|
37
|
+
}) => foundation?.theme?.['bgtxt-blue-normal']};
|
|
38
|
+
`;
|
|
39
|
+
const erroredInputWrapperStyle = FoundationStyledComponent.css`
|
|
40
|
+
box-shadow: 0 0 0 3px ${({
|
|
41
|
+
foundation
|
|
42
|
+
}) => foundation?.theme?.['bgtxt-orange-light']},
|
|
43
|
+
inset 0 0 0 1px ${({
|
|
44
|
+
foundation
|
|
45
|
+
}) => foundation?.theme?.['bgtxt-orange-normal']};
|
|
46
|
+
`;
|
|
28
47
|
|
|
29
48
|
exports.erroredInputWrapperStyle = erroredInputWrapperStyle;
|
|
30
49
|
exports.focusedInputWrapperStyle = focusedInputWrapperStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixins.js","sources":["../../../../../src/components/Forms/Inputs/mixins.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { type FormComponentProps } from '~/src/components/Forms/Form.types'\n\nexport const inputTextStyle = css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darkest']};\n\n ${(props: FormComponentProps) => props?.readOnly && css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darker']};\n `}\n`\n\nexport const inputPlaceholderStyle = css`\n &::placeholder {\n color: ${({ foundation }) => foundation?.theme?.['txt-black-dark']};\n }\n`\n\nexport const inputWrapperStyle = css`\n box-shadow: 0 1px 2px ${({ foundation }) => foundation?.theme?.['bg-black-lighter']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bg-black-dark']};\n`\n\nexport const focusedInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-normal']};\n`\n\nexport const erroredInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-normal']};\n`\n"],"names":["inputTextStyle","css","foundation","theme","props","readOnly","inputPlaceholderStyle","inputWrapperStyle","focusedInputWrapperStyle","erroredInputWrapperStyle"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"mixins.js","sources":["../../../../../src/components/Forms/Inputs/mixins.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { type FormComponentProps } from '~/src/components/Forms/Form.types'\n\nexport const inputTextStyle = css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darkest']};\n\n ${(props: FormComponentProps) => props?.readOnly && css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darker']};\n `}\n`\n\nexport const inputPlaceholderStyle = css`\n &::placeholder {\n color: ${({ foundation }) => foundation?.theme?.['txt-black-dark']};\n }\n`\n\nexport const inputWrapperStyle = css`\n box-shadow: 0 1px 2px ${({ foundation }) => foundation?.theme?.['bg-black-lighter']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bg-black-dark']};\n`\n\nexport const focusedInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-normal']};\n`\n\nexport const erroredInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-normal']};\n`\n"],"names":["inputTextStyle","css","foundation","theme","props","readOnly","inputPlaceholderStyle","inputWrapperStyle","focusedInputWrapperStyle","erroredInputWrapperStyle"],"mappings":";;;;AAIO,MAAMA,cAAc,GAAGC,6BAAI,CAAA;AAClC,SAAA,EAAW,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,mBAAmB,CAAE,CAAA;AACxE;AACA,EAAA,EAAKC,KAAyB,IAAKA,KAAK,EAAEC,QAAQ,IAAIJ,6BAAI,CAAA;AAC1D,WAAA,EAAa,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAE,CAAA;AACzE,EAAI,CAAA,CAAA;AACJ,EAAC;AAEM,MAAMG,qBAAqB,GAAGL,6BAAI,CAAA;AACzC;AACA,WAAA,EAAa,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,gBAAgB,CAAE,CAAA;AACvE;AACA,EAAC;AAEM,MAAMI,iBAAiB,GAAGN,6BAAI,CAAA;AACrC,wBAAA,EAA0B,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAE,CAAA;AACtF,oBAAA,EAAsB,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,eAAe,CAAE,CAAA;AAC/E,EAAC;AAEM,MAAMK,wBAAwB,GAAGP,6BAAI,CAAA;AAC5C,wBAAA,EAA0B,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAE,CAAA;AACtF,oBAAA,EAAsB,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,mBAAmB,CAAE,CAAA;AACnF,EAAC;AAEM,MAAMM,wBAAwB,GAAGR,6BAAI,CAAA;AAC5C,wBAAA,EAA0B,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,oBAAoB,CAAE,CAAA;AACxF,oBAAA,EAAsB,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,qBAAqB,CAAE,CAAA;AACrF;;;;;;;;"}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var reactUtils = require('../../../utils/reactUtils.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Context = /*#__PURE__*/React.createContext(defaultValue);
|
|
8
|
-
function useContext(consumerName) {
|
|
9
|
-
const contextValue = React.useContext(Context);
|
|
10
|
-
if (!contextValue) {
|
|
11
|
-
throw new Error(`'${consumerName}' must be used within '${providerName}'`);
|
|
12
|
-
}
|
|
13
|
-
return contextValue;
|
|
14
|
-
}
|
|
15
|
-
return [Context.Provider, useContext];
|
|
16
|
-
}
|
|
17
|
-
const [SegmentedControlContextProvider, useSegmentedControlContext] = createContext('SegmentedControl', null);
|
|
18
|
-
const [SegmentedControlItemListContextProvider, useSegmentedControlItemListContext] = createContext('SegmentedControlItemList', null);
|
|
5
|
+
const [SegmentedControlContextProvider, useSegmentedControlContext] = reactUtils.createContext(null, 'SegmentedControl');
|
|
6
|
+
const [SegmentedControlItemListContextProvider, useSegmentedControlItemListContext] = reactUtils.createContext(null, 'SegmentedControlItemList');
|
|
19
7
|
|
|
20
8
|
exports.SegmentedControlContextProvider = SegmentedControlContextProvider;
|
|
21
9
|
exports.SegmentedControlItemListContextProvider = SegmentedControlItemListContextProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlContext.js","sources":["../../../../../src/components/Forms/SegmentedControl/SegmentedControlContext.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"SegmentedControlContext.js","sources":["../../../../../src/components/Forms/SegmentedControl/SegmentedControlContext.ts"],"sourcesContent":["import { createContext } from '~/src/utils/reactUtils'\n\nimport {\n type SegmentedControlProps,\n type SegmentedControlType,\n} from './SegmentedControl.types'\n\ntype SegmentedControlContextValue = Required<Pick<SegmentedControlProps<SegmentedControlType, string>, 'type' | 'size' | 'width'>>\n\nexport const [\n SegmentedControlContextProvider,\n useSegmentedControlContext,\n] = createContext<SegmentedControlContextValue | null>(null, 'SegmentedControl')\n\ninterface SegmentedControlItemListContextValue {\n setSelectedElement: (node: HTMLButtonElement | null) => void\n}\n\nexport const [\n SegmentedControlItemListContextProvider,\n useSegmentedControlItemListContext,\n] = createContext<SegmentedControlItemListContextValue | null>(null, 'SegmentedControlItemList')\n"],"names":["SegmentedControlContextProvider","useSegmentedControlContext","createContext","SegmentedControlItemListContextProvider","useSegmentedControlItemListContext"],"mappings":";;;;AASa,MAAA,CACXA,+BAA+B,EAC/BC,0BAA0B,CAC3B,GAAGC,wBAAa,CAAsC,IAAI,EAAE,kBAAkB,EAAC;AAMnE,MAAA,CACXC,uCAAuC,EACvCC,kCAAkC,CACnC,GAAGF,wBAAa,CAA8C,IAAI,EAAE,0BAA0B;;;;;;;"}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var domUtils = require('../../utils/domUtils.js');
|
|
7
|
-
var
|
|
7
|
+
var FormControlContext = require('./FormControl/FormControlContext.js');
|
|
8
8
|
|
|
9
9
|
// TODO: 테스트 추가
|
|
10
10
|
function useFormFieldProps(props) {
|
|
11
|
-
const contextValue = useFormControlContext
|
|
11
|
+
const contextValue = FormControlContext.useFormControlContext();
|
|
12
12
|
const formFieldProps = React.useMemo(() => {
|
|
13
13
|
const mergedProps = contextValue?.getFieldProps(props) ?? {
|
|
14
14
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldProps.js","sources":["../../../../src/components/Forms/useFormFieldProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { ariaAttr } from '~/src/utils/domUtils'\n\nimport type { FormComponentProps } from '~/src/components/Forms/Form.types'\
|
|
1
|
+
{"version":3,"file":"useFormFieldProps.js","sources":["../../../../src/components/Forms/useFormFieldProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { ariaAttr } from '~/src/utils/domUtils'\n\nimport type { FormComponentProps } from '~/src/components/Forms/Form.types'\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\n// TODO: 테스트 추가\nfunction useFormFieldProps<Props extends FormComponentProps>(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 ...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 disabled,\n hasError,\n required,\n readOnly,\n }\n }, [\n props,\n contextValue,\n ])\n\n return formFieldProps as typeof formFieldProps & Props\n}\n\nexport default useFormFieldProps\n"],"names":["useFormFieldProps","props","contextValue","useFormControlContext","formFieldProps","useMemo","mergedProps","getFieldProps","disabled","readOnly","required","hasError","rest","ariaAttr"],"mappings":";;;;;;;;AAOA;AACA,SAASA,iBAAiBA,CAAmCC,KAAa,EAAE;AAC1E,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;AAE5C,EAAA,MAAMC,cAAc,GAAGC,aAAO,CAAC,MAAM;IACnC,MAAMC,WAAW,GAAGJ,YAAY,EAAEK,aAAa,CAACN,KAAK,CAAC,IAAI;MAAE,GAAGA,KAAAA;KAAO,CAAA;IAEtE,MAAM;AACJO,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;MAChB,GAAGC,IAAAA;AACL,KAAC,GAAGN,WAAW,CAAA;IAEf,OAAO;AACL,MAAA,GAAGM,IAAI;AACP,MAAA,eAAe,EAAEC,iBAAQ,CAACL,QAAQ,CAAC;AACnC,MAAA,cAAc,EAAEK,iBAAQ,CAACF,QAAQ,CAAC;AAClC,MAAA,eAAe,EAAEE,iBAAQ,CAACH,QAAQ,CAAC;AACnC,MAAA,eAAe,EAAEG,iBAAQ,CAACJ,QAAQ,CAAC;MACnCD,QAAQ;MACRG,QAAQ;MACRD,QAAQ;AACRD,MAAAA,QAAAA;KACD,CAAA;AACH,GAAC,EAAE,CACDR,KAAK,EACLC,YAAY,CACb,CAAC,CAAA;AAEF,EAAA,OAAOE,cAAc,CAAA;AACvB;;;;"}
|
|
@@ -4,10 +4,10 @@ var DisabledOpacity = require('../../constants/DisabledOpacity.js');
|
|
|
4
4
|
var ListItem_types = require('./ListItem.types.js');
|
|
5
5
|
var utils = require('./utils.js');
|
|
6
6
|
var Icon = require('../Icon/Icon.js');
|
|
7
|
+
var index = require('../../foundation/Transition/index.js');
|
|
7
8
|
var FoundationStyledComponent = require('../../foundation/FoundationStyledComponent.js');
|
|
8
9
|
var Mixins = require('../../foundation/Mixins.js');
|
|
9
10
|
var Typography = require('../../foundation/Typography.js');
|
|
10
|
-
var index = require('../../foundation/Transition/index.js');
|
|
11
11
|
|
|
12
12
|
const getColorFromColorVariantWithDefaultValue = (variant, defaultValue) => {
|
|
13
13
|
switch (variant) {
|
|
@@ -6,22 +6,34 @@ var FoundationStyledComponent = require('../../foundation/FoundationStyledCompon
|
|
|
6
6
|
function getStyleOfSize(size) {
|
|
7
7
|
switch (size) {
|
|
8
8
|
case ListItem_types.ListItemSize.S:
|
|
9
|
-
return FoundationStyledComponent.css
|
|
9
|
+
return FoundationStyledComponent.css`
|
|
10
|
+
padding: 4px 6px;
|
|
11
|
+
${({
|
|
10
12
|
foundation
|
|
11
|
-
}) => foundation?.rounding.round6
|
|
13
|
+
}) => foundation?.rounding.round6};
|
|
14
|
+
`;
|
|
12
15
|
case ListItem_types.ListItemSize.L:
|
|
13
|
-
return FoundationStyledComponent.css
|
|
16
|
+
return FoundationStyledComponent.css`
|
|
17
|
+
padding: 8px 6px;
|
|
18
|
+
${({
|
|
14
19
|
foundation
|
|
15
|
-
}) => foundation?.rounding.round8
|
|
20
|
+
}) => foundation?.rounding.round8};
|
|
21
|
+
`;
|
|
16
22
|
case ListItem_types.ListItemSize.XL:
|
|
17
|
-
return FoundationStyledComponent.css
|
|
23
|
+
return FoundationStyledComponent.css`
|
|
24
|
+
padding: 10px 6px;
|
|
25
|
+
${({
|
|
18
26
|
foundation
|
|
19
|
-
}) => foundation?.rounding.round12
|
|
27
|
+
}) => foundation?.rounding.round12};
|
|
28
|
+
`;
|
|
20
29
|
case ListItem_types.ListItemSize.M:
|
|
21
30
|
default:
|
|
22
|
-
return FoundationStyledComponent.css
|
|
31
|
+
return FoundationStyledComponent.css`
|
|
32
|
+
padding: 6px;
|
|
33
|
+
${({
|
|
23
34
|
foundation
|
|
24
|
-
}) => foundation?.rounding.round6
|
|
35
|
+
}) => foundation?.rounding.round6};
|
|
36
|
+
`;
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/ListItem/utils.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { ListItemSize } from './ListItem.types'\n\nexport function getStyleOfSize(size?: ListItemSize) {\n switch (size) {\n case ListItemSize.S:\n return css`\n padding: 4px 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n case ListItemSize.L:\n return css`\n padding: 8px 6px;\n ${({ foundation }) => foundation?.rounding.round8};\n `\n case ListItemSize.XL:\n return css`\n padding: 10px 6px;\n ${({ foundation }) => foundation?.rounding.round12};\n `\n case ListItemSize.M:\n default:\n return css`\n padding: 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n }\n}\n"],"names":["getStyleOfSize","size","ListItemSize","S","css","foundation","rounding","round6","L","round8","XL","round12","M"],"mappings":";;;;;AAIO,SAASA,cAAcA,CAACC,IAAmB,EAAE;AAClD,EAAA,QAAQA,IAAI;IACV,KAAKC,2BAAY,CAACC,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/ListItem/utils.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { ListItemSize } from './ListItem.types'\n\nexport function getStyleOfSize(size?: ListItemSize) {\n switch (size) {\n case ListItemSize.S:\n return css`\n padding: 4px 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n case ListItemSize.L:\n return css`\n padding: 8px 6px;\n ${({ foundation }) => foundation?.rounding.round8};\n `\n case ListItemSize.XL:\n return css`\n padding: 10px 6px;\n ${({ foundation }) => foundation?.rounding.round12};\n `\n case ListItemSize.M:\n default:\n return css`\n padding: 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n }\n}\n"],"names":["getStyleOfSize","size","ListItemSize","S","css","foundation","rounding","round6","L","round8","XL","round12","M"],"mappings":";;;;;AAIO,SAASA,cAAcA,CAACC,IAAmB,EAAE;AAClD,EAAA,QAAQA,IAAI;IACV,KAAKC,2BAAY,CAACC,CAAC;AACjB,MAAA,OAAOC,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;IACH,KAAKL,2BAAY,CAACM,CAAC;AACjB,MAAA,OAAOJ,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACG,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;IACH,KAAKP,2BAAY,CAACQ,EAAE;AAClB,MAAA,OAAON,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACK,OAAQ,CAAA;AAC3D,MAAO,CAAA,CAAA;IACH,KAAKT,2BAAY,CAACU,CAAC,CAAA;AACnB,IAAA;AACE,MAAA,OAAOR,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;AACL,GAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../../../src/components/Modals/Modal/Modal.tsx"],"sourcesContent":["import React, { useCallback } from 'react'\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { type ModalProps } from './Modal.types'\n\n/**\n * `Modal` is a dialog that appears on top of the page.\n *\n * `Modal` is a context of the Modal-related components. It doesn't render any DOM node.\n * It controls the visibility of the entire component and provides\n * handlers and accessibility properties to Modal-related components.\n *\n * @example\n *\n * ```tsx\n * // Anatomy of the Modal\n * <Modal>\n * <ModalTrigger />\n * <ModalContent>\n * <ModalHeader />\n * <ModalBody />\n * <ModalFooter />\n * </ModalContent>\n * </Modal>\n * ```\n */\nexport function Modal({\n children,\n show,\n defaultShow,\n onShow = noop,\n onHide = noop,\n}: ModalProps) {\n const onOpenChange = useCallback<NonNullable<DialogPrimitive.DialogProps['onOpenChange']>>((open) => {\n const callback = open ? onShow : onHide\n callback()\n }, [\n onShow,\n onHide,\n ])\n\n return (\n <DialogPrimitive.Root\n open={show}\n defaultOpen={defaultShow}\n onOpenChange={onOpenChange}\n >\n { children }\n </DialogPrimitive.Root>\n )\n}\n
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../../../src/components/Modals/Modal/Modal.tsx"],"sourcesContent":["import React, { useCallback } from 'react'\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { type ModalProps } from './Modal.types'\n\n/**\n * `Modal` is a dialog that appears on top of the page.\n *\n * `Modal` is a context of the Modal-related components. It doesn't render any DOM node.\n * It controls the visibility of the entire component and provides\n * handlers and accessibility properties to Modal-related components.\n *\n * @example\n *\n * ```tsx\n * // Anatomy of the Modal\n * <Modal>\n * <ModalTrigger />\n * <ModalContent>\n * <ModalHeader />\n * <ModalBody />\n * <ModalFooter />\n * </ModalContent>\n * </Modal>\n * ```\n */\nexport function Modal({\n children,\n show,\n defaultShow,\n onShow = noop,\n onHide = noop,\n}: ModalProps) {\n const onOpenChange = useCallback<NonNullable<DialogPrimitive.DialogProps['onOpenChange']>>((open) => {\n const callback = open ? onShow : onHide\n callback()\n }, [\n onShow,\n onHide,\n ])\n\n return (\n <DialogPrimitive.Root\n open={show}\n defaultOpen={defaultShow}\n onOpenChange={onOpenChange}\n >\n { children }\n </DialogPrimitive.Root>\n )\n}\n"],"names":["Modal","children","show","defaultShow","onShow","noop","onHide","onOpenChange","useCallback","open","callback","React","createElement","DialogPrimitive","defaultOpen"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,KAAKA,CAAC;EACpBC,QAAQ;EACRC,IAAI;EACJC,WAAW;AACXC,EAAAA,MAAM,GAAGC,kBAAI;AACbC,EAAAA,MAAM,GAAGD,kBAAAA;AACC,CAAC,EAAE;AACb,EAAA,MAAME,YAAY,GAAGC,iBAAW,CAA4DC,IAAI,IAAK;AACnG,IAAA,MAAMC,QAAQ,GAAGD,IAAI,GAAGL,MAAM,GAAGE,MAAM,CAAA;AACvCI,IAAAA,QAAQ,EAAE,CAAA;AACZ,GAAC,EAAE,CACDN,MAAM,EACNE,MAAM,CACP,CAAC,CAAA;AAEF,EAAA,oBACEK,KAAA,CAAAC,aAAA,CAACC,UAAoB,EAAA;AACnBJ,IAAAA,IAAI,EAAEP,IAAK;AACXY,IAAAA,WAAW,EAAEX,WAAY;AACzBI,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAAA,EAEzBN,QACkB,CAAC,CAAA;AAE3B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.types.js","sources":["../../../../../src/components/Modals/Modal/Modal.types.ts"],"sourcesContent":["import {\n type BezierComponentProps,\n type ChildrenProps,\n type SideContentProps,\n} from '~/src/types/ComponentProps'\n\nexport enum ModalTitleSize {\n L = 'L',\n M = 'M',\n}\n\ninterface ModalOptions {\n /**\n * The controlled open state of the modal.\n * Must be used in conjunction with `onShow` and `onHide`.\n */\n show?: boolean\n\n /**\n * The open state of the modal when it is initially rendered.\n * Use when you **do not need to control** its open state.\n */\n defaultShow?: boolean\n\n /**\n * Callback function to be called when the modal is opened.\n * @default noop\n */\n onShow?: () => void\n\n /**\n * Callback function to be called when the modal is closed.\n * @default noop\n */\n onHide?: () => void\n}\n\ninterface ModalContentOptions {\n /**\n * Specify a container element to portal the content into.\n * @default document.body\n */\n container?: HTMLElement | null\n\n /**\n * Show close icon button that closes the modal when clicked.\n * @default false\n */\n showCloseIcon?: boolean\n\n /**\n * Width of the modal.\n * @default 'max-content'\n */\n width?: React.CSSProperties['width']\n\n /**\n * Height of the modal.\n * @default 'fit-content'\n */\n height?: React.CSSProperties['height']\n\n /**\n * z-index of the modal content.\n * Rather than using this option, Please check modal is positioned in the proper stacking context.\n * @default ZIndex.Modal\n */\n zIndex?: React.CSSProperties['zIndex']\n}\n\ninterface ModalHeaderOptions {\n /**\n * An accessible title to be announced when the modal is opened.\n */\n title: React.ReactNode\n\n /**\n * An accessible subtitle to be announced when the modal is opened.\n */\n subtitle?: React.ReactNode\n\n /**\n * An accessible description to be announced when the modal is opened.\n */\n description?: React.ReactNode\n\n /**\n * Size of the title\n * @default ModalTitleSize.L\n */\n titleSize?: ModalTitleSize\n\n /**\n * Hides content from the screen in an accessible way.\n * @default false\n */\n hidden?: boolean\n}\n\ntype ModalFooterSideContent = React.ReactNode\n\ninterface ModalFooterOptions extends\n SideContentProps<ModalFooterSideContent, ModalFooterSideContent> {}\n\nexport interface ModalProps extends\n ChildrenProps,\n ModalOptions {}\n\nexport interface ModalContentProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement>,\n ModalContentOptions {}\n\nexport interface ModalHeaderProps extends\n BezierComponentProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof ModalHeaderOptions>,\n ModalHeaderOptions {}\n\nexport interface ModalBodyProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface ModalFooterProps extends\n BezierComponentProps,\n React.HTMLAttributes<HTMLElement>,\n ModalFooterOptions {}\n\nexport interface ModalTriggerProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalCloseProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalContentContextValue extends\n
|
|
1
|
+
{"version":3,"file":"Modal.types.js","sources":["../../../../../src/components/Modals/Modal/Modal.types.ts"],"sourcesContent":["import {\n type BezierComponentProps,\n type ChildrenProps,\n type SideContentProps,\n} from '~/src/types/ComponentProps'\n\nexport enum ModalTitleSize {\n L = 'L',\n M = 'M',\n}\n\ninterface ModalOptions {\n /**\n * The controlled open state of the modal.\n * Must be used in conjunction with `onShow` and `onHide`.\n */\n show?: boolean\n\n /**\n * The open state of the modal when it is initially rendered.\n * Use when you **do not need to control** its open state.\n */\n defaultShow?: boolean\n\n /**\n * Callback function to be called when the modal is opened.\n * @default noop\n */\n onShow?: () => void\n\n /**\n * Callback function to be called when the modal is closed.\n * @default noop\n */\n onHide?: () => void\n}\n\ninterface ModalContentOptions {\n /**\n * Specify a container element to portal the content into.\n * @default document.body\n */\n container?: HTMLElement | null\n\n /**\n * Show close icon button that closes the modal when clicked.\n * @default false\n */\n showCloseIcon?: boolean\n\n /**\n * Width of the modal.\n * @default 'max-content'\n */\n width?: React.CSSProperties['width']\n\n /**\n * Height of the modal.\n * @default 'fit-content'\n */\n height?: React.CSSProperties['height']\n\n /**\n * z-index of the modal content.\n * Rather than using this option, Please check modal is positioned in the proper stacking context.\n * @default ZIndex.Modal\n */\n zIndex?: React.CSSProperties['zIndex']\n}\n\ninterface ModalHeaderOptions {\n /**\n * An accessible title to be announced when the modal is opened.\n */\n title: React.ReactNode\n\n /**\n * An accessible subtitle to be announced when the modal is opened.\n */\n subtitle?: React.ReactNode\n\n /**\n * An accessible description to be announced when the modal is opened.\n */\n description?: React.ReactNode\n\n /**\n * Size of the title\n * @default ModalTitleSize.L\n */\n titleSize?: ModalTitleSize\n\n /**\n * Hides content from the screen in an accessible way.\n * @default false\n */\n hidden?: boolean\n}\n\ntype ModalFooterSideContent = React.ReactNode\n\ninterface ModalFooterOptions extends\n SideContentProps<ModalFooterSideContent, ModalFooterSideContent> {}\n\nexport interface ModalProps extends\n ChildrenProps,\n ModalOptions {}\n\nexport interface ModalContentProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement>,\n ModalContentOptions {}\n\nexport interface ModalHeaderProps extends\n BezierComponentProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof ModalHeaderOptions>,\n ModalHeaderOptions {}\n\nexport interface ModalBodyProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface ModalFooterProps extends\n BezierComponentProps,\n React.HTMLAttributes<HTMLElement>,\n ModalFooterOptions {}\n\nexport interface ModalTriggerProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalCloseProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalContentContextValue extends\n Required<Pick<ModalContentOptions, 'showCloseIcon'>> {}\n"],"names":["ModalTitleSize"],"mappings":";;AAMYA,IAAAA,cAAc,0BAAdA,cAAc,EAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;AAAA,EAAA,OAAdA,cAAc,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
|