@cerberus-design/react 0.15.0-next-5d7dc1e → 0.15.0-next-7a184be

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 (97) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +238 -92
  2. package/build/legacy/components/{FieldsetLabel.cjs → deprecated/FieldsetLabel.cjs} +1 -1
  3. package/build/legacy/components/deprecated/FieldsetLabel.cjs.map +1 -0
  4. package/build/legacy/components/fieldset/fieldset.cjs +116 -0
  5. package/build/legacy/components/fieldset/fieldset.cjs.map +1 -0
  6. package/build/legacy/components/fieldset/index.cjs +126 -0
  7. package/build/legacy/components/fieldset/index.cjs.map +1 -0
  8. package/build/legacy/components/fieldset/parts.cjs +80 -0
  9. package/build/legacy/components/fieldset/parts.cjs.map +1 -0
  10. package/build/legacy/components/fieldset/primitives.cjs +76 -0
  11. package/build/legacy/components/fieldset/primitives.cjs.map +1 -0
  12. package/build/legacy/components/radio/index.cjs +143 -0
  13. package/build/legacy/components/radio/index.cjs.map +1 -0
  14. package/build/legacy/components/radio/parts.cjs +113 -0
  15. package/build/legacy/components/radio/parts.cjs.map +1 -0
  16. package/build/legacy/components/radio/primitives.cjs +115 -0
  17. package/build/legacy/components/radio/primitives.cjs.map +1 -0
  18. package/build/legacy/components/radio/radio.cjs +82 -0
  19. package/build/legacy/components/radio/radio.cjs.map +1 -0
  20. package/build/legacy/index.cjs +764 -635
  21. package/build/legacy/index.cjs.map +1 -1
  22. package/build/modern/_tsup-dts-rollup.d.ts +238 -92
  23. package/build/modern/chunk-5RTNSVYU.js +88 -0
  24. package/build/modern/chunk-5RTNSVYU.js.map +1 -0
  25. package/build/modern/chunk-7TQRTBUP.js +19 -0
  26. package/build/modern/chunk-7TQRTBUP.js.map +1 -0
  27. package/build/modern/chunk-AO3GB72J.js +27 -0
  28. package/build/modern/chunk-AO3GB72J.js.map +1 -0
  29. package/build/modern/{chunk-OYT7RGC7.js → chunk-DRDNNRU3.js} +2 -2
  30. package/build/modern/chunk-DRDNNRU3.js.map +1 -0
  31. package/build/modern/chunk-FUL2VRDU.js +25 -0
  32. package/build/modern/chunk-FUL2VRDU.js.map +1 -0
  33. package/build/modern/chunk-IDTAB2UJ.js +1 -0
  34. package/build/modern/chunk-OGYMMATX.js +1 -0
  35. package/build/modern/{chunk-FK52US7K.js → chunk-RHCTPSKT.js} +7 -7
  36. package/build/modern/chunk-STLN7BMJ.js +22 -0
  37. package/build/modern/chunk-STLN7BMJ.js.map +1 -0
  38. package/build/modern/chunk-Z3FDG263.js +53 -0
  39. package/build/modern/chunk-Z3FDG263.js.map +1 -0
  40. package/build/modern/{chunk-CF3EHG42.js → chunk-ZFFW5ELD.js} +4 -4
  41. package/build/modern/components/AccordionItemGroup.js +1 -1
  42. package/build/modern/components/DatePicker.client.js +3 -3
  43. package/build/modern/components/FileStatus.js +2 -2
  44. package/build/modern/components/deprecated/FieldsetLabel.js +7 -0
  45. package/build/modern/components/fieldset/fieldset.js +11 -0
  46. package/build/modern/components/fieldset/fieldset.js.map +1 -0
  47. package/build/modern/components/fieldset/index.js +24 -0
  48. package/build/modern/components/fieldset/index.js.map +1 -0
  49. package/build/modern/components/fieldset/parts.js +8 -0
  50. package/build/modern/components/fieldset/parts.js.map +1 -0
  51. package/build/modern/components/fieldset/primitives.js +13 -0
  52. package/build/modern/components/fieldset/primitives.js.map +1 -0
  53. package/build/modern/components/radio/index.js +30 -0
  54. package/build/modern/components/radio/index.js.map +1 -0
  55. package/build/modern/components/radio/parts.js +8 -0
  56. package/build/modern/components/radio/parts.js.map +1 -0
  57. package/build/modern/components/radio/primitives.js +21 -0
  58. package/build/modern/components/radio/primitives.js.map +1 -0
  59. package/build/modern/components/radio/radio.js +8 -0
  60. package/build/modern/components/radio/radio.js.map +1 -0
  61. package/build/modern/context/confirm-modal.js +1 -1
  62. package/build/modern/context/cta-modal.js +2 -2
  63. package/build/modern/context/prompt-modal.js +1 -1
  64. package/build/modern/index.js +115 -77
  65. package/build/modern/index.js.map +1 -1
  66. package/package.json +3 -3
  67. package/src/components/deprecated/FieldsetLabel.tsx +32 -0
  68. package/src/components/fieldset/fieldset.tsx +55 -0
  69. package/src/components/fieldset/index.ts +3 -0
  70. package/src/components/fieldset/parts.ts +47 -0
  71. package/src/components/fieldset/primitives.tsx +79 -0
  72. package/src/components/radio/index.ts +3 -0
  73. package/src/components/radio/parts.ts +65 -0
  74. package/src/components/radio/primitives.tsx +123 -0
  75. package/src/components/radio/radio.tsx +35 -0
  76. package/src/index.ts +3 -3
  77. package/build/legacy/components/Fieldset.cjs +0 -53
  78. package/build/legacy/components/Fieldset.cjs.map +0 -1
  79. package/build/legacy/components/FieldsetLabel.cjs.map +0 -1
  80. package/build/legacy/components/Radio.cjs +0 -64
  81. package/build/legacy/components/Radio.cjs.map +0 -1
  82. package/build/modern/chunk-6EUC3SUI.js +0 -28
  83. package/build/modern/chunk-6EUC3SUI.js.map +0 -1
  84. package/build/modern/chunk-6WOJAMZV.js +0 -40
  85. package/build/modern/chunk-6WOJAMZV.js.map +0 -1
  86. package/build/modern/chunk-OYT7RGC7.js.map +0 -1
  87. package/build/modern/components/Fieldset.js +0 -8
  88. package/build/modern/components/FieldsetLabel.js +0 -7
  89. package/build/modern/components/Radio.js +0 -7
  90. package/src/components/Fieldset.tsx +0 -65
  91. package/src/components/FieldsetLabel.tsx +0 -62
  92. package/src/components/Radio.tsx +0 -68
  93. /package/build/modern/{components/Fieldset.js.map → chunk-IDTAB2UJ.js.map} +0 -0
  94. /package/build/modern/{components/FieldsetLabel.js.map → chunk-OGYMMATX.js.map} +0 -0
  95. /package/build/modern/{chunk-FK52US7K.js.map → chunk-RHCTPSKT.js.map} +0 -0
  96. /package/build/modern/{chunk-CF3EHG42.js.map → chunk-ZFFW5ELD.js.map} +0 -0
  97. /package/build/modern/components/{Radio.js.map → deprecated/FieldsetLabel.js.map} +0 -0
@@ -1,40 +0,0 @@
1
- // src/components/Radio.tsx
2
- import { Field } from "@ark-ui/react/field";
3
- import { cx } from "@cerberus/styled-system/css";
4
- import { hstack } from "@cerberus/styled-system/patterns";
5
- import { radio } from "@cerberus/styled-system/recipes";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- function Radio(props) {
8
- const { children, size, ...nativeProps } = props;
9
- const styles = radio({ size });
10
- return /* @__PURE__ */ jsxs(
11
- "div",
12
- {
13
- className: cx(
14
- "group",
15
- hstack({
16
- gap: "sm"
17
- }),
18
- styles.root
19
- ),
20
- tabIndex: 0,
21
- children: [
22
- /* @__PURE__ */ jsx(
23
- Field.Input,
24
- {
25
- ...nativeProps,
26
- className: cx(nativeProps.className, styles.input),
27
- tabIndex: -1,
28
- type: "radio"
29
- }
30
- ),
31
- children
32
- ]
33
- }
34
- );
35
- }
36
-
37
- export {
38
- Radio
39
- };
40
- //# sourceMappingURL=chunk-6WOJAMZV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Radio.tsx"],"sourcesContent":["import { Field } from '@ark-ui/react/field'\nimport { cx } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { radio } from '@cerberus/styled-system/recipes'\nimport type { RecipeVariantProps } from '@cerberus/styled-system/types'\nimport type { InputHTMLAttributes, PropsWithChildren } from 'react'\n\n/**\n * This module contains the Radio component.\n * @module\n */\n\nexport type RadioRecipe = RecipeVariantProps<typeof radio>\nexport interface RadioBaseProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /**\n * A unique identifier for the radio button. Required for accessibility.\n */\n id: string\n}\nexport type RadioProps = RadioBaseProps & RadioRecipe\n\n/**\n * The Radio component is used to allow users to select a single option from a list of options.\n * @see https://cerberus.digitalu.design/react/radio\n * @memberof module:Field\n * @example\n * ```tsx\n * <Field>\n * <fieldset name=\"fruit\">\n * <Radio id=\"radio-1\" name=\"fruit\" value=\"1\">\n * Option 1\n * </Radio>\n * <Radio id=\"radio-2\" name=\"fruit\" value=\"2\">\n * Option 2\n * </Radio>\n * <Radio id=\"radio-3\" name=\"fruit\" value=\"3\">\n * Option 3\n * </Radio>\n * </fieldset>\n * </Field>\n * ```\n */\nexport function Radio(props: PropsWithChildren<RadioProps>) {\n const { children, size, ...nativeProps } = props\n const styles = radio({ size })\n\n return (\n <div\n className={cx(\n 'group',\n hstack({\n gap: 'sm',\n }),\n styles.root,\n )}\n tabIndex={0}\n >\n <Field.Input\n {...nativeProps}\n className={cx(nativeProps.className, styles.input)}\n tabIndex={-1}\n type=\"radio\"\n />\n {children}\n </div>\n )\n}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,aAAa;AA6ClB,SAUE,KAVF;AALG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,UAAU,MAAM,GAAG,YAAY,IAAI;AAC3C,QAAM,SAAS,MAAM,EAAE,KAAK,CAAC;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,OAAO;AAAA,UACL,KAAK;AAAA,QACP,CAAC;AAAA,QACD,OAAO;AAAA,MACT;AAAA,MACA,UAAU;AAAA,MAEV;AAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACE,GAAG;AAAA,YACJ,WAAW,GAAG,YAAY,WAAW,OAAO,KAAK;AAAA,YACjD,UAAU;AAAA,YACV,MAAK;AAAA;AAAA,QACP;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/FieldsetLabel.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'\nimport type { LabelProps } from './deprecated/Label'\n\n/**\n * This module contains the FieldsetLabel component.\n * @module FieldsetLabel\n */\n\nexport type FieldsetLabelProps = LabelProps &\n LabelVariantProps & {\n htmlFor?: string\n }\n\n/**\n * Used for labeling inputs that are children of a Fieldset group.\n * @memberof Fieldset\n * @see https://cerberus.digitalu.design/react/fieldset\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @example\n * ```tsx\n * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'\n * import { Hstack } from '@cerberus/styled-system/jsx'\n *\n * function SomeForm() {\n * return (\n * <form>\n * <Fieldset>\n * <Legend>Do you like cats?</Legend>\n * <Hstack>\n * <Field>\n * <Radio id=\"yes\" name=\"cats\" value=\"yes\" />\n * <FieldsetLabel htmlFor=\"yes\">Yes</FieldsetLabel>\n * </Field>\n * </Hstack>\n * <Hstack>\n * <Field>\n * <Radio id=\"no\" name=\"cats\" value=\"no\" />\n * <FieldsetLabel htmlFor=\"no\">No</FieldsetLabel>\n * </Field>\n * </Hstack>\n * </Fieldset>\n * </form>\n * )\n * }\n * ```\n */\nexport function FieldsetLabel(props: FieldsetLabelProps) {\n const { size, usage, ...nativeProps } = props\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({\n size,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAqC;AAiD1C;AAHG,SAAS,cAAc,OAA2B;AACvD,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,8 +0,0 @@
1
- "use client";
2
- import {
3
- Fieldset
4
- } from "../chunk-6EUC3SUI.js";
5
- export {
6
- Fieldset
7
- };
8
- //# sourceMappingURL=Fieldset.js.map
@@ -1,7 +0,0 @@
1
- import {
2
- FieldsetLabel
3
- } from "../chunk-OYT7RGC7.js";
4
- export {
5
- FieldsetLabel
6
- };
7
- //# sourceMappingURL=FieldsetLabel.js.map
@@ -1,7 +0,0 @@
1
- import {
2
- Radio
3
- } from "../chunk-6WOJAMZV.js";
4
- export {
5
- Radio
6
- };
7
- //# sourceMappingURL=Radio.js.map
@@ -1,65 +0,0 @@
1
- 'use client'
2
-
3
- import { useFieldContext } from '@ark-ui/react/field'
4
- import { css, cx } from '@cerberus/styled-system/css'
5
- import type { FieldsetHTMLAttributes } from 'react'
6
-
7
- /**
8
- * This module contains the Fieldset component.
9
- * @module Fieldset
10
- */
11
-
12
- export type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>
13
-
14
- /**
15
- * A component to group related elements in a form for accessibility.
16
- * @memberof Field
17
- * @see https://cerberus.digitalu.com/react/fieldset
18
- * @description [A11y Form Checklist](https://www.a11yproject.com/checklist/#forms)
19
- * @description [MDN Web Docs: Fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset)
20
- * @example
21
- * ```tsx
22
- * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'
23
- * import { Hstack } from '@cerberus/styled-system/jsx'
24
- *
25
- * function SomeForm() {
26
- * return (
27
- * <form>
28
- * <Fieldset>
29
- * <Legend>Do you like cats?</Legend>
30
- * <Hstack>
31
- * <Field>
32
- * <Radio id="yes" name="cats" value="yes" />
33
- * <Label htmlFor="yes">Yes</Label>
34
- * </Field>
35
- * </Hstack>
36
- * <Hstack>
37
- * <Field>
38
- * <Radio id="no" name="cats" value="no" />
39
- * <Label htmlFor="no">No</Label>
40
- * </Field>
41
- * </Hstack>
42
- * </Fieldset>
43
- * </form>
44
- * )
45
- * }
46
- */
47
- export function Fieldset(props: FieldsetProps) {
48
- const { invalid, disabled } = useFieldContext()
49
-
50
- return (
51
- <fieldset
52
- {...props}
53
- disabled={disabled}
54
- {...(invalid && { 'aria-invalid': true })}
55
- className={cx(
56
- props.className,
57
- css({
58
- border: 'none',
59
- pt: 2,
60
- margin: 0,
61
- }),
62
- )}
63
- />
64
- )
65
- }
@@ -1,62 +0,0 @@
1
- import { cx } from '@cerberus/styled-system/css'
2
- import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
3
- import type { LabelProps } from './deprecated/Label'
4
-
5
- /**
6
- * This module contains the FieldsetLabel component.
7
- * @module FieldsetLabel
8
- */
9
-
10
- export type FieldsetLabelProps = LabelProps &
11
- LabelVariantProps & {
12
- htmlFor?: string
13
- }
14
-
15
- /**
16
- * Used for labeling inputs that are children of a Fieldset group.
17
- * @memberof Fieldset
18
- * @see https://cerberus.digitalu.design/react/fieldset
19
- * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
20
- * @example
21
- * ```tsx
22
- * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'
23
- * import { Hstack } from '@cerberus/styled-system/jsx'
24
- *
25
- * function SomeForm() {
26
- * return (
27
- * <form>
28
- * <Fieldset>
29
- * <Legend>Do you like cats?</Legend>
30
- * <Hstack>
31
- * <Field>
32
- * <Radio id="yes" name="cats" value="yes" />
33
- * <FieldsetLabel htmlFor="yes">Yes</FieldsetLabel>
34
- * </Field>
35
- * </Hstack>
36
- * <Hstack>
37
- * <Field>
38
- * <Radio id="no" name="cats" value="no" />
39
- * <FieldsetLabel htmlFor="no">No</FieldsetLabel>
40
- * </Field>
41
- * </Hstack>
42
- * </Fieldset>
43
- * </form>
44
- * )
45
- * }
46
- * ```
47
- */
48
- export function FieldsetLabel(props: FieldsetLabelProps) {
49
- const { size, usage, ...nativeProps } = props
50
- return (
51
- <label
52
- {...nativeProps}
53
- className={cx(
54
- nativeProps.className,
55
- label({
56
- size,
57
- usage,
58
- }),
59
- )}
60
- />
61
- )
62
- }
@@ -1,68 +0,0 @@
1
- import { Field } from '@ark-ui/react/field'
2
- import { cx } from '@cerberus/styled-system/css'
3
- import { hstack } from '@cerberus/styled-system/patterns'
4
- import { radio } from '@cerberus/styled-system/recipes'
5
- import type { RecipeVariantProps } from '@cerberus/styled-system/types'
6
- import type { InputHTMLAttributes, PropsWithChildren } from 'react'
7
-
8
- /**
9
- * This module contains the Radio component.
10
- * @module
11
- */
12
-
13
- export type RadioRecipe = RecipeVariantProps<typeof radio>
14
- export interface RadioBaseProps
15
- extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
16
- /**
17
- * A unique identifier for the radio button. Required for accessibility.
18
- */
19
- id: string
20
- }
21
- export type RadioProps = RadioBaseProps & RadioRecipe
22
-
23
- /**
24
- * The Radio component is used to allow users to select a single option from a list of options.
25
- * @see https://cerberus.digitalu.design/react/radio
26
- * @memberof module:Field
27
- * @example
28
- * ```tsx
29
- * <Field>
30
- * <fieldset name="fruit">
31
- * <Radio id="radio-1" name="fruit" value="1">
32
- * Option 1
33
- * </Radio>
34
- * <Radio id="radio-2" name="fruit" value="2">
35
- * Option 2
36
- * </Radio>
37
- * <Radio id="radio-3" name="fruit" value="3">
38
- * Option 3
39
- * </Radio>
40
- * </fieldset>
41
- * </Field>
42
- * ```
43
- */
44
- export function Radio(props: PropsWithChildren<RadioProps>) {
45
- const { children, size, ...nativeProps } = props
46
- const styles = radio({ size })
47
-
48
- return (
49
- <div
50
- className={cx(
51
- 'group',
52
- hstack({
53
- gap: 'sm',
54
- }),
55
- styles.root,
56
- )}
57
- tabIndex={0}
58
- >
59
- <Field.Input
60
- {...nativeProps}
61
- className={cx(nativeProps.className, styles.input)}
62
- tabIndex={-1}
63
- type="radio"
64
- />
65
- {children}
66
- </div>
67
- )
68
- }