@simplybusiness/mobius 4.8.4 → 4.8.6
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/CHANGELOG.md +14 -0
- package/dist/cjs/components/Checkbox/Checkbox.js +4 -3
- package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +4 -2
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/cjs/components/Flex/propUtils.js +0 -1
- package/dist/cjs/components/Flex/propUtils.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +4 -3
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Checkbox/CheckboxGroup.js +4 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/esm/components/Checkbox/types.js.map +1 -1
- package/dist/esm/components/Flex/propUtils.js +0 -1
- package/dist/esm/components/Flex/propUtils.js.map +1 -1
- package/dist/types/components/Checkbox/CheckboxGroup.stories.d.ts +1 -0
- package/dist/types/components/Checkbox/types.d.ts +12 -1
- package/package.json +2 -2
- package/src/components/Checkbox/Checkbox.test.tsx +13 -0
- package/src/components/Checkbox/Checkbox.tsx +4 -1
- package/src/components/Checkbox/CheckboxGroup.mdx +4 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +20 -0
- package/src/components/Checkbox/CheckboxGroup.test.tsx +121 -70
- package/src/components/Checkbox/CheckboxGroup.tsx +6 -1
- package/src/components/Checkbox/types.ts +17 -2
- package/src/components/Flex/Flex.test.tsx +1 -0
- package/src/components/Flex/propUtils.test.ts +0 -2
- package/src/components/Flex/propUtils.ts +0 -1
- package/src/components/Grid/Grid.stories.tsx +0 -17
- package/dist/cjs/utils/getPaddingValue.js +0 -21
- package/dist/cjs/utils/getPaddingValue.js.map +0 -1
- package/dist/esm/utils/getPaddingValue.js +0 -11
- package/dist/esm/utils/getPaddingValue.js.map +0 -1
- package/dist/types/utils/getPaddingValue.d.ts +0 -2
- package/dist/types/utils/getPaddingValue.test.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.8.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [34295d7]
|
|
8
|
+
- @simplybusiness/icons@4.7.0
|
|
9
|
+
|
|
10
|
+
## 4.8.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 600dfd4: Fix `<Flex>` not honouring CSS `display` overwrite; fix Chopin `<Header>` styles
|
|
15
|
+
- 1439ba7: Fix `<Checkbox>` not passing additional props to `<input>` when provided; fix `<CheckboxGroup orientation="horizontal">` not working
|
|
16
|
+
|
|
3
17
|
## 4.8.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -20,7 +20,7 @@ function _interop_require_default(obj) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
const Checkbox = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
23
|
-
const { id, label, isDisabled, isRequired, validationState, onChange, className, errorMessage, defaultSelected = false, isReadOnly, value } = props;
|
|
23
|
+
const { id, label, isDisabled, isRequired, validationState, onChange, className, errorMessage, defaultSelected = false, isReadOnly, value, ["aria-describedby"]: ariaDescribedBy, ...rest } = props;
|
|
24
24
|
const [selected, setSelected] = (0, _react.useState)(defaultSelected);
|
|
25
25
|
const fallbackRef = (0, _react.useRef)(null);
|
|
26
26
|
const refObj = ref || fallbackRef;
|
|
@@ -40,7 +40,7 @@ const Checkbox = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
40
40
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;
|
|
41
41
|
const describedBy = (0, _spaceDelimitedList.spaceDelimitedList)([
|
|
42
42
|
shouldErrorMessageShow,
|
|
43
|
-
|
|
43
|
+
ariaDescribedBy
|
|
44
44
|
]);
|
|
45
45
|
const labelId = (0, _react.useId)();
|
|
46
46
|
const toggleState = ()=>{
|
|
@@ -83,7 +83,8 @@ const Checkbox = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
83
83
|
defaultChecked: defaultSelected,
|
|
84
84
|
required: isRequired,
|
|
85
85
|
id: id || inputId,
|
|
86
|
-
value: value
|
|
86
|
+
value: value,
|
|
87
|
+
...rest
|
|
87
88
|
}),
|
|
88
89
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
89
90
|
className: "mobius/CheckboxLabel",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ChangeEvent,\n forwardRef,\n useRef,\n useState,\n KeyboardEvent,\n MouseEvent,\n useId,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { CheckboxElementType, CheckboxProps, CheckboxRef } from \"./types\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\n\nexport const Checkbox: ForwardedRefComponent<\n CheckboxProps,\n CheckboxElementType\n> = forwardRef((props: CheckboxProps, ref: CheckboxRef) => {\n const {\n id,\n label,\n isDisabled,\n isRequired,\n validationState,\n onChange,\n className,\n errorMessage,\n defaultSelected = false,\n isReadOnly,\n value,\n } = props;\n const [selected, setSelected] = useState<boolean>(defaultSelected);\n const fallbackRef = useRef<HTMLInputElement>(null);\n const refObj = ref || fallbackRef;\n const inputId = useId();\n const checkboxClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n \"--is-selected\": selected,\n \"--is-valid\": validationState === \"valid\",\n \"--is-invalid\": validationState === \"invalid\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n className,\n );\n // Append an additional wrapper class name to differenitate from input\n const wrapperClasses = classNames(\n \"mobius\",\n \"mobius/Checkbox\",\n checkboxClasses,\n );\n const inputClasses = classNames(\"mobius/CheckboxInput\", checkboxClasses);\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ChangeEvent,\n forwardRef,\n useRef,\n useState,\n KeyboardEvent,\n MouseEvent,\n useId,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { CheckboxElementType, CheckboxProps, CheckboxRef } from \"./types\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\n\nexport const Checkbox: ForwardedRefComponent<\n CheckboxProps,\n CheckboxElementType\n> = forwardRef((props: CheckboxProps, ref: CheckboxRef) => {\n const {\n id,\n label,\n isDisabled,\n isRequired,\n validationState,\n onChange,\n className,\n errorMessage,\n defaultSelected = false,\n isReadOnly,\n value,\n [\"aria-describedby\"]: ariaDescribedBy,\n ...rest\n } = props;\n const [selected, setSelected] = useState<boolean>(defaultSelected);\n const fallbackRef = useRef<HTMLInputElement>(null);\n const refObj = ref || fallbackRef;\n const inputId = useId();\n const checkboxClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n \"--is-selected\": selected,\n \"--is-valid\": validationState === \"valid\",\n \"--is-invalid\": validationState === \"invalid\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n className,\n );\n // Append an additional wrapper class name to differenitate from input\n const wrapperClasses = classNames(\n \"mobius\",\n \"mobius/Checkbox\",\n checkboxClasses,\n );\n const inputClasses = classNames(\"mobius/CheckboxInput\", checkboxClasses);\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n ariaDescribedBy,\n ]);\n const labelId = useId();\n\n const toggleState = () => {\n setSelected(!selected);\n };\n\n const handleClick = (event: MouseEvent<CheckboxElementType>) => {\n const isMouseEvent = event.clientX;\n\n if (isMouseEvent) {\n toggleState();\n }\n };\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.code === \"Space\") {\n toggleState();\n }\n };\n\n return (\n <>\n <label id={labelId} className={wrapperClasses}>\n <input\n aria-describedby={describedBy}\n aria-errormessage={shouldErrorMessageShow}\n aria-invalid={validationState === \"invalid\"}\n readOnly={isReadOnly}\n disabled={isDisabled}\n ref={refObj}\n className={inputClasses}\n onClick={handleClick}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n type=\"checkbox\"\n defaultChecked={defaultSelected}\n required={isRequired}\n id={id || inputId}\n value={value}\n {...rest}\n />\n <span className=\"mobius/CheckboxLabel\">{label}</span>\n </label>\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n </>\n );\n});\n"],"names":["Checkbox","forwardRef","props","ref","id","label","isDisabled","isRequired","validationState","onChange","className","errorMessage","defaultSelected","isReadOnly","value","ariaDescribedBy","rest","selected","setSelected","useState","fallbackRef","useRef","refObj","inputId","useId","checkboxClasses","classNames","wrapperClasses","inputClasses","errorMessageId","shouldErrorMessageShow","undefined","describedBy","spaceDelimitedList","labelId","toggleState","handleClick","event","isMouseEvent","clientX","handleChange","handleKeyDown","code","input","aria-describedby","aria-errormessage","aria-invalid","readOnly","disabled","onClick","onKeyDown","type","defaultChecked","required","span","ErrorMessage"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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U;YACZA,SAAS4B;QACX;IACF;IAEA,MAAMI,gBAAgB,CAACJ;QACrB,IAAIA,MAAMK,IAAI,KAAK,SAAS;YAC1BP;QACF;IACF;IAEA,qBACE;;0BACE,sBAAC9B;gBAAMD,IAAI8B;gBAASxB,WAAWiB;;kCAC7B,qBAACgB;wBACCC,oBAAkBZ;wBAClBa,qBAAmBf;wBACnBgB,gBAActC,oBAAoB;wBAClCuC,UAAUlC;wBACVmC,UAAU1C;wBACVH,KAAKmB;wBACLZ,WAAWkB;wBACXqB,SAASb;wBACT3B,UAAU+B;wBACVU,WAAWT;wBACXU,MAAK;wBACLC,gBAAgBxC;wBAChByC,UAAU9C;wBACVH,IAAIA,MAAMmB;wBACVT,OAAOA;wBACN,GAAGE,IAAI;;kCAEV,qBAACsC;wBAAK5C,WAAU;kCAAwBL;;;;0BAE1C,qBAACkD,0BAAY;gBAACnD,IAAIyB;gBAAgBlB,cAAcA;;;;AAGtD"}
|
|
@@ -21,7 +21,7 @@ function _interop_require_default(obj) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
const CheckboxGroup = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
24
|
-
const { label, isDisabled = false, isRequired, validationState, orientation = "vertical", onChange, className, errorMessage, children, defaultValue = [], isReadOnly, ...rest } = props;
|
|
24
|
+
const { label, isDisabled = false, isRequired, validationState, orientation = "vertical", onChange, className, errorMessage, children, defaultValue = [], isReadOnly, itemsPerRow, ...rest } = props;
|
|
25
25
|
const [selected, setSelected] = (0, _react.useState)(defaultValue);
|
|
26
26
|
const checkboxGroupClasses = (0, _dedupe.default)("mobius", "mobius/CheckboxGroup", className, {
|
|
27
27
|
"--is-horizontal": orientation === "horizontal",
|
|
@@ -67,6 +67,9 @@ const CheckboxGroup = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
67
67
|
ref: ref,
|
|
68
68
|
className: checkboxGroupClasses,
|
|
69
69
|
role: "group",
|
|
70
|
+
style: {
|
|
71
|
+
"--checkbox-items-per-row": itemsPerRow || _react.Children.count(children)
|
|
72
|
+
},
|
|
70
73
|
children: [
|
|
71
74
|
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.Label, {
|
|
72
75
|
elementType: "span",
|
|
@@ -79,7 +82,6 @@ const CheckboxGroup = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
79
82
|
children: _react.Children.map(children, (child)=>{
|
|
80
83
|
if (/*#__PURE__*/ (0, _react.isValidElement)(child)) {
|
|
81
84
|
return /*#__PURE__*/ (0, _react.cloneElement)(child, {
|
|
82
|
-
orientation,
|
|
83
85
|
isDisabled,
|
|
84
86
|
isRequired,
|
|
85
87
|
isReadOnly,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n forwardRef,\n ReactElement,\n cloneElement,\n isValidElement,\n useId,\n ChangeEvent,\n useState,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport {\n CheckboxElementType,\n CheckboxGroupElementType,\n CheckboxGroupProps,\n CheckboxGroupRef,\n} from \"./types\";\nimport { Label } from \"../Label\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\n\nexport const CheckboxGroup: ForwardedRefComponent<\n CheckboxGroupProps,\n CheckboxGroupElementType\n> = forwardRef((props: CheckboxGroupProps, ref: CheckboxGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n orientation = \"vertical\",\n onChange,\n className,\n errorMessage,\n children,\n defaultValue = [],\n isReadOnly,\n ...rest\n } = props;\n const [selected, setSelected] = useState<string[]>(defaultValue);\n const checkboxGroupClasses = classNames(\n \"mobius\",\n \"mobius/CheckboxGroup\",\n className,\n {\n \"--is-horizontal\": orientation === \"horizontal\",\n \"--is-vertical\": orientation === \"vertical\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n );\n const labelClasses = classNames({\n \"--is-valid\": validationState === \"valid\",\n \"--is-invalid\": validationState === \"invalid\",\n \"--is-disabled\": isDisabled,\n });\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n const {\n target: { value, checked },\n } = event;\n\n if (!checked) {\n setSelected(selected.filter(item => item !== value));\n }\n\n if (checked) {\n setSelected([...selected, value]);\n }\n };\n\n useEffect(() => {\n if (onChange) {\n onChange(selected);\n }\n }, [selected, onChange]);\n\n return (\n <div\n {...rest}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n ref={ref}\n className={checkboxGroupClasses}\n role=\"group\"\n >\n {label && (\n <Label elementType=\"span\" id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className=\"mobius/CheckboxWrapper\">\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n forwardRef,\n ReactElement,\n cloneElement,\n isValidElement,\n useId,\n ChangeEvent,\n useState,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport {\n CheckboxElementType,\n CheckboxGroupElementType,\n CheckboxGroupProps,\n CheckboxGroupRef,\n} from \"./types\";\nimport { Label } from \"../Label\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\n\nexport const CheckboxGroup: ForwardedRefComponent<\n CheckboxGroupProps,\n CheckboxGroupElementType\n> = forwardRef((props: CheckboxGroupProps, ref: CheckboxGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n orientation = \"vertical\",\n onChange,\n className,\n errorMessage,\n children,\n defaultValue = [],\n isReadOnly,\n itemsPerRow,\n ...rest\n } = props;\n const [selected, setSelected] = useState<string[]>(defaultValue);\n const checkboxGroupClasses = classNames(\n \"mobius\",\n \"mobius/CheckboxGroup\",\n className,\n {\n \"--is-horizontal\": orientation === \"horizontal\",\n \"--is-vertical\": orientation === \"vertical\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n );\n const labelClasses = classNames({\n \"--is-valid\": validationState === \"valid\",\n \"--is-invalid\": validationState === \"invalid\",\n \"--is-disabled\": isDisabled,\n });\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n const {\n target: { value, checked },\n } = event;\n\n if (!checked) {\n setSelected(selected.filter(item => item !== value));\n }\n\n if (checked) {\n setSelected([...selected, value]);\n }\n };\n\n useEffect(() => {\n if (onChange) {\n onChange(selected);\n }\n }, [selected, onChange]);\n\n return (\n <div\n {...rest}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n ref={ref}\n className={checkboxGroupClasses}\n role=\"group\"\n style={\n {\n \"--checkbox-items-per-row\": itemsPerRow || Children.count(children),\n } as React.CSSProperties\n }\n >\n {label && (\n <Label elementType=\"span\" id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className=\"mobius/CheckboxWrapper\">\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n isDisabled,\n isRequired,\n isReadOnly,\n validationState,\n defaultSelected: selected.includes(child.props.value),\n onChange: handleChange,\n \"aria-describedby\": describedBy,\n });\n }\n\n return child;\n })}\n </div>\n {errorMessage && (\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n )}\n </div>\n );\n});\n"],"names":["CheckboxGroup","forwardRef","props","ref","label","isDisabled","isRequired","validationState","orientation","onChange","className","errorMessage","children","defaultValue","isReadOnly","itemsPerRow","rest","selected","setSelected","useState","checkboxGroupClasses","classNames","labelClasses","errorMessageId","useId","shouldErrorMessageShow","undefined","describedBy","spaceDelimitedList","labelId","handleChange","event","target","value","checked","filter","item","useEffect","div","aria-labelledby","role","style","Children","count","Label","elementType","id","map","child","isValidElement","cloneElement","defaultSelected","includes","ErrorMessage"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;+BAyBaA;;;eAAAA;;;;uBAbN;+DACgB;uBAQD;8BACO;oCACM;;;;;;AAE5B,MAAMA,8BAGTC,IAAAA,iBAAU,EAAC,CAACC,OAA2BC;IACzC,MAAM,EACJC,KAAK,EACLC,aAAa,KAAK,EAClBC,UAAU,EACVC,eAAe,EACfC,cAAc,UAAU,EACxBC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,eAAe,EAAE,EACjBC,UAAU,EACVC,WAAW,EACX,GAAGC,MACJ,GAAGd;IACJ,MAAM,CAACe,UAAUC,YAAY,GAAGC,IAAAA,eAAQ,EAAWN;IACnD,MAAMO,uBAAuBC,IAAAA,eAAU,EACrC,UACA,wBACAX,WACA;QACE,mBAAmBF,gBAAgB;QACnC,iBAAiBA,gBAAgB;QACjC,iBAAiB,OAAOF,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;IACvD;IAEF,MAAMgB,eAAeD,IAAAA,eAAU,EAAC;QAC9B,cAAcd,oBAAoB;QAClC,gBAAgBA,oBAAoB;QACpC,iBAAiBF;IACnB;I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A;;;;AAIxD"}
|
|
@@ -21,7 +21,6 @@ const _filterUndefinedProps = require("../../utils/filterUndefinedProps");
|
|
|
21
21
|
const buildFlexStyles = (props)=>{
|
|
22
22
|
const { flexDirection, flexWrap, flexGrow, flex, justifyContent, alignItems, alignContent, gap, rowGap, columnGap } = props;
|
|
23
23
|
const styleProps = {
|
|
24
|
-
display: "flex",
|
|
25
24
|
flexDirection,
|
|
26
25
|
flexWrap,
|
|
27
26
|
flexGrow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Flex/propUtils.ts"],"sourcesContent":["import { getSpacingValue } from \"../../utils\";\nimport { filterUndefinedProps } from \"../../utils/filterUndefinedProps\";\nimport { FlexNonStyleProps, FlexProps, FlexStyleProps } from \"./types\";\n\nexport const buildFlexStyles = (props: FlexStyleProps) => {\n const {\n flexDirection,\n flexWrap,\n flexGrow,\n flex,\n justifyContent,\n alignItems,\n alignContent,\n gap,\n rowGap,\n columnGap,\n } = props;\n\n const styleProps = {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Flex/propUtils.ts"],"sourcesContent":["import { getSpacingValue } from \"../../utils\";\nimport { filterUndefinedProps } from \"../../utils/filterUndefinedProps\";\nimport { FlexNonStyleProps, FlexProps, FlexStyleProps } from \"./types\";\n\nexport const buildFlexStyles = (props: FlexStyleProps) => {\n const {\n flexDirection,\n flexWrap,\n flexGrow,\n flex,\n justifyContent,\n alignItems,\n alignContent,\n gap,\n rowGap,\n columnGap,\n } = props;\n\n const styleProps = {\n flexDirection,\n flexWrap,\n flexGrow,\n flex,\n justifyContent,\n alignItems,\n alignContent,\n gap: getSpacingValue(gap),\n columnGap: getSpacingValue(columnGap),\n rowGap: getSpacingValue(rowGap),\n };\n\n return filterUndefinedProps(styleProps);\n};\n\nexport const splitProps = (\n props: FlexProps,\n): [FlexStyleProps, FlexNonStyleProps] => {\n const {\n flexDirection,\n flexWrap,\n flexGrow,\n flex,\n justifyContent,\n alignItems,\n alignContent,\n gap,\n rowGap,\n columnGap,\n ...otherProps\n } = props;\n\n return [\n {\n flexDirection,\n flexWrap,\n flexGrow,\n flex,\n justifyContent,\n alignItems,\n alignContent,\n gap,\n rowGap,\n columnGap,\n },\n otherProps,\n ];\n};\n"],"names":["buildFlexStyles","splitProps","props","flexDirection","flexWrap","flexGrow","flex","justifyContent","alignItems","alignContent","gap","rowGap","columnGap","styleProps","getSpacingValue","filterUndefinedProps","otherProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,eAAe;eAAfA;;IA8BAC,UAAU;eAAVA;;;uBAlCmB;sCACK;AAG9B,MAAMD,kBAAkB,CAACE;IAC9B,MAAM,EACJC,aAAa,EACbC,QAAQ,EACRC,QAAQ,EACRC,IAAI,EACJC,cAAc,EACdC,UAAU,EACVC,YAAY,EACZC,GAAG,EACHC,MAAM,EACNC,SAAS,EACV,GAAGV;IAEJ,MAAMW,aAAa;QACjBV;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC,KAAKI,IAAAA,sBAAe,EAACJ;QACrBE,WAAWE,IAAAA,sBAAe,EAACF;QAC3BD,QAAQG,IAAAA,sBAAe,EAACH;IAC1B;IAEA,OAAOI,IAAAA,0CAAoB,EAACF;AAC9B;AAEO,MAAMZ,aAAa,CACxBC;IAEA,MAAM,EACJC,aAAa,EACbC,QAAQ,EACRC,QAAQ,EACRC,IAAI,EACJC,cAAc,EACdC,UAAU,EACVC,YAAY,EACZC,GAAG,EACHC,MAAM,EACNC,SAAS,EACT,GAAGI,YACJ,GAAGd;IAEJ,OAAO;QACL;YACEC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;QACAI;KACD;AACH"}
|