@veeqo/ui 10.1.0 → 10.3.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.
Files changed (42) hide show
  1. package/dist/components/Checkbox/Checkbox.cjs +5 -4
  2. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  3. package/dist/components/Checkbox/Checkbox.d.ts +2 -1
  4. package/dist/components/Checkbox/Checkbox.js +5 -4
  5. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  6. package/dist/components/Choice/Choice.cjs +6 -6
  7. package/dist/components/Choice/Choice.cjs.map +1 -1
  8. package/dist/components/Choice/Choice.d.ts +2 -2
  9. package/dist/components/Choice/Choice.js +7 -7
  10. package/dist/components/Choice/Choice.js.map +1 -1
  11. package/dist/components/Choice/components/styled.cjs +3 -7
  12. package/dist/components/Choice/components/styled.cjs.map +1 -1
  13. package/dist/components/Choice/components/styled.d.ts +0 -2
  14. package/dist/components/Choice/components/styled.js +4 -6
  15. package/dist/components/Choice/components/styled.js.map +1 -1
  16. package/dist/components/ChoiceList/ChoiceList.cjs +2 -1
  17. package/dist/components/ChoiceList/ChoiceList.cjs.map +1 -1
  18. package/dist/components/ChoiceList/ChoiceList.d.ts +2 -0
  19. package/dist/components/ChoiceList/ChoiceList.js +2 -1
  20. package/dist/components/ChoiceList/ChoiceList.js.map +1 -1
  21. package/dist/components/Pagination/Pagination.cjs +6 -7
  22. package/dist/components/Pagination/Pagination.cjs.map +1 -1
  23. package/dist/components/Pagination/Pagination.js +6 -7
  24. package/dist/components/Pagination/Pagination.js.map +1 -1
  25. package/dist/components/Pagination/components.cjs +3 -3
  26. package/dist/components/Pagination/components.cjs.map +1 -1
  27. package/dist/components/Pagination/components.js +3 -3
  28. package/dist/components/Pagination/components.js.map +1 -1
  29. package/dist/components/Pagination/styled.cjs +4 -5
  30. package/dist/components/Pagination/styled.cjs.map +1 -1
  31. package/dist/components/Pagination/styled.d.ts +6 -1
  32. package/dist/components/Pagination/styled.js +4 -5
  33. package/dist/components/Pagination/styled.js.map +1 -1
  34. package/dist/components/Radio/Radio.cjs +5 -4
  35. package/dist/components/Radio/Radio.cjs.map +1 -1
  36. package/dist/components/Radio/Radio.js +6 -5
  37. package/dist/components/Radio/Radio.js.map +1 -1
  38. package/dist/components/Toggle/Toggle.cjs +9 -5
  39. package/dist/components/Toggle/Toggle.cjs.map +1 -1
  40. package/dist/components/Toggle/Toggle.js +10 -6
  41. package/dist/components/Toggle/Toggle.js.map +1 -1
  42. package/package.json +1 -1
@@ -9,8 +9,8 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
11
11
 
12
- const Checkbox = ({ checked, indeterminate, value, name, disabled, ariaLabel, className, onChange, ...otherProps }) => {
13
- const id = React.useMemo(() => generateId.generateId('checkbox'), []);
12
+ const Checkbox = ({ id, checked, indeterminate, value, name, hint, disabled, ariaLabel, className, onChange, ...otherProps }) => {
13
+ const componentId = React.useMemo(() => id !== null && id !== undefined ? id : generateId.generateId('checkbox'), [id]);
14
14
  const checkboxRef = React.useRef(null);
15
15
  const handleChange = React.useCallback((e) => {
16
16
  onChange(e.currentTarget.checked, value);
@@ -24,8 +24,9 @@ const Checkbox = ({ checked, indeterminate, value, name, disabled, ariaLabel, cl
24
24
  }
25
25
  checkboxRef.current.indeterminate = false;
26
26
  }, [indeterminate]);
27
- return (React__default.default.createElement(Choice.Choice, { id: id, disabled: disabled, className: className, ...otherProps },
28
- React__default.default.createElement(styled.Input, { ref: checkboxRef, id: id, type: "checkbox", checked: checked, value: value, name: name, disabled: disabled, "aria-label": ariaLabel, onChange: handleChange })));
27
+ const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
28
+ return (React__default.default.createElement(Choice.Choice, { htmlFor: componentId, disabled: disabled, className: className, hint: hint, ...otherProps },
29
+ React__default.default.createElement(styled.Input, { ref: checkboxRef, id: componentId, type: "checkbox", checked: checked, value: value, name: name, disabled: disabled, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onChange: handleChange })));
29
30
  };
30
31
 
31
32
  exports.Checkbox = Checkbox;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n checked,\n indeterminate,\n value,\n name,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const id = useMemo(() => generateId('checkbox'), []);\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 return (\n <Choice id={id} disabled={disabled} className={className} {...otherProps}>\n <Input\n ref={checkboxRef}\n id={id}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n onChange={handleChange}\n />\n </Choice>\n );\n};\n"],"names":["useMemo","generateId","useRef","useCallback","useEffect","React","Choice","Input"],"mappings":";;;;;;;;;;;AAkBa,MAAA,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;AAClB,IAAA,MAAM,EAAE,GAAGA,aAAO,CAAC,MAAMC,qBAAU,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AACpD,IAAA,MAAM,WAAW,GAAGC,YAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAEDC,eAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,aAAM,EAAC,EAAA,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,KAAM,UAAU,EAAA;AACtE,QAAAD,sBAAA,CAAA,aAAA,CAACE,YAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACrB,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
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 { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\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) => 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 />\n </Choice>\n );\n};\n"],"names":["useMemo","generateId","useRef","useCallback","useEffect","React","Choice","Input"],"mappings":";;;;;;;;;;;AAmBO,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,GAAGA,aAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAIC,qBAAU,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,MAAM,WAAW,GAAGC,YAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAEDC,eAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;IAEhE,QACEC,qCAACC,aAAM,EAAA,EACL,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KACN,UAAU,EAAA;AAEd,QAAAD,sBAAA,CAAA,aAAA,CAACE,YAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { ForwardedChoiceProps } from '../Choice';
3
3
  export type CheckboxValue = string | number;
4
4
  export interface CheckboxProps extends ForwardedChoiceProps {
5
+ id?: string;
5
6
  checked: boolean;
6
7
  indeterminate?: boolean;
7
8
  value?: CheckboxValue;
@@ -11,4 +12,4 @@ export interface CheckboxProps extends ForwardedChoiceProps {
11
12
  onChange: (checked: boolean, value?: CheckboxValue) => void;
12
13
  className?: string;
13
14
  }
14
- export declare const Checkbox: ({ checked, indeterminate, value, name, disabled, ariaLabel, className, onChange, ...otherProps }: CheckboxProps) => React.JSX.Element;
15
+ export declare const Checkbox: ({ id, checked, indeterminate, value, name, hint, disabled, ariaLabel, className, onChange, ...otherProps }: CheckboxProps) => React.JSX.Element;
@@ -3,8 +3,8 @@ import { Choice } from '../Choice/Choice.js';
3
3
  import { Input } from './styled.js';
4
4
  import { generateId } from '../../utils/generateId.js';
5
5
 
6
- const Checkbox = ({ checked, indeterminate, value, name, disabled, ariaLabel, className, onChange, ...otherProps }) => {
7
- const id = useMemo(() => generateId('checkbox'), []);
6
+ const Checkbox = ({ id, checked, indeterminate, value, name, hint, disabled, ariaLabel, className, onChange, ...otherProps }) => {
7
+ const componentId = useMemo(() => id !== null && id !== undefined ? id : generateId('checkbox'), [id]);
8
8
  const checkboxRef = useRef(null);
9
9
  const handleChange = useCallback((e) => {
10
10
  onChange(e.currentTarget.checked, value);
@@ -18,8 +18,9 @@ const Checkbox = ({ checked, indeterminate, value, name, disabled, ariaLabel, cl
18
18
  }
19
19
  checkboxRef.current.indeterminate = false;
20
20
  }, [indeterminate]);
21
- return (React__default.createElement(Choice, { id: id, disabled: disabled, className: className, ...otherProps },
22
- React__default.createElement(Input, { ref: checkboxRef, id: id, type: "checkbox", checked: checked, value: value, name: name, disabled: disabled, "aria-label": ariaLabel, onChange: handleChange })));
21
+ const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
22
+ return (React__default.createElement(Choice, { htmlFor: componentId, disabled: disabled, className: className, hint: hint, ...otherProps },
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 })));
23
24
  };
24
25
 
25
26
  export { Checkbox };
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n checked,\n indeterminate,\n value,\n name,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const id = useMemo(() => generateId('checkbox'), []);\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 return (\n <Choice id={id} disabled={disabled} className={className} {...otherProps}>\n <Input\n ref={checkboxRef}\n id={id}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n onChange={handleChange}\n />\n </Choice>\n );\n};\n"],"names":["React"],"mappings":";;;;;AAkBa,MAAA,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;AAClB,IAAA,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AACpD,IAAA,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,SAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,KAAM,UAAU,EAAA;AACtE,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACrB,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
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 { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\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) => 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 />\n </Choice>\n );\n};\n"],"names":["React"],"mappings":";;;;;AAmBO,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,SAAA,GAAF,EAAE,GAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,SAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;IAEhE,QACEA,6BAAC,MAAM,EAAA,EACL,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KACN,UAAU,EAAA;AAEd,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
@@ -18,7 +18,7 @@ const generateClassNames = (prefix) => ({
18
18
  tooltip: prefix ? 'choice__tooltip' : undefined,
19
19
  error: prefix ? 'choice__error' : undefined,
20
20
  });
21
- const Choice = ({ id, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
21
+ const Choice = ({ htmlFor, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
22
22
  const classNames = generateClassNames(className);
23
23
  const contentMarkup = (React__default.default.createElement(styled.RootLayout, null,
24
24
  inputPosition === 'left' && (React__default.default.createElement(styled.InputLayout, { align: Accessory ? 'center' : 'top' }, children)),
@@ -26,17 +26,17 @@ const Choice = ({ id, className, label, hint, tooltip, tooltipContent, error, bo
26
26
  label || hint || error || Badge || Footer ? (React__default.default.createElement(styled.TextLayout, null,
27
27
  React__default.default.createElement(Stack.Stack, { direction: "horizontal", alignY: "center", spacing: "sm" },
28
28
  Badge,
29
- label && (React__default.default.createElement(Text.Text, { variant: labelVariant, className: classNames.label }, label)),
29
+ label && (React__default.default.createElement(Text.Text, { as: "label", htmlFor: htmlFor, variant: labelVariant, className: classNames.label }, label)),
30
30
  (tooltip || tooltipContent) && (React__default.default.createElement(styled.BlockTooltip, { text: tooltip, content: tooltipContent, className: classNames.tooltip },
31
31
  React__default.default.createElement(HelpIcon.HelpIcon, { "data-testid": "tooltip-help", name: "help", width: index.theme.sizes.base, color: index.theme.colors.neutral.ink.lightest })))),
32
- hint && React__default.default.createElement(styled.HintText, { className: classNames.hint }, hint),
33
- error && React__default.default.createElement(styled.ErrorText, { className: classNames.error }, error),
32
+ hint && (React__default.default.createElement(Text.Text, { id: `hint-${htmlFor}`, variant: "hintText", className: classNames.hint }, hint)),
33
+ error && (React__default.default.createElement(Text.Text, { variant: "error", className: classNames.error }, error)),
34
34
  Footer)) : null,
35
35
  inputPosition === 'right' && (React__default.default.createElement(styled.InputLayout, { align: Accessory ? 'center' : 'top' }, children))));
36
36
  if (bordered) {
37
- return (React__default.default.createElement(styled.BorderedWrapper, { disabled: disabled, htmlFor: id, className: className }, contentMarkup));
37
+ return (React__default.default.createElement(styled.BorderedWrapper, { disabled: disabled, className: className }, contentMarkup));
38
38
  }
39
- return (React__default.default.createElement(styled.Wrapper, { disabled: disabled, htmlFor: id, className: className }, contentMarkup));
39
+ return (React__default.default.createElement(styled.Wrapper, { disabled: disabled, className: className }, contentMarkup));
40
40
  };
41
41
 
42
42
  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';\n\nimport {\n Wrapper,\n BorderedWrapper,\n RootLayout,\n InputLayout,\n AccessoryLayout,\n TextLayout,\n HintText,\n ErrorText,\n BlockTooltip,\n} from './components/styled';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\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 id: 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 id,\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 contentMarkup = (\n <RootLayout>\n {inputPosition === 'left' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n {Accessory && <AccessoryLayout>{Accessory}</AccessoryLayout>}\n {label || hint || error || Badge || Footer ? (\n <TextLayout>\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 <BlockTooltip 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 </BlockTooltip>\n )}\n </Stack>\n {hint && <HintText className={classNames.hint}>{hint}</HintText>}\n {error && <ErrorText className={classNames.error}>{error}</ErrorText>}\n {Footer}\n </TextLayout>\n ) : null}\n {inputPosition === 'right' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n </RootLayout>\n );\n\n if (bordered) {\n return (\n <BorderedWrapper disabled={disabled} htmlFor={id} className={className}>\n {contentMarkup}\n </BorderedWrapper>\n );\n }\n\n return (\n <Wrapper disabled={disabled} htmlFor={id} className={className}>\n {contentMarkup}\n </Wrapper>\n );\n};\n"],"names":["React","RootLayout","InputLayout","AccessoryLayout","TextLayout","Stack","Text","BlockTooltip","HelpIcon","theme","HintText","ErrorText","BorderedWrapper","Wrapper"],"mappings":";;;;;;;;;;;;;;AAwCA,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;AAEW,MAAA,MAAM,GAAG,CAAC,EACrB,EAAE,EACF,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,M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V,sBAAC,CAAA,aAAA,CAAAW,gBAAS,EAAC,EAAA,SAAS,EAAE,UAAU,CAAC,KAAK,EAAG,EAAA,KAAK,CAAa;AACpE,YAAA,MAAM,CACI,IACX,IAAI;QACP,aAAa,KAAK,OAAO,KACxBX,sBAAA,CAAA,aAAA,CAACE,kBAAW,EAAC,EAAA,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,EAAA,EAAG,QAAQ,CAAe,CAC3E,CACU,CACd;AAED,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEF,sBAAC,CAAA,aAAA,CAAAY,sBAAe,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,IACnE,aAAa,CACE;AAErB;AAED,IAAA,QACEZ,sBAAC,CAAA,aAAA,CAAAa,cAAO,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,IAC3D,aAAa,CACN;AAEd;;;;"}
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';\n\nimport {\n Wrapper,\n BorderedWrapper,\n RootLayout,\n InputLayout,\n AccessoryLayout,\n TextLayout,\n BlockTooltip,\n} from './components/styled';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\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 contentMarkup = (\n <RootLayout>\n {inputPosition === 'left' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n {Accessory && <AccessoryLayout>{Accessory}</AccessoryLayout>}\n {label || hint || error || Badge || Footer ? (\n <TextLayout>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n {Badge}\n {label && (\n <Text\n as=\"label\"\n htmlFor={htmlFor}\n variant={labelVariant}\n className={classNames.label}\n >\n {label}\n </Text>\n )}\n {(tooltip || tooltipContent) && (\n <BlockTooltip 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 </BlockTooltip>\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 </TextLayout>\n ) : null}\n {inputPosition === 'right' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n </RootLayout>\n );\n\n if (bordered) {\n return (\n <BorderedWrapper disabled={disabled} className={className}>\n {contentMarkup}\n </BorderedWrapper>\n );\n }\n\n return (\n <Wrapper disabled={disabled} className={className}>\n {contentMarkup}\n </Wrapper>\n );\n};\n"],"names":["React","RootLayout","InputLayout","AccessoryLayout","TextLayout","Stack","Text","BlockTooltip","HelpI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ErB;AAED,IAAA,QACEV,sBAAA,CAAA,aAAA,CAACW,cAAO,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA,EAC9C,aAAa,CACN;AAEd;;;;"}
@@ -16,7 +16,7 @@ export interface ForwardedChoiceProps {
16
16
  labelVariant?: TextVariant;
17
17
  }
18
18
  export interface ChoiceProps extends ForwardedChoiceProps {
19
- id: string;
19
+ htmlFor: string;
20
20
  children: ReactNode;
21
21
  }
22
- export declare const Choice: ({ id, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled, labelVariant, inputPosition, }: ChoiceProps) => React.JSX.Element;
22
+ export declare const Choice: ({ htmlFor, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled, labelVariant, inputPosition, }: ChoiceProps) => React.JSX.Element;
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import { Stack } from '../Stack/Stack.js';
3
3
  import '../Stack/types.js';
4
4
  import { theme } from '../../theme/index.js';
5
- import { RootLayout, InputLayout, AccessoryLayout, TextLayout, BlockTooltip, HintText, ErrorText, BorderedWrapper, Wrapper } from './components/styled.js';
5
+ import { RootLayout, InputLayout, AccessoryLayout, TextLayout, BlockTooltip, BorderedWrapper, Wrapper } from './components/styled.js';
6
6
  import { HelpIcon } from '../../icons/HelpIcon.js';
7
7
  import { Text } from '../Text/Text.js';
8
8
 
@@ -12,7 +12,7 @@ const generateClassNames = (prefix) => ({
12
12
  tooltip: prefix ? 'choice__tooltip' : undefined,
13
13
  error: prefix ? 'choice__error' : undefined,
14
14
  });
15
- const Choice = ({ id, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
15
+ const Choice = ({ htmlFor, className, label, hint, tooltip, tooltipContent, error, bordered, Badge, Accessory, Footer, children, disabled = false, labelVariant = 'body', inputPosition = 'left', }) => {
16
16
  const classNames = generateClassNames(className);
17
17
  const contentMarkup = (React__default.createElement(RootLayout, null,
18
18
  inputPosition === 'left' && (React__default.createElement(InputLayout, { align: Accessory ? 'center' : 'top' }, children)),
@@ -20,17 +20,17 @@ const Choice = ({ id, className, label, hint, tooltip, tooltipContent, error, bo
20
20
  label || hint || error || Badge || Footer ? (React__default.createElement(TextLayout, null,
21
21
  React__default.createElement(Stack, { direction: "horizontal", alignY: "center", spacing: "sm" },
22
22
  Badge,
23
- label && (React__default.createElement(Text, { variant: labelVariant, className: classNames.label }, label)),
23
+ label && (React__default.createElement(Text, { as: "label", htmlFor: htmlFor, variant: labelVariant, className: classNames.label }, label)),
24
24
  (tooltip || tooltipContent) && (React__default.createElement(BlockTooltip, { text: tooltip, content: tooltipContent, className: classNames.tooltip },
25
25
  React__default.createElement(HelpIcon, { "data-testid": "tooltip-help", name: "help", width: theme.sizes.base, color: theme.colors.neutral.ink.lightest })))),
26
- hint && React__default.createElement(HintText, { className: classNames.hint }, hint),
27
- error && React__default.createElement(ErrorText, { className: classNames.error }, error),
26
+ hint && (React__default.createElement(Text, { id: `hint-${htmlFor}`, variant: "hintText", className: classNames.hint }, hint)),
27
+ error && (React__default.createElement(Text, { variant: "error", className: classNames.error }, error)),
28
28
  Footer)) : null,
29
29
  inputPosition === 'right' && (React__default.createElement(InputLayout, { align: Accessory ? 'center' : 'top' }, children))));
30
30
  if (bordered) {
31
- return (React__default.createElement(BorderedWrapper, { disabled: disabled, htmlFor: id, className: className }, contentMarkup));
31
+ return (React__default.createElement(BorderedWrapper, { disabled: disabled, className: className }, contentMarkup));
32
32
  }
33
- return (React__default.createElement(Wrapper, { disabled: disabled, htmlFor: id, className: className }, contentMarkup));
33
+ return (React__default.createElement(Wrapper, { disabled: disabled, className: className }, contentMarkup));
34
34
  };
35
35
 
36
36
  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';\n\nimport {\n Wrapper,\n BorderedWrapper,\n RootLayout,\n InputLayout,\n AccessoryLayout,\n TextLayout,\n HintText,\n ErrorText,\n BlockTooltip,\n} from './components/styled';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\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 id: 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 id,\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 contentMarkup = (\n <RootLayout>\n {inputPosition === 'left' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n {Accessory && <AccessoryLayout>{Accessory}</AccessoryLayout>}\n {label || hint || error || Badge || Footer ? (\n <TextLayout>\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 <BlockTooltip 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 </BlockTooltip>\n )}\n </Stack>\n {hint && <HintText className={classNames.hint}>{hint}</HintText>}\n {error && <ErrorText className={classNames.error}>{error}</ErrorText>}\n {Footer}\n </TextLayout>\n ) : null}\n {inputPosition === 'right' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n </RootLayout>\n );\n\n if (bordered) {\n return (\n <BorderedWrapper disabled={disabled} htmlFor={id} className={className}>\n {contentMarkup}\n </BorderedWrapper>\n );\n }\n\n return (\n <Wrapper disabled={disabled} htmlFor={id} className={className}>\n {contentMarkup}\n </Wrapper>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AAwCA,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;AAEW,MAAA,MAAM,GAAG,CAAC,EACrB,EAAE,EACF,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,aAAa,IACjBA,cAAA,CAAA,aAAA,CAAC,UAAU,EAAA,IAAA;QACR,aAAa,KAAK,MAAM,KACvBA,6BAAC,WAAW,EAAA,EAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,EAAA,EAAG,QAAQ,CAAe,CAC3E;AACA,QAAA,SAAS,IAAIA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,IAAA,EA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ACU,CACd;AAED,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEA,cAAC,CAAA,aAAA,CAAA,eAAe,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,IACnE,aAAa,CACE;AAErB;AAED,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,OAAO,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,IAC3D,aAAa,CACN;AAEd;;;;"}
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';\n\nimport {\n Wrapper,\n BorderedWrapper,\n RootLayout,\n InputLayout,\n AccessoryLayout,\n TextLayout,\n BlockTooltip,\n} from './components/styled';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { Text } from '../Text';\nimport { TextVariant } from '../Text/types';\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 contentMarkup = (\n <RootLayout>\n {inputPosition === 'left' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n {Accessory && <AccessoryLayout>{Accessory}</AccessoryLayout>}\n {label || hint || error || Badge || Footer ? (\n <TextLayout>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n {Badge}\n {label && (\n <Text\n as=\"label\"\n htmlFor={htmlFor}\n variant={labelVariant}\n className={classNames.label}\n >\n {label}\n </Text>\n )}\n {(tooltip || tooltipContent) && (\n <BlockTooltip 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 </BlockTooltip>\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 </TextLayout>\n ) : null}\n {inputPosition === 'right' && (\n <InputLayout align={Accessory ? 'center' : 'top'}>{children}</InputLayout>\n )}\n </RootLayout>\n );\n\n if (bordered) {\n return (\n <BorderedWrapper disabled={disabled} className={className}>\n {contentMarkup}\n </BorderedWrapper>\n );\n }\n\n return (\n <Wrapper disabled={disabled} className={className}>\n {contentMarkup}\n </Wrapper>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AAsCA,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;AAEW,MAAA,MAAM,GAAG,CAAC,EACrB,OAAO,EACP,SAAS,EACT,KAAK,EACL,IAAI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KAAK,CAAC,KAAK,CAAC,IAAI,EACvB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EACxC,CAAA,CACW,CAChB,CACK;YACP,IAAI,KACHA,cAAC,CAAA,aAAA,CAAA,IAAI,IAAC,EAAE,EAAE,CAAQ,KAAA,EAAA,OAAO,CAAE,CAAA,EAAE,OAAO,EAAC,UAAU,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EAAA,EACvE,IAAI,CACA,CACR;AACA,YAAA,KAAK,KACJA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,KAAK,EAC9C,EAAA,KAAK,CACD,CACR;AACA,YAAA,MAAM,CACI,IACX,IAAI;QACP,aAAa,KAAK,OAAO,KACxBA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,EAAA,EAAG,QAAQ,CAAe,CAC3E,CACU,CACd;AAED,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA,EACtD,aAAa,CACE;AAErB;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA,EAC9C,aAAa,CACN;AAEd;;;;"}
@@ -16,17 +16,13 @@ const RootLayout = styled__default.default.div.withConfig({ displayName: "vui--R
16
16
  const InputLayout = styled__default.default.div.withConfig({ displayName: "vui--InputLayout", componentId: "vui--1yac6kr" }) `align-self:stretch;display:flex;align-items:${(props) => alignMap[props.align]};`;
17
17
  const AccessoryLayout = styled__default.default.div.withConfig({ displayName: "vui--AccessoryLayout", componentId: "vui--qbgrc7" }) `align-self:center;display:flex;align-items:center;`;
18
18
  const TextLayout = styled__default.default.div.withConfig({ displayName: "vui--TextLayout", componentId: "vui--1uu3ed5" }) `flex:1;& > * + *{margin-top:${index.theme.sizes.sm};}`;
19
- const HintText = styled__default.default.div.withConfig({ displayName: "vui--HintText", componentId: "vui--lz8nl" }) `font-family:${index.theme.fontFamily};font-size:${index.theme.sizes[3]};line-height:${index.theme.sizes[4]};color:${index.theme.colors.neutral.ink.light};`;
20
- const ErrorText = styled__default.default.div.withConfig({ displayName: "vui--ErrorText", componentId: "vui--piugtf" }) `font-family:${index.theme.text.error.fontFamily};font-size:${index.theme.text.error.fontSize};font-weight:${index.theme.text.error.fontWeight};line-height:${index.theme.text.error.lineHeight};color:${index.theme.text.error.color};`;
21
- const Wrapper = styled__default.default.label.withConfig({ displayName: "vui--Wrapper", componentId: "vui--2wdtq1" }) `box-sizing:border-box;&:hover{cursor:${(props) => (props.disabled ? 'default' : 'pointer')};}`;
22
- const BorderedWrapper = styled__default.default(Wrapper).withConfig({ displayName: "vui--BorderedWrapper", componentId: "vui--1an42ms" }) `border:2px solid ${index.theme.colors.neutral.grey.dark};border-radius:${index.theme.radius.md};padding:${index.theme.sizes.base} 0.75rem;&:hover{border-color:${index.theme.colors.secondary.blue.base};}`;
23
- const BlockTooltip = styled__default.default(Tooltip.Tooltip).withConfig({ displayName: "vui--BlockTooltip", componentId: "vui--1ifrill" }) `display:block;&-hoverable{display:block;}`;
19
+ const Wrapper = styled__default.default.label.withConfig({ displayName: "vui--Wrapper", componentId: "vui--taq5r4" }) `box-sizing:border-box;&:hover{cursor:${(props) => (props.disabled ? 'default' : 'pointer')};}`;
20
+ const BorderedWrapper = styled__default.default(Wrapper).withConfig({ displayName: "vui--BorderedWrapper", componentId: "vui--f5wv6j" }) `border:2px solid ${index.theme.colors.neutral.grey.dark};border-radius:${index.theme.radius.md};padding:${index.theme.sizes.base} 0.75rem;&:hover{border-color:${index.theme.colors.secondary.blue.base};}`;
21
+ const BlockTooltip = styled__default.default(Tooltip.Tooltip).withConfig({ displayName: "vui--BlockTooltip", componentId: "vui--1n3z4wy" }) `display:block;&-hoverable{display:block;}`;
24
22
 
25
23
  exports.AccessoryLayout = AccessoryLayout;
26
24
  exports.BlockTooltip = BlockTooltip;
27
25
  exports.BorderedWrapper = BorderedWrapper;
28
- exports.ErrorText = ErrorText;
29
- exports.HintText = HintText;
30
26
  exports.InputLayout = InputLayout;
31
27
  exports.RootLayout = RootLayout;
32
28
  exports.TextLayout = TextLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../../src/components/Choice/components/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Tooltip } from '../../Tooltip';\nimport { theme } from '../../../theme';\n\nconst alignMap = {\n top: 'flex-start',\n center: 'center',\n};\n\nexport const RootLayout = styled.div`\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: ${theme.sizes.base};\n }\n`;\n\nexport interface InputLayoutProps {\n align: 'top' | 'center';\n}\n\nexport const InputLayout = styled.div<InputLayoutProps>`\n align-self: stretch;\n display: flex;\n align-items: ${(props) => alignMap[props.align]};\n`;\n\nexport const AccessoryLayout = styled.div`\n align-self: center;\n display: flex;\n align-items: center;\n`;\n\nexport const TextLayout = styled.div`\n flex: 1;\n\n & > * + * {\n margin-top: ${theme.sizes.sm};\n }\n`;\n\nexport const HintText = styled.div`\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport const ErrorText = styled.div`\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n`;\n\nexport const Wrapper = styled.label<{ disabled: boolean }>`\n box-sizing: border-box;\n\n &:hover {\n cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};\n }\n`;\n\nexport const BorderedWrapper = styled(Wrapper)`\n border: 2px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.radius.md};\n padding: ${theme.sizes.base} 0.75rem;\n\n &:hover {\n border-color: ${theme.colors.secondary.blue.base};\n }\n`;\n\nexport const BlockTooltip = styled(Tooltip)`\n /* Tooltip uses inline-block containers which add more height when\n the child component is an inline element (e.g. Glyph or an SVG),\n so we need to set to block to preserve the height and fix alignment. */\n display: block;\n &-hoverable {\n display: block;\n }\n`;\n"],"names":["styled","theme","Tooltip"],"mappings":";;;;;;;;;;AAIA,MAAM,QAAQ,GAAG;AACf,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,MAAM,EAAE,QAAQ;CACjB;AAEM,MAAM,UAAU,GAAGA,uBAAM,CAAC,GAAG,CAKjB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,sDAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,IAAI;MAQtB,WAAW,GAAGD,uBAAM,CAAC,GAAG,6HAGpB,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;MAGpC,eAAe,GAAGA,uBAAM,CAAC,GAAG;AAMlC,MAAM,UAAU,GAAGA,uBAAM,CAAC,GAAG,CAIlB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,4BAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,EAAE;AAInB,MAAA,QAAQ,GAAGD,uBAAM,CAAC,GAAG,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,eAAA,EAAA,WAAA,EAAA,YAAA,EAAA,CAAA,CAAA,CAAA,YAAA,EACjBC,WAAK,CAAC,UAAU,CAClB,WAAA,EAAAA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,aAAA,EAAAA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UACpBA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,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+ {"version":3,"file":"styled.cjs","sources":["../../../../src/components/Choice/components/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Tooltip } from '../../Tooltip';\nimport { theme } from '../../../theme';\n\nconst alignMap = {\n top: 'flex-start',\n center: 'center',\n};\n\nexport const RootLayout = styled.div`\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: ${theme.sizes.base};\n }\n`;\n\nexport interface InputLayoutProps {\n align: 'top' | 'center';\n}\n\nexport const InputLayout = styled.div<InputLayoutProps>`\n align-self: stretch;\n display: flex;\n align-items: ${(props) => alignMap[props.align]};\n`;\n\nexport const AccessoryLayout = styled.div`\n align-self: center;\n display: flex;\n align-items: center;\n`;\n\nexport const TextLayout = styled.div`\n flex: 1;\n\n & > * + * {\n margin-top: ${theme.sizes.sm};\n }\n`;\n\nexport const Wrapper = styled.label<{ disabled: boolean }>`\n box-sizing: border-box;\n\n &:hover {\n cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};\n }\n`;\n\nexport const BorderedWrapper = styled(Wrapper)`\n border: 2px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.radius.md};\n padding: ${theme.sizes.base} 0.75rem;\n\n &:hover {\n border-color: ${theme.colors.secondary.blue.base};\n }\n`;\n\nexport const BlockTooltip = styled(Tooltip)`\n /* Tooltip uses inline-block containers which add more height when\n the child component is an inline element (e.g. Glyph or an SVG),\n so we need to set to block to preserve the height and fix alignment. */\n display: block;\n &-hoverable {\n display: block;\n }\n`;\n"],"names":["styled","theme","Tooltip"],"mappings":";;;;;;;;;;AAIA,MAAM,QAAQ,GAAG;AACf,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,MAAM,EAAE,QAAQ;CACjB;AAEM,MAAM,UAAU,GAAGA,uBAAM,CAAC,GAAG,CAKjB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,sDAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,IAAI;MAQtB,WAAW,GAAGD,uBAAM,CAAC,GAAG,6HAGpB,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;MAGpC,eAAe,GAAGA,uBAAM,CAAC,GAAG;AAMlC,MAAM,UAAU,GAAGA,uBAAM,CAAC,GAAG,CAIlB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,4BAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,EAAE;AAInB,MAAA,OAAO,GAAGD,uBAAM,CAAC,KAAK,CAIrB,UAAA,CAAA,EAAA,WAAA,EAAA,cAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,qCAAA,EAAA,CAAC,KAAK,MAAM,KAAK,CAAC,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,CAAA,EAAA;AAIpD,MAAA,eAAe,GAAGA,uBAAM,CAAC,OAAO,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,iBAAA,EACxBC,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CACjC,eAAA,EAAAA,WAAK,CAAC,MAAM,CAAC,EAAE,CAAA,SAAA,EACrBA,WAAK,CAAC,KAAK,CAAC,IAAI,CAAA,8BAAA,EAGTA,WAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;MAIvC,YAAY,GAAGD,uBAAM,CAACE,eAAO,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,yCAAA;;;;;;;;;;"}
@@ -5,8 +5,6 @@ export interface InputLayoutProps {
5
5
  export declare const InputLayout: import("styled-components").StyledComponent<"div", any, InputLayoutProps, never>;
6
6
  export declare const AccessoryLayout: import("styled-components").StyledComponent<"div", any, {}, never>;
7
7
  export declare const TextLayout: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const HintText: import("styled-components").StyledComponent<"div", any, {}, never>;
9
- export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
10
8
  export declare const Wrapper: import("styled-components").StyledComponent<"label", any, {
11
9
  disabled: boolean;
12
10
  }, never>;
@@ -10,11 +10,9 @@ const RootLayout = styled.div.withConfig({ displayName: "vui--RootLayout", compo
10
10
  const InputLayout = styled.div.withConfig({ displayName: "vui--InputLayout", componentId: "vui--1yac6kr" }) `align-self:stretch;display:flex;align-items:${(props) => alignMap[props.align]};`;
11
11
  const AccessoryLayout = styled.div.withConfig({ displayName: "vui--AccessoryLayout", componentId: "vui--qbgrc7" }) `align-self:center;display:flex;align-items:center;`;
12
12
  const TextLayout = styled.div.withConfig({ displayName: "vui--TextLayout", componentId: "vui--1uu3ed5" }) `flex:1;& > * + *{margin-top:${theme.sizes.sm};}`;
13
- const HintText = styled.div.withConfig({ displayName: "vui--HintText", componentId: "vui--lz8nl" }) `font-family:${theme.fontFamily};font-size:${theme.sizes[3]};line-height:${theme.sizes[4]};color:${theme.colors.neutral.ink.light};`;
14
- const ErrorText = styled.div.withConfig({ displayName: "vui--ErrorText", componentId: "vui--piugtf" }) `font-family:${theme.text.error.fontFamily};font-size:${theme.text.error.fontSize};font-weight:${theme.text.error.fontWeight};line-height:${theme.text.error.lineHeight};color:${theme.text.error.color};`;
15
- const Wrapper = styled.label.withConfig({ displayName: "vui--Wrapper", componentId: "vui--2wdtq1" }) `box-sizing:border-box;&:hover{cursor:${(props) => (props.disabled ? 'default' : 'pointer')};}`;
16
- const BorderedWrapper = styled(Wrapper).withConfig({ displayName: "vui--BorderedWrapper", componentId: "vui--1an42ms" }) `border:2px solid ${theme.colors.neutral.grey.dark};border-radius:${theme.radius.md};padding:${theme.sizes.base} 0.75rem;&:hover{border-color:${theme.colors.secondary.blue.base};}`;
17
- const BlockTooltip = styled(Tooltip).withConfig({ displayName: "vui--BlockTooltip", componentId: "vui--1ifrill" }) `display:block;&-hoverable{display:block;}`;
13
+ const Wrapper = styled.label.withConfig({ displayName: "vui--Wrapper", componentId: "vui--taq5r4" }) `box-sizing:border-box;&:hover{cursor:${(props) => (props.disabled ? 'default' : 'pointer')};}`;
14
+ const BorderedWrapper = styled(Wrapper).withConfig({ displayName: "vui--BorderedWrapper", componentId: "vui--f5wv6j" }) `border:2px solid ${theme.colors.neutral.grey.dark};border-radius:${theme.radius.md};padding:${theme.sizes.base} 0.75rem;&:hover{border-color:${theme.colors.secondary.blue.base};}`;
15
+ const BlockTooltip = styled(Tooltip).withConfig({ displayName: "vui--BlockTooltip", componentId: "vui--1n3z4wy" }) `display:block;&-hoverable{display:block;}`;
18
16
 
19
- export { AccessoryLayout, BlockTooltip, BorderedWrapper, ErrorText, HintText, InputLayout, RootLayout, TextLayout, Wrapper };
17
+ export { AccessoryLayout, BlockTooltip, BorderedWrapper, InputLayout, RootLayout, TextLayout, Wrapper };
20
18
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../src/components/Choice/components/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Tooltip } from '../../Tooltip';\nimport { theme } from '../../../theme';\n\nconst alignMap = {\n top: 'flex-start',\n center: 'center',\n};\n\nexport const RootLayout = styled.div`\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: ${theme.sizes.base};\n }\n`;\n\nexport interface InputLayoutProps {\n align: 'top' | 'center';\n}\n\nexport const InputLayout = styled.div<InputLayoutProps>`\n align-self: stretch;\n display: flex;\n align-items: ${(props) => alignMap[props.align]};\n`;\n\nexport const AccessoryLayout = styled.div`\n align-self: center;\n display: flex;\n align-items: center;\n`;\n\nexport const TextLayout = styled.div`\n flex: 1;\n\n & > * + * {\n margin-top: ${theme.sizes.sm};\n }\n`;\n\nexport const HintText = styled.div`\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport const ErrorText = styled.div`\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n`;\n\nexport const Wrapper = styled.label<{ disabled: boolean }>`\n box-sizing: border-box;\n\n &:hover {\n cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};\n }\n`;\n\nexport const BorderedWrapper = styled(Wrapper)`\n border: 2px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.radius.md};\n padding: ${theme.sizes.base} 0.75rem;\n\n &:hover {\n border-color: ${theme.colors.secondary.blue.base};\n }\n`;\n\nexport const BlockTooltip = styled(Tooltip)`\n /* Tooltip uses inline-block containers which add more height when\n the child component is an inline element (e.g. Glyph or an SVG),\n so we need to set to block to preserve the height and fix alignment. */\n display: block;\n &-hoverable {\n display: block;\n }\n`;\n"],"names":[],"mappings":";;;;AAIA,MAAM,QAAQ,GAAG;AACf,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,MAAM,EAAE,QAAQ;CACjB;AAEM,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAKjB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,sDAAA,EAAA,KAAK,CAAC,KAAK,CAAC,IAAI;MAQtB,WAAW,GAAG,MAAM,CAAC,GAAG,6HAGpB,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;MAGpC,eAAe,GAAG,MAAM,CAAC,GAAG;AAMlC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAIlB,UAAA,CAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,4BAAA,EAAA,KAAK,CAAC,KAAK,CAAC,EAAE;AAInB,MAAA,QAAQ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AAE,CAAA,SAAA,EACrB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAA,8BAAA,EAGT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;MAIvC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,yCAAA;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../src/components/Choice/components/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Tooltip } from '../../Tooltip';\nimport { theme } from '../../../theme';\n\nconst alignMap = {\n top: 'flex-start',\n center: 'center',\n};\n\nexport const RootLayout = styled.div`\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: ${theme.sizes.base};\n }\n`;\n\nexport interface InputLayoutProps {\n align: 'top' | 'center';\n}\n\nexport const InputLayout = styled.div<InputLayoutProps>`\n align-self: stretch;\n display: flex;\n align-items: ${(props) => alignMap[props.align]};\n`;\n\nexport const AccessoryLayout = styled.div`\n align-self: center;\n display: flex;\n align-items: center;\n`;\n\nexport const TextLayout = styled.div`\n flex: 1;\n\n & > * + * {\n margin-top: ${theme.sizes.sm};\n }\n`;\n\nexport const Wrapper = styled.label<{ disabled: boolean }>`\n box-sizing: border-box;\n\n &:hover {\n cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};\n }\n`;\n\nexport const BorderedWrapper = styled(Wrapper)`\n border: 2px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.radius.md};\n padding: ${theme.sizes.base} 0.75rem;\n\n &:hover {\n border-color: ${theme.colors.secondary.blue.base};\n }\n`;\n\nexport const BlockTooltip = styled(Tooltip)`\n /* Tooltip uses inline-block containers which add more height when\n the child component is an inline element (e.g. Glyph or an SVG),\n so we need to set to block to preserve the height and fix alignment. */\n display: block;\n &-hoverable {\n display: block;\n }\n`;\n"],"names":[],"mappings":";;;;AAIA,MAAM,QAAQ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A,EAAA,WAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,yCAAA;;;;"}
@@ -39,10 +39,11 @@ class ChoiceList extends React.Component {
39
39
  };
40
40
  }
41
41
  render() {
42
- const { allowMultiple, options, selected, title, disabled, bordered } = this.props;
42
+ const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
43
43
  const InputComponent = allowMultiple ? Checkbox.Checkbox : Radio.Radio;
44
44
  return (React__default.default.createElement(styled.Fieldset, { disabled: disabled },
45
45
  title && React__default.default.createElement(styled.Legend, null, title),
46
+ accessorySlot,
46
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 })))));
47
48
  }
48
49
  }
@@ -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 { Fieldset, Legend } from './styled';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\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 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 } = this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <Fieldset disabled={disabled}>\n {title && <Legend>{title}</Legend>}\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","Fieldset","Legend"],"mappings":";;;;;;;;;;;AAgCM,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,IAAI,aAAa,EAAE;AACjB,gBAAA,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC;gBACzC;AACD;AAED,YAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC;AACzC,SAAC;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;AACH,SAAC;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;AAAM,iBAAA;AACL,gBAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,KAAK,aAAa,KAAK,KAAK,CAAC;AAC1E;YAED,QAAQ,CAAC,WAAW,CAAC;AACvB,SAAC;;IAED,MAAM,GAAA;AACJ,QAAA,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;QAElF,MAAM,cAAc,GAAG,aAAa,GAAGC,iBAAQ,GAAGC,WAAK;AAEvD,QAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,eAAQ,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAA;AACzB,YAAA,KAAK,IAAID,sBAAA,CAAA,aAAA,CAACE,aAAM,EAAA,IAAA,EAAE,KAAK,CAAU;YACjC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBF,sBAAC,CAAA,aAAA,CAAA,cAAc,EACb,EAAA,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;;AAGhB;;;;"}
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 { Fieldset, Legend } from './styled';\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 disabled={disabled}>\n {title && <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","Fieldset","Legend"],"mappings":";;;;;;;;;;;AAkCM,MAAO,UAAW,SAAQA,eAA0B,CAAA;AAA1D,IAAA,WAAA,GAAA;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EAAA,QAAQ,EAAE,QAAQ,EAAA;AACzB,YAAA,KAAK,IAAID,sBAAA,CAAA,aAAA,CAACE,aAAM,EAAA,IAAA,EAAE,KAAK,CAAU;YACjC,aAAa;YACb,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBF,sBAAC,CAAA,aAAA,CAAA,cAAc,EACb,EAAA,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;;AAGhB;;;;"}
@@ -1,6 +1,7 @@
1
1
  import React, { Component, ReactNode } from 'react';
2
2
  type ChoiceListOptionValue = string | number;
3
3
  export interface ChoiceListOption {
4
+ id?: string;
4
5
  value: ChoiceListOptionValue;
5
6
  name?: string;
6
7
  label: string;
@@ -14,6 +15,7 @@ export interface ChoiceListProps {
14
15
  options: ChoiceListOption[];
15
16
  selected: ChoiceListOptionValue[];
16
17
  title?: string;
18
+ accessorySlot?: ReactNode;
17
19
  allowMultiple?: boolean;
18
20
  disabled?: boolean;
19
21
  bordered?: boolean;
@@ -33,10 +33,11 @@ class ChoiceList extends Component {
33
33
  };
34
34
  }
35
35
  render() {
36
- const { allowMultiple, options, selected, title, disabled, bordered } = this.props;
36
+ const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
37
37
  const InputComponent = allowMultiple ? Checkbox : Radio;
38
38
  return (React__default.createElement(Fieldset, { disabled: disabled },
39
39
  title && React__default.createElement(Legend, null, title),
40
+ accessorySlot,
40
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 })))));
41
42
  }
42
43
  }
@@ -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 { Fieldset, Legend } from './styled';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\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 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 } = this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <Fieldset disabled={disabled}>\n {title && <Legend>{title}</Legend>}\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":";;;;;AA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QACEA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAA;AACzB,YAAA,KAAK,IAAIA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA,EAAE,KAAK,CAAU;YACjC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBA,cAAC,CAAA,aAAA,CAAA,cAAc,EACb,EAAA,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;;AAGhB;;;;"}
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 { Fieldset, Legend } from './styled';\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 disabled={disabled}>\n {title && <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;AAED,YAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC;AACzC,SAAC;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;AACH,SAAC;AAED,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,KAA4B,EAAE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types.cjs');
6
4
  var styled = require('./styled.cjs');
7
5
  var components = require('./components.cjs');
8
6
  var usePagination = require('./hooks/usePagination.cjs');
@@ -10,6 +8,7 @@ var RightArrowIcon = require('../../icons/RightArrowIcon.cjs');
10
8
  var StartArrowIcon = require('../../icons/StartArrowIcon.cjs');
11
9
  var LeftArrowIcon = require('../../icons/LeftArrowIcon.cjs');
12
10
  var EndArrowIcon = require('../../icons/EndArrowIcon.cjs');
11
+ var FlexRow = require('../Flex/FlexRow/FlexRow.cjs');
13
12
 
14
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
15
14
 
@@ -35,14 +34,14 @@ const Pagination = ({ testId, e2eClassName, currentPage, totalPagesCount, handle
35
34
  if (currentPage !== totalPagesCount)
36
35
  handleChangePage(totalPagesCount);
37
36
  };
38
- return (React__default.default.createElement(Stack.Stack, { direction: "horizontal", alignY: "center", spacing: "xs", "data-testid": testId, className: e2eClassName },
39
- React__default.default.createElement(styled.PaginationButton, { onClick: handleSkipBack, iconSlot: React__default.default.createElement(StartArrowIcon.StartArrowIcon, null), size: "sm", "aria-label": "go to first page" }),
40
- React__default.default.createElement(styled.PaginationButton, { onClick: handleDecrement, iconSlot: React__default.default.createElement(LeftArrowIcon.LeftArrowIcon, null), size: "sm", "aria-label": "go to previous page", "aria-disabled": currentPage <= 1 }),
37
+ return (React__default.default.createElement(FlexRow.FlexRow, { alignItems: "center", gap: "xs", "data-testid": testId, className: e2eClassName },
38
+ React__default.default.createElement(styled.PaginationButton, { onClick: handleSkipBack, iconSlot: React__default.default.createElement(StartArrowIcon.StartArrowIcon, null), size: "sm", "aria-label": "go to first page", "aria-disabled": currentPage <= 1, disabled: currentPage <= 1 }),
39
+ React__default.default.createElement(styled.PaginationButton, { onClick: handleDecrement, iconSlot: React__default.default.createElement(LeftArrowIcon.LeftArrowIcon, null), size: "sm", "aria-label": "go to previous page", "aria-disabled": currentPage <= 1, disabled: currentPage <= 1 }),
41
40
  React__default.default.createElement("form", { onSubmit: handleFormSubmit },
42
41
  React__default.default.createElement(styled.PageInput, { "aria-live": "polite", "aria-label": `page ${currentPage} of ${totalPagesCount}`, size: "sm", type: "number", value: pageInputValue, min: "1", max: `${totalPagesCount}`, onChange: handleInputChange, onBlur: handleSubmit })),
43
42
  React__default.default.createElement(components.PageCount, { count: totalPagesCount }),
44
- React__default.default.createElement(styled.PaginationButton, { onClick: handleIncrement, iconSlot: React__default.default.createElement(RightArrowIcon.RightArrowIcon, null), size: "sm", "aria-label": "go to next page", "aria-disabled": currentPage >= totalPagesCount }),
45
- React__default.default.createElement(styled.PaginationButton, { onClick: handleSkipToEnd, iconSlot: React__default.default.createElement(EndArrowIcon.EndArrowIcon, null), size: "sm", "aria-label": "go to last page", "aria-disabled": currentPage >= totalPagesCount })));
43
+ React__default.default.createElement(styled.PaginationButton, { onClick: handleIncrement, iconSlot: React__default.default.createElement(RightArrowIcon.RightArrowIcon, null), size: "sm", "aria-label": "go to next page", "aria-disabled": currentPage >= totalPagesCount, disabled: currentPage >= totalPagesCount }),
44
+ React__default.default.createElement(styled.PaginationButton, { onClick: handleSkipToEnd, iconSlot: React__default.default.createElement(EndArrowIcon.EndArrowIcon, null), size: "sm", "aria-label": "go to last page", "aria-disabled": currentPage >= totalPagesCount, disabled: currentPage >= totalPagesCount })));
46
45
  };
47
46
 
48
47
  exports.Pagination = Pagination;
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.cjs","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { PaginationProps } from './types';\n\nimport { Stack } from '../Stack';\nimport { PageInput, PaginationButton } from './styled';\nimport { PageCount } from './components';\nimport { usePagination } from './hooks/usePagination';\n\nimport { RightArrowIcon } from '../../icons/RightArrowIcon';\nimport { StartArrowIcon } from '../../icons/StartArrowIcon';\nimport { LeftArrowIcon } from '../../icons/LeftArrowIcon';\nimport { EndArrowIcon } from '../../icons/EndArrowIcon';\n\nexport const Pagination = ({\n testId,\n e2eClassName,\n currentPage,\n totalPagesCount,\n handleChangePage,\n}: PaginationProps) => {\n const {\n pageInputValue,\n handleIncrement,\n handleDecrement,\n handleFormSubmit,\n handleInputChange,\n handleSubmit,\n } = usePagination({\n currentPage,\n totalPagesCount,\n handleChangePage,\n });\n\n /**\n * A function to go back to the first page, provided we aren't already there.\n */\n const handleSkipBack = () => {\n if (currentPage !== 1) handleChangePage(1);\n };\n\n /**\n * A function to go to the last page, provided we aren't already there.\n */\n const handleSkipToEnd = () => {\n if (currentPage !== totalPagesCount) handleChangePage(totalPagesCount);\n };\n\n return (\n <Stack\n direction=\"horizontal\"\n alignY=\"center\"\n spacing=\"xs\"\n data-testid={testId}\n className={e2eClassName}\n >\n <PaginationButton\n onClick={handleSkipBack}\n iconSlot={<StartArrowIcon />}\n size=\"sm\"\n aria-label=\"go to first page\"\n />\n <PaginationButton\n onClick={handleDecrement}\n iconSlot={<LeftArrowIcon />}\n size=\"sm\"\n aria-label=\"go to previous page\"\n aria-disabled={currentPage <= 1}\n />\n\n <form onSubmit={handleFormSubmit}>\n <PageInput\n aria-live=\"polite\"\n aria-label={`page ${currentPage} of ${totalPagesCount}`}\n size=\"sm\"\n type=\"number\"\n value={pageInputValue}\n min=\"1\"\n max={`${totalPagesCount}`}\n onChange={handleInputChange}\n onBlur={handleSubmit}\n />\n </form>\n\n <PageCount count={totalPagesCount} />\n\n <PaginationButton\n onClick={handleIncrement}\n iconSlot={<RightArrowIcon />}\n size=\"sm\"\n aria-label=\"go to next page\"\n aria-disabled={currentPage >= totalPagesCount}\n />\n\n <PaginationButton\n onClick={handleSkipToEnd}\n iconSlot={<EndArrowIcon />}\n size=\"sm\"\n aria-label=\"go to last page\"\n aria-disabled={currentPage >= totalPagesCount}\n />\n </Stack>\n );\n};\n"],"names":["usePagination","React","Stack","PaginationButton","StartArrowIcon","LeftArrowIcon","PageInput","PageCount","RightArrowIcon","EndArrowIcon"],"mappings":";;;;;;;;;;;;;;;;;AAaa,MAAA,UAAU,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AAQ,KAAA,EAAA,WAAW,OAAO,eAAe,CAAA,CAAE,EACvD,IAAI,EAAC,IAAI,EACT,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,cAAc,EACrB,GAAG,EAAC,GAAG,EACP,GAAG,EAAE,GAAG,eAAe,CAAA,CAAE,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,YAAY,GACpB,CACG;AAEP,QAAAL,sBAAA,CAAA,aAAA,CAACM,oBAAS,EAAA,EAAC,KAAK,EAAE,eAAe,EAAI,CAAA;QAErCN,sBAAC,CAAA,aAAA,CAAAE,uBAAgB,IACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEF,sBAAC,CAAA,aAAA,CAAAO,6BAAc,OAAG,EAC5B,IAAI,EAAC,IAAI,EAAA,YAAA,EACE,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,CAAA;QAEFP,sBAAC,CAAA,aAAA,CAAAE,uBAAgB,EACf,EAAA,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEF,sBAAC,CAAA,aAAA,CAAAQ,yBAAY,EAAG,IAAA,CAAA,EAC1B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAAA,CAC7C,CACI;AAEZ;;;;"}
1
+ {"version":3,"file":"Pagination.cjs","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { PaginationProps } from './types';\n\nimport { PageInput, PaginationButton } from './styled';\nimport { PageCount } from './components';\nimport { usePagination } from './hooks/usePagination';\n\nimport { RightArrowIcon } from '../../icons/RightArrowIcon';\nimport { StartArrowIcon } from '../../icons/StartArrowIcon';\nimport { LeftArrowIcon } from '../../icons/LeftArrowIcon';\nimport { EndArrowIcon } from '../../icons/EndArrowIcon';\nimport { FlexRow } from '../Flex/FlexRow';\n\nexport const Pagination = ({\n testId,\n e2eClassName,\n currentPage,\n totalPagesCount,\n handleChangePage,\n}: PaginationProps) => {\n const {\n pageInputValue,\n handleIncrement,\n handleDecrement,\n handleFormSubmit,\n handleInputChange,\n handleSubmit,\n } = usePagination({\n currentPage,\n totalPagesCount,\n handleChangePage,\n });\n\n /**\n * A function to go back to the first page, provided we aren't already there.\n */\n const handleSkipBack = () => {\n if (currentPage !== 1) handleChangePage(1);\n };\n\n /**\n * A function to go to the last page, provided we aren't already there.\n */\n const handleSkipToEnd = () => {\n if (currentPage !== totalPagesCount) handleChangePage(totalPagesCount);\n };\n\n return (\n <FlexRow alignItems=\"center\" gap=\"xs\" data-testid={testId} className={e2eClassName}>\n <PaginationButton\n onClick={handleSkipBack}\n iconSlot={<StartArrowIcon />}\n size=\"sm\"\n aria-label=\"go to first page\"\n aria-disabled={currentPage <= 1}\n disabled={currentPage <= 1}\n />\n <PaginationButton\n onClick={handleDecrement}\n iconSlot={<LeftArrowIcon />}\n size=\"sm\"\n aria-label=\"go to previous page\"\n aria-disabled={currentPage <= 1}\n disabled={currentPage <= 1}\n />\n\n <form onSubmit={handleFormSubmit}>\n <PageInput\n aria-live=\"polite\"\n aria-label={`page ${currentPage} of ${totalPagesCount}`}\n size=\"sm\"\n type=\"number\"\n value={pageInputValue}\n min=\"1\"\n max={`${totalPagesCount}`}\n onChange={handleInputChange}\n onBlur={handleSubmit}\n />\n </form>\n\n <PageCount count={totalPagesCount} />\n\n <PaginationButton\n onClick={handleIncrement}\n iconSlot={<RightArrowIcon />}\n size=\"sm\"\n aria-label=\"go to next page\"\n aria-disabled={currentPage >= totalPagesCount}\n disabled={currentPage >= totalPagesCount}\n />\n\n <PaginationButton\n onClick={handleSkipToEnd}\n iconSlot={<EndArrowIcon />}\n size=\"sm\"\n aria-label=\"go to last page\"\n aria-disabled={currentPage >= totalPagesCount}\n disabled={currentPage >= totalPagesCount}\n />\n </FlexRow>\n );\n};\n"],"names":["usePagination","React","FlexRow","PaginationButton","StartArrowIcon","LeftArrowIcon","PageInput","PageCount","RightArrowIcon","EndArrowIcon"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AAC,EAC1B,CAAA;QAEFJ,sBAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,QAAQ,EAAE,gBAAgB,EAAA;AAC9B,YAAAA,sBAAA,CAAA,aAAA,CAACK,gBAAS,EACE,EAAA,WAAA,EAAA,QAAQ,gBACN,CAAQ,KAAA,EAAA,WAAW,OAAO,eAAe,CAAA,CAAE,EACvD,IAAI,EAAC,IAAI,EACT,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,cAAc,EACrB,GAAG,EAAC,GAAG,EACP,GAAG,EAAE,GAAG,eAAe,CAAA,CAAE,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,YAAY,GACpB,CACG;AAEP,QAAAL,sBAAA,CAAA,aAAA,CAACM,oBAAS,EAAA,EAAC,KAAK,EAAE,eAAe,EAAI,CAAA;QAErCN,sBAAC,CAAA,aAAA,CAAAE,uBAAgB,EACf,EAAA,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEF,sBAAA,CAAA,aAAA,CAACO,6BAAc,EAAA,IAAA,CAAG,EAC5B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,QAAQ,EAAE,WAAW,IAAI,eAAe,EACxC,CAAA;AAEF,QAAAP,sBAAA,CAAA,aAAA,CAACE,uBAAgB,EAAA,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEF,sBAAC,CAAA,aAAA,CAAAQ,yBAAY,EAAG,IAAA,CAAA,EAC1B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,QAAQ,EAAE,WAAW,IAAI,eAAe,EACxC,CAAA,CACM;AAEd;;;;"}
@@ -1,6 +1,4 @@
1
1
  import React__default from 'react';
2
- import { Stack } from '../Stack/Stack.js';
3
- import '../Stack/types.js';
4
2
  import { PaginationButton, PageInput } from './styled.js';
5
3
  import { PageCount } from './components.js';
6
4
  import { usePagination } from './hooks/usePagination.js';
@@ -8,6 +6,7 @@ import { RightArrowIcon } from '../../icons/RightArrowIcon.js';
8
6
  import { StartArrowIcon } from '../../icons/StartArrowIcon.js';
9
7
  import { LeftArrowIcon } from '../../icons/LeftArrowIcon.js';
10
8
  import { EndArrowIcon } from '../../icons/EndArrowIcon.js';
9
+ import { FlexRow } from '../Flex/FlexRow/FlexRow.js';
11
10
 
12
11
  const Pagination = ({ testId, e2eClassName, currentPage, totalPagesCount, handleChangePage, }) => {
13
12
  const { pageInputValue, handleIncrement, handleDecrement, handleFormSubmit, handleInputChange, handleSubmit, } = usePagination({
@@ -29,14 +28,14 @@ const Pagination = ({ testId, e2eClassName, currentPage, totalPagesCount, handle
29
28
  if (currentPage !== totalPagesCount)
30
29
  handleChangePage(totalPagesCount);
31
30
  };
32
- return (React__default.createElement(Stack, { direction: "horizontal", alignY: "center", spacing: "xs", "data-testid": testId, className: e2eClassName },
33
- React__default.createElement(PaginationButton, { onClick: handleSkipBack, iconSlot: React__default.createElement(StartArrowIcon, null), size: "sm", "aria-label": "go to first page" }),
34
- React__default.createElement(PaginationButton, { onClick: handleDecrement, iconSlot: React__default.createElement(LeftArrowIcon, null), size: "sm", "aria-label": "go to previous page", "aria-disabled": currentPage <= 1 }),
31
+ return (React__default.createElement(FlexRow, { alignItems: "center", gap: "xs", "data-testid": testId, className: e2eClassName },
32
+ React__default.createElement(PaginationButton, { onClick: handleSkipBack, iconSlot: React__default.createElement(StartArrowIcon, null), size: "sm", "aria-label": "go to first page", "aria-disabled": currentPage <= 1, disabled: currentPage <= 1 }),
33
+ React__default.createElement(PaginationButton, { onClick: handleDecrement, iconSlot: React__default.createElement(LeftArrowIcon, null), size: "sm", "aria-label": "go to previous page", "aria-disabled": currentPage <= 1, disabled: currentPage <= 1 }),
35
34
  React__default.createElement("form", { onSubmit: handleFormSubmit },
36
35
  React__default.createElement(PageInput, { "aria-live": "polite", "aria-label": `page ${currentPage} of ${totalPagesCount}`, size: "sm", type: "number", value: pageInputValue, min: "1", max: `${totalPagesCount}`, onChange: handleInputChange, onBlur: handleSubmit })),
37
36
  React__default.createElement(PageCount, { count: totalPagesCount }),
38
- React__default.createElement(PaginationButton, { onClick: handleIncrement, iconSlot: React__default.createElement(RightArrowIcon, null), size: "sm", "aria-label": "go to next page", "aria-disabled": currentPage >= totalPagesCount }),
39
- React__default.createElement(PaginationButton, { onClick: handleSkipToEnd, iconSlot: React__default.createElement(EndArrowIcon, null), size: "sm", "aria-label": "go to last page", "aria-disabled": currentPage >= totalPagesCount })));
37
+ React__default.createElement(PaginationButton, { onClick: handleIncrement, iconSlot: React__default.createElement(RightArrowIcon, null), size: "sm", "aria-label": "go to next page", "aria-disabled": currentPage >= totalPagesCount, disabled: currentPage >= totalPagesCount }),
38
+ React__default.createElement(PaginationButton, { onClick: handleSkipToEnd, iconSlot: React__default.createElement(EndArrowIcon, null), size: "sm", "aria-label": "go to last page", "aria-disabled": currentPage >= totalPagesCount, disabled: currentPage >= totalPagesCount })));
40
39
  };
41
40
 
42
41
  export { Pagination };
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { PaginationProps } from './types';\n\nimport { Stack } from '../Stack';\nimport { PageInput, PaginationButton } from './styled';\nimport { PageCount } from './components';\nimport { usePagination } from './hooks/usePagination';\n\nimport { RightArrowIcon } from '../../icons/RightArrowIcon';\nimport { StartArrowIcon } from '../../icons/StartArrowIcon';\nimport { LeftArrowIcon } from '../../icons/LeftArrowIcon';\nimport { EndArrowIcon } from '../../icons/EndArrowIcon';\n\nexport const Pagination = ({\n testId,\n e2eClassName,\n currentPage,\n totalPagesCount,\n handleChangePage,\n}: PaginationProps) => {\n const {\n pageInputValue,\n handleIncrement,\n handleDecrement,\n handleFormSubmit,\n handleInputChange,\n handleSubmit,\n } = usePagination({\n currentPage,\n totalPagesCount,\n handleChangePage,\n });\n\n /**\n * A function to go back to the first page, provided we aren't already there.\n */\n const handleSkipBack = () => {\n if (currentPage !== 1) handleChangePage(1);\n };\n\n /**\n * A function to go to the last page, provided we aren't already there.\n */\n const handleSkipToEnd = () => {\n if (currentPage !== totalPagesCount) handleChangePage(totalPagesCount);\n };\n\n return (\n <Stack\n direction=\"horizontal\"\n alignY=\"center\"\n spacing=\"xs\"\n data-testid={testId}\n className={e2eClassName}\n >\n <PaginationButton\n onClick={handleSkipBack}\n iconSlot={<StartArrowIcon />}\n size=\"sm\"\n aria-label=\"go to first page\"\n />\n <PaginationButton\n onClick={handleDecrement}\n iconSlot={<LeftArrowIcon />}\n size=\"sm\"\n aria-label=\"go to previous page\"\n aria-disabled={currentPage <= 1}\n />\n\n <form onSubmit={handleFormSubmit}>\n <PageInput\n aria-live=\"polite\"\n aria-label={`page ${currentPage} of ${totalPagesCount}`}\n size=\"sm\"\n type=\"number\"\n value={pageInputValue}\n min=\"1\"\n max={`${totalPagesCount}`}\n onChange={handleInputChange}\n onBlur={handleSubmit}\n />\n </form>\n\n <PageCount count={totalPagesCount} />\n\n <PaginationButton\n onClick={handleIncrement}\n iconSlot={<RightArrowIcon />}\n size=\"sm\"\n aria-label=\"go to next page\"\n aria-disabled={currentPage >= totalPagesCount}\n />\n\n <PaginationButton\n onClick={handleSkipToEnd}\n iconSlot={<EndArrowIcon />}\n size=\"sm\"\n aria-label=\"go to last page\"\n aria-disabled={currentPage >= totalPagesCount}\n />\n </Stack>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;AAaa,MAAA,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACA,KAAI;AACpB,IAAA,MAAM,EACJ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,GAAG,aAAa,CAAC;QAChB,WAAW;QACX,eAAe;QACf,gBAAgB;AACjB,KAAA,CAAC;AAEF;;AAEG;IACH,MAAM,c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AA,EAAC,KAAK,EAAE,eAAe,EAAI,CAAA;QAErCA,cAAC,CAAA,aAAA,CAAA,gBAAgB,IACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEA,cAAC,CAAA,aAAA,CAAA,cAAc,OAAG,EAC5B,IAAI,EAAC,IAAI,EAAA,YAAA,EACE,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,CAAA;QAEFA,cAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEA,cAAC,CAAA,aAAA,CAAA,YAAY,EAAG,IAAA,CAAA,EAC1B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAAA,CAC7C,CACI;AAEZ;;;;"}
1
+ {"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { PaginationProps } from './types';\n\nimport { PageInput, PaginationButton } from './styled';\nimport { PageCount } from './components';\nimport { usePagination } from './hooks/usePagination';\n\nimport { RightArrowIcon } from '../../icons/RightArrowIcon';\nimport { StartArrowIcon } from '../../icons/StartArrowIcon';\nimport { LeftArrowIcon } from '../../icons/LeftArrowIcon';\nimport { EndArrowIcon } from '../../icons/EndArrowIcon';\nimport { FlexRow } from '../Flex/FlexRow';\n\nexport const Pagination = ({\n testId,\n e2eClassName,\n currentPage,\n totalPagesCount,\n handleChangePage,\n}: PaginationProps) => {\n const {\n pageInputValue,\n handleIncrement,\n handleDecrement,\n handleFormSubmit,\n handleInputChange,\n handleSubmit,\n } = usePagination({\n currentPage,\n totalPagesCount,\n handleChangePage,\n });\n\n /**\n * A function to go back to the first page, provided we aren't already there.\n */\n const handleSkipBack = () => {\n if (currentPage !== 1) handleChangePage(1);\n };\n\n /**\n * A function to go to the last page, provided we aren't already there.\n */\n const handleSkipToEnd = () => {\n if (currentPage !== totalPagesCount) handleChangePage(totalPagesCount);\n };\n\n return (\n <FlexRow alignItems=\"center\" gap=\"xs\" data-testid={testId} className={e2eClassName}>\n <PaginationButton\n onClick={handleSkipBack}\n iconSlot={<StartArrowIcon />}\n size=\"sm\"\n aria-label=\"go to first page\"\n aria-disabled={currentPage <= 1}\n disabled={currentPage <= 1}\n />\n <PaginationButton\n onClick={handleDecrement}\n iconSlot={<LeftArrowIcon />}\n size=\"sm\"\n aria-label=\"go to previous page\"\n aria-disabled={currentPage <= 1}\n disabled={currentPage <= 1}\n />\n\n <form onSubmit={handleFormSubmit}>\n <PageInput\n aria-live=\"polite\"\n aria-label={`page ${currentPage} of ${totalPagesCount}`}\n size=\"sm\"\n type=\"number\"\n value={pageInputValue}\n min=\"1\"\n max={`${totalPagesCount}`}\n onChange={handleInputChange}\n onBlur={handleSubmit}\n />\n </form>\n\n <PageCount count={totalPagesCount} />\n\n <PaginationButton\n onClick={handleIncrement}\n iconSlot={<RightArrowIcon />}\n size=\"sm\"\n aria-label=\"go to next page\"\n aria-disabled={currentPage >= totalPagesCount}\n disabled={currentPage >= totalPagesCount}\n />\n\n <PaginationButton\n onClick={handleSkipToEnd}\n iconSlot={<EndArrowIcon />}\n size=\"sm\"\n aria-label=\"go to last page\"\n aria-disabled={currentPage >= totalPagesCount}\n disabled={currentPage >= totalPagesCount}\n />\n </FlexRow>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;AAaa,MAAA,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACA,KAAI;AACpB,IAAA,MAAM,EACJ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,GAAG,aAAa,CAAC;QAChB,WAAW;QACX,eAAe;QACf,gBAAgB;AACjB,KAAA,CAAC;AAEF;;AAEG;IACH,MAAM,cAAc,GAAG,MAAK;QAC1B,IAAI,WAAW,KAAK,CAAC;YAAE,gBAAgB,CAAC,CAAC,CA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Y,GACpB,CACG;AAEP,QAAAA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,KAAK,EAAE,eAAe,EAAI,CAAA;QAErCA,cAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG,EAC5B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,QAAQ,EAAE,WAAW,IAAI,eAAe,EACxC,CAAA;AAEF,QAAAA,cAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAEA,cAAC,CAAA,aAAA,CAAA,YAAY,EAAG,IAAA,CAAA,EAC1B,IAAI,EAAC,IAAI,EACE,YAAA,EAAA,iBAAiB,EACb,eAAA,EAAA,WAAW,IAAI,eAAe,EAC7C,QAAQ,EAAE,WAAW,IAAI,eAAe,EACxC,CAAA,CACM;AAEd;;;;"}
@@ -10,9 +10,9 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
10
 
11
11
  const PageCount = ({ count }) => (React__default.default.createElement(React__default.default.Fragment, null,
12
12
  React__default.default.createElement("div", null,
13
- React__default.default.createElement(Text.Text, { variant: "bodySmall", "aria-hidden": true }, "/")),
14
- React__default.default.createElement(styled.PageLimitContainer, { alignX: "center", alignY: "center", "aria-hidden": true },
15
- React__default.default.createElement(Text.Text, { variant: "bodySmall" }, count))));
13
+ React__default.default.createElement(Text.Text, { variant: "bodySmallBold", "aria-hidden": true }, "/")),
14
+ React__default.default.createElement(styled.PageLimitContainer, { alignItems: "center", justifyContent: "center", "aria-hidden": true },
15
+ React__default.default.createElement(Text.Text, { variant: "body" }, count))));
16
16
 
17
17
  exports.PageCount = PageCount;
18
18
  //# sourceMappingURL=components.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.cjs","sources":["../../../src/components/Pagination/components.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '../Text';\nimport { PageLimitContainer } from './styled';\n\nexport const PageCount = ({ count }: { count: number }) => (\n <>\n <div>\n <Text variant=\"bodySmall\" aria-hidden>\n /\n </Text>\n </div>\n <PageLimitContainer alignX=\"center\" alignY=\"center\" aria-hidden>\n <Text variant=\"bodySmall\">{count}</Text>\n </PageLimitContainer>\n </>\n);\n"],"names":["React","Text","PageLimitContainer"],"mappings":";;;;;;;;;;AAIa,MAAA,SAAS,GAAG,CAAC,EAAE,KAAK,EAAqB,MACpDA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA;AACE,IAAAA,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACE,QAAAA,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAC,EAAA,OAAO,EAAC,WAAW,6BAElB,CACH;IACND,sBAAC,CAAA,aAAA,CAAAE,yBAAkB,IAAC,MAAM,EAAC,QAAQ,EAAC,MAAM,EAAC,QAAQ,EAAA,aAAA,EAAA,IAAA,EAAA;QACjDF,sBAAC,CAAA,aAAA,CAAAC,SAAI,EAAC,EAAA,OAAO,EAAC,WAAW,EAAE,EAAA,KAAK,CAAQ,CACrB,CACpB;;;;"}
1
+ {"version":3,"file":"components.cjs","sources":["../../../src/components/Pagination/components.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '../Text';\nimport { PageLimitContainer } from './styled';\n\nexport const PageCount = ({ count }: { count: number }) => (\n <>\n <div>\n <Text variant=\"bodySmallBold\" aria-hidden>\n /\n </Text>\n </div>\n <PageLimitContainer alignItems=\"center\" justifyContent=\"center\" aria-hidden>\n <Text variant=\"body\">{count}</Text>\n </PageLimitContainer>\n </>\n);\n"],"names":["React","Text","PageLimitContainer"],"mappings":";;;;;;;;;;AAIa,MAAA,SAAS,GAAG,CAAC,EAAE,KAAK,EAAqB,MACpDA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA;AACE,IAAAA,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACE,QAAAA,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAC,EAAA,OAAO,EAAC,eAAe,6BAEtB,CACH;IACND,sBAAC,CAAA,aAAA,CAAAE,yBAAkB,IAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAA,aAAA,EAAA,IAAA,EAAA;QAC7DF,sBAAC,CAAA,aAAA,CAAAC,SAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAE,EAAA,KAAK,CAAQ,CAChB,CACpB;;;;"}
@@ -4,9 +4,9 @@ import { PageLimitContainer } from './styled.js';
4
4
 
5
5
  const PageCount = ({ count }) => (React__default.createElement(React__default.Fragment, null,
6
6
  React__default.createElement("div", null,
7
- React__default.createElement(Text, { variant: "bodySmall", "aria-hidden": true }, "/")),
8
- React__default.createElement(PageLimitContainer, { alignX: "center", alignY: "center", "aria-hidden": true },
9
- React__default.createElement(Text, { variant: "bodySmall" }, count))));
7
+ React__default.createElement(Text, { variant: "bodySmallBold", "aria-hidden": true }, "/")),
8
+ React__default.createElement(PageLimitContainer, { alignItems: "center", justifyContent: "center", "aria-hidden": true },
9
+ React__default.createElement(Text, { variant: "body" }, count))));
10
10
 
11
11
  export { PageCount };
12
12
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sources":["../../../src/components/Pagination/components.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '../Text';\nimport { PageLimitContainer } from './styled';\n\nexport const PageCount = ({ count }: { count: number }) => (\n <>\n <div>\n <Text variant=\"bodySmall\" aria-hidden>\n /\n </Text>\n </div>\n <PageLimitContainer alignX=\"center\" alignY=\"center\" aria-hidden>\n <Text variant=\"bodySmall\">{count}</Text>\n </PageLimitContainer>\n </>\n);\n"],"names":["React"],"mappings":";;;;AAIa,MAAA,SAAS,GAAG,CAAC,EAAE,KAAK,EAAqB,MACpDA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;AACE,IAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACE,QAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,OAAO,EAAC,WAAW,6BAElB,CACH;IACNA,cAAC,CAAA,aAAA,CAAA,kBAAkB,IAAC,MAAM,EAAC,QAAQ,EAAC,MAAM,EAAC,QAAQ,EAAA,aAAA,EAAA,IAAA,EAAA;QACjDA,cAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,WAAW,EAAE,EAAA,KAAK,CAAQ,CACrB,CACpB;;;;"}
1
+ {"version":3,"file":"components.js","sources":["../../../src/components/Pagination/components.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '../Text';\nimport { PageLimitContainer } from './styled';\n\nexport const PageCount = ({ count }: { count: number }) => (\n <>\n <div>\n <Text variant=\"bodySmallBold\" aria-hidden>\n /\n </Text>\n </div>\n <PageLimitContainer alignItems=\"center\" justifyContent=\"center\" aria-hidden>\n <Text variant=\"body\">{count}</Text>\n </PageLimitContainer>\n </>\n);\n"],"names":["React"],"mappings":";;;;AAIa,MAAA,SAAS,GAAG,CAAC,EAAE,KAAK,EAAqB,MACpDA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;AACE,IAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACE,QAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,OAAO,EAAC,eAAe,6BAEtB,CACH;IACNA,cAAC,CAAA,aAAA,CAAA,kBAAkB,IAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAA,aAAA,EAAA,IAAA,EAAA;QAC7DA,cAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAE,EAAA,KAAK,CAAQ,CAChB,CACpB;;;;"}
@@ -2,8 +2,7 @@
2
2
 
3
3
  var styled = require('styled-components');
4
4
  var index = require('../../theme/index.cjs');
5
- var Stack = require('../Stack/Stack.cjs');
6
- require('../Stack/types.cjs');
5
+ var FlexRow = require('../Flex/FlexRow/FlexRow.cjs');
7
6
  var Button = require('../Button/Button.cjs');
8
7
  var index$1 = require('../TextField/index.cjs');
9
8
 
@@ -11,9 +10,9 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
10
 
12
11
  var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
13
12
 
14
- const PageLimitContainer = styled__default.default(Stack.Stack).withConfig({ displayName: "vui--PageLimitContainer", componentId: "vui--11yg0z2" }) `width:${index.theme.sizes.lg};height:30px;background-color:${index.theme.colors.neutral.grey.light};border:1px solid ${index.theme.colors.neutral.grey.base};border-radius:${index.theme.sizes.xs};`;
15
- const PaginationButton = styled__default.default(Button.Button).withConfig({ displayName: "vui--PaginationButton", componentId: "vui--1xoa6c5" }) `color:${index.theme.colors.neutral.ink.base};width:32px;height:32px;svg{width:24px;height:24px;}`;
16
- const PageInput = styled__default.default(index$1.TextField).withConfig({ displayName: "vui--PageInput", componentId: "vui--vpfeol" }) `&[type='number']{width:5.5ch;}`;
13
+ const PageLimitContainer = styled__default.default(FlexRow.FlexRow).withConfig({ displayName: "vui--PageLimitContainer", componentId: "vui--11yg0z2" }) `box-sizing:border-box;min-width:${index.theme.sizes[10]};height:${index.theme.sizes.lg};padding:0 ${index.theme.sizes[3]};background-color:${index.theme.colors.neutral.grey.light};border:1px solid ${index.theme.colors.neutral.grey.dark};border-radius:${index.theme.sizes.xs};`;
14
+ const PaginationButton = styled__default.default(Button.Button).withConfig({ displayName: "vui--PaginationButton", componentId: "vui--1xoa6c5" }) `color:${index.theme.colors.neutral.ink.base};width:${index.theme.sizes.lg};height:${index.theme.sizes.lg};svg{width:${index.theme.sizes.md};height:${index.theme.sizes.md};}`;
15
+ const PageInput = styled__default.default(index$1.TextField).withConfig({ displayName: "vui--PageInput", componentId: "vui--vpfeol" }) `&[type='number']{min-width:auto;}`;
17
16
 
18
17
  exports.PageInput = PageInput;
19
18
  exports.PageLimitContainer = PageLimitContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../src/components/Pagination/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { Stack } from '../Stack';\nimport { Button } from '../Button';\nimport { TextField } from '../TextField';\n\nexport const PageLimitContainer = styled(Stack)`\n width: ${theme.sizes.lg};\n height: 30px;\n background-color: ${theme.colors.neutral.grey.light};\n\n border: 1px solid ${theme.colors.neutral.grey.base};\n border-radius: ${theme.sizes.xs};\n`;\n\nexport const PaginationButton = styled(Button)`\n color: ${theme.colors.neutral.ink.base};\n width: 32px;\n height: 32px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const PageInput = styled(TextField)`\n &[type='number'] {\n width: 5.5ch;\n }\n`;\n"],"names":["styled","Stack","theme","Button","TextField"],"mappings":";;;;;;;;;;;;;AAMa,MAAA,kBAAkB,GAAGA,uBAAM,CAACC,WAAK,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACpCC,WAAK,CAAC,KAAK,CAAC,EAAE,iCAEHA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAA,kBAAA,EAE/BA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,kBACjCA,WAAK,CAAC,KAAK,CAAC,EAAE;AAGpB,MAAA,gBAAgB,GAAGF,uBAAM,CAACG,aAAM,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACnCD,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;MAU3B,SAAS,GAAGF,uBAAM,CAACI,iBAAS,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,8BAAA;;;;;;"}
1
+ {"version":3,"file":"styled.cjs","sources":["../../../src/components/Pagination/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { FlexRow } from '../Flex/FlexRow';\nimport { Button } from '../Button';\nimport { TextField } from '../TextField';\n\nexport const PageLimitContainer = styled(FlexRow)`\n box-sizing: border-box;\n min-width: ${theme.sizes[10]};\n height: ${theme.sizes.lg};\n padding: 0 ${theme.sizes[3]};\n background-color: ${theme.colors.neutral.grey.light};\n border: 1px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.sizes.xs};\n`;\n\nexport const PaginationButton = styled(Button)`\n color: ${theme.colors.neutral.ink.base};\n // TODO: Remove these style overrides when the Button component is updated match the design system\n width: ${theme.sizes.lg};\n height: ${theme.sizes.lg};\n\n svg {\n width: ${theme.sizes.md};\n height: ${theme.sizes.md};\n }\n`;\n\nexport const PageInput = styled(TextField)`\n &[type='number'] {\n min-width: auto;\n }\n`;\n"],"names":["styled","FlexRow","theme","Button","TextField"],"mappings":";;;;;;;;;;;;AAMa,MAAA,kBAAkB,GAAGA,uBAAM,CAACC,eAAO,CAAC,CAElC,UAAA,CAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,gCAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAClB,QAAA,EAAAA,WAAK,CAAC,KAAK,CAAC,EAAE,CACX,WAAA,EAAAA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,kBAAA,EAAAA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAC/B,kBAAA,EAAAA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAA,EACjCA,WAAK,CAAC,KAAK,CAAC,EAAE,CAAA,CAAA;AAGpB,MAAA,gBAAgB,GAAGF,uBAAM,CAACG,aAAM,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACnCD,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,UAE7BA,WAAK,CAAC,KAAK,CAAC,EAAE,WACbA,WAAK,CAAC,KAAK,CAAC,EAAE,cAGbA,WAAK,CAAC,KAAK,CAAC,EAAE,WACbA,WAAK,CAAC,KAAK,CAAC,EAAE;MAIf,SAAS,GAAGF,uBAAM,CAACI,iBAAS,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,iCAAA;;;;;;"}
@@ -1,5 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const PageLimitContainer: import("styled-components").StyledComponent<"div", any, import("../Stack").StackProps, never>;
2
+ export declare const PageLimitContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
3
+ alignItems?: import("csstype").Property.AlignItems | undefined;
4
+ justifyContent?: import("csstype").Property.JustifyContent | undefined;
5
+ gap?: keyof import("../../theme/modules/sizes").SizeScale | undefined;
6
+ flexWrap?: import("csstype").Property.FlexWrap | undefined;
7
+ } & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
3
8
  export declare const PaginationButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
4
9
  children?: import("react").ReactNode;
5
10
  variant?: import("../Button/types").ButtonVariant | undefined;
@@ -1,13 +1,12 @@
1
1
  import styled from 'styled-components';
2
2
  import { theme } from '../../theme/index.js';
3
- import { Stack } from '../Stack/Stack.js';
4
- import '../Stack/types.js';
3
+ import { FlexRow } from '../Flex/FlexRow/FlexRow.js';
5
4
  import { Button } from '../Button/Button.js';
6
5
  import { TextField } from '../TextField/index.js';
7
6
 
8
- const PageLimitContainer = styled(Stack).withConfig({ displayName: "vui--PageLimitContainer", componentId: "vui--11yg0z2" }) `width:${theme.sizes.lg};height:30px;background-color:${theme.colors.neutral.grey.light};border:1px solid ${theme.colors.neutral.grey.base};border-radius:${theme.sizes.xs};`;
9
- const PaginationButton = styled(Button).withConfig({ displayName: "vui--PaginationButton", componentId: "vui--1xoa6c5" }) `color:${theme.colors.neutral.ink.base};width:32px;height:32px;svg{width:24px;height:24px;}`;
10
- const PageInput = styled(TextField).withConfig({ displayName: "vui--PageInput", componentId: "vui--vpfeol" }) `&[type='number']{width:5.5ch;}`;
7
+ const PageLimitContainer = styled(FlexRow).withConfig({ displayName: "vui--PageLimitContainer", componentId: "vui--11yg0z2" }) `box-sizing:border-box;min-width:${theme.sizes[10]};height:${theme.sizes.lg};padding:0 ${theme.sizes[3]};background-color:${theme.colors.neutral.grey.light};border:1px solid ${theme.colors.neutral.grey.dark};border-radius:${theme.sizes.xs};`;
8
+ const PaginationButton = styled(Button).withConfig({ displayName: "vui--PaginationButton", componentId: "vui--1xoa6c5" }) `color:${theme.colors.neutral.ink.base};width:${theme.sizes.lg};height:${theme.sizes.lg};svg{width:${theme.sizes.md};height:${theme.sizes.md};}`;
9
+ const PageInput = styled(TextField).withConfig({ displayName: "vui--PageInput", componentId: "vui--vpfeol" }) `&[type='number']{min-width:auto;}`;
11
10
 
12
11
  export { PageInput, PageLimitContainer, PaginationButton };
13
12
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../src/components/Pagination/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { Stack } from '../Stack';\nimport { Button } from '../Button';\nimport { TextField } from '../TextField';\n\nexport const PageLimitContainer = styled(Stack)`\n width: ${theme.sizes.lg};\n height: 30px;\n background-color: ${theme.colors.neutral.grey.light};\n\n border: 1px solid ${theme.colors.neutral.grey.base};\n border-radius: ${theme.sizes.xs};\n`;\n\nexport const PaginationButton = styled(Button)`\n color: ${theme.colors.neutral.ink.base};\n width: 32px;\n height: 32px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const PageInput = styled(TextField)`\n &[type='number'] {\n width: 5.5ch;\n }\n`;\n"],"names":[],"mappings":";;;;;;;AAMa,MAAA,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACpC,KAAK,CAAC,KAAK,CAAC,EAAE,iCAEH,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAA,kBAAA,EAE/B,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,kBACjC,KAAK,CAAC,KAAK,CAAC,EAAE;AAGpB,MAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACnC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;MAU3B,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,8BAAA;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../src/components/Pagination/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { theme } from '../../theme';\nimport { FlexRow } from '../Flex/FlexRow';\nimport { Button } from '../Button';\nimport { TextField } from '../TextField';\n\nexport const PageLimitContainer = styled(FlexRow)`\n box-sizing: border-box;\n min-width: ${theme.sizes[10]};\n height: ${theme.sizes.lg};\n padding: 0 ${theme.sizes[3]};\n background-color: ${theme.colors.neutral.grey.light};\n border: 1px solid ${theme.colors.neutral.grey.dark};\n border-radius: ${theme.sizes.xs};\n`;\n\nexport const PaginationButton = styled(Button)`\n color: ${theme.colors.neutral.ink.base};\n // TODO: Remove these style overrides when the Button component is updated match the design system\n width: ${theme.sizes.lg};\n height: ${theme.sizes.lg};\n\n svg {\n width: ${theme.sizes.md};\n height: ${theme.sizes.md};\n }\n`;\n\nexport const PageInput = styled(TextField)`\n &[type='number'] {\n min-width: auto;\n }\n`;\n"],"names":[],"mappings":";;;;;;AAMa,MAAA,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAElC,UAAA,CAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,gCAAA,EAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAClB,QAAA,EAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CACX,WAAA,EAAA,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,kBAAA,EAAA,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAC/B,kBAAA,EAAA,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAA,EACjC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAA,CAAA;AAGpB,MAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,MAAA,EACnC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,UAE7B,KAAK,CAAC,KAAK,CAAC,EAAE,WACb,KAAK,CAAC,KAAK,CAAC,EAAE,cAGb,KAAK,CAAC,KAAK,CAAC,EAAE,WACb,KAAK,CAAC,KAAK,CAAC,EAAE;MAIf,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,iCAAA;;;;"}
@@ -9,13 +9,14 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
11
11
 
12
- const Radio = React.forwardRef(({ checked, value, name, disabled, onChange, id, children, 'aria-label': ariaLabel, ...otherProps }, ref) => {
12
+ const Radio = React.forwardRef(({ checked, value, name, hint, disabled, onChange, id, children, 'aria-label': ariaLabel, ...otherProps }, ref) => {
13
13
  const handleChange = React.useCallback((e) => {
14
14
  onChange(e.currentTarget.checked, value);
15
15
  }, [onChange, value]);
16
- const componentId = id !== null && id !== undefined ? id : generateId.generateId('radio');
17
- return (React__default.default.createElement(Choice.Choice, { id: componentId, disabled: disabled, ...otherProps },
18
- React__default.default.createElement(styled.Input, { id: componentId, type: "radio", checked: checked, value: value, name: name, disabled: disabled, onChange: handleChange, ref: ref, "aria-label": ariaLabel }),
16
+ const componentId = React.useMemo(() => id !== null && id !== undefined ? id : generateId.generateId('radio'), [id]);
17
+ const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
18
+ return (React__default.default.createElement(Choice.Choice, { htmlFor: componentId, disabled: disabled, hint: hint, ...otherProps },
19
+ React__default.default.createElement(styled.Input, { id: componentId, type: "radio", checked: checked, value: value, name: name, disabled: disabled, onChange: handleChange, ref: ref, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy }),
19
20
  children));
20
21
  });
21
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n id?: string;\n className?: string;\n checked: boolean;\n value?: RadioValue;\n disabled?: boolean;\n name?: string;\n onChange: (checked: boolean, value?: RadioValue) => void;\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = id ?? generateId('radio');\n\n return (\n <Choice id={componentId} disabled={disabled} {...otherProps}>\n <Input\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-label={ariaLabel}\n />\n {children}\n </Choice>\n );\n },\n);\n"],"names":["forwardRef","useCallback","generateId","React","Choice","Input"],"mappings":";;;;;;;;;;;AAkBO,MAAM,KAAK,GAAGA,gBAAU,CAC7B,CACE,EACE,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,UAAU,EACF,EACb,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;AAED,IAAA,MAAM,WAAW,GAAG,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAIC,qBAAU,CAAC,OAAO,CAAC;AAE7C,IAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,aAAM,EAAA,EAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAA,GAAM,UAAU,EAAA;AACzD,QAAAD,sBAAA,CAAA,aAAA,CAACE,YAAK,EAAA,EACJ,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,EAAA,YAAA,EACI,SAAS,EACrB,CAAA;QACD,QAAQ,CACF;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n id?: string;\n className?: string;\n checked: boolean;\n value?: RadioValue;\n disabled?: boolean;\n name?: string;\n onChange: (checked: boolean, value?: RadioValue) => void;\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n hint,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = useMemo(() => id ?? generateId('radio'), [id]);\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice htmlFor={componentId} disabled={disabled} hint={hint} {...otherProps}>\n <Input\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {children}\n </Choice>\n );\n },\n);\n"],"names":["forwardRef","useCallback","useMemo","generateId","React","Choice","Input"],"mappings":";;;;;;;;;;;AAkBO,MAAM,KAAK,GAAGA,gBAAU,CAC7B,CACE,EACE,OAAO,EACP,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,UAAU,EACF,EACb,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,MAAM,WAAW,GAAGC,aAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAIC,qBAAU,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAClE,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;AAEhE,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,aAAM,EAAC,EAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,EAAA;AAC1E,QAAAD,sBAAA,CAAA,aAAA,CAACE,YAAK,EACJ,EAAA,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,gBACI,SAAS,EAAA,kBAAA,EACH,eAAe,EACjC,CAAA;QACD,QAAQ,CACF;AAEb,CAAC;;;;"}
@@ -1,15 +1,16 @@
1
- import React__default, { forwardRef, useCallback } from 'react';
1
+ import React__default, { forwardRef, useCallback, useMemo } from 'react';
2
2
  import { Choice } from '../Choice/Choice.js';
3
3
  import { Input } from './styled.js';
4
4
  import { generateId } from '../../utils/generateId.js';
5
5
 
6
- const Radio = forwardRef(({ checked, value, name, disabled, onChange, id, children, 'aria-label': ariaLabel, ...otherProps }, ref) => {
6
+ const Radio = forwardRef(({ checked, value, name, hint, disabled, onChange, id, children, 'aria-label': ariaLabel, ...otherProps }, ref) => {
7
7
  const handleChange = useCallback((e) => {
8
8
  onChange(e.currentTarget.checked, value);
9
9
  }, [onChange, value]);
10
- const componentId = id !== null && id !== undefined ? id : generateId('radio');
11
- return (React__default.createElement(Choice, { id: componentId, disabled: disabled, ...otherProps },
12
- React__default.createElement(Input, { id: componentId, type: "radio", checked: checked, value: value, name: name, disabled: disabled, onChange: handleChange, ref: ref, "aria-label": ariaLabel }),
10
+ const componentId = useMemo(() => id !== null && id !== undefined ? id : generateId('radio'), [id]);
11
+ const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
12
+ return (React__default.createElement(Choice, { htmlFor: componentId, disabled: disabled, hint: hint, ...otherProps },
13
+ React__default.createElement(Input, { id: componentId, type: "radio", checked: checked, value: value, name: name, disabled: disabled, onChange: handleChange, ref: ref, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy }),
13
14
  children));
14
15
  });
15
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n id?: string;\n className?: string;\n checked: boolean;\n value?: RadioValue;\n disabled?: boolean;\n name?: string;\n onChange: (checked: boolean, value?: RadioValue) => void;\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = id ?? generateId('radio');\n\n return (\n <Choice id={componentId} disabled={disabled} {...otherProps}>\n <Input\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-label={ariaLabel}\n />\n {children}\n </Choice>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;AAkBO,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,UAAU,EACF,EACb,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;AAED,IAAA,MAAM,WAAW,GAAG,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAI,UAAU,CAAC,OAAO,CAAC;AAE7C,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAA,GAAM,UAAU,EAAA;AACzD,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EACJ,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,EAAA,YAAA,EACI,SAAS,EACrB,CAAA;QACD,QAAQ,CACF;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n id?: string;\n className?: string;\n checked: boolean;\n value?: RadioValue;\n disabled?: boolean;\n name?: string;\n onChange: (checked: boolean, value?: RadioValue) => void;\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n hint,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = useMemo(() => id ?? generateId('radio'), [id]);\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice htmlFor={componentId} disabled={disabled} hint={hint} {...otherProps}>\n <Input\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {children}\n </Choice>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;AAkBO,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,OAAO,EACP,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,UAAU,EACF,EACb,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAClE,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;AAEhE,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,EAAA;AAC1E,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EACJ,EAAA,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,gBACI,SAAS,EAAA,kBAAA,EACH,eAAe,EACjC,CAAA;QACD,QAAQ,CACF;AAEb,CAAC;;;;"}
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var generateId = require('../../utils/generateId.cjs');
4
5
  var styled = require('./styled.cjs');
5
6
  var Choice = require('../Choice/Choice.cjs');
6
7
 
@@ -11,11 +12,14 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
11
12
  /**
12
13
  * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.
13
14
  */
14
- const Toggle = React.forwardRef(({ id = 'testid', className, name, switched, small, onClick = () => { }, disabled, ariaLabel, inputPosition = 'right', ...choiceProps }, ref) => (React__default.default.createElement(Choice.Choice, { id: id, inputPosition: inputPosition, ...choiceProps },
15
- React__default.default.createElement(styled.Wrapper, { className: className, disabled: disabled },
16
- React__default.default.createElement(styled.Switch, { small: small, disabled: disabled, className: className },
17
- React__default.default.createElement(styled.Input, { id: id, role: "switch", type: "checkbox", name: name, "aria-label": ariaLabel, checked: !!switched, onChange: (e) => (disabled ? undefined : onClick(e)), disabled: disabled, ref: ref }),
18
- React__default.default.createElement(styled.Slider, { switched: switched, disabled: disabled }))))));
15
+ const Toggle = React.forwardRef(({ id, className, name, switched, small, onClick = () => { }, disabled, ariaLabel, inputPosition = 'right', ...choiceProps }, ref) => {
16
+ const componentId = React.useMemo(() => id !== null && id !== undefined ? id : generateId.generateId('toggle'), [id]);
17
+ return (React__default.default.createElement(Choice.Choice, { htmlFor: componentId, inputPosition: inputPosition, ...choiceProps },
18
+ React__default.default.createElement(styled.Wrapper, { className: className, disabled: disabled },
19
+ React__default.default.createElement(styled.Switch, { small: small, disabled: disabled, className: className },
20
+ React__default.default.createElement(styled.Input, { id: componentId, role: "switch", type: "checkbox", name: name, "aria-label": ariaLabel, checked: !!switched, onChange: (e) => (disabled ? undefined : onClick(e)), disabled: disabled, ref: ref }),
21
+ React__default.default.createElement(styled.Slider, { switched: switched, disabled: disabled })))));
22
+ });
19
23
 
20
24
  exports.Toggle = Toggle;
21
25
  //# sourceMappingURL=Toggle.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.cjs","sources":["../../../src/components/Toggle/Toggle.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ToggleProps } from './types';\nimport { Input, Slider, Switch, Wrapper } from './styled';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\n\n/**\n * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n id = 'testid',\n className,\n name,\n switched,\n small,\n onClick = () => {},\n disabled,\n ariaLabel,\n inputPosition = 'right',\n ...choiceProps\n }: ToggleProps,\n ref,\n ) => (\n <Choice id={id} inputPosition={inputPosition} {...(choiceProps as ForwardedChoiceProps)}>\n <Wrapper className={className} disabled={disabled}>\n <Switch small={small} disabled={disabled} className={className}>\n <Input\n id={id}\n role=\"switch\"\n type=\"checkbox\"\n name={name}\n aria-label={ariaLabel}\n checked={!!switched}\n onChange={(e) => (disabled ? undefined : onClick(e))}\n disabled={disabled}\n ref={ref}\n />\n <Slider switched={switched} disabled={disabled} />\n </Switch>\n </Wrapper>\n </Choice>\n ),\n);\n"],"names":["forwardRef","React","Choice","Wrapper","Switch","Input","Slider"],"mappings":";;;;;;;;;;AAMA;;AAEG;AACU,MAAA,MAAM,GAAGA,gBAAU,CAC9B,CACE,EACE,EAAE,GAAG,QAAQ,EACb,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,GAAG,MAAK,GAAG,EAClB,QAAQ,EACR,SAAS,EACT,aAAa,GAAG,OAAO,EACvB,GAAG,WAAW,EACF,EACd,GAAG,MAEHC,sBAAA,CAAA,aAAA,CAACC,aAAM,EAAA,EAAC,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa,EAAA,GAAO,WAAoC,EAAA;IACrFD,sBAAC,CAAA,aAAA,CAAAE,cAAO,IAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAA;AAC/C,QAAAF,sBAAA,CAAA,aAAA,CAACG,aAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA;YAC5DH,sBAAC,CAAA,aAAA,CAAAI,YAAK,EACJ,EAAA,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,EACE,YAAA,EAAA,SAAS,EACrB,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,CAAA;AACF,YAAAJ,sBAAA,CAAA,aAAA,CAACK,aAAM,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC3C,CACD,CACH,CACV;;;;"}
1
+ {"version":3,"file":"Toggle.cjs","sources":["../../../src/components/Toggle/Toggle.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport { generateId } from '../../utils/generateId';\nimport { ToggleProps } from './types';\nimport { Input, Slider, Switch, Wrapper } from './styled';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\n\n/**\n * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n id,\n className,\n name,\n switched,\n small,\n onClick = () => {},\n disabled,\n ariaLabel,\n inputPosition = 'right',\n ...choiceProps\n }: ToggleProps,\n ref,\n ) => {\n const componentId = useMemo(() => id ?? generateId('toggle'), [id]);\n return (\n <Choice\n htmlFor={componentId}\n inputPosition={inputPosition}\n {...(choiceProps as ForwardedChoiceProps)}\n >\n <Wrapper className={className} disabled={disabled}>\n <Switch small={small} disabled={disabled} className={className}>\n <Input\n id={componentId}\n role=\"switch\"\n type=\"checkbox\"\n name={name}\n aria-label={ariaLabel}\n checked={!!switched}\n onChange={(e) => (disabled ? undefined : onClick(e))}\n disabled={disabled}\n ref={ref}\n />\n <Slider switched={switched} disabled={disabled} />\n </Switch>\n </Wrapper>\n </Choice>\n );\n },\n);\n"],"names":["forwardRef","useMemo","generateId","React","Choice","Wrapper","Switch","Input","Slider"],"mappings":";;;;;;;;;;;AAOA;;AAEG;AACU,MAAA,MAAM,GAAGA,gBAAU,CAC9B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{ forwardRef } from 'react';
1
+ import React__default, { forwardRef, useMemo } from 'react';
2
+ import { generateId } from '../../utils/generateId.js';
2
3
  import { Wrapper, Switch, Input, Slider } from './styled.js';
3
4
  import { Choice } from '../Choice/Choice.js';
4
5
 
5
6
  /**
6
7
  * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.
7
8
  */
8
- const Toggle = forwardRef(({ id = 'testid', className, name, switched, small, onClick = () => { }, disabled, ariaLabel, inputPosition = 'right', ...choiceProps }, ref) => (React__default.createElement(Choice, { id: id, inputPosition: inputPosition, ...choiceProps },
9
- React__default.createElement(Wrapper, { className: className, disabled: disabled },
10
- React__default.createElement(Switch, { small: small, disabled: disabled, className: className },
11
- React__default.createElement(Input, { id: id, role: "switch", type: "checkbox", name: name, "aria-label": ariaLabel, checked: !!switched, onChange: (e) => (disabled ? undefined : onClick(e)), disabled: disabled, ref: ref }),
12
- React__default.createElement(Slider, { switched: switched, disabled: disabled }))))));
9
+ const Toggle = forwardRef(({ id, className, name, switched, small, onClick = () => { }, disabled, ariaLabel, inputPosition = 'right', ...choiceProps }, ref) => {
10
+ const componentId = useMemo(() => id !== null && id !== undefined ? id : generateId('toggle'), [id]);
11
+ return (React__default.createElement(Choice, { htmlFor: componentId, inputPosition: inputPosition, ...choiceProps },
12
+ React__default.createElement(Wrapper, { className: className, disabled: disabled },
13
+ React__default.createElement(Switch, { small: small, disabled: disabled, className: className },
14
+ React__default.createElement(Input, { id: componentId, role: "switch", type: "checkbox", name: name, "aria-label": ariaLabel, checked: !!switched, onChange: (e) => (disabled ? undefined : onClick(e)), disabled: disabled, ref: ref }),
15
+ React__default.createElement(Slider, { switched: switched, disabled: disabled })))));
16
+ });
13
17
 
14
18
  export { Toggle };
15
19
  //# sourceMappingURL=Toggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.js","sources":["../../../src/components/Toggle/Toggle.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ToggleProps } from './types';\nimport { Input, Slider, Switch, Wrapper } from './styled';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\n\n/**\n * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n id = 'testid',\n className,\n name,\n switched,\n small,\n onClick = () => {},\n disabled,\n ariaLabel,\n inputPosition = 'right',\n ...choiceProps\n }: ToggleProps,\n ref,\n ) => (\n <Choice id={id} inputPosition={inputPosition} {...(choiceProps as ForwardedChoiceProps)}>\n <Wrapper className={className} disabled={disabled}>\n <Switch small={small} disabled={disabled} className={className}>\n <Input\n id={id}\n role=\"switch\"\n type=\"checkbox\"\n name={name}\n aria-label={ariaLabel}\n checked={!!switched}\n onChange={(e) => (disabled ? undefined : onClick(e))}\n disabled={disabled}\n ref={ref}\n />\n <Slider switched={switched} disabled={disabled} />\n </Switch>\n </Wrapper>\n </Choice>\n ),\n);\n"],"names":["React"],"mappings":";;;;AAMA;;AAEG;AACU,MAAA,MAAM,GAAG,UAAU,CAC9B,CACE,EACE,EAAE,GAAG,QAAQ,EACb,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,GAAG,MAAK,GAAG,EAClB,QAAQ,EACR,SAAS,EACT,aAAa,GAAG,OAAO,EACvB,GAAG,WAAW,EACF,EACd,GAAG,MAEHA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa,EAAA,GAAO,WAAoC,EAAA;IACrFA,cAAC,CAAA,aAAA,CAAA,OAAO,IAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAA;AAC/C,QAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA;YAC5DA,cAAC,CAAA,aAAA,CAAA,KAAK,EACJ,EAAA,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,EACE,YAAA,EAAA,SAAS,EACrB,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,CAAA;AACF,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC3C,CACD,CACH,CACV;;;;"}
1
+ {"version":3,"file":"Toggle.js","sources":["../../../src/components/Toggle/Toggle.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport { generateId } from '../../utils/generateId';\nimport { ToggleProps } from './types';\nimport { Input, Slider, Switch, Wrapper } from './styled';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\n\n/**\n * A toggle switch component, use-cases should provide a label, wrap with a custom one or pass in an aria-label.\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n id,\n className,\n name,\n switched,\n small,\n onClick = () => {},\n disabled,\n ariaLabel,\n inputPosition = 'right',\n ...choiceProps\n }: ToggleProps,\n ref,\n ) => {\n const componentId = useMemo(() => id ?? generateId('toggle'), [id]);\n return (\n <Choice\n htmlFor={componentId}\n inputPosition={inputPosition}\n {...(choiceProps as ForwardedChoiceProps)}\n >\n <Wrapper className={className} disabled={disabled}>\n <Switch small={small} disabled={disabled} className={className}>\n <Input\n id={componentId}\n role=\"switch\"\n type=\"checkbox\"\n name={name}\n aria-label={ariaLabel}\n checked={!!switched}\n onChange={(e) => (disabled ? undefined : onClick(e))}\n disabled={disabled}\n ref={ref}\n />\n <Slider switched={switched} disabled={disabled} />\n </Switch>\n </Wrapper>\n </Choice>\n );\n },\n);\n"],"names":["React"],"mapp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,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "10.1.0",
3
+ "version": "10.3.0",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",