@cerberus-design/react 0.8.0-next-29d0773 → 0.8.0-next-5e1561d

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 (80) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.ts +29 -0
  2. package/build/legacy/{chunk-ITND4I7J.js → chunk-2CYO4SJM.js} +2 -2
  3. package/build/legacy/{chunk-6CNSWNE2.js → chunk-6OPGX7H5.js} +3 -3
  4. package/build/legacy/chunk-EBRWD5EE.js +54 -0
  5. package/build/legacy/chunk-EBRWD5EE.js.map +1 -0
  6. package/build/{modern/chunk-YRGASCC5.js → legacy/chunk-GOJYBQNG.js} +2 -2
  7. package/build/legacy/{chunk-XYCRUMOL.js → chunk-I3QCRJ5R.js} +2 -2
  8. package/build/legacy/{chunk-URKYD3YB.js → chunk-M7HQ5V66.js} +2 -2
  9. package/build/{modern/chunk-MINQJYGV.js → legacy/chunk-NKJL4J2S.js} +2 -2
  10. package/build/legacy/{chunk-4DPGADIC.js → chunk-P7JQ47LC.js} +2 -2
  11. package/build/legacy/{chunk-TSUSAKL3.js → chunk-Q6AA6XBS.js} +2 -2
  12. package/build/legacy/{chunk-CWZON7EZ.js → chunk-SWHJ4GA4.js} +2 -2
  13. package/build/legacy/{chunk-H4F2ONKN.js → chunk-YBD32ORB.js} +2 -1
  14. package/build/legacy/chunk-YBD32ORB.js.map +1 -0
  15. package/build/legacy/components/Checkbox.js +12 -0
  16. package/build/legacy/components/Checkbox.js.map +1 -0
  17. package/build/legacy/components/FileUploader.js +3 -3
  18. package/build/legacy/components/Input.js +3 -3
  19. package/build/legacy/components/Notification.js +3 -3
  20. package/build/legacy/components/Select.js +3 -3
  21. package/build/legacy/components/Toggle.js +3 -3
  22. package/build/legacy/config/cerbIcons.js +1 -1
  23. package/build/legacy/config/defineIcons.js +2 -2
  24. package/build/legacy/context/confirm-modal.js +3 -3
  25. package/build/legacy/context/notification-center.js +4 -4
  26. package/build/legacy/context/prompt-modal.js +4 -4
  27. package/build/legacy/index.js +24 -20
  28. package/build/legacy/index.js.map +1 -1
  29. package/build/modern/_tsup-dts-rollup.d.ts +29 -0
  30. package/build/modern/{chunk-QRTCZO2W.js → chunk-3CMOWLNY.js} +3 -3
  31. package/build/modern/chunk-EBRWD5EE.js +54 -0
  32. package/build/modern/chunk-EBRWD5EE.js.map +1 -0
  33. package/build/modern/{chunk-NVCUFUD7.js → chunk-GE7RTD5F.js} +2 -2
  34. package/build/{legacy/chunk-YRGASCC5.js → modern/chunk-GOJYBQNG.js} +2 -2
  35. package/build/modern/{chunk-O7SC4O5S.js → chunk-GX63P3NP.js} +2 -2
  36. package/build/modern/{chunk-URKYD3YB.js → chunk-M7HQ5V66.js} +2 -2
  37. package/build/{legacy/chunk-MINQJYGV.js → modern/chunk-NKJL4J2S.js} +2 -2
  38. package/build/modern/{chunk-XWE45ZOL.js → chunk-PQGIVCAA.js} +2 -2
  39. package/build/modern/{chunk-TSUSAKL3.js → chunk-Q6AA6XBS.js} +2 -2
  40. package/build/modern/{chunk-GM3AUVXL.js → chunk-WA7ZWO2U.js} +2 -2
  41. package/build/modern/{chunk-H4F2ONKN.js → chunk-YBD32ORB.js} +2 -1
  42. package/build/modern/chunk-YBD32ORB.js.map +1 -0
  43. package/build/modern/components/Checkbox.js +12 -0
  44. package/build/modern/components/Checkbox.js.map +1 -0
  45. package/build/modern/components/FileUploader.js +3 -3
  46. package/build/modern/components/Input.js +3 -3
  47. package/build/modern/components/Notification.js +3 -3
  48. package/build/modern/components/Select.js +3 -3
  49. package/build/modern/components/Toggle.js +3 -3
  50. package/build/modern/config/cerbIcons.js +1 -1
  51. package/build/modern/config/defineIcons.js +2 -2
  52. package/build/modern/context/confirm-modal.js +3 -3
  53. package/build/modern/context/notification-center.js +4 -4
  54. package/build/modern/context/prompt-modal.js +4 -4
  55. package/build/modern/index.js +24 -20
  56. package/build/modern/index.js.map +1 -1
  57. package/package.json +3 -3
  58. package/src/components/Checkbox.tsx +68 -0
  59. package/src/config/cerbIcons.ts +2 -0
  60. package/src/index.ts +1 -0
  61. package/build/legacy/chunk-H4F2ONKN.js.map +0 -1
  62. package/build/modern/chunk-H4F2ONKN.js.map +0 -1
  63. /package/build/legacy/{chunk-ITND4I7J.js.map → chunk-2CYO4SJM.js.map} +0 -0
  64. /package/build/legacy/{chunk-6CNSWNE2.js.map → chunk-6OPGX7H5.js.map} +0 -0
  65. /package/build/legacy/{chunk-YRGASCC5.js.map → chunk-GOJYBQNG.js.map} +0 -0
  66. /package/build/legacy/{chunk-XYCRUMOL.js.map → chunk-I3QCRJ5R.js.map} +0 -0
  67. /package/build/legacy/{chunk-URKYD3YB.js.map → chunk-M7HQ5V66.js.map} +0 -0
  68. /package/build/legacy/{chunk-MINQJYGV.js.map → chunk-NKJL4J2S.js.map} +0 -0
  69. /package/build/legacy/{chunk-4DPGADIC.js.map → chunk-P7JQ47LC.js.map} +0 -0
  70. /package/build/legacy/{chunk-TSUSAKL3.js.map → chunk-Q6AA6XBS.js.map} +0 -0
  71. /package/build/legacy/{chunk-CWZON7EZ.js.map → chunk-SWHJ4GA4.js.map} +0 -0
  72. /package/build/modern/{chunk-QRTCZO2W.js.map → chunk-3CMOWLNY.js.map} +0 -0
  73. /package/build/modern/{chunk-NVCUFUD7.js.map → chunk-GE7RTD5F.js.map} +0 -0
  74. /package/build/modern/{chunk-YRGASCC5.js.map → chunk-GOJYBQNG.js.map} +0 -0
  75. /package/build/modern/{chunk-O7SC4O5S.js.map → chunk-GX63P3NP.js.map} +0 -0
  76. /package/build/modern/{chunk-URKYD3YB.js.map → chunk-M7HQ5V66.js.map} +0 -0
  77. /package/build/modern/{chunk-MINQJYGV.js.map → chunk-NKJL4J2S.js.map} +0 -0
  78. /package/build/modern/{chunk-XWE45ZOL.js.map → chunk-PQGIVCAA.js.map} +0 -0
  79. /package/build/modern/{chunk-TSUSAKL3.js.map → chunk-Q6AA6XBS.js.map} +0 -0
  80. /package/build/modern/{chunk-GM3AUVXL.js.map → chunk-WA7ZWO2U.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-4CAT3FHV.js";
4
4
  import {
5
5
  Input
6
- } from "./chunk-URKYD3YB.js";
6
+ } from "./chunk-M7HQ5V66.js";
7
7
  import {
8
8
  Label
9
9
  } from "./chunk-RQPDRHRP.js";
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-JIZQFTW6.js";
37
37
  import {
38
38
  $cerberusIcons
39
- } from "./chunk-TSUSAKL3.js";
39
+ } from "./chunk-Q6AA6XBS.js";
40
40
  import {
41
41
  useModal
42
42
  } from "./chunk-C5HLLGME.js";
@@ -204,4 +204,4 @@ export {
204
204
  PromptModal,
205
205
  usePromptModal
206
206
  };
207
- //# sourceMappingURL=chunk-QRTCZO2W.js.map
207
+ //# sourceMappingURL=chunk-3CMOWLNY.js.map
@@ -0,0 +1,54 @@
1
+ import {
2
+ useFieldContext
3
+ } from "./chunk-ZAU4JVLL.js";
4
+ import {
5
+ Show
6
+ } from "./chunk-4O4QFF4S.js";
7
+ import {
8
+ $cerberusIcons
9
+ } from "./chunk-Q6AA6XBS.js";
10
+
11
+ // src/components/Checkbox.tsx
12
+ import {
13
+ checkbox
14
+ } from "@cerberus/styled-system/recipes";
15
+ import { vstack } from "@cerberus/styled-system/patterns";
16
+ import { cx } from "@cerberus/styled-system/css";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ function Checkbox(props) {
19
+ const { describedBy, size, checked, ...nativeProps } = props;
20
+ const { invalid, ...fieldStates } = useFieldContext();
21
+ const styles = checkbox({ size });
22
+ const { checkbox: CheckIcon } = $cerberusIcons;
23
+ return /* @__PURE__ */ jsxs(
24
+ "div",
25
+ {
26
+ className: cx(
27
+ styles.root,
28
+ vstack({
29
+ gap: "0",
30
+ justify: "center"
31
+ })
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ jsx(
35
+ "input",
36
+ {
37
+ ...nativeProps,
38
+ ...fieldStates,
39
+ ...describedBy && { "aria-describedby": describedBy },
40
+ ...invalid && { "aria-invalid": true },
41
+ className: cx("peer", nativeProps.className, styles.input),
42
+ type: "checkbox"
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsx(Show, { when: checked, children: /* @__PURE__ */ jsx("span", { className: styles.icon, children: /* @__PURE__ */ jsx(CheckIcon, {}) }) })
46
+ ]
47
+ }
48
+ );
49
+ }
50
+
51
+ export {
52
+ Checkbox
53
+ };
54
+ //# sourceMappingURL=chunk-EBRWD5EE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Checkbox.tsx"],"sourcesContent":["'use client'\n\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { vstack } from '@cerberus/styled-system/patterns'\nimport { cx } from '@cerberus/styled-system/css'\nimport type { InputHTMLAttributes } from 'react'\nimport { Show } from './Show'\nimport { useFieldContext } from '../context/field'\nimport { $cerberusIcons } from '../config/defineIcons'\n\n/**\n * This module contains the Checkbox component.\n * @module\n */\n\nexport type CheckboxProps = CheckboxVariantProps &\n Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id'> & {\n describedBy?: string\n id: string\n }\n\n/**\n * Checkbox component\n * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Checkbox docs](https://cerberus.digitalu.design/react/checkbox)\n * @example\n * ```tsx\n * <Field>\n * <Checkbox id=\"legal\" checked={checked.legal} onChange={handleChange} />\n * </Field>\n * ```\n */\nexport function Checkbox(props: CheckboxProps) {\n const { describedBy, size, checked, ...nativeProps } = props\n const { invalid, ...fieldStates } = useFieldContext()\n const styles = checkbox({ size })\n const { checkbox: CheckIcon } = $cerberusIcons\n\n return (\n <div\n className={cx(\n styles.root,\n vstack({\n gap: '0',\n justify: 'center',\n }),\n )}\n >\n <input\n {...nativeProps}\n {...fieldStates}\n {...(describedBy && { 'aria-describedby': describedBy })}\n {...(invalid && { 'aria-invalid': true })}\n className={cx('peer', nativeProps.className, styles.input)}\n type=\"checkbox\"\n />\n <Show when={checked}>\n <span className={styles.icon}>\n <CheckIcon />\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;AAEA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,cAAc;AACvB,SAAS,UAAU;AAoCf,SASE,KATF;AAPG,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,aAAa,MAAM,SAAS,GAAG,YAAY,IAAI;AACvD,QAAM,EAAE,SAAS,GAAG,YAAY,IAAI,gBAAgB;AACpD,QAAM,SAAS,SAAS,EAAE,KAAK,CAAC;AAChC,QAAM,EAAE,UAAU,UAAU,IAAI;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,UACL,KAAK;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAI,eAAe,EAAE,oBAAoB,YAAY;AAAA,YACrD,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,YACvC,WAAW,GAAG,QAAQ,YAAY,WAAW,OAAO,KAAK;AAAA,YACzD,MAAK;AAAA;AAAA,QACP;AAAA,QACA,oBAAC,QAAK,MAAM,SACV,8BAAC,UAAK,WAAW,OAAO,MACtB,8BAAC,aAAU,GACb,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-4O4QFF4S.js";
4
4
  import {
5
5
  $cerberusIcons
6
- } from "./chunk-TSUSAKL3.js";
6
+ } from "./chunk-Q6AA6XBS.js";
7
7
 
8
8
  // src/components/FileUploader.tsx
9
9
  import { cx } from "@cerberus/styled-system/css";
@@ -59,4 +59,4 @@ function FileUploader(props) {
59
59
  export {
60
60
  FileUploader
61
61
  };
62
- //# sourceMappingURL=chunk-NVCUFUD7.js.map
62
+ //# sourceMappingURL=chunk-GE7RTD5F.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZAU4JVLL.js";
4
4
  import {
5
5
  $cerberusIcons
6
- } from "./chunk-TSUSAKL3.js";
6
+ } from "./chunk-Q6AA6XBS.js";
7
7
 
8
8
  // src/components/Toggle.tsx
9
9
  import { cx } from "@cerberus/styled-system/css";
@@ -55,4 +55,4 @@ function Toggle(props) {
55
55
  export {
56
56
  Toggle
57
57
  };
58
- //# sourceMappingURL=chunk-YRGASCC5.js.map
58
+ //# sourceMappingURL=chunk-GOJYBQNG.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JIZQFTW6.js";
4
4
  import {
5
5
  $cerberusIcons
6
- } from "./chunk-TSUSAKL3.js";
6
+ } from "./chunk-Q6AA6XBS.js";
7
7
 
8
8
  // src/components/Notification.tsx
9
9
  import { cx } from "@cerberus/styled-system/css";
@@ -73,4 +73,4 @@ function Notification(props) {
73
73
  export {
74
74
  Notification
75
75
  };
76
- //# sourceMappingURL=chunk-O7SC4O5S.js.map
76
+ //# sourceMappingURL=chunk-GX63P3NP.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-4O4QFF4S.js";
7
7
  import {
8
8
  $cerberusIcons
9
- } from "./chunk-TSUSAKL3.js";
9
+ } from "./chunk-Q6AA6XBS.js";
10
10
 
11
11
  // src/components/Input.tsx
12
12
  import { input } from "@cerberus/styled-system/recipes";
@@ -39,4 +39,4 @@ function Input(props) {
39
39
  export {
40
40
  Input
41
41
  };
42
- //# sourceMappingURL=chunk-URKYD3YB.js.map
42
+ //# sourceMappingURL=chunk-M7HQ5V66.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-4O4QFF4S.js";
7
7
  import {
8
8
  $cerberusIcons
9
- } from "./chunk-TSUSAKL3.js";
9
+ } from "./chunk-Q6AA6XBS.js";
10
10
 
11
11
  // src/components/Select.tsx
12
12
  import { cx } from "@cerberus/styled-system/css";
@@ -65,4 +65,4 @@ export {
65
65
  Select,
66
66
  Option
67
67
  };
68
- //# sourceMappingURL=chunk-MINQJYGV.js.map
68
+ //# sourceMappingURL=chunk-NKJL4J2S.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Notification
3
- } from "./chunk-O7SC4O5S.js";
3
+ } from "./chunk-GX63P3NP.js";
4
4
  import {
5
5
  NotificationDescription
6
6
  } from "./chunk-HW76XVA3.js";
@@ -119,4 +119,4 @@ export {
119
119
  NotificationCenter,
120
120
  useNotificationCenter
121
121
  };
122
- //# sourceMappingURL=chunk-XWE45ZOL.js.map
122
+ //# sourceMappingURL=chunk-PQGIVCAA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultIcons
3
- } from "./chunk-H4F2ONKN.js";
3
+ } from "./chunk-YBD32ORB.js";
4
4
 
5
5
  // src/config/defineIcons.ts
6
6
  function _validateIconsProperties(icons) {
@@ -24,4 +24,4 @@ export {
24
24
  defineIcons,
25
25
  $cerberusIcons
26
26
  };
27
- //# sourceMappingURL=chunk-TSUSAKL3.js.map
27
+ //# sourceMappingURL=chunk-Q6AA6XBS.js.map
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-JIZQFTW6.js";
28
28
  import {
29
29
  $cerberusIcons
30
- } from "./chunk-TSUSAKL3.js";
30
+ } from "./chunk-Q6AA6XBS.js";
31
31
  import {
32
32
  useModal
33
33
  } from "./chunk-C5HLLGME.js";
@@ -151,4 +151,4 @@ export {
151
151
  ConfirmModal,
152
152
  useConfirmModal
153
153
  };
154
- //# sourceMappingURL=chunk-GM3AUVXL.js.map
154
+ //# sourceMappingURL=chunk-WA7ZWO2U.js.map
@@ -10,6 +10,7 @@ import {
10
10
  WarningFilled
11
11
  } from "@cerberus/icons";
12
12
  var defaultIcons = {
13
+ checkbox: Checkmark,
13
14
  confirmModal: Information,
14
15
  promptModal: Information,
15
16
  fileUploader: CloudUpload,
@@ -25,4 +26,4 @@ var defaultIcons = {
25
26
  export {
26
27
  defaultIcons
27
28
  };
28
- //# sourceMappingURL=chunk-H4F2ONKN.js.map
29
+ //# sourceMappingURL=chunk-YBD32ORB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n CheckmarkFilled,\n ChevronDown,\n CloudUpload,\n ErrorFilled,\n Information,\n InformationFilled,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport type IconType = CarbonIconType | ElementType\n\nexport interface DefinedIcons {\n checkbox?: IconType\n confirmModal?: IconType\n promptModal?: IconType\n fileUploader?: IconType\n infoNotification?: IconType\n successNotification?: IconType\n warningNotification?: IconType\n dangerNotification?: IconType\n invalid: IconType\n selectArrow?: IconType\n toggleChecked?: IconType\n}\n\nexport const defaultIcons: DefinedIcons = {\n checkbox: Checkmark,\n confirmModal: Information,\n promptModal: Information,\n fileUploader: CloudUpload,\n infoNotification: InformationFilled,\n successNotification: CheckmarkFilled,\n warningNotification: WarningFilled,\n dangerNotification: ErrorFilled,\n invalid: WarningFilled,\n selectArrow: ChevronDown,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAmBA,IAAM,eAA6B;AAAA,EACxC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,eAAe;AACjB;","names":[]}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import {
3
+ Checkbox
4
+ } from "../chunk-EBRWD5EE.js";
5
+ import "../chunk-ZAU4JVLL.js";
6
+ import "../chunk-4O4QFF4S.js";
7
+ import "../chunk-Q6AA6XBS.js";
8
+ import "../chunk-YBD32ORB.js";
9
+ export {
10
+ Checkbox
11
+ };
12
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  FileUploader
4
- } from "../chunk-NVCUFUD7.js";
4
+ } from "../chunk-GE7RTD5F.js";
5
5
  import "../chunk-4O4QFF4S.js";
6
- import "../chunk-TSUSAKL3.js";
7
- import "../chunk-H4F2ONKN.js";
6
+ import "../chunk-Q6AA6XBS.js";
7
+ import "../chunk-YBD32ORB.js";
8
8
  export {
9
9
  FileUploader
10
10
  };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "../chunk-URKYD3YB.js";
4
+ } from "../chunk-M7HQ5V66.js";
5
5
  import "../chunk-ZAU4JVLL.js";
6
6
  import "../chunk-4O4QFF4S.js";
7
- import "../chunk-TSUSAKL3.js";
8
- import "../chunk-H4F2ONKN.js";
7
+ import "../chunk-Q6AA6XBS.js";
8
+ import "../chunk-YBD32ORB.js";
9
9
  export {
10
10
  Input
11
11
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Notification
4
- } from "../chunk-O7SC4O5S.js";
4
+ } from "../chunk-GX63P3NP.js";
5
5
  import "../chunk-JIZQFTW6.js";
6
- import "../chunk-TSUSAKL3.js";
7
- import "../chunk-H4F2ONKN.js";
6
+ import "../chunk-Q6AA6XBS.js";
7
+ import "../chunk-YBD32ORB.js";
8
8
  export {
9
9
  Notification
10
10
  };
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  Option,
4
4
  Select
5
- } from "../chunk-MINQJYGV.js";
5
+ } from "../chunk-NKJL4J2S.js";
6
6
  import "../chunk-ZAU4JVLL.js";
7
7
  import "../chunk-4O4QFF4S.js";
8
- import "../chunk-TSUSAKL3.js";
9
- import "../chunk-H4F2ONKN.js";
8
+ import "../chunk-Q6AA6XBS.js";
9
+ import "../chunk-YBD32ORB.js";
10
10
  export {
11
11
  Option,
12
12
  Select
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Toggle
4
- } from "../chunk-YRGASCC5.js";
4
+ } from "../chunk-GOJYBQNG.js";
5
5
  import "../chunk-ZAU4JVLL.js";
6
- import "../chunk-TSUSAKL3.js";
7
- import "../chunk-H4F2ONKN.js";
6
+ import "../chunk-Q6AA6XBS.js";
7
+ import "../chunk-YBD32ORB.js";
8
8
  export {
9
9
  Toggle
10
10
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultIcons
3
- } from "../chunk-H4F2ONKN.js";
3
+ } from "../chunk-YBD32ORB.js";
4
4
  export {
5
5
  defaultIcons
6
6
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  $cerberusIcons,
3
3
  defineIcons
4
- } from "../chunk-TSUSAKL3.js";
5
- import "../chunk-H4F2ONKN.js";
4
+ } from "../chunk-Q6AA6XBS.js";
5
+ import "../chunk-YBD32ORB.js";
6
6
  export {
7
7
  $cerberusIcons,
8
8
  defineIcons
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConfirmModal,
4
4
  useConfirmModal
5
- } from "../chunk-GM3AUVXL.js";
5
+ } from "../chunk-WA7ZWO2U.js";
6
6
  import "../chunk-4CAT3FHV.js";
7
7
  import "../chunk-2UFNQM55.js";
8
8
  import "../chunk-4M4LCQ43.js";
@@ -12,8 +12,8 @@ import "../chunk-JJP2TFTU.js";
12
12
  import "../chunk-6F34A7NZ.js";
13
13
  import "../chunk-4O4QFF4S.js";
14
14
  import "../chunk-JIZQFTW6.js";
15
- import "../chunk-TSUSAKL3.js";
16
- import "../chunk-H4F2ONKN.js";
15
+ import "../chunk-Q6AA6XBS.js";
16
+ import "../chunk-YBD32ORB.js";
17
17
  import "../chunk-C5HLLGME.js";
18
18
  export {
19
19
  ConfirmModal,
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  NotificationCenter,
4
4
  useNotificationCenter
5
- } from "../chunk-XWE45ZOL.js";
6
- import "../chunk-O7SC4O5S.js";
5
+ } from "../chunk-PQGIVCAA.js";
6
+ import "../chunk-GX63P3NP.js";
7
7
  import "../chunk-HW76XVA3.js";
8
8
  import "../chunk-3C2DJSEE.js";
9
9
  import "../chunk-4CAT3FHV.js";
10
10
  import "../chunk-6F34A7NZ.js";
11
11
  import "../chunk-4O4QFF4S.js";
12
12
  import "../chunk-JIZQFTW6.js";
13
- import "../chunk-TSUSAKL3.js";
14
- import "../chunk-H4F2ONKN.js";
13
+ import "../chunk-Q6AA6XBS.js";
14
+ import "../chunk-YBD32ORB.js";
15
15
  export {
16
16
  NotificationCenter,
17
17
  useNotificationCenter
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  PromptModal,
4
4
  usePromptModal
5
- } from "../chunk-QRTCZO2W.js";
5
+ } from "../chunk-3CMOWLNY.js";
6
6
  import "../chunk-4CAT3FHV.js";
7
- import "../chunk-URKYD3YB.js";
7
+ import "../chunk-M7HQ5V66.js";
8
8
  import "../chunk-RQPDRHRP.js";
9
9
  import "../chunk-2UFNQM55.js";
10
10
  import "../chunk-4M4LCQ43.js";
@@ -15,8 +15,8 @@ import "../chunk-6F34A7NZ.js";
15
15
  import "../chunk-ZAU4JVLL.js";
16
16
  import "../chunk-4O4QFF4S.js";
17
17
  import "../chunk-JIZQFTW6.js";
18
- import "../chunk-TSUSAKL3.js";
19
- import "../chunk-H4F2ONKN.js";
18
+ import "../chunk-Q6AA6XBS.js";
19
+ import "../chunk-YBD32ORB.js";
20
20
  import "../chunk-C5HLLGME.js";
21
21
  export {
22
22
  PromptModal,
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  NotificationCenter,
3
3
  useNotificationCenter
4
- } from "./chunk-XWE45ZOL.js";
4
+ } from "./chunk-PQGIVCAA.js";
5
5
  import {
6
6
  PromptModal,
7
7
  usePromptModal
8
- } from "./chunk-QRTCZO2W.js";
8
+ } from "./chunk-3CMOWLNY.js";
9
+ import {
10
+ Tbody
11
+ } from "./chunk-PJ3744I6.js";
9
12
  import {
10
13
  Td
11
14
  } from "./chunk-XREC5IJE.js";
@@ -20,15 +23,18 @@ import {
20
23
  } from "./chunk-N3FUF4TB.js";
21
24
  import {
22
25
  Toggle
23
- } from "./chunk-YRGASCC5.js";
26
+ } from "./chunk-GOJYBQNG.js";
24
27
  import {
25
28
  ConfirmModal,
26
29
  useConfirmModal
27
- } from "./chunk-GM3AUVXL.js";
30
+ } from "./chunk-WA7ZWO2U.js";
31
+ import {
32
+ Radio
33
+ } from "./chunk-PH64POOB.js";
28
34
  import {
29
35
  Option,
30
36
  Select
31
- } from "./chunk-MINQJYGV.js";
37
+ } from "./chunk-NKJL4J2S.js";
32
38
  import {
33
39
  Tab
34
40
  } from "./chunk-SONHHNYQ.js";
@@ -46,8 +52,8 @@ import {
46
52
  Tag
47
53
  } from "./chunk-Z6IWNVPN.js";
48
54
  import {
49
- Tbody
50
- } from "./chunk-PJ3744I6.js";
55
+ NavMenuLink
56
+ } from "./chunk-6DIGPXAD.js";
51
57
  import {
52
58
  NavMenuList,
53
59
  getPosition
@@ -61,7 +67,7 @@ import {
61
67
  } from "./chunk-KJUCHZHV.js";
62
68
  import {
63
69
  Notification
64
- } from "./chunk-O7SC4O5S.js";
70
+ } from "./chunk-GX63P3NP.js";
65
71
  import {
66
72
  NotificationDescription
67
73
  } from "./chunk-HW76XVA3.js";
@@ -75,11 +81,11 @@ import {
75
81
  ProgressBar
76
82
  } from "./chunk-TYTEREKZ.js";
77
83
  import {
78
- Radio
79
- } from "./chunk-PH64POOB.js";
84
+ IconButton
85
+ } from "./chunk-SLHX5K6I.js";
80
86
  import {
81
87
  Input
82
- } from "./chunk-URKYD3YB.js";
88
+ } from "./chunk-M7HQ5V66.js";
83
89
  import {
84
90
  Label
85
91
  } from "./chunk-RQPDRHRP.js";
@@ -98,9 +104,6 @@ import {
98
104
  import {
99
105
  ModalIcon
100
106
  } from "./chunk-JJP2TFTU.js";
101
- import {
102
- NavMenuLink
103
- } from "./chunk-6DIGPXAD.js";
104
107
  import {
105
108
  MODE_KEY,
106
109
  THEME_KEY,
@@ -114,6 +117,9 @@ import {
114
117
  import {
115
118
  Button
116
119
  } from "./chunk-6F34A7NZ.js";
120
+ import {
121
+ Checkbox
122
+ } from "./chunk-EBRWD5EE.js";
117
123
  import {
118
124
  Droppable
119
125
  } from "./chunk-7VJOPJVX.js";
@@ -133,13 +139,10 @@ import {
133
139
  } from "./chunk-ZAU4JVLL.js";
134
140
  import {
135
141
  FileUploader
136
- } from "./chunk-NVCUFUD7.js";
142
+ } from "./chunk-GE7RTD5F.js";
137
143
  import {
138
144
  Show
139
145
  } from "./chunk-4O4QFF4S.js";
140
- import {
141
- IconButton
142
- } from "./chunk-SLHX5K6I.js";
143
146
  import "./chunk-55J6XMHW.js";
144
147
  import {
145
148
  createNavTriggerProps
@@ -158,8 +161,8 @@ import {
158
161
  import {
159
162
  $cerberusIcons,
160
163
  defineIcons
161
- } from "./chunk-TSUSAKL3.js";
162
- import "./chunk-H4F2ONKN.js";
164
+ } from "./chunk-Q6AA6XBS.js";
165
+ import "./chunk-YBD32ORB.js";
163
166
  import {
164
167
  useModal
165
168
  } from "./chunk-C5HLLGME.js";
@@ -169,6 +172,7 @@ export * from "@dnd-kit/core";
169
172
  export {
170
173
  $cerberusIcons,
171
174
  Button,
175
+ Checkbox,
172
176
  ConfirmModal,
173
177
  Droppable,
174
178
  FeatureFlag,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/ModalIcon'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/Checkbox'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/ModalIcon'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,cAAc;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.8.0-next-29d0773",
3
+ "version": "0.8.0-next-5e1561d",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -25,8 +25,8 @@
25
25
  "react": "^18",
26
26
  "react-dom": "^18",
27
27
  "tsup": "^8.1.0",
28
- "@cerberus-design/styled-system": "0.8.0-next-29d0773",
29
- "@cerberus-design/configs": "0.0.0"
28
+ "@cerberus-design/configs": "0.0.0",
29
+ "@cerberus-design/styled-system": "0.8.0-next-5e1561d"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"
@@ -0,0 +1,68 @@
1
+ 'use client'
2
+
3
+ import {
4
+ checkbox,
5
+ type CheckboxVariantProps,
6
+ } from '@cerberus/styled-system/recipes'
7
+ import { vstack } from '@cerberus/styled-system/patterns'
8
+ import { cx } from '@cerberus/styled-system/css'
9
+ import type { InputHTMLAttributes } from 'react'
10
+ import { Show } from './Show'
11
+ import { useFieldContext } from '../context/field'
12
+ import { $cerberusIcons } from '../config/defineIcons'
13
+
14
+ /**
15
+ * This module contains the Checkbox component.
16
+ * @module
17
+ */
18
+
19
+ export type CheckboxProps = CheckboxVariantProps &
20
+ Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id'> & {
21
+ describedBy?: string
22
+ id: string
23
+ }
24
+
25
+ /**
26
+ * Checkbox component
27
+ * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)
28
+ * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
29
+ * @definition [Checkbox docs](https://cerberus.digitalu.design/react/checkbox)
30
+ * @example
31
+ * ```tsx
32
+ * <Field>
33
+ * <Checkbox id="legal" checked={checked.legal} onChange={handleChange} />
34
+ * </Field>
35
+ * ```
36
+ */
37
+ export function Checkbox(props: CheckboxProps) {
38
+ const { describedBy, size, checked, ...nativeProps } = props
39
+ const { invalid, ...fieldStates } = useFieldContext()
40
+ const styles = checkbox({ size })
41
+ const { checkbox: CheckIcon } = $cerberusIcons
42
+
43
+ return (
44
+ <div
45
+ className={cx(
46
+ styles.root,
47
+ vstack({
48
+ gap: '0',
49
+ justify: 'center',
50
+ }),
51
+ )}
52
+ >
53
+ <input
54
+ {...nativeProps}
55
+ {...fieldStates}
56
+ {...(describedBy && { 'aria-describedby': describedBy })}
57
+ {...(invalid && { 'aria-invalid': true })}
58
+ className={cx('peer', nativeProps.className, styles.input)}
59
+ type="checkbox"
60
+ />
61
+ <Show when={checked}>
62
+ <span className={styles.icon}>
63
+ <CheckIcon />
64
+ </span>
65
+ </Show>
66
+ </div>
67
+ )
68
+ }
@@ -14,6 +14,7 @@ import type { ElementType } from 'react'
14
14
  export type IconType = CarbonIconType | ElementType
15
15
 
16
16
  export interface DefinedIcons {
17
+ checkbox?: IconType
17
18
  confirmModal?: IconType
18
19
  promptModal?: IconType
19
20
  fileUploader?: IconType
@@ -27,6 +28,7 @@ export interface DefinedIcons {
27
28
  }
28
29
 
29
30
  export const defaultIcons: DefinedIcons = {
31
+ checkbox: Checkmark,
30
32
  confirmModal: Information,
31
33
  promptModal: Information,
32
34
  fileUploader: CloudUpload,