@veeqo/ui 14.7.1 → 14.8.0
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/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +9 -0
- package/dist/components/Checkbox/Checkbox.module.scss.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +7 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js.map +1 -0
- package/dist/components/Choice/Choice.cjs +21 -11
- package/dist/components/Choice/Choice.cjs.map +1 -1
- package/dist/components/Choice/Choice.js +21 -11
- package/dist/components/Choice/Choice.js.map +1 -1
- package/dist/components/Choice/Choice.module.scss.cjs +9 -0
- package/dist/components/Choice/Choice.module.scss.cjs.map +1 -0
- package/dist/components/Choice/Choice.module.scss.js +7 -0
- package/dist/components/Choice/Choice.module.scss.js.map +1 -0
- package/dist/components/ChoiceList/ChoiceList.cjs +3 -3
- package/dist/components/ChoiceList/ChoiceList.cjs.map +1 -1
- package/dist/components/ChoiceList/ChoiceList.js +3 -3
- package/dist/components/ChoiceList/ChoiceList.js.map +1 -1
- package/dist/components/ChoiceList/ChoiceList.module.scss.cjs +9 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.cjs.map +1 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.js +7 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.js.map +1 -0
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs +4 -2
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js +4 -2
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +4 -2
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +4 -2
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +4 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js +4 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs +4 -2
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js +4 -2
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js.map +1 -1
- package/dist/components/DimensionsInput/DimensionsInput.cjs +0 -1
- package/dist/components/DimensionsInput/DimensionsInput.cjs.map +1 -1
- package/dist/components/DimensionsInput/DimensionsInput.js +0 -1
- package/dist/components/DimensionsInput/DimensionsInput.js.map +1 -1
- package/dist/components/InputAffix/InputAffix.cjs +6 -10
- package/dist/components/InputAffix/InputAffix.cjs.map +1 -1
- package/dist/components/InputAffix/InputAffix.d.ts +4 -6
- package/dist/components/InputAffix/InputAffix.js +6 -9
- package/dist/components/InputAffix/InputAffix.js.map +1 -1
- package/dist/components/InputAffix/InputAffix.module.scss.cjs +9 -0
- package/dist/components/InputAffix/InputAffix.module.scss.cjs.map +1 -0
- package/dist/components/InputAffix/InputAffix.module.scss.js +7 -0
- package/dist/components/InputAffix/InputAffix.module.scss.js.map +1 -0
- package/dist/components/PriceInput/PriceInput.cjs +1 -1
- package/dist/components/PriceInput/PriceInput.cjs.map +1 -1
- package/dist/components/PriceInput/PriceInput.js +1 -1
- package/dist/components/PriceInput/PriceInput.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +2 -2
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.js +2 -2
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/Radio.module.scss.cjs +9 -0
- package/dist/components/Radio/Radio.module.scss.cjs.map +1 -0
- package/dist/components/Radio/Radio.module.scss.js +7 -0
- package/dist/components/Radio/Radio.module.scss.js.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +2 -8
- package/dist/components/ToggleButton/ToggleButton.js +2 -2
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/types.d.ts +8 -0
- package/dist/components/WeightInput/WeightInput.cjs +0 -1
- package/dist/components/WeightInput/WeightInput.cjs.map +1 -1
- package/dist/components/WeightInput/WeightInput.js +0 -1
- package/dist/components/WeightInput/WeightInput.js.map +1 -1
- package/dist/utils/forms/inputStyles.cjs +1 -2
- package/dist/utils/forms/inputStyles.cjs.map +1 -1
- package/dist/utils/forms/inputStyles.js +2 -2
- package/dist/utils/forms/inputStyles.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Checkbox/styled.cjs +0 -14
- package/dist/components/Checkbox/styled.cjs.map +0 -1
- package/dist/components/Checkbox/styled.d.ts +0 -1
- package/dist/components/Checkbox/styled.js +0 -8
- package/dist/components/Checkbox/styled.js.map +0 -1
- package/dist/components/Choice/components/styled.cjs +0 -30
- package/dist/components/Choice/components/styled.cjs.map +0 -1
- package/dist/components/Choice/components/styled.d.ts +0 -14
- package/dist/components/Choice/components/styled.js +0 -18
- package/dist/components/Choice/components/styled.js.map +0 -1
- package/dist/components/ChoiceList/styled.cjs +0 -15
- package/dist/components/ChoiceList/styled.cjs.map +0 -1
- package/dist/components/ChoiceList/styled.d.ts +0 -2
- package/dist/components/ChoiceList/styled.js +0 -8
- package/dist/components/ChoiceList/styled.js.map +0 -1
- package/dist/components/Radio/styled.cjs +0 -12
- package/dist/components/Radio/styled.cjs.map +0 -1
- package/dist/components/Radio/styled.d.ts +0 -1
- package/dist/components/Radio/styled.js +0 -6
- package/dist/components/Radio/styled.js.map +0 -1
- package/dist/components/ToggleButton/styled.cjs +0 -49
- package/dist/components/ToggleButton/styled.cjs.map +0 -1
- package/dist/components/ToggleButton/styled.d.ts +0 -1
- package/dist/components/ToggleButton/styled.js +0 -43
- package/dist/components/ToggleButton/styled.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Choice = require('../Choice/Choice.cjs');
|
|
5
|
-
var styled = require('./styled.cjs');
|
|
6
5
|
var generateId = require('../../utils/generateId.cjs');
|
|
6
|
+
var Checkbox_module = require('./Checkbox.module.scss.cjs');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
9
|
|
|
@@ -26,7 +26,7 @@ const Checkbox = ({ id, checked, indeterminate, value, name, hint, disabled, ari
|
|
|
26
26
|
}, [indeterminate]);
|
|
27
27
|
const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
|
|
28
28
|
return (React__default.default.createElement(Choice.Choice, { htmlFor: componentId, disabled: disabled, className: className, hint: hint, ...otherProps },
|
|
29
|
-
React__default.default.createElement(
|
|
29
|
+
React__default.default.createElement("input", { ref: checkboxRef, id: componentId, type: "checkbox", checked: checked, value: value, name: name, disabled: disabled, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onChange: handleChange, className: Checkbox_module.input })));
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
exports.Checkbox = Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport {
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { generateId } from '../../utils/generateId';\n\nimport styles from './Checkbox.module.scss';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue, meta?: { shiftKey?: boolean }) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n className={styles.input}\n />\n </Choice>\n );\n};\n"],"names":["useMemo","generateId","useRef","useCallback","useEffect","React","Choice","styles"],"mappings":";;;;;;;;;;;AAoBO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EAC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,EAAA,kBAAA,EACH,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAEE,eAAM,CAAC,KAAK,EAAA,CACvB,CACK;AAEb;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useMemo, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import { Choice } from '../Choice/Choice.js';
|
|
3
|
-
import { Input } from './styled.js';
|
|
4
3
|
import { generateId } from '../../utils/generateId.js';
|
|
4
|
+
import styles from './Checkbox.module.scss.js';
|
|
5
5
|
|
|
6
6
|
const Checkbox = ({ id, checked, indeterminate, value, name, hint, disabled, ariaLabel, className, onChange, ...otherProps }) => {
|
|
7
7
|
const componentId = useMemo(() => id !== null && id !== void 0 ? id : generateId('checkbox'), [id]);
|
|
@@ -20,7 +20,7 @@ const Checkbox = ({ id, checked, indeterminate, value, name, hint, disabled, ari
|
|
|
20
20
|
}, [indeterminate]);
|
|
21
21
|
const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
|
|
22
22
|
return (React__default.createElement(Choice, { htmlFor: componentId, disabled: disabled, className: className, hint: hint, ...otherProps },
|
|
23
|
-
React__default.createElement(
|
|
23
|
+
React__default.createElement("input", { ref: checkboxRef, id: componentId, type: "checkbox", checked: checked, value: value, name: name, disabled: disabled, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onChange: handleChange, className: styles.input })));
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export { Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport {
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { generateId } from '../../utils/generateId';\n\nimport styles from './Checkbox.module.scss';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue, meta?: { shiftKey?: boolean }) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n className={styles.input}\n />\n </Choice>\n );\n};\n"],"names":["React"],"mappings":";;;;;AAoBO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;IAClB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAF,EAAE,GAAI,UAAU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$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._input_r02q7_1 {\n appearance: none;\n width: 18px;\n height: 18px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-lightest);\n border-radius: var(--radius-base);\n cursor: pointer;\n flex-shrink: 0;\n transition: box-shadow 0.1s, background-color 0.1s;\n}\n._input_r02q7_1:checked {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n}\n._input_r02q7_1:hover {\n border-color: var(--colors-secondary-blue-base);\n}\n._input_r02q7_1:active {\n border-color: var(--colors-secondary-blue-base);\n}\n._input_r02q7_1:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n}\n._input_r02q7_1:indeterminate {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n}\n._input_r02q7_1:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-grey-base);\n color: var(--colors-neutral-ink-light);\n cursor: default;\n}\n._input_r02q7_1:checked:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>\");\n}\n._input_r02q7_1:indeterminate:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>\");\n}");
|
|
6
|
+
var styles = {"input":"_input_r02q7_1"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=Checkbox.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.module.scss.cjs","sources":["../../../src/components/Checkbox/Checkbox.module.scss"],"sourcesContent":[".input {\n appearance: none;\n width: 18px;\n height: 18px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-lightest);\n border-radius: var(--radius-base);\n cursor: pointer;\n flex-shrink: 0;\n transition:\n box-shadow 0.1s,\n background-color 0.1s;\n\n &:checked {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n }\n\n &:hover {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:active {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n }\n\n &:indeterminate {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-grey-base);\n color: var(--colors-neutral-ink-light);\n cursor: default;\n }\n\n &:checked:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>\");\n }\n\n &:indeterminate:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>\");\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,2zEAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._input_r02q7_1 {\n appearance: none;\n width: 18px;\n height: 18px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-lightest);\n border-radius: var(--radius-base);\n cursor: pointer;\n flex-shrink: 0;\n transition: box-shadow 0.1s, background-color 0.1s;\n}\n._input_r02q7_1:checked {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n}\n._input_r02q7_1:hover {\n border-color: var(--colors-secondary-blue-base);\n}\n._input_r02q7_1:active {\n border-color: var(--colors-secondary-blue-base);\n}\n._input_r02q7_1:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n}\n._input_r02q7_1:indeterminate {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n}\n._input_r02q7_1:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-grey-base);\n color: var(--colors-neutral-ink-light);\n cursor: default;\n}\n._input_r02q7_1:checked:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>\");\n}\n._input_r02q7_1:indeterminate:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>\");\n}");
|
|
4
|
+
var styles = {"input":"_input_r02q7_1"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Checkbox.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.module.scss.js","sources":["../../../src/components/Checkbox/Checkbox.module.scss"],"sourcesContent":[".input {\n appearance: none;\n width: 18px;\n height: 18px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-lightest);\n border-radius: var(--radius-base);\n cursor: pointer;\n flex-shrink: 0;\n transition:\n box-shadow 0.1s,\n background-color 0.1s;\n\n &:checked {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n }\n\n &:hover {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:active {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n }\n\n &:indeterminate {\n background-color: var(--colors-secondary-blue-base);\n border-color: var(--colors-secondary-blue-base);\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>\");\n background-repeat: no-repeat;\n background-size: var(--sizes-4);\n background-position: center;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-grey-base);\n color: var(--colors-neutral-ink-light);\n cursor: default;\n }\n\n &:checked:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>\");\n }\n\n &:indeterminate:disabled {\n background-image: url(\"data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>\");\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,2zEAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
5
|
+
require('uid/secure');
|
|
4
6
|
var Stack = require('../Stack/Stack.cjs');
|
|
5
7
|
var index = require('../../theme/index.cjs');
|
|
6
|
-
var
|
|
8
|
+
var Tooltip = require('../Tooltip/Tooltip.cjs');
|
|
7
9
|
var HelpIcon = require('../../icons/design-system/components/HelpIcon.cjs');
|
|
8
10
|
var Text = require('../Text/Text.cjs');
|
|
11
|
+
var Choice_module = require('./Choice.module.scss.cjs');
|
|
9
12
|
|
|
10
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
14
|
|
|
@@ -19,23 +22,30 @@ const generateClassNames = (prefix) => ({
|
|
|
19
22
|
});
|
|
20
23
|
const Choice = ({ htmlFor, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
|
|
21
24
|
const classNames = generateClassNames(className);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
Accessory
|
|
25
|
-
|
|
25
|
+
const inputLayoutClass = [
|
|
26
|
+
Choice_module['input-layout'],
|
|
27
|
+
Accessory ? Choice_module['align-center'] : Choice_module['align-top'],
|
|
28
|
+
].join(' ');
|
|
29
|
+
const wrapperClass = buildClassnames.buildClassnames([
|
|
30
|
+
Choice_module.wrapper,
|
|
31
|
+
bordered && Choice_module.bordered,
|
|
32
|
+
disabled && Choice_module.disabled,
|
|
33
|
+
className,
|
|
34
|
+
]);
|
|
35
|
+
const contentMarkup = (React__default.default.createElement("div", { className: Choice_module['root-layout'] },
|
|
36
|
+
inputPosition === 'left' && React__default.default.createElement("div", { className: inputLayoutClass }, children),
|
|
37
|
+
Accessory && React__default.default.createElement("div", { className: Choice_module['accessory-layout'] }, Accessory),
|
|
38
|
+
label || hint || error || Badge || Footer ? (React__default.default.createElement("div", { className: Choice_module['text-layout'] },
|
|
26
39
|
React__default.default.createElement(Stack.Stack, { direction: "horizontal", alignY: "center", spacing: "sm" },
|
|
27
40
|
Badge,
|
|
28
41
|
label && (React__default.default.createElement(Text.Text, { variant: labelVariant, className: classNames.label }, label)),
|
|
29
|
-
(tooltip || tooltipContent) && (React__default.default.createElement(
|
|
42
|
+
(tooltip || tooltipContent) && (React__default.default.createElement(Tooltip.Tooltip, { text: tooltip, content: tooltipContent, className: classNames.tooltip },
|
|
30
43
|
React__default.default.createElement(HelpIcon.ReactComponent, { "data-testid": "tooltip-help", name: "help", width: index.theme.sizes.base, color: index.theme.colors.neutral.ink.lightest })))),
|
|
31
44
|
hint && (React__default.default.createElement(Text.Text, { id: `hint-${htmlFor}`, variant: "hintText", className: classNames.hint }, hint)),
|
|
32
45
|
error && (React__default.default.createElement(Text.Text, { variant: "error", className: classNames.error }, error)),
|
|
33
46
|
Footer)) : null,
|
|
34
|
-
inputPosition === 'right' &&
|
|
35
|
-
|
|
36
|
-
return (React__default.default.createElement(styled.BorderedWrapper, { disabled: disabled, className: className }, contentMarkup));
|
|
37
|
-
}
|
|
38
|
-
return (React__default.default.createElement(styled.Wrapper, { disabled: disabled, className: className }, contentMarkup));
|
|
47
|
+
inputPosition === 'right' && React__default.default.createElement("div", { className: inputLayoutClass }, children)));
|
|
48
|
+
return (React__default.default.createElement("label", { htmlFor: htmlFor, className: wrapperClass }, contentMarkup));
|
|
39
49
|
};
|
|
40
50
|
|
|
41
51
|
exports.Choice = Choice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choice.cjs","sources":["../../../src/components/Choice/Choice.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Stack } from '../Stack';\nimport { theme } from '../../theme';\
|
|
1
|
+
{"version":3,"file":"Choice.cjs","sources":["../../../src/components/Choice/Choice.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { buildClassnames } from '../../utils';\nimport { Stack } from '../Stack';\nimport { theme } from '../../theme';\nimport { Tooltip } from '../Tooltip';\nimport { HelpIcon } from '../../icons';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\n\nimport styles from './Choice.module.scss';\n\nexport interface ForwardedChoiceProps {\n className?: string;\n disabled?: boolean;\n label?: ReactNode;\n hint?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n error?: ReactNode;\n bordered?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n inputPosition?: 'left' | 'right';\n labelVariant?: TextVariant;\n}\n\nexport interface ChoiceProps extends ForwardedChoiceProps {\n htmlFor: string;\n children: ReactNode;\n}\n\nconst generateClassNames = (prefix?: string): any => ({\n hint: prefix ? 'choice__hint' : undefined,\n label: prefix ? 'choice__label' : undefined,\n tooltip: prefix ? 'choice__tooltip' : undefined,\n error: prefix ? 'choice__error' : undefined,\n});\n\nexport const Choice = ({\n htmlFor,\n className,\n label,\n hint,\n tooltip,\n tooltipContent,\n error,\n bordered,\n Badge,\n Accessory,\n Footer,\n children,\n disabled = false,\n labelVariant = 'body',\n inputPosition = 'left',\n}: ChoiceProps) => {\n const classNames = generateClassNames(className);\n\n const inputLayoutClass = [\n styles['input-layout'],\n Accessory ? styles['align-center'] : styles['align-top'],\n ].join(' ');\n\n const wrapperClass = buildClassnames([\n styles.wrapper,\n bordered && styles.bordered,\n disabled && styles.disabled,\n className,\n ]);\n\n const contentMarkup = (\n <div className={styles['root-layout']}>\n {inputPosition === 'left' && <div className={inputLayoutClass}>{children}</div>}\n {Accessory && <div className={styles['accessory-layout']}>{Accessory}</div>}\n {label || hint || error || Badge || Footer ? (\n <div className={styles['text-layout']}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n {Badge}\n {label && (\n <Text variant={labelVariant} className={classNames.label}>\n {label}\n </Text>\n )}\n {(tooltip || tooltipContent) && (\n <Tooltip text={tooltip} content={tooltipContent} className={classNames.tooltip}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n name=\"help\"\n width={theme.sizes.base}\n color={theme.colors.neutral.ink.lightest}\n />\n </Tooltip>\n )}\n </Stack>\n {hint && (\n <Text id={`hint-${htmlFor}`} variant=\"hintText\" className={classNames.hint}>\n {hint}\n </Text>\n )}\n {error && (\n <Text variant=\"error\" className={classNames.error}>\n {error}\n </Text>\n )}\n {Footer}\n </div>\n ) : null}\n {inputPosition === 'right' && <div className={inputLayoutClass}>{children}</div>}\n </div>\n );\n\n return (\n <label htmlFor={htmlFor} className={wrapperClass}>\n {contentMarkup}\n </label>\n );\n};\n"],"names":["styles","buildClassnames","React","Stack","Text","Tooltip","HelpIcon","theme"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAAW;IACpD,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IACzC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAC3C,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAC/C,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;AAC5C,CAAA,CAAC;AAEK,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,EACP,SAAS,EACT,KAAK,EACL,IAAI,EACJ,OAAO,EACP,cAAc,EACd,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,YAAY,GAAG,MAAM,EACrB,aAAa,GAAG,MAAM,GACV,KAAI;AAChB,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC;AAEhD,IAAA,MAAM,gBAAgB,GAAG;QACvBA,aAAM,CAAC,cAAc,CAAC;AACtB,QAAA,SAAS,GAAGA,aAAM,CAAC,cAAc,CAAC,GAAGA,a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AAAH,sBAAA,CAAA,aAAA,CAACI,uBAAQ,EAAA,EAAA,aAAA,EACK,cAAc,EAC1B,IAAI,EAAC,MAAM,EACX,KAAK,EAAEC,WAAK,CAAC,KAAK,CAAC,IAAI,EACvB,KAAK,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAA,CACxC,CACM,CACX,CACK;YACP,IAAI,KACHL,sBAAA,CAAA,aAAA,CAACE,SAAI,IAAC,EAAE,EAAE,CAAA,KAAA,EAAQ,OAAO,CAAA,CAAE,EAAE,OAAO,EAAC,UAAU,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EAAA,EACvE,IAAI,CACA,CACR;AACA,YAAA,KAAK,KACJF,sBAAA,CAAA,aAAA,CAACE,SAAI,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,KAAK,EAAA,EAC9C,KAAK,CACD,CACR;AACA,YAAA,MAAM,CACH,IACJ,IAAI;AACP,QAAA,aAAa,KAAK,OAAO,IAAIF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,gBAAgB,EAAA,EAAG,QAAQ,CAAO,CAC5E,CACP;AAED,IAAA,QACEA,sBAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAA,EAC7C,aAAa,CACR;AAEZ;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
+
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
3
|
+
import 'uid/secure';
|
|
2
4
|
import { Stack } from '../Stack/Stack.js';
|
|
3
5
|
import { theme } from '../../theme/index.js';
|
|
4
|
-
import {
|
|
6
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
5
7
|
import { ReactComponent as HelpIcon } from '../../icons/design-system/components/HelpIcon.js';
|
|
6
8
|
import { Text } from '../Text/Text.js';
|
|
9
|
+
import styles from './Choice.module.scss.js';
|
|
7
10
|
|
|
8
11
|
const generateClassNames = (prefix) => ({
|
|
9
12
|
hint: prefix ? 'choice__hint' : undefined,
|
|
@@ -13,23 +16,30 @@ const generateClassNames = (prefix) => ({
|
|
|
13
16
|
});
|
|
14
17
|
const Choice = ({ htmlFor, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
|
|
15
18
|
const classNames = generateClassNames(className);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
Accessory
|
|
19
|
-
|
|
19
|
+
const inputLayoutClass = [
|
|
20
|
+
styles['input-layout'],
|
|
21
|
+
Accessory ? styles['align-center'] : styles['align-top'],
|
|
22
|
+
].join(' ');
|
|
23
|
+
const wrapperClass = buildClassnames([
|
|
24
|
+
styles.wrapper,
|
|
25
|
+
bordered && styles.bordered,
|
|
26
|
+
disabled && styles.disabled,
|
|
27
|
+
className,
|
|
28
|
+
]);
|
|
29
|
+
const contentMarkup = (React__default.createElement("div", { className: styles['root-layout'] },
|
|
30
|
+
inputPosition === 'left' && React__default.createElement("div", { className: inputLayoutClass }, children),
|
|
31
|
+
Accessory && React__default.createElement("div", { className: styles['accessory-layout'] }, Accessory),
|
|
32
|
+
label || hint || error || Badge || Footer ? (React__default.createElement("div", { className: styles['text-layout'] },
|
|
20
33
|
React__default.createElement(Stack, { direction: "horizontal", alignY: "center", spacing: "sm" },
|
|
21
34
|
Badge,
|
|
22
35
|
label && (React__default.createElement(Text, { variant: labelVariant, className: classNames.label }, label)),
|
|
23
|
-
(tooltip || tooltipContent) && (React__default.createElement(
|
|
36
|
+
(tooltip || tooltipContent) && (React__default.createElement(Tooltip, { text: tooltip, content: tooltipContent, className: classNames.tooltip },
|
|
24
37
|
React__default.createElement(HelpIcon, { "data-testid": "tooltip-help", name: "help", width: theme.sizes.base, color: theme.colors.neutral.ink.lightest })))),
|
|
25
38
|
hint && (React__default.createElement(Text, { id: `hint-${htmlFor}`, variant: "hintText", className: classNames.hint }, hint)),
|
|
26
39
|
error && (React__default.createElement(Text, { variant: "error", className: classNames.error }, error)),
|
|
27
40
|
Footer)) : null,
|
|
28
|
-
inputPosition === 'right' &&
|
|
29
|
-
|
|
30
|
-
return (React__default.createElement(BorderedWrapper, { disabled: disabled, className: className }, contentMarkup));
|
|
31
|
-
}
|
|
32
|
-
return (React__default.createElement(Wrapper, { disabled: disabled, className: className }, contentMarkup));
|
|
41
|
+
inputPosition === 'right' && React__default.createElement("div", { className: inputLayoutClass }, children)));
|
|
42
|
+
return (React__default.createElement("label", { htmlFor: htmlFor, className: wrapperClass }, contentMarkup));
|
|
33
43
|
};
|
|
34
44
|
|
|
35
45
|
export { Choice };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choice.js","sources":["../../../src/components/Choice/Choice.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Stack } from '../Stack';\nimport { theme } from '../../theme';\
|
|
1
|
+
{"version":3,"file":"Choice.js","sources":["../../../src/components/Choice/Choice.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { buildClassnames } from '../../utils';\nimport { Stack } from '../Stack';\nimport { theme } from '../../theme';\nimport { Tooltip } from '../Tooltip';\nimport { HelpIcon } from '../../icons';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\n\nimport styles from './Choice.module.scss';\n\nexport interface ForwardedChoiceProps {\n className?: string;\n disabled?: boolean;\n label?: ReactNode;\n hint?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n error?: ReactNode;\n bordered?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n inputPosition?: 'left' | 'right';\n labelVariant?: TextVariant;\n}\n\nexport interface ChoiceProps extends ForwardedChoiceProps {\n htmlFor: string;\n children: ReactNode;\n}\n\nconst generateClassNames = (prefix?: string): any => ({\n hint: prefix ? 'choice__hint' : undefined,\n label: prefix ? 'choice__label' : undefined,\n tooltip: prefix ? 'choice__tooltip' : undefined,\n error: prefix ? 'choice__error' : undefined,\n});\n\nexport const Choice = ({\n htmlFor,\n className,\n label,\n hint,\n tooltip,\n tooltipContent,\n error,\n bordered,\n Badge,\n Accessory,\n Footer,\n children,\n disabled = false,\n labelVariant = 'body',\n inputPosition = 'left',\n}: ChoiceProps) => {\n const classNames = generateClassNames(className);\n\n const inputLayoutClass = [\n styles['input-layout'],\n Accessory ? styles['align-center'] : styles['align-top'],\n ].join(' ');\n\n const wrapperClass = buildClassnames([\n styles.wrapper,\n bordered && styles.bordered,\n disabled && styles.disabled,\n className,\n ]);\n\n const contentMarkup = (\n <div className={styles['root-layout']}>\n {inputPosition === 'left' && <div className={inputLayoutClass}>{children}</div>}\n {Accessory && <div className={styles['accessory-layout']}>{Accessory}</div>}\n {label || hint || error || Badge || Footer ? (\n <div className={styles['text-layout']}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n {Badge}\n {label && (\n <Text variant={labelVariant} className={classNames.label}>\n {label}\n </Text>\n )}\n {(tooltip || tooltipContent) && (\n <Tooltip text={tooltip} content={tooltipContent} className={classNames.tooltip}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n name=\"help\"\n width={theme.sizes.base}\n color={theme.colors.neutral.ink.lightest}\n />\n </Tooltip>\n )}\n </Stack>\n {hint && (\n <Text id={`hint-${htmlFor}`} variant=\"hintText\" className={classNames.hint}>\n {hint}\n </Text>\n )}\n {error && (\n <Text variant=\"error\" className={classNames.error}>\n {error}\n </Text>\n )}\n {Footer}\n </div>\n ) : null}\n {inputPosition === 'right' && <div className={inputLayoutClass}>{children}</div>}\n </div>\n );\n\n return (\n <label htmlFor={htmlFor} className={wrapperClass}>\n {contentMarkup}\n </label>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;AAgCA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAAW;IACpD,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAC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AA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,gBAAgB,EAAA,EAAG,QAAQ,CAAO,CAC5E,CACP;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAA,EAC7C,aAAa,CACR;AAEZ;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._wrapper_jvoun_1 {\n box-sizing: border-box;\n}\n._wrapper_jvoun_1:hover {\n cursor: pointer;\n}\n._wrapper_jvoun_1._disabled_jvoun_7:hover {\n cursor: default;\n}\n\n._bordered_jvoun_11 {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n}\n._bordered_jvoun_11:not(._disabled_jvoun_7):hover {\n border-color: var(--colors-secondary-blue-base);\n}\n\n._root-layout_jvoun_20 {\n display: flex;\n align-items: center;\n}\n._root-layout_jvoun_20 > * + * {\n margin-left: var(--sizes-base);\n}\n\n._input-layout_jvoun_28 {\n align-self: stretch;\n display: flex;\n}\n._input-layout_jvoun_28._align-top_jvoun_32 {\n align-items: flex-start;\n}\n._input-layout_jvoun_28._align-center_jvoun_35 {\n align-items: center;\n}\n\n._accessory-layout_jvoun_39 {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n._text-layout_jvoun_45 {\n flex: 1;\n}\n._text-layout_jvoun_45 > * + * {\n margin-top: var(--sizes-sm);\n}");
|
|
6
|
+
var styles = {"wrapper":"_wrapper_jvoun_1","disabled":"_disabled_jvoun_7","bordered":"_bordered_jvoun_11","root-layout":"_root-layout_jvoun_20","input-layout":"_input-layout_jvoun_28","align-top":"_align-top_jvoun_32","align-center":"_align-center_jvoun_35","accessory-layout":"_accessory-layout_jvoun_39","text-layout":"_text-layout_jvoun_45"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=Choice.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Choice.module.scss.cjs","sources":["../../../src/components/Choice/Choice.module.scss"],"sourcesContent":[".wrapper {\n box-sizing: border-box;\n\n &:hover {\n cursor: pointer;\n }\n\n &.disabled:hover {\n cursor: default;\n }\n}\n\n.bordered {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n\n &:not(.disabled):hover {\n border-color: var(--colors-secondary-blue-base);\n }\n}\n\n.root-layout {\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: var(--sizes-base);\n }\n}\n\n.input-layout {\n align-self: stretch;\n display: flex;\n\n &.align-top {\n align-items: flex-start;\n }\n\n &.align-center {\n align-items: center;\n }\n}\n\n.accessory-layout {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n.text-layout {\n flex: 1;\n\n & > * + * {\n margin-top: var(--sizes-sm);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,ogCAAA;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._wrapper_jvoun_1 {\n box-sizing: border-box;\n}\n._wrapper_jvoun_1:hover {\n cursor: pointer;\n}\n._wrapper_jvoun_1._disabled_jvoun_7:hover {\n cursor: default;\n}\n\n._bordered_jvoun_11 {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n}\n._bordered_jvoun_11:not(._disabled_jvoun_7):hover {\n border-color: var(--colors-secondary-blue-base);\n}\n\n._root-layout_jvoun_20 {\n display: flex;\n align-items: center;\n}\n._root-layout_jvoun_20 > * + * {\n margin-left: var(--sizes-base);\n}\n\n._input-layout_jvoun_28 {\n align-self: stretch;\n display: flex;\n}\n._input-layout_jvoun_28._align-top_jvoun_32 {\n align-items: flex-start;\n}\n._input-layout_jvoun_28._align-center_jvoun_35 {\n align-items: center;\n}\n\n._accessory-layout_jvoun_39 {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n._text-layout_jvoun_45 {\n flex: 1;\n}\n._text-layout_jvoun_45 > * + * {\n margin-top: var(--sizes-sm);\n}");
|
|
4
|
+
var styles = {"wrapper":"_wrapper_jvoun_1","disabled":"_disabled_jvoun_7","bordered":"_bordered_jvoun_11","root-layout":"_root-layout_jvoun_20","input-layout":"_input-layout_jvoun_28","align-top":"_align-top_jvoun_32","align-center":"_align-center_jvoun_35","accessory-layout":"_accessory-layout_jvoun_39","text-layout":"_text-layout_jvoun_45"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Choice.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Choice.module.scss.js","sources":["../../../src/components/Choice/Choice.module.scss"],"sourcesContent":[".wrapper {\n box-sizing: border-box;\n\n &:hover {\n cursor: pointer;\n }\n\n &.disabled:hover {\n cursor: default;\n }\n}\n\n.bordered {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n\n &:not(.disabled):hover {\n border-color: var(--colors-secondary-blue-base);\n }\n}\n\n.root-layout {\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: var(--sizes-base);\n }\n}\n\n.input-layout {\n align-self: stretch;\n display: flex;\n\n &.align-top {\n align-items: flex-start;\n }\n\n &.align-center {\n align-items: center;\n }\n}\n\n.accessory-layout {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n.text-layout {\n flex: 1;\n\n & > * + * {\n margin-top: var(--sizes-sm);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,ogCAAA;;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Radio = require('../Radio/Radio.cjs');
|
|
5
5
|
var Checkbox = require('../Checkbox/Checkbox.cjs');
|
|
6
|
-
var
|
|
6
|
+
var ChoiceList_module = require('./ChoiceList.module.scss.cjs');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
9
|
|
|
@@ -41,8 +41,8 @@ class ChoiceList extends React.Component {
|
|
|
41
41
|
render() {
|
|
42
42
|
const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
|
|
43
43
|
const InputComponent = allowMultiple ? Checkbox.Checkbox : Radio.Radio;
|
|
44
|
-
return (React__default.default.createElement(
|
|
45
|
-
title && React__default.default.createElement(
|
|
44
|
+
return (React__default.default.createElement("fieldset", { className: ChoiceList_module.fieldset, disabled: disabled },
|
|
45
|
+
title && React__default.default.createElement("legend", { className: ChoiceList_module.legend }, title),
|
|
46
46
|
accessorySlot,
|
|
47
47
|
options.map((option) => (React__default.default.createElement(InputComponent, { key: option.value, bordered: bordered, checked: selected.includes(option.value), onChange: (checked) => this.handleChange(option.value, checked), ...option })))));
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceList.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport
|
|
1
|
+
{"version":3,"file":"ChoiceList.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport styles from './ChoiceList.module.scss';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\n id?: string;\n value: ChoiceListOptionValue;\n name?: string;\n label: string;\n hint?: string;\n disabled?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n}\n\nexport interface ChoiceListProps {\n options: ChoiceListOption[];\n selected: ChoiceListOptionValue[];\n title?: string;\n accessorySlot?: ReactNode;\n allowMultiple?: boolean;\n disabled?: boolean;\n bordered?: boolean;\n error?: string;\n onChange: (selected: ChoiceListOptionValue[]) => void;\n}\n\nexport class ChoiceList extends Component<ChoiceListProps> {\n handleChange = (value: ChoiceListOptionValue, checked: boolean) => {\n const { allowMultiple } = this.props;\n\n if (allowMultiple) {\n this.handleChangeMultiple(value, checked);\n return;\n }\n\n this.handleChangeSingle(value, checked);\n };\n\n handleChangeSingle = (value: ChoiceListOptionValue, checked: boolean) => {\n const { onChange } = this.props;\n\n if (checked) {\n onChange([value]);\n }\n };\n\n handleChangeMultiple = (value: ChoiceListOptionValue, checked: boolean) => {\n const { selected, onChange } = this.props;\n let newSelected = [];\n\n if (checked) {\n newSelected = [...selected, value];\n } else {\n newSelected = selected.filter((selectedValue) => selectedValue !== value);\n }\n\n onChange(newSelected);\n };\n\n render() {\n const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } =\n this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <fieldset className={styles.fieldset} disabled={disabled}>\n {title && <legend className={styles.legend}>{title}</legend>}\n {accessorySlot}\n {options.map((option) => (\n <InputComponent\n key={option.value}\n bordered={bordered}\n checked={selected.includes(option.value)}\n onChange={(checked: boolean) => this.handleChange(option.value, checked)}\n {...option}\n />\n ))}\n </fieldset>\n );\n }\n}\n"],"names":["Component","Checkbox","Radio","React","styles"],"mappings":";;;;;;;;;;;AAkCM,MAAO,UAAW,SAAQA,eAA0B,CAAA;AAA1D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AAChE,YAAA,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,KAAK;AAEpC,YAAA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SAAS,EAAEC,iBAAM,CAAC,MAAM,EAAA,EAAG,KAAK,CAAU;YAC3D,aAAa;YACb,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBD,sBAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACxC,QAAQ,EAAE,CAAC,OAAgB,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAAA,GACpE,MAAM,EAAA,CACV,CACH,CAAC,CACO;IAEf;AACD;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { Component } from 'react';
|
|
2
2
|
import { Radio } from '../Radio/Radio.js';
|
|
3
3
|
import { Checkbox } from '../Checkbox/Checkbox.js';
|
|
4
|
-
import
|
|
4
|
+
import styles from './ChoiceList.module.scss.js';
|
|
5
5
|
|
|
6
6
|
class ChoiceList extends Component {
|
|
7
7
|
constructor() {
|
|
@@ -35,8 +35,8 @@ class ChoiceList extends Component {
|
|
|
35
35
|
render() {
|
|
36
36
|
const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
|
|
37
37
|
const InputComponent = allowMultiple ? Checkbox : Radio;
|
|
38
|
-
return (React__default.createElement(
|
|
39
|
-
title && React__default.createElement(
|
|
38
|
+
return (React__default.createElement("fieldset", { className: styles.fieldset, disabled: disabled },
|
|
39
|
+
title && React__default.createElement("legend", { className: styles.legend }, title),
|
|
40
40
|
accessorySlot,
|
|
41
41
|
options.map((option) => (React__default.createElement(InputComponent, { key: option.value, bordered: bordered, checked: selected.includes(option.value), onChange: (checked) => this.handleChange(option.value, checked), ...option })))));
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceList.js","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport
|
|
1
|
+
{"version":3,"file":"ChoiceList.js","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport styles from './ChoiceList.module.scss';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\n id?: string;\n value: ChoiceListOptionValue;\n name?: string;\n label: string;\n hint?: string;\n disabled?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n}\n\nexport interface ChoiceListProps {\n options: ChoiceListOption[];\n selected: ChoiceListOptionValue[];\n title?: string;\n accessorySlot?: ReactNode;\n allowMultiple?: boolean;\n disabled?: boolean;\n bordered?: boolean;\n error?: string;\n onChange: (selected: ChoiceListOptionValue[]) => void;\n}\n\nexport class ChoiceList extends Component<ChoiceListProps> {\n handleChange = (value: ChoiceListOptionValue, checked: boolean) => {\n const { allowMultiple } = this.props;\n\n if (allowMultiple) {\n this.handleChangeMultiple(value, checked);\n return;\n }\n\n this.handleChangeSingle(value, checked);\n };\n\n handleChangeSingle = (value: ChoiceListOptionValue, checked: boolean) => {\n const { onChange } = this.props;\n\n if (checked) {\n onChange([value]);\n }\n };\n\n handleChangeMultiple = (value: ChoiceListOptionValue, checked: boolean) => {\n const { selected, onChange } = this.props;\n let newSelected = [];\n\n if (checked) {\n newSelected = [...selected, value];\n } else {\n newSelected = selected.filter((selectedValue) => selectedValue !== value);\n }\n\n onChange(newSelected);\n };\n\n render() {\n const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } =\n this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <fieldset className={styles.fieldset} disabled={disabled}>\n {title && <legend className={styles.legend}>{title}</legend>}\n {accessorySlot}\n {options.map((option) => (\n <InputComponent\n key={option.value}\n bordered={bordered}\n checked={selected.includes(option.value)}\n onChange={(checked: boolean) => this.handleChange(option.value, checked)}\n {...option}\n />\n ))}\n </fieldset>\n );\n }\n}\n"],"names":["React"],"mappings":";;;;;AAkCM,MAAO,UAAW,SAAQ,SAA0B,CAAA;AAA1D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AAChE,YAAA,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,KAAK;AAEpC,YAAA,IAAI,aAAa,EAAE;AACjB,gBAAA,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC;gBACzC;AACD,YAAA;AAED,YAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC;AACzC,QAAA,CAAC;AAED,QAAA,IAAA,CAAA,kBAAkB,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AACtE,YAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;AAE/B,YAAA,IAAI,OAAO,EAAE;AACX,gBAAA,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AAClB,YAAA;AACH,QAAA,CAAC;AAED,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;YACxE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;YACzC,IAAI,WAAW,GAAG,EAAE;AAEpB,YAAA,IAAI,OAAO,EAAE;AACX,gBAAA,WAAW,GAAG,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC;AACnC,YAAA;AAAM,iBAAA;AACL,gBAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,KAAK,aAAa,KAAK,KAAK,CAAC;AAC1E,YAAA;YAED,QAAQ,CAAC,WAAW,CAAC;AACvB,QAAA,CAAC;IAwBH;IAtBE,MAAM,GAAA;AACJ,QAAA,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAClF,IAAI,CAAC,KAAK;QAEZ,MAAM,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,KAAK;QAEvD,QACEA,cAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAU,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAA;YACrD,KAAK,IAAIA,yCAAQ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAA,EAAG,KAAK,CAAU;YAC3D,aAAa;YACb,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACxC,QAAQ,EAAE,CAAC,OAAgB,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAAA,GACpE,MAAM,EAAA,CACV,CACH,CAAC,CACO;IAEf;AACD;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._heading-xxl_1vf1j_1 {\n font-family: var(--text-heading-xxl-font-family);\n font-style: var(--text-heading-xxl-font-style);\n font-weight: var(--text-heading-xxl-font-weight);\n font-size: var(--text-heading-xxl-font-size);\n line-height: var(--text-heading-xxl-line-height);\n color: var(--text-heading-xxl-color);\n text-decoration: var(--text-heading-xxl-text-decoration);\n letter-spacing: var(--text-heading-xxl-letter-spacing);\n}\n\n._heading-xl_1vf1j_12 {\n font-family: var(--text-heading-xl-font-family);\n font-style: var(--text-heading-xl-font-style);\n font-weight: var(--text-heading-xl-font-weight);\n font-size: var(--text-heading-xl-font-size);\n line-height: var(--text-heading-xl-line-height);\n color: var(--text-heading-xl-color);\n text-decoration: var(--text-heading-xl-text-decoration);\n letter-spacing: var(--text-heading-xl-letter-spacing);\n}\n\n._heading-large_1vf1j_23 {\n font-family: var(--text-heading-large-font-family);\n font-style: var(--text-heading-large-font-style);\n font-weight: var(--text-heading-large-font-weight);\n font-size: var(--text-heading-large-font-size);\n line-height: var(--text-heading-large-line-height);\n color: var(--text-heading-large-color);\n text-decoration: var(--text-heading-large-text-decoration);\n letter-spacing: var(--text-heading-large-letter-spacing);\n}\n\n._heading-medium_1vf1j_34 {\n font-family: var(--text-heading-medium-font-family);\n font-style: var(--text-heading-medium-font-style);\n font-weight: var(--text-heading-medium-font-weight);\n font-size: var(--text-heading-medium-font-size);\n line-height: var(--text-heading-medium-line-height);\n color: var(--text-heading-medium-color);\n text-decoration: var(--text-heading-medium-text-decoration);\n letter-spacing: var(--text-heading-medium-letter-spacing);\n}\n\n._heading-small_1vf1j_45 {\n font-family: var(--text-heading-small-font-family);\n font-style: var(--text-heading-small-font-style);\n font-weight: var(--text-heading-small-font-weight);\n font-size: var(--text-heading-small-font-size);\n line-height: var(--text-heading-small-line-height);\n color: var(--text-heading-small-color);\n text-decoration: var(--text-heading-small-text-decoration);\n letter-spacing: var(--text-heading-small-letter-spacing);\n}\n\n._heading-table_1vf1j_56 {\n font-family: var(--text-heading-table-font-family);\n font-style: var(--text-heading-table-font-style);\n font-weight: var(--text-heading-table-font-weight);\n font-size: var(--text-heading-table-font-size);\n line-height: var(--text-heading-table-line-height);\n color: var(--text-heading-table-color);\n text-decoration: var(--text-heading-table-text-decoration);\n letter-spacing: var(--text-heading-table-letter-spacing);\n}\n\n._subheading-large_1vf1j_67 {\n font-family: var(--text-subheading-large-font-family);\n font-style: var(--text-subheading-large-font-style);\n font-weight: var(--text-subheading-large-font-weight);\n font-size: var(--text-subheading-large-font-size);\n line-height: var(--text-subheading-large-line-height);\n color: var(--text-subheading-large-color);\n text-decoration: var(--text-subheading-large-text-decoration);\n letter-spacing: var(--text-subheading-large-letter-spacing);\n}\n\n._subheading-medium_1vf1j_78 {\n font-family: var(--text-subheading-medium-font-family);\n font-style: var(--text-subheading-medium-font-style);\n font-weight: var(--text-subheading-medium-font-weight);\n font-size: var(--text-subheading-medium-font-size);\n line-height: var(--text-subheading-medium-line-height);\n color: var(--text-subheading-medium-color);\n text-decoration: var(--text-subheading-medium-text-decoration);\n letter-spacing: var(--text-subheading-medium-letter-spacing);\n}\n\n._subheading-small_1vf1j_89 {\n font-family: var(--text-subheading-small-font-family);\n font-style: var(--text-subheading-small-font-style);\n font-weight: var(--text-subheading-small-font-weight);\n font-size: var(--text-subheading-small-font-size);\n line-height: var(--text-subheading-small-line-height);\n color: var(--text-subheading-small-color);\n text-decoration: var(--text-subheading-small-text-decoration);\n letter-spacing: var(--text-subheading-small-letter-spacing);\n}\n\n._subheading-small-bold_1vf1j_100 {\n font-family: var(--text-subheading-small-bold-font-family);\n font-style: var(--text-subheading-small-bold-font-style);\n font-weight: var(--text-subheading-small-bold-font-weight);\n font-size: var(--text-subheading-small-bold-font-size);\n line-height: var(--text-subheading-small-bold-line-height);\n color: var(--text-subheading-small-bold-color);\n text-decoration: var(--text-subheading-small-bold-text-decoration);\n letter-spacing: var(--text-subheading-small-bold-letter-spacing);\n}\n\n._body_1vf1j_111 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n}\n\n._body-small_1vf1j_122 {\n font-family: var(--text-body-small-font-family);\n font-style: var(--text-body-small-font-style);\n font-weight: var(--text-body-small-font-weight);\n font-size: var(--text-body-small-font-size);\n line-height: var(--text-body-small-line-height);\n color: var(--text-body-small-color);\n text-decoration: var(--text-body-small-text-decoration);\n letter-spacing: var(--text-body-small-letter-spacing);\n}\n\n._body-bold_1vf1j_133 {\n font-family: var(--text-body-bold-font-family);\n font-style: var(--text-body-bold-font-style);\n font-weight: var(--text-body-bold-font-weight);\n font-size: var(--text-body-bold-font-size);\n line-height: var(--text-body-bold-line-height);\n color: var(--text-body-bold-color);\n text-decoration: var(--text-body-bold-text-decoration);\n letter-spacing: var(--text-body-bold-letter-spacing);\n}\n\n._body-bold-dark_1vf1j_144 {\n font-family: var(--text-body-bold-dark-font-family);\n font-style: var(--text-body-bold-dark-font-style);\n font-weight: var(--text-body-bold-dark-font-weight);\n font-size: var(--text-body-bold-dark-font-size);\n line-height: var(--text-body-bold-dark-line-height);\n color: var(--text-body-bold-dark-color);\n text-decoration: var(--text-body-bold-dark-text-decoration);\n letter-spacing: var(--text-body-bold-dark-letter-spacing);\n}\n\n._body-small-bold_1vf1j_155 {\n font-family: var(--text-body-small-bold-font-family);\n font-style: var(--text-body-small-bold-font-style);\n font-weight: var(--text-body-small-bold-font-weight);\n font-size: var(--text-body-small-bold-font-size);\n line-height: var(--text-body-small-bold-line-height);\n color: var(--text-body-small-bold-color);\n text-decoration: var(--text-body-small-bold-text-decoration);\n letter-spacing: var(--text-body-small-bold-letter-spacing);\n}\n\n._button_1vf1j_166 {\n font-family: var(--text-button-font-family);\n font-style: var(--text-button-font-style);\n font-weight: var(--text-button-font-weight);\n font-size: var(--text-button-font-size);\n line-height: var(--text-button-line-height);\n color: var(--text-button-color);\n text-decoration: var(--text-button-text-decoration);\n letter-spacing: var(--text-button-letter-spacing);\n}\n\n._button-small_1vf1j_177 {\n font-family: var(--text-button-small-font-family);\n font-style: var(--text-button-small-font-style);\n font-weight: var(--text-button-small-font-weight);\n font-size: var(--text-button-small-font-size);\n line-height: var(--text-button-small-line-height);\n color: var(--text-button-small-color);\n text-decoration: var(--text-button-small-text-decoration);\n letter-spacing: var(--text-button-small-letter-spacing);\n}\n\n._link-large_1vf1j_188 {\n font-family: var(--text-link-large-font-family);\n font-style: var(--text-link-large-font-style);\n font-weight: var(--text-link-large-font-weight);\n font-size: var(--text-link-large-font-size);\n line-height: var(--text-link-large-line-height);\n color: var(--text-link-large-color);\n text-decoration: var(--text-link-large-text-decoration);\n letter-spacing: var(--text-link-large-letter-spacing);\n}\n\n._link-medium_1vf1j_199 {\n font-family: var(--text-link-medium-font-family);\n font-style: var(--text-link-medium-font-style);\n font-weight: var(--text-link-medium-font-weight);\n font-size: var(--text-link-medium-font-size);\n line-height: var(--text-link-medium-line-height);\n color: var(--text-link-medium-color);\n text-decoration: var(--text-link-medium-text-decoration);\n letter-spacing: var(--text-link-medium-letter-spacing);\n}\n\n._link_1vf1j_188 {\n font-family: var(--text-link-font-family);\n font-style: var(--text-link-font-style);\n font-weight: var(--text-link-font-weight);\n font-size: var(--text-link-font-size);\n line-height: var(--text-link-line-height);\n color: var(--text-link-color);\n text-decoration: var(--text-link-text-decoration);\n letter-spacing: var(--text-link-letter-spacing);\n}\n\n._link-small_1vf1j_221 {\n font-family: var(--text-link-small-font-family);\n font-style: var(--text-link-small-font-style);\n font-weight: var(--text-link-small-font-weight);\n font-size: var(--text-link-small-font-size);\n line-height: var(--text-link-small-line-height);\n color: var(--text-link-small-color);\n text-decoration: var(--text-link-small-text-decoration);\n letter-spacing: var(--text-link-small-letter-spacing);\n}\n\n._input-label_1vf1j_232 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}\n\n._input-label-small_1vf1j_243 {\n font-family: var(--text-input-label-small-font-family);\n font-style: var(--text-input-label-small-font-style);\n font-weight: var(--text-input-label-small-font-weight);\n font-size: var(--text-input-label-small-font-size);\n line-height: var(--text-input-label-small-line-height);\n color: var(--text-input-label-small-color);\n text-decoration: var(--text-input-label-small-text-decoration);\n letter-spacing: var(--text-input-label-small-letter-spacing);\n}\n\n._hint-text_1vf1j_254 {\n font-family: var(--text-hint-text-font-family);\n font-style: var(--text-hint-text-font-style);\n font-weight: var(--text-hint-text-font-weight);\n font-size: var(--text-hint-text-font-size);\n line-height: var(--text-hint-text-line-height);\n color: var(--text-hint-text-color);\n text-decoration: var(--text-hint-text-text-decoration);\n letter-spacing: var(--text-hint-text-letter-spacing);\n}\n\n._placeholder_1vf1j_265 {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n\n._placeholder-small_1vf1j_276 {\n font-family: var(--text-placeholder-small-font-family);\n font-style: var(--text-placeholder-small-font-style);\n font-weight: var(--text-placeholder-small-font-weight);\n font-size: var(--text-placeholder-small-font-size);\n line-height: var(--text-placeholder-small-line-height);\n color: var(--text-placeholder-small-color);\n text-decoration: var(--text-placeholder-small-text-decoration);\n letter-spacing: var(--text-placeholder-small-letter-spacing);\n}\n\n._placeholder-code_1vf1j_287 {\n font-family: var(--text-placeholder-code-font-family);\n font-style: var(--text-placeholder-code-font-style);\n font-weight: var(--text-placeholder-code-font-weight);\n font-size: var(--text-placeholder-code-font-size);\n line-height: var(--text-placeholder-code-line-height);\n color: var(--text-placeholder-code-color);\n text-decoration: var(--text-placeholder-code-text-decoration);\n letter-spacing: var(--text-placeholder-code-letter-spacing);\n}\n\n._placeholder-code-small_1vf1j_298 {\n font-family: var(--text-placeholder-code-small-font-family);\n font-style: var(--text-placeholder-code-small-font-style);\n font-weight: var(--text-placeholder-code-small-font-weight);\n font-size: var(--text-placeholder-code-small-font-size);\n line-height: var(--text-placeholder-code-small-line-height);\n color: var(--text-placeholder-code-small-color);\n text-decoration: var(--text-placeholder-code-small-text-decoration);\n letter-spacing: var(--text-placeholder-code-small-letter-spacing);\n}\n\n._error_1vf1j_309 {\n font-family: var(--text-error-font-family);\n font-style: var(--text-error-font-style);\n font-weight: var(--text-error-font-weight);\n font-size: var(--text-error-font-size);\n line-height: var(--text-error-line-height);\n color: var(--text-error-color);\n text-decoration: var(--text-error-text-decoration);\n letter-spacing: var(--text-error-letter-spacing);\n}\n\n._error-small_1vf1j_320 {\n font-family: var(--text-error-small-font-family);\n font-style: var(--text-error-small-font-style);\n font-weight: var(--text-error-small-font-weight);\n font-size: var(--text-error-small-font-size);\n line-height: var(--text-error-small-line-height);\n color: var(--text-error-small-color);\n text-decoration: var(--text-error-small-text-decoration);\n letter-spacing: var(--text-error-small-letter-spacing);\n}\n\n._success-small_1vf1j_331 {\n font-family: var(--text-success-small-font-family);\n font-style: var(--text-success-small-font-style);\n font-weight: var(--text-success-small-font-weight);\n font-size: var(--text-success-small-font-size);\n line-height: var(--text-success-small-line-height);\n color: var(--text-success-small-color);\n text-decoration: var(--text-success-small-text-decoration);\n letter-spacing: var(--text-success-small-letter-spacing);\n}\n\n._fieldset_1vf1j_342 {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n}\n._fieldset_1vf1j_342 > * + * {\n margin-top: var(--sizes-base);\n}\n\n._legend_1vf1j_352 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}");
|
|
6
|
+
var styles = {"fieldset":"_fieldset_1vf1j_342","legend":"_legend_1vf1j_352"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=ChoiceList.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoiceList.module.scss.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.module.scss"],"sourcesContent":["@use '../../theme/scss/text.module.scss' as text;\n\n.fieldset {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n\n & > * + * {\n margin-top: var(--sizes-base);\n }\n}\n\n.legend {\n @include text.input-label;\n}\n"],"names":[],"mappings":";;;;AAGE,eAAA,CAAA,modAAA;AACA,aAAA,CAAA,UAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,mBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._heading-xxl_1vf1j_1 {\n font-family: var(--text-heading-xxl-font-family);\n font-style: var(--text-heading-xxl-font-style);\n font-weight: var(--text-heading-xxl-font-weight);\n font-size: var(--text-heading-xxl-font-size);\n line-height: var(--text-heading-xxl-line-height);\n color: var(--text-heading-xxl-color);\n text-decoration: var(--text-heading-xxl-text-decoration);\n letter-spacing: var(--text-heading-xxl-letter-spacing);\n}\n\n._heading-xl_1vf1j_12 {\n font-family: var(--text-heading-xl-font-family);\n font-style: var(--text-heading-xl-font-style);\n font-weight: var(--text-heading-xl-font-weight);\n font-size: var(--text-heading-xl-font-size);\n line-height: var(--text-heading-xl-line-height);\n color: var(--text-heading-xl-color);\n text-decoration: var(--text-heading-xl-text-decoration);\n letter-spacing: var(--text-heading-xl-letter-spacing);\n}\n\n._heading-large_1vf1j_23 {\n font-family: var(--text-heading-large-font-family);\n font-style: var(--text-heading-large-font-style);\n font-weight: var(--text-heading-large-font-weight);\n font-size: var(--text-heading-large-font-size);\n line-height: var(--text-heading-large-line-height);\n color: var(--text-heading-large-color);\n text-decoration: var(--text-heading-large-text-decoration);\n letter-spacing: var(--text-heading-large-letter-spacing);\n}\n\n._heading-medium_1vf1j_34 {\n font-family: var(--text-heading-medium-font-family);\n font-style: var(--text-heading-medium-font-style);\n font-weight: var(--text-heading-medium-font-weight);\n font-size: var(--text-heading-medium-font-size);\n line-height: var(--text-heading-medium-line-height);\n color: var(--text-heading-medium-color);\n text-decoration: var(--text-heading-medium-text-decoration);\n letter-spacing: var(--text-heading-medium-letter-spacing);\n}\n\n._heading-small_1vf1j_45 {\n font-family: var(--text-heading-small-font-family);\n font-style: var(--text-heading-small-font-style);\n font-weight: var(--text-heading-small-font-weight);\n font-size: var(--text-heading-small-font-size);\n line-height: var(--text-heading-small-line-height);\n color: var(--text-heading-small-color);\n text-decoration: var(--text-heading-small-text-decoration);\n letter-spacing: var(--text-heading-small-letter-spacing);\n}\n\n._heading-table_1vf1j_56 {\n font-family: var(--text-heading-table-font-family);\n font-style: var(--text-heading-table-font-style);\n font-weight: var(--text-heading-table-font-weight);\n font-size: var(--text-heading-table-font-size);\n line-height: var(--text-heading-table-line-height);\n color: var(--text-heading-table-color);\n text-decoration: var(--text-heading-table-text-decoration);\n letter-spacing: var(--text-heading-table-letter-spacing);\n}\n\n._subheading-large_1vf1j_67 {\n font-family: var(--text-subheading-large-font-family);\n font-style: var(--text-subheading-large-font-style);\n font-weight: var(--text-subheading-large-font-weight);\n font-size: var(--text-subheading-large-font-size);\n line-height: var(--text-subheading-large-line-height);\n color: var(--text-subheading-large-color);\n text-decoration: var(--text-subheading-large-text-decoration);\n letter-spacing: var(--text-subheading-large-letter-spacing);\n}\n\n._subheading-medium_1vf1j_78 {\n font-family: var(--text-subheading-medium-font-family);\n font-style: var(--text-subheading-medium-font-style);\n font-weight: var(--text-subheading-medium-font-weight);\n font-size: var(--text-subheading-medium-font-size);\n line-height: var(--text-subheading-medium-line-height);\n color: var(--text-subheading-medium-color);\n text-decoration: var(--text-subheading-medium-text-decoration);\n letter-spacing: var(--text-subheading-medium-letter-spacing);\n}\n\n._subheading-small_1vf1j_89 {\n font-family: var(--text-subheading-small-font-family);\n font-style: var(--text-subheading-small-font-style);\n font-weight: var(--text-subheading-small-font-weight);\n font-size: var(--text-subheading-small-font-size);\n line-height: var(--text-subheading-small-line-height);\n color: var(--text-subheading-small-color);\n text-decoration: var(--text-subheading-small-text-decoration);\n letter-spacing: var(--text-subheading-small-letter-spacing);\n}\n\n._subheading-small-bold_1vf1j_100 {\n font-family: var(--text-subheading-small-bold-font-family);\n font-style: var(--text-subheading-small-bold-font-style);\n font-weight: var(--text-subheading-small-bold-font-weight);\n font-size: var(--text-subheading-small-bold-font-size);\n line-height: var(--text-subheading-small-bold-line-height);\n color: var(--text-subheading-small-bold-color);\n text-decoration: var(--text-subheading-small-bold-text-decoration);\n letter-spacing: var(--text-subheading-small-bold-letter-spacing);\n}\n\n._body_1vf1j_111 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n}\n\n._body-small_1vf1j_122 {\n font-family: var(--text-body-small-font-family);\n font-style: var(--text-body-small-font-style);\n font-weight: var(--text-body-small-font-weight);\n font-size: var(--text-body-small-font-size);\n line-height: var(--text-body-small-line-height);\n color: var(--text-body-small-color);\n text-decoration: var(--text-body-small-text-decoration);\n letter-spacing: var(--text-body-small-letter-spacing);\n}\n\n._body-bold_1vf1j_133 {\n font-family: var(--text-body-bold-font-family);\n font-style: var(--text-body-bold-font-style);\n font-weight: var(--text-body-bold-font-weight);\n font-size: var(--text-body-bold-font-size);\n line-height: var(--text-body-bold-line-height);\n color: var(--text-body-bold-color);\n text-decoration: var(--text-body-bold-text-decoration);\n letter-spacing: var(--text-body-bold-letter-spacing);\n}\n\n._body-bold-dark_1vf1j_144 {\n font-family: var(--text-body-bold-dark-font-family);\n font-style: var(--text-body-bold-dark-font-style);\n font-weight: var(--text-body-bold-dark-font-weight);\n font-size: var(--text-body-bold-dark-font-size);\n line-height: var(--text-body-bold-dark-line-height);\n color: var(--text-body-bold-dark-color);\n text-decoration: var(--text-body-bold-dark-text-decoration);\n letter-spacing: var(--text-body-bold-dark-letter-spacing);\n}\n\n._body-small-bold_1vf1j_155 {\n font-family: var(--text-body-small-bold-font-family);\n font-style: var(--text-body-small-bold-font-style);\n font-weight: var(--text-body-small-bold-font-weight);\n font-size: var(--text-body-small-bold-font-size);\n line-height: var(--text-body-small-bold-line-height);\n color: var(--text-body-small-bold-color);\n text-decoration: var(--text-body-small-bold-text-decoration);\n letter-spacing: var(--text-body-small-bold-letter-spacing);\n}\n\n._button_1vf1j_166 {\n font-family: var(--text-button-font-family);\n font-style: var(--text-button-font-style);\n font-weight: var(--text-button-font-weight);\n font-size: var(--text-button-font-size);\n line-height: var(--text-button-line-height);\n color: var(--text-button-color);\n text-decoration: var(--text-button-text-decoration);\n letter-spacing: var(--text-button-letter-spacing);\n}\n\n._button-small_1vf1j_177 {\n font-family: var(--text-button-small-font-family);\n font-style: var(--text-button-small-font-style);\n font-weight: var(--text-button-small-font-weight);\n font-size: var(--text-button-small-font-size);\n line-height: var(--text-button-small-line-height);\n color: var(--text-button-small-color);\n text-decoration: var(--text-button-small-text-decoration);\n letter-spacing: var(--text-button-small-letter-spacing);\n}\n\n._link-large_1vf1j_188 {\n font-family: var(--text-link-large-font-family);\n font-style: var(--text-link-large-font-style);\n font-weight: var(--text-link-large-font-weight);\n font-size: var(--text-link-large-font-size);\n line-height: var(--text-link-large-line-height);\n color: var(--text-link-large-color);\n text-decoration: var(--text-link-large-text-decoration);\n letter-spacing: var(--text-link-large-letter-spacing);\n}\n\n._link-medium_1vf1j_199 {\n font-family: var(--text-link-medium-font-family);\n font-style: var(--text-link-medium-font-style);\n font-weight: var(--text-link-medium-font-weight);\n font-size: var(--text-link-medium-font-size);\n line-height: var(--text-link-medium-line-height);\n color: var(--text-link-medium-color);\n text-decoration: var(--text-link-medium-text-decoration);\n letter-spacing: var(--text-link-medium-letter-spacing);\n}\n\n._link_1vf1j_188 {\n font-family: var(--text-link-font-family);\n font-style: var(--text-link-font-style);\n font-weight: var(--text-link-font-weight);\n font-size: var(--text-link-font-size);\n line-height: var(--text-link-line-height);\n color: var(--text-link-color);\n text-decoration: var(--text-link-text-decoration);\n letter-spacing: var(--text-link-letter-spacing);\n}\n\n._link-small_1vf1j_221 {\n font-family: var(--text-link-small-font-family);\n font-style: var(--text-link-small-font-style);\n font-weight: var(--text-link-small-font-weight);\n font-size: var(--text-link-small-font-size);\n line-height: var(--text-link-small-line-height);\n color: var(--text-link-small-color);\n text-decoration: var(--text-link-small-text-decoration);\n letter-spacing: var(--text-link-small-letter-spacing);\n}\n\n._input-label_1vf1j_232 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}\n\n._input-label-small_1vf1j_243 {\n font-family: var(--text-input-label-small-font-family);\n font-style: var(--text-input-label-small-font-style);\n font-weight: var(--text-input-label-small-font-weight);\n font-size: var(--text-input-label-small-font-size);\n line-height: var(--text-input-label-small-line-height);\n color: var(--text-input-label-small-color);\n text-decoration: var(--text-input-label-small-text-decoration);\n letter-spacing: var(--text-input-label-small-letter-spacing);\n}\n\n._hint-text_1vf1j_254 {\n font-family: var(--text-hint-text-font-family);\n font-style: var(--text-hint-text-font-style);\n font-weight: var(--text-hint-text-font-weight);\n font-size: var(--text-hint-text-font-size);\n line-height: var(--text-hint-text-line-height);\n color: var(--text-hint-text-color);\n text-decoration: var(--text-hint-text-text-decoration);\n letter-spacing: var(--text-hint-text-letter-spacing);\n}\n\n._placeholder_1vf1j_265 {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n\n._placeholder-small_1vf1j_276 {\n font-family: var(--text-placeholder-small-font-family);\n font-style: var(--text-placeholder-small-font-style);\n font-weight: var(--text-placeholder-small-font-weight);\n font-size: var(--text-placeholder-small-font-size);\n line-height: var(--text-placeholder-small-line-height);\n color: var(--text-placeholder-small-color);\n text-decoration: var(--text-placeholder-small-text-decoration);\n letter-spacing: var(--text-placeholder-small-letter-spacing);\n}\n\n._placeholder-code_1vf1j_287 {\n font-family: var(--text-placeholder-code-font-family);\n font-style: var(--text-placeholder-code-font-style);\n font-weight: var(--text-placeholder-code-font-weight);\n font-size: var(--text-placeholder-code-font-size);\n line-height: var(--text-placeholder-code-line-height);\n color: var(--text-placeholder-code-color);\n text-decoration: var(--text-placeholder-code-text-decoration);\n letter-spacing: var(--text-placeholder-code-letter-spacing);\n}\n\n._placeholder-code-small_1vf1j_298 {\n font-family: var(--text-placeholder-code-small-font-family);\n font-style: var(--text-placeholder-code-small-font-style);\n font-weight: var(--text-placeholder-code-small-font-weight);\n font-size: var(--text-placeholder-code-small-font-size);\n line-height: var(--text-placeholder-code-small-line-height);\n color: var(--text-placeholder-code-small-color);\n text-decoration: var(--text-placeholder-code-small-text-decoration);\n letter-spacing: var(--text-placeholder-code-small-letter-spacing);\n}\n\n._error_1vf1j_309 {\n font-family: var(--text-error-font-family);\n font-style: var(--text-error-font-style);\n font-weight: var(--text-error-font-weight);\n font-size: var(--text-error-font-size);\n line-height: var(--text-error-line-height);\n color: var(--text-error-color);\n text-decoration: var(--text-error-text-decoration);\n letter-spacing: var(--text-error-letter-spacing);\n}\n\n._error-small_1vf1j_320 {\n font-family: var(--text-error-small-font-family);\n font-style: var(--text-error-small-font-style);\n font-weight: var(--text-error-small-font-weight);\n font-size: var(--text-error-small-font-size);\n line-height: var(--text-error-small-line-height);\n color: var(--text-error-small-color);\n text-decoration: var(--text-error-small-text-decoration);\n letter-spacing: var(--text-error-small-letter-spacing);\n}\n\n._success-small_1vf1j_331 {\n font-family: var(--text-success-small-font-family);\n font-style: var(--text-success-small-font-style);\n font-weight: var(--text-success-small-font-weight);\n font-size: var(--text-success-small-font-size);\n line-height: var(--text-success-small-line-height);\n color: var(--text-success-small-color);\n text-decoration: var(--text-success-small-text-decoration);\n letter-spacing: var(--text-success-small-letter-spacing);\n}\n\n._fieldset_1vf1j_342 {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n}\n._fieldset_1vf1j_342 > * + * {\n margin-top: var(--sizes-base);\n}\n\n._legend_1vf1j_352 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}");
|
|
4
|
+
var styles = {"fieldset":"_fieldset_1vf1j_342","legend":"_legend_1vf1j_352"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=ChoiceList.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoiceList.module.scss.js","sources":["../../../src/components/ChoiceList/ChoiceList.module.scss"],"sourcesContent":["@use '../../theme/scss/text.module.scss' as text;\n\n.fieldset {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n\n & > * + * {\n margin-top: var(--sizes-base);\n }\n}\n\n.legend {\n @include text.input-label;\n}\n"],"names":["___$insertStyle"],"mappings":";;AAGEA,WAAA,CAAA,modAAA;AACA,aAAA,CAAA,UAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,mBAAA;;;;"}
|
|
@@ -12,9 +12,11 @@ require('../../../../../theme/modules/shadows.cjs');
|
|
|
12
12
|
require('../../../../../theme/modules/sizes.cjs');
|
|
13
13
|
require('../../../../../theme/modules/text.cjs');
|
|
14
14
|
require('styled-components');
|
|
15
|
-
require('
|
|
15
|
+
require('framer-motion');
|
|
16
|
+
require('../../../../Tooltip/components/styled.cjs');
|
|
17
|
+
require('../../../../Tooltip/components/TooltipPopover.cjs');
|
|
18
|
+
require('react-dom');
|
|
16
19
|
require('../../../../Text/Text.cjs');
|
|
17
|
-
require('../../../../Checkbox/styled.cjs');
|
|
18
20
|
require('../../../../Radio/Radio.cjs');
|
|
19
21
|
var useExpandableCell = require('./hooks/useExpandableCell.cjs');
|
|
20
22
|
var BodyCell_module = require('./BodyCell.module.scss.cjs');
|