@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
@@ -0,0 +1,32 @@
1
+ import { cx } from '@cerberus/styled-system/css'
2
+ import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
3
+ import type { LabelProps } from './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
+ * @deprecated
17
+ */
18
+ export function FieldsetLabel(props: FieldsetLabelProps) {
19
+ const { size, usage, ...nativeProps } = props
20
+ return (
21
+ <label
22
+ {...nativeProps}
23
+ className={cx(
24
+ nativeProps.className,
25
+ label({
26
+ size,
27
+ usage,
28
+ }),
29
+ )}
30
+ />
31
+ )
32
+ }
@@ -0,0 +1,55 @@
1
+ import type { FieldsetRootProps } from '@ark-ui/react'
2
+ import { splitProps } from '../../utils'
3
+ import { FieldsetParts } from './parts'
4
+ import type { FieldsetVariantProps } from '@cerberus/styled-system/recipes'
5
+
6
+ /**
7
+ * This module contains the Fieldset component.
8
+ * @module Fieldset
9
+ */
10
+
11
+ export interface FieldsetProps extends FieldsetRootProps, FieldsetVariantProps {
12
+ /**
13
+ * The legend/title/label of the fieldset group.
14
+ */
15
+ legend?: string
16
+ /**
17
+ * The description text for the fieldset group.
18
+ */
19
+ helperText?: string
20
+ /**
21
+ * The error text for the fieldset group shown when the field is invalid.
22
+ */
23
+ errorText?: string
24
+ }
25
+
26
+ /**
27
+ * A component used for grouping related fields in a form that is an
28
+ * abstraction of the Fieldset primitives.
29
+ * @description [Fieldset Docs](https://cerberus.digitalu.design/react/fieldset)
30
+ * @description [Primitive Docs](https://ark-ui.com/react/docs/components/fieldset)
31
+ */
32
+ export function Fieldset(props: FieldsetProps) {
33
+ const [fieldsetProps, { usage }, rootProps] = splitProps(
34
+ props,
35
+ ['legend', 'helperText', 'errorText', 'children'],
36
+ ['usage'],
37
+ )
38
+
39
+ return (
40
+ <FieldsetParts.Root {...rootProps}>
41
+ <FieldsetParts.Legend usage={usage}>
42
+ {fieldsetProps.legend}
43
+ </FieldsetParts.Legend>
44
+ <FieldsetParts.HelperText usage={usage}>
45
+ {fieldsetProps.helperText}
46
+ </FieldsetParts.HelperText>
47
+
48
+ {fieldsetProps.children}
49
+
50
+ <FieldsetParts.ErrorText>
51
+ {fieldsetProps.errorText}
52
+ </FieldsetParts.ErrorText>
53
+ </FieldsetParts.Root>
54
+ )
55
+ }
@@ -0,0 +1,3 @@
1
+ export * from './fieldset'
2
+ export * from './parts'
3
+ export * from './primitives'
@@ -0,0 +1,47 @@
1
+ import type { ElementType } from 'react'
2
+ import {
3
+ FieldsetErrorText,
4
+ FieldsetHelperText,
5
+ FieldsetLegend,
6
+ FieldsetRoot,
7
+ } from './primitives'
8
+
9
+ /**
10
+ * This module contains the parts of the Field component.
11
+ * @module 'field/parts'
12
+ */
13
+
14
+ interface FieldsetPartsValue {
15
+ /**
16
+ * The container of the field.
17
+ */
18
+ Root: ElementType
19
+ /**
20
+ * The label of the field.
21
+ */
22
+ Legend: ElementType
23
+ /**
24
+ * The text that displays when the field is valid.
25
+ */
26
+ HelperText: ElementType
27
+ /**
28
+ * The text that displays when the field is invalid.
29
+ */
30
+ ErrorText: ElementType
31
+ }
32
+
33
+ /**
34
+ * An Object containing the parts of the Field component. For users that
35
+ * prefer Object component syntax.
36
+ *
37
+ * @remarks
38
+ *
39
+ * When using object component syntax, you import the FieldParts object and
40
+ * the entire family of components vs. only what you use.
41
+ */
42
+ export const FieldsetParts: FieldsetPartsValue = {
43
+ Root: FieldsetRoot,
44
+ Legend: FieldsetLegend,
45
+ HelperText: FieldsetHelperText,
46
+ ErrorText: FieldsetErrorText,
47
+ }
@@ -0,0 +1,79 @@
1
+ import {
2
+ Fieldset,
3
+ type FieldsetHelperTextProps,
4
+ type FieldsetLegendProps,
5
+ type FieldsetRootProps,
6
+ } from '@ark-ui/react/fieldset'
7
+ import { cx } from '@cerberus/styled-system/css'
8
+ import {
9
+ fieldset,
10
+ type FieldsetVariantProps,
11
+ } from '@cerberus/styled-system/recipes'
12
+
13
+ /**
14
+ * This module contains all the primitives of the Fieldset component.
15
+ * @module 'react/fieldset'
16
+ */
17
+
18
+ /**
19
+ * The context & container for the Fieldset components.
20
+ * @description [Fieldset Docs](https://cerberus.digitalu.design/react/fieldset)
21
+ * @description [Primitive Docs](https://ark-ui.com/react/docs/components/fieldset)
22
+ */
23
+ export function FieldsetRoot(props: FieldsetRootProps) {
24
+ const styles = fieldset()
25
+ return (
26
+ <Fieldset.Root {...props} className={cx(styles.root, props.className)} />
27
+ )
28
+ }
29
+
30
+ /**
31
+ * The legend element for the Fieldset group.
32
+ * @description [Fieldset Docs](https://cerberus.digitalu.design/react/fieldset)
33
+ * @description [Primitive Docs](https://ark-ui.com/react/docs/components/fieldset)
34
+ */
35
+ export function FieldsetLegend(
36
+ props: FieldsetLegendProps & FieldsetVariantProps,
37
+ ) {
38
+ const { usage, ...legendProps } = props
39
+ const styles = fieldset({ usage })
40
+ return (
41
+ <Fieldset.Legend
42
+ {...legendProps}
43
+ className={cx(styles.legend, legendProps.className)}
44
+ />
45
+ )
46
+ }
47
+
48
+ /**
49
+ * The description element for the Fieldset group.
50
+ * @description [Fieldset Docs](https://cerberus.digitalu.design/react/fieldset)
51
+ * @description [Primitive Docs](https://ark-ui.com/react/docs/components/fieldset)
52
+ */
53
+ export function FieldsetHelperText(
54
+ props: FieldsetHelperTextProps & FieldsetVariantProps,
55
+ ) {
56
+ const { usage, ...helperTextProps } = props
57
+ const styles = fieldset({ usage })
58
+ return (
59
+ <Fieldset.HelperText
60
+ {...helperTextProps}
61
+ className={cx(styles.helperText, helperTextProps.className)}
62
+ />
63
+ )
64
+ }
65
+
66
+ /**
67
+ * The error text element for the Fieldset group.
68
+ * @description [Fieldset Docs](https://cerberus.digitalu.design/react/fieldset)
69
+ * @description [Primitive Docs](https://ark-ui.com/react/docs/components/fieldset)
70
+ */
71
+ export function FieldsetErrorText(props: FieldsetHelperTextProps) {
72
+ const styles = fieldset()
73
+ return (
74
+ <Fieldset.ErrorText
75
+ {...props}
76
+ className={cx(styles.errorText, props.className)}
77
+ />
78
+ )
79
+ }
@@ -0,0 +1,3 @@
1
+ export * from './parts'
2
+ export * from './primitives'
3
+ export * from './radio'
@@ -0,0 +1,65 @@
1
+ import type { ElementType } from 'react'
2
+ import {
3
+ RadioGroupRoot,
4
+ RadioGroupLabel,
5
+ RadioGroupIndicator,
6
+ RadioGroupItem,
7
+ RadioGroupItemText,
8
+ RadioGroupItemControl,
9
+ RadioGroupItemHiddenInput,
10
+ } from './primitives'
11
+
12
+ /**
13
+ * This module contains the parts of the Radio parts.
14
+ * @module 'radio/parts'
15
+ */
16
+
17
+ interface RadioPartsValue {
18
+ /**
19
+ * The container of the field.
20
+ */
21
+ Root: ElementType
22
+ /**
23
+ * The label of the field.
24
+ */
25
+ Label: ElementType
26
+ /**
27
+ * The indicator that appears when a radio is checked.
28
+ */
29
+ Indicator: ElementType
30
+ /**
31
+ * An individual radio item of the field.
32
+ */
33
+ Item: ElementType
34
+ /**
35
+ * The text that labels a single radio of the field.
36
+ */
37
+ ItemText: ElementType
38
+ /**
39
+ * The visual radio control of the field.
40
+ */
41
+ ItemControl: ElementType
42
+ /**
43
+ * The native input for a radio item in the field.
44
+ */
45
+ ItemHiddenInput: ElementType
46
+ }
47
+
48
+ /**
49
+ * An Object containing the parts of the Radio component. For users that
50
+ * prefer Object component syntax.
51
+ *
52
+ * @remarks
53
+ *
54
+ * When using object component syntax, you import the RadioParts object and
55
+ * the entire family of components vs. only what you use.
56
+ */
57
+ export const RadioParts: RadioPartsValue = {
58
+ Root: RadioGroupRoot,
59
+ Label: RadioGroupLabel,
60
+ Indicator: RadioGroupIndicator,
61
+ Item: RadioGroupItem,
62
+ ItemText: RadioGroupItemText,
63
+ ItemControl: RadioGroupItemControl,
64
+ ItemHiddenInput: RadioGroupItemHiddenInput,
65
+ }
@@ -0,0 +1,123 @@
1
+ import {
2
+ RadioGroup as ArkRadioGroup,
3
+ type RadioGroupIndicatorProps,
4
+ type RadioGroupItemControlProps,
5
+ type RadioGroupItemHiddenInputProps,
6
+ type RadioGroupItemProps,
7
+ type RadioGroupItemTextProps,
8
+ type RadioGroupLabelProps,
9
+ type RadioGroupRootProps,
10
+ } from '@ark-ui/react/radio-group'
11
+ import { cx } from '@cerberus/styled-system/css'
12
+ import {
13
+ radioGroup,
14
+ type RadioGroupVariantProps,
15
+ } from '@cerberus/styled-system/recipes'
16
+
17
+ /**
18
+ * This module contains the Radio primitives
19
+ * @module 'react/radio'
20
+ */
21
+
22
+ /**
23
+ * The RadioGroupRoot component is used to group radio buttons together.
24
+ */
25
+ export function RadioGroupRoot(
26
+ props: RadioGroupRootProps & RadioGroupVariantProps,
27
+ ) {
28
+ const { size, orientation, ...rootProps } = props
29
+ const styles = radioGroup({ size, orientation })
30
+ return (
31
+ <ArkRadioGroup.Root
32
+ {...rootProps}
33
+ className={cx(styles.root, rootProps.className)}
34
+ />
35
+ )
36
+ }
37
+
38
+ /**
39
+ * The RadioGroupLabel component is used to label a group of radio buttons.
40
+ */
41
+ export function RadioGroupLabel(props: RadioGroupLabelProps) {
42
+ const styles = radioGroup()
43
+ return (
44
+ <ArkRadioGroup.Label
45
+ {...props}
46
+ className={cx(styles.label, props.className)}
47
+ />
48
+ )
49
+ }
50
+
51
+ /**
52
+ * The RadioGroupIndicator component is used to indicate the selected radio
53
+ * button in a group.
54
+ */
55
+ export function RadioGroupIndicator(props: RadioGroupIndicatorProps) {
56
+ const styles = radioGroup()
57
+ return (
58
+ <ArkRadioGroup.Indicator
59
+ {...props}
60
+ className={cx(styles.indicator, props.className)}
61
+ />
62
+ )
63
+ }
64
+
65
+ /**
66
+ * The RadioGroupItem component is used to render a single radio button in a
67
+ * group.
68
+ */
69
+ export function RadioGroupItem(props: RadioGroupItemProps) {
70
+ const styles = radioGroup()
71
+ return (
72
+ <ArkRadioGroup.Item
73
+ {...props}
74
+ className={cx(styles.item, props.className)}
75
+ />
76
+ )
77
+ }
78
+
79
+ /**
80
+ * The RadioGroupItemText component is used to render the text label for a
81
+ * single radio button in a group.
82
+ */
83
+ export function RadioGroupItemText(
84
+ props: RadioGroupItemTextProps & RadioGroupVariantProps,
85
+ ) {
86
+ const { size, orientation, ...itemTextProps } = props
87
+ const styles = radioGroup({ size, orientation })
88
+ return (
89
+ <ArkRadioGroup.ItemText
90
+ {...itemTextProps}
91
+ className={cx(styles.itemText, itemTextProps.className)}
92
+ />
93
+ )
94
+ }
95
+
96
+ /**
97
+ * The RadioGroupItemControl component is used to render the control for a
98
+ * single radio button in a group.
99
+ */
100
+ export function RadioGroupItemControl(
101
+ props: RadioGroupItemControlProps & RadioGroupVariantProps,
102
+ ) {
103
+ const { size, orientation, ...itemControlProps } = props
104
+ const styles = radioGroup({ size, orientation })
105
+ return (
106
+ <ArkRadioGroup.ItemControl
107
+ {...itemControlProps}
108
+ className={cx(styles.itemControl, itemControlProps.className)}
109
+ />
110
+ )
111
+ }
112
+
113
+ /**
114
+ * The RadioGroupItemHiddenInput component is used to render the hidden input
115
+ * for a single radio button in a group.
116
+ */
117
+ export function RadioGroupItemHiddenInput(
118
+ props: RadioGroupItemHiddenInputProps,
119
+ ) {
120
+ return <ArkRadioGroup.ItemHiddenInput {...props} />
121
+ }
122
+
123
+ export const RadioGroup = RadioGroupRoot
@@ -0,0 +1,35 @@
1
+ import type { RadioGroupItemProps } from '@ark-ui/react'
2
+ import { type RadioGroupVariantProps } from '@cerberus/styled-system/recipes'
3
+ import {
4
+ RadioGroupItem,
5
+ RadioGroupItemControl,
6
+ RadioGroupItemHiddenInput,
7
+ RadioGroupItemText,
8
+ } from './primitives'
9
+
10
+ /**
11
+ * This module contains the Radio component.
12
+ * @module
13
+ */
14
+
15
+ export type RadioProps = RadioGroupVariantProps & RadioGroupItemProps
16
+
17
+ /**
18
+ * The Radio component is used to allow users to select a single option from a list of options.
19
+ * @see https://cerberus.digitalu.design/react/radio
20
+ * @memberof module:Field
21
+ * @example
22
+ * ```tsx
23
+ * <Radio value="option1">Option 1</Radio>
24
+ * ```
25
+ */
26
+ export function Radio(props: RadioProps) {
27
+ const { size, children, ...groupProps } = props
28
+ return (
29
+ <RadioGroupItem {...groupProps}>
30
+ <RadioGroupItemControl size={size} />
31
+ <RadioGroupItemText size={size}>{children}</RadioGroupItemText>
32
+ <RadioGroupItemHiddenInput />
33
+ </RadioGroupItem>
34
+ )
35
+ }
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  // deprecated
7
7
 
8
8
  export * from './components/deprecated/FieldMessage'
9
+ export * from './components/deprecated/FieldsetLabel'
9
10
  export * from './components/deprecated/Label'
10
11
  export * from './components/deprecated/Modal'
11
12
  export * from './components/deprecated/ModalHeader'
@@ -33,8 +34,7 @@ export * from './components/Dialog.client'
33
34
  export * from './components/Droppable'
34
35
  export * from './components/FeatureFlag'
35
36
  export * from './components/field/index'
36
- export * from './components/Fieldset'
37
- export * from './components/FieldsetLabel'
37
+ export * from './components/fieldset/index'
38
38
  export * from './components/FileStatus'
39
39
  export * from './components/FileUploader'
40
40
  export * from './components/for'
@@ -46,7 +46,7 @@ export * from './components/NotificationHeading'
46
46
  export * from './components/NotificationDescription'
47
47
  export * from './components/Portal'
48
48
  export * from './components/ProgressBar'
49
- export * from './components/Radio'
49
+ export * from './components/radio/index'
50
50
  export * from './components/Spinner'
51
51
  export * from './components/Tabs.client'
52
52
  export * from './components/Table'
@@ -1,53 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/components/Fieldset.tsx
22
- var Fieldset_exports = {};
23
- __export(Fieldset_exports, {
24
- Fieldset: () => Fieldset
25
- });
26
- module.exports = __toCommonJS(Fieldset_exports);
27
- var import_field = require("@ark-ui/react/field");
28
- var import_css = require("@cerberus/styled-system/css");
29
- var import_jsx_runtime = require("react/jsx-runtime");
30
- function Fieldset(props) {
31
- const { invalid, disabled } = (0, import_field.useFieldContext)();
32
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
33
- "fieldset",
34
- {
35
- ...props,
36
- disabled,
37
- ...invalid && { "aria-invalid": true },
38
- className: (0, import_css.cx)(
39
- props.className,
40
- (0, import_css.css)({
41
- border: "none",
42
- pt: 2,
43
- margin: 0
44
- })
45
- )
46
- }
47
- );
48
- }
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- Fieldset
52
- });
53
- //# sourceMappingURL=Fieldset.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Fieldset.tsx"],"sourcesContent":["'use client'\n\nimport { useFieldContext } from '@ark-ui/react/field'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport type { FieldsetHTMLAttributes } from 'react'\n\n/**\n * This module contains the Fieldset component.\n * @module Fieldset\n */\n\nexport type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>\n\n/**\n * A component to group related elements in a form for accessibility.\n * @memberof Field\n * @see https://cerberus.digitalu.com/react/fieldset\n * @description [A11y Form Checklist](https://www.a11yproject.com/checklist/#forms)\n * @description [MDN Web Docs: Fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset)\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 * <Label htmlFor=\"yes\">Yes</Label>\n * </Field>\n * </Hstack>\n * <Hstack>\n * <Field>\n * <Radio id=\"no\" name=\"cats\" value=\"no\" />\n * <Label htmlFor=\"no\">No</Label>\n * </Field>\n * </Hstack>\n * </Fieldset>\n * </form>\n * )\n * }\n */\nexport function Fieldset(props: FieldsetProps) {\n const { invalid, disabled } = useFieldContext()\n\n return (\n <fieldset\n {...props}\n disabled={disabled}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(\n props.className,\n css({\n border: 'none',\n pt: 2,\n margin: 0,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAgC;AAChC,iBAAwB;AA+CpB;AAJG,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,SAAS,SAAS,QAAI,8BAAgB;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACC,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,eAAW;AAAA,QACT,MAAM;AAAA,YACN,gBAAI;AAAA,UACF,QAAQ;AAAA,UACR,IAAI;AAAA,UACJ,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA;AAAA,EACF;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;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAmB;AACnB,qBAA8C;AAiD1C;AAHG,SAAS,cAAc,OAA2B;AACvD,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,sBAAM;AAAA,UACJ;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/components/Radio.tsx
21
- var Radio_exports = {};
22
- __export(Radio_exports, {
23
- Radio: () => Radio
24
- });
25
- module.exports = __toCommonJS(Radio_exports);
26
- var import_field = require("@ark-ui/react/field");
27
- var import_css = require("@cerberus/styled-system/css");
28
- var import_patterns = require("@cerberus/styled-system/patterns");
29
- var import_recipes = require("@cerberus/styled-system/recipes");
30
- var import_jsx_runtime = require("react/jsx-runtime");
31
- function Radio(props) {
32
- const { children, size, ...nativeProps } = props;
33
- const styles = (0, import_recipes.radio)({ size });
34
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
35
- "div",
36
- {
37
- className: (0, import_css.cx)(
38
- "group",
39
- (0, import_patterns.hstack)({
40
- gap: "sm"
41
- }),
42
- styles.root
43
- ),
44
- tabIndex: 0,
45
- children: [
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
- import_field.Field.Input,
48
- {
49
- ...nativeProps,
50
- className: (0, import_css.cx)(nativeProps.className, styles.input),
51
- tabIndex: -1,
52
- type: "radio"
53
- }
54
- ),
55
- children
56
- ]
57
- }
58
- );
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- Radio
63
- });
64
- //# sourceMappingURL=Radio.cjs.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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AACtB,iBAAmB;AACnB,sBAAuB;AACvB,qBAAsB;AA6ClB;AALG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,UAAU,MAAM,GAAG,YAAY,IAAI;AAC3C,QAAM,aAAS,sBAAM,EAAE,KAAK,CAAC;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,YACA,wBAAO;AAAA,UACL,KAAK;AAAA,QACP,CAAC;AAAA,QACD,OAAO;AAAA,MACT;AAAA,MACA,UAAU;AAAA,MAEV;AAAA;AAAA,UAAC,mBAAM;AAAA,UAAN;AAAA,YACE,GAAG;AAAA,YACJ,eAAW,eAAG,YAAY,WAAW,OAAO,KAAK;AAAA,YACjD,UAAU;AAAA,YACV,MAAK;AAAA;AAAA,QACP;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -1,28 +0,0 @@
1
- // src/components/Fieldset.tsx
2
- import { useFieldContext } from "@ark-ui/react/field";
3
- import { css, cx } from "@cerberus/styled-system/css";
4
- import { jsx } from "react/jsx-runtime";
5
- function Fieldset(props) {
6
- const { invalid, disabled } = useFieldContext();
7
- return /* @__PURE__ */ jsx(
8
- "fieldset",
9
- {
10
- ...props,
11
- disabled,
12
- ...invalid && { "aria-invalid": true },
13
- className: cx(
14
- props.className,
15
- css({
16
- border: "none",
17
- pt: 2,
18
- margin: 0
19
- })
20
- )
21
- }
22
- );
23
- }
24
-
25
- export {
26
- Fieldset
27
- };
28
- //# sourceMappingURL=chunk-6EUC3SUI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Fieldset.tsx"],"sourcesContent":["'use client'\n\nimport { useFieldContext } from '@ark-ui/react/field'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport type { FieldsetHTMLAttributes } from 'react'\n\n/**\n * This module contains the Fieldset component.\n * @module Fieldset\n */\n\nexport type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>\n\n/**\n * A component to group related elements in a form for accessibility.\n * @memberof Field\n * @see https://cerberus.digitalu.com/react/fieldset\n * @description [A11y Form Checklist](https://www.a11yproject.com/checklist/#forms)\n * @description [MDN Web Docs: Fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset)\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 * <Label htmlFor=\"yes\">Yes</Label>\n * </Field>\n * </Hstack>\n * <Hstack>\n * <Field>\n * <Radio id=\"no\" name=\"cats\" value=\"no\" />\n * <Label htmlFor=\"no\">No</Label>\n * </Field>\n * </Hstack>\n * </Fieldset>\n * </form>\n * )\n * }\n */\nexport function Fieldset(props: FieldsetProps) {\n const { invalid, disabled } = useFieldContext()\n\n return (\n <fieldset\n {...props}\n disabled={disabled}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(\n props.className,\n css({\n border: 'none',\n pt: 2,\n margin: 0,\n }),\n )}\n />\n )\n}\n"],"mappings":";AAEA,SAAS,uBAAuB;AAChC,SAAS,KAAK,UAAU;AA+CpB;AAJG,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,SAAS,SAAS,IAAI,gBAAgB;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACC,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,WAAW;AAAA,QACT,MAAM;AAAA,QACN,IAAI;AAAA,UACF,QAAQ;AAAA,UACR,IAAI;AAAA,UACJ,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}