@cerberus-design/react 0.5.2 → 0.6.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 (204) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.ts +157 -49
  2. package/build/legacy/aria-helpers/tabs.aria.js +1 -1
  3. package/build/legacy/{chunk-XFWARXLU.js → chunk-2ATICEW3.js} +1 -1
  4. package/build/legacy/chunk-2ATICEW3.js.map +1 -0
  5. package/build/legacy/chunk-3CBN7U25.js +24 -0
  6. package/build/legacy/chunk-3CBN7U25.js.map +1 -0
  7. package/build/{modern/chunk-R4H3352X.js → legacy/chunk-4O4QFF4S.js} +2 -3
  8. package/build/legacy/{chunk-R4H3352X.js.map → chunk-4O4QFF4S.js.map} +1 -1
  9. package/build/legacy/chunk-5MNCW677.js +11 -0
  10. package/build/legacy/chunk-5MNCW677.js.map +1 -0
  11. package/build/{modern/chunk-7BXBIDZB.js → legacy/chunk-5XNLWIZO.js} +11 -8
  12. package/build/legacy/chunk-5XNLWIZO.js.map +1 -0
  13. package/build/{modern/chunk-JA4IX7GN.js → legacy/chunk-6DIGPXAD.js} +2 -2
  14. package/build/legacy/chunk-734PGVLT.js +58 -0
  15. package/build/legacy/chunk-734PGVLT.js.map +1 -0
  16. package/build/legacy/{chunk-WSQTX34C.js → chunk-G2QMBSK5.js} +2 -2
  17. package/build/{modern/chunk-OXVNTE4A.js → legacy/chunk-HE3HFKYU.js} +8 -7
  18. package/build/legacy/chunk-HE3HFKYU.js.map +1 -0
  19. package/build/legacy/{chunk-MJB3V6J4.js → chunk-RPZAPUCF.js} +3 -4
  20. package/build/legacy/{chunk-MJB3V6J4.js.map → chunk-RPZAPUCF.js.map} +1 -1
  21. package/build/legacy/{chunk-BT2B5C7M.js → chunk-S7HBD2A7.js} +2 -3
  22. package/build/legacy/{chunk-BT2B5C7M.js.map → chunk-S7HBD2A7.js.map} +1 -1
  23. package/build/legacy/chunk-SCQVXJBT.js +22 -0
  24. package/build/legacy/chunk-SCQVXJBT.js.map +1 -0
  25. package/build/{modern/chunk-NIMWIOIA.js → legacy/chunk-SLHX5K6I.js} +1 -1
  26. package/build/legacy/chunk-SLHX5K6I.js.map +1 -0
  27. package/build/legacy/{chunk-5TBINKAO.js → chunk-TCO46FK7.js} +1 -1
  28. package/build/legacy/chunk-TCO46FK7.js.map +1 -0
  29. package/build/legacy/{chunk-YVUZSAJG.js → chunk-VGHVH2T3.js} +1 -1
  30. package/build/legacy/chunk-VGHVH2T3.js.map +1 -0
  31. package/build/legacy/chunk-WE3JNSNO.js +33 -0
  32. package/build/legacy/chunk-WE3JNSNO.js.map +1 -0
  33. package/build/legacy/{chunk-LD5ZV46F.js → chunk-X4YQ27D5.js} +14 -7
  34. package/build/legacy/chunk-X4YQ27D5.js.map +1 -0
  35. package/build/legacy/{chunk-MYRKQVDI.js → chunk-YA2UV2AB.js} +2 -2
  36. package/build/legacy/{chunk-SVZU6LPF.js → chunk-YJCWUN33.js} +2 -2
  37. package/build/legacy/components/Button.js +1 -1
  38. package/build/legacy/components/FieldMessage.js +1 -1
  39. package/build/legacy/components/IconButton.js +1 -1
  40. package/build/legacy/components/Input.js +4 -2
  41. package/build/legacy/components/Label.js +2 -2
  42. package/build/legacy/components/NavMenuLink.js +2 -2
  43. package/build/legacy/components/NavMenuList.js +2 -2
  44. package/build/legacy/components/NavMenuTrigger.js +2 -2
  45. package/build/legacy/components/Radio.js +9 -0
  46. package/build/legacy/components/Radio.js.map +1 -0
  47. package/build/legacy/components/Show.js +1 -1
  48. package/build/legacy/components/Tab.js +2 -2
  49. package/build/legacy/components/TabPanel.js +2 -2
  50. package/build/legacy/components/Tag.js +2 -2
  51. package/build/legacy/components/Textarea.js +1 -1
  52. package/build/legacy/components/Toggle.js +11 -0
  53. package/build/legacy/components/Toggle.js.map +1 -0
  54. package/build/legacy/config/cerbIcons.js +7 -0
  55. package/build/legacy/config/cerbIcons.js.map +1 -0
  56. package/build/legacy/config/defineIcons.js +10 -0
  57. package/build/legacy/config/defineIcons.js.map +1 -0
  58. package/build/legacy/hooks/useToggle.js +8 -0
  59. package/build/legacy/hooks/useToggle.js.map +1 -0
  60. package/build/legacy/index.js +48 -29
  61. package/build/legacy/noExternals.d.ts +1 -0
  62. package/build/modern/_tsup-dts-rollup.d.ts +157 -49
  63. package/build/modern/aria-helpers/tabs.aria.js +1 -1
  64. package/build/modern/{chunk-XFWARXLU.js → chunk-2ATICEW3.js} +1 -1
  65. package/build/modern/chunk-2ATICEW3.js.map +1 -0
  66. package/build/modern/chunk-3CBN7U25.js +24 -0
  67. package/build/modern/chunk-3CBN7U25.js.map +1 -0
  68. package/build/{legacy/chunk-R4H3352X.js → modern/chunk-4O4QFF4S.js} +2 -3
  69. package/build/modern/{chunk-R4H3352X.js.map → chunk-4O4QFF4S.js.map} +1 -1
  70. package/build/modern/chunk-5MNCW677.js +11 -0
  71. package/build/modern/chunk-5MNCW677.js.map +1 -0
  72. package/build/{legacy/chunk-JA4IX7GN.js → modern/chunk-6DIGPXAD.js} +2 -2
  73. package/build/modern/chunk-734PGVLT.js +58 -0
  74. package/build/modern/chunk-734PGVLT.js.map +1 -0
  75. package/build/modern/{chunk-WSQTX34C.js → chunk-G2QMBSK5.js} +2 -2
  76. package/build/{legacy/chunk-OXVNTE4A.js → modern/chunk-HE3HFKYU.js} +8 -7
  77. package/build/modern/chunk-HE3HFKYU.js.map +1 -0
  78. package/build/modern/chunk-QEA6N6TN.js +22 -0
  79. package/build/modern/chunk-QEA6N6TN.js.map +1 -0
  80. package/build/modern/{chunk-MJB3V6J4.js → chunk-RPZAPUCF.js} +3 -4
  81. package/build/modern/{chunk-MJB3V6J4.js.map → chunk-RPZAPUCF.js.map} +1 -1
  82. package/build/modern/{chunk-BT2B5C7M.js → chunk-S7HBD2A7.js} +2 -3
  83. package/build/modern/{chunk-BT2B5C7M.js.map → chunk-S7HBD2A7.js.map} +1 -1
  84. package/build/{legacy/chunk-NIMWIOIA.js → modern/chunk-SLHX5K6I.js} +1 -1
  85. package/build/modern/chunk-SLHX5K6I.js.map +1 -0
  86. package/build/{legacy/chunk-7BXBIDZB.js → modern/chunk-SLIOCQBZ.js} +11 -8
  87. package/build/modern/chunk-SLIOCQBZ.js.map +1 -0
  88. package/build/modern/{chunk-IQP6HSC4.js → chunk-SUP7U42W.js} +2 -2
  89. package/build/modern/{chunk-5TBINKAO.js → chunk-TCO46FK7.js} +1 -1
  90. package/build/modern/chunk-TCO46FK7.js.map +1 -0
  91. package/build/modern/{chunk-YVUZSAJG.js → chunk-VGHVH2T3.js} +1 -1
  92. package/build/modern/chunk-VGHVH2T3.js.map +1 -0
  93. package/build/modern/chunk-WE3JNSNO.js +33 -0
  94. package/build/modern/chunk-WE3JNSNO.js.map +1 -0
  95. package/build/modern/{chunk-LD5ZV46F.js → chunk-X4YQ27D5.js} +14 -7
  96. package/build/modern/chunk-X4YQ27D5.js.map +1 -0
  97. package/build/modern/{chunk-SVZU6LPF.js → chunk-YJCWUN33.js} +2 -2
  98. package/build/modern/components/Button.js +1 -1
  99. package/build/modern/components/FieldMessage.js +1 -1
  100. package/build/modern/components/IconButton.js +1 -1
  101. package/build/modern/components/Input.js +4 -2
  102. package/build/modern/components/Label.js +2 -2
  103. package/build/modern/components/NavMenuLink.js +2 -2
  104. package/build/modern/components/NavMenuList.js +2 -2
  105. package/build/modern/components/NavMenuTrigger.js +2 -2
  106. package/build/modern/components/Radio.js +9 -0
  107. package/build/modern/components/Radio.js.map +1 -0
  108. package/build/modern/components/Show.js +1 -1
  109. package/build/modern/components/Tab.js +2 -2
  110. package/build/modern/components/TabPanel.js +2 -2
  111. package/build/modern/components/Tag.js +2 -2
  112. package/build/modern/components/Textarea.js +1 -1
  113. package/build/modern/components/Toggle.js +11 -0
  114. package/build/modern/components/Toggle.js.map +1 -0
  115. package/build/modern/config/cerbIcons.js +7 -0
  116. package/build/modern/config/cerbIcons.js.map +1 -0
  117. package/build/modern/config/defineIcons.js +10 -0
  118. package/build/modern/config/defineIcons.js.map +1 -0
  119. package/build/modern/hooks/useToggle.js +8 -0
  120. package/build/modern/hooks/useToggle.js.map +1 -0
  121. package/build/modern/index.js +48 -29
  122. package/build/modern/noExternals.d.ts +1 -0
  123. package/package.json +7 -6
  124. package/src/components/Button.tsx +3 -6
  125. package/src/components/FieldMessage.tsx +4 -2
  126. package/src/components/IconButton.tsx +6 -9
  127. package/src/components/Input.tsx +21 -7
  128. package/src/components/Label.tsx +9 -6
  129. package/src/components/Radio.tsx +35 -0
  130. package/src/components/Tag.tsx +27 -24
  131. package/src/components/Textarea.tsx +3 -1
  132. package/src/components/Toggle.tsx +55 -0
  133. package/src/config/cerbIcons.ts +12 -0
  134. package/src/config/defineIcons.ts +19 -0
  135. package/src/hooks/useToggle.ts +30 -0
  136. package/src/index.ts +7 -0
  137. package/build/legacy/aria-helpers/nav-menu.aria.d.ts +0 -2
  138. package/build/legacy/aria-helpers/tabs.aria.d.ts +0 -1
  139. package/build/legacy/chunk-5TBINKAO.js.map +0 -1
  140. package/build/legacy/chunk-7BXBIDZB.js.map +0 -1
  141. package/build/legacy/chunk-LD5ZV46F.js.map +0 -1
  142. package/build/legacy/chunk-NIMWIOIA.js.map +0 -1
  143. package/build/legacy/chunk-OXVNTE4A.js.map +0 -1
  144. package/build/legacy/chunk-XFWARXLU.js.map +0 -1
  145. package/build/legacy/chunk-YVUZSAJG.js.map +0 -1
  146. package/build/legacy/components/Button.d.ts +0 -2
  147. package/build/legacy/components/FieldMessage.d.ts +0 -2
  148. package/build/legacy/components/IconButton.d.ts +0 -3
  149. package/build/legacy/components/Input.d.ts +0 -2
  150. package/build/legacy/components/Label.d.ts +0 -2
  151. package/build/legacy/components/NavMenuLink.d.ts +0 -2
  152. package/build/legacy/components/NavMenuList.d.ts +0 -3
  153. package/build/legacy/components/NavMenuTrigger.d.ts +0 -2
  154. package/build/legacy/components/Show.d.ts +0 -2
  155. package/build/legacy/components/Tab.d.ts +0 -2
  156. package/build/legacy/components/TabList.d.ts +0 -2
  157. package/build/legacy/components/TabPanel.d.ts +0 -2
  158. package/build/legacy/components/Tag.d.ts +0 -4
  159. package/build/legacy/components/Textarea.d.ts +0 -2
  160. package/build/legacy/context/field.d.ts +0 -3
  161. package/build/legacy/context/navMenu.d.ts +0 -5
  162. package/build/legacy/context/tabs.d.ts +0 -5
  163. package/build/legacy/context/theme.d.ts +0 -8
  164. package/build/legacy/hooks/useTheme.d.ts +0 -1
  165. package/build/legacy/index.d.ts +0 -58
  166. package/build/legacy/types.d.ts +0 -1
  167. package/build/modern/aria-helpers/nav-menu.aria.d.ts +0 -2
  168. package/build/modern/aria-helpers/tabs.aria.d.ts +0 -1
  169. package/build/modern/chunk-5TBINKAO.js.map +0 -1
  170. package/build/modern/chunk-7BXBIDZB.js.map +0 -1
  171. package/build/modern/chunk-LD5ZV46F.js.map +0 -1
  172. package/build/modern/chunk-NIMWIOIA.js.map +0 -1
  173. package/build/modern/chunk-OXVNTE4A.js.map +0 -1
  174. package/build/modern/chunk-XFWARXLU.js.map +0 -1
  175. package/build/modern/chunk-YVUZSAJG.js.map +0 -1
  176. package/build/modern/components/Button.d.ts +0 -2
  177. package/build/modern/components/FieldMessage.d.ts +0 -2
  178. package/build/modern/components/IconButton.d.ts +0 -3
  179. package/build/modern/components/Input.d.ts +0 -2
  180. package/build/modern/components/Label.d.ts +0 -2
  181. package/build/modern/components/NavMenuLink.d.ts +0 -2
  182. package/build/modern/components/NavMenuList.d.ts +0 -3
  183. package/build/modern/components/NavMenuTrigger.d.ts +0 -2
  184. package/build/modern/components/Show.d.ts +0 -2
  185. package/build/modern/components/Tab.d.ts +0 -2
  186. package/build/modern/components/TabList.d.ts +0 -2
  187. package/build/modern/components/TabPanel.d.ts +0 -2
  188. package/build/modern/components/Tag.d.ts +0 -4
  189. package/build/modern/components/Textarea.d.ts +0 -2
  190. package/build/modern/context/field.d.ts +0 -3
  191. package/build/modern/context/navMenu.d.ts +0 -5
  192. package/build/modern/context/tabs.d.ts +0 -5
  193. package/build/modern/context/theme.d.ts +0 -8
  194. package/build/modern/hooks/useTheme.d.ts +0 -1
  195. package/build/modern/index.d.ts +0 -58
  196. package/build/modern/types.d.ts +0 -1
  197. /package/build/legacy/{chunk-JA4IX7GN.js.map → chunk-6DIGPXAD.js.map} +0 -0
  198. /package/build/legacy/{chunk-WSQTX34C.js.map → chunk-G2QMBSK5.js.map} +0 -0
  199. /package/build/legacy/{chunk-MYRKQVDI.js.map → chunk-YA2UV2AB.js.map} +0 -0
  200. /package/build/legacy/{chunk-SVZU6LPF.js.map → chunk-YJCWUN33.js.map} +0 -0
  201. /package/build/modern/{chunk-JA4IX7GN.js.map → chunk-6DIGPXAD.js.map} +0 -0
  202. /package/build/modern/{chunk-WSQTX34C.js.map → chunk-G2QMBSK5.js.map} +0 -0
  203. /package/build/modern/{chunk-IQP6HSC4.js.map → chunk-SUP7U42W.js.map} +0 -0
  204. /package/build/modern/{chunk-SVZU6LPF.js.map → chunk-YJCWUN33.js.map} +0 -0
@@ -1,16 +1,32 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
+ import { button } from '@cerberus/styled-system/recipes';
2
3
  import { ButtonHTMLAttributes } from 'react';
3
- import type { ConditionalValue } from '@cerberus/styled-system/types';
4
+ import { CarbonIconType } from '@cerberus/icons';
5
+ import { ChangeEvent } from 'react';
4
6
  import { Context } from 'react';
5
7
  import { ElementType } from 'react';
8
+ import { fieldMessage } from '@cerberus/styled-system/recipes';
6
9
  import { HTMLAttributes } from 'react';
10
+ import { iconButton } from '@cerberus/styled-system/recipes';
11
+ import { input } from '@cerberus/styled-system/recipes';
7
12
  import type { InputHTMLAttributes } from 'react';
8
13
  import { JSX as JSX_2 } from 'react/jsx-runtime';
14
+ import { label } from '@cerberus/styled-system/recipes';
9
15
  import { MutableRefObject } from 'react';
10
16
  import { PropsWithChildren } from 'react';
17
+ import { radio } from '@cerberus-design/styled-system/recipes';
11
18
  import { ReactNode } from 'react';
19
+ import { RecipeVariantProps } from '@cerberus/styled-system/css';
20
+ import type { RecipeVariantProps as RecipeVariantProps_2 } from '@cerberus-design/styled-system/types';
21
+ import type { RecipeVariantProps as RecipeVariantProps_3 } from '@cerberus/styled-system/types';
12
22
  import { RefObject } from 'react';
23
+ import { tag } from '@cerberus/styled-system/recipes';
13
24
  import type { TextareaHTMLAttributes } from 'react';
25
+ import { ToggleVariantProps } from '@cerberus-design/styled-system/recipes';
26
+
27
+ declare let $cerberusIcons: DefinedIcons;
28
+ export { $cerberusIcons }
29
+ export { $cerberusIcons as $cerberusIcons_alias_1 }
14
30
 
15
31
  /**
16
32
  * A component that allows the user to perform actions
@@ -24,20 +40,17 @@ export { Button as Button_alias_1 }
24
40
  * This module contains the Button component.
25
41
  * @module
26
42
  */
27
- declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
28
- palette?: 'action' | 'danger';
29
- usage?: 'filled' | 'outline' | 'text';
30
- shape?: 'sharp' | 'rounded';
31
- }
43
+ declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & RecipeVariantProps<typeof button>;
32
44
  export { ButtonProps }
33
45
  export { ButtonProps as ButtonProps_alias_1 }
34
46
 
35
- declare interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
36
- palette?: NonActionablePalette;
37
- shape?: 'pill';
47
+ declare type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
48
+ gradient?: never;
49
+ palette?: never;
38
50
  onClick: () => void;
39
- usage?: 'filled';
40
- }
51
+ shape: 'pill';
52
+ usage: 'filled';
53
+ };
41
54
  export { ClickableTagProps }
42
55
  export { ClickableTagProps as ClickableTagProps_alias_1 }
43
56
 
@@ -53,10 +66,21 @@ declare type CustomThemes<K extends string = DefaultThemes> = 'cerberus' | K;
53
66
  export { CustomThemes }
54
67
  export { CustomThemes as CustomThemes_alias_1 }
55
68
 
69
+ export declare const defaultIcons: DefinedIcons;
70
+
56
71
  declare type DefaultThemes = 'cerberus';
57
72
  export { DefaultThemes }
58
73
  export { DefaultThemes as DefaultThemes_alias_1 }
59
74
 
75
+ export declare interface DefinedIcons {
76
+ invalid: CarbonIconType | ElementType;
77
+ toggleChecked: CarbonIconType | ElementType;
78
+ }
79
+
80
+ declare function defineIcons(icons: DefinedIcons): DefinedIcons;
81
+ export { defineIcons }
82
+ export { defineIcons as defineIcons_alias_1 }
83
+
60
84
  declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
61
85
  export { Field }
62
86
  export { Field as Field_alias_1 }
@@ -88,16 +112,24 @@ declare function FieldMessage(props: FieldMessageProps): JSX_2.Element;
88
112
  export { FieldMessage }
89
113
  export { FieldMessage as FieldMessage_alias_1 }
90
114
 
91
- /**
92
- * This module contains the FieldMessage component.
93
- * @module
94
- */
95
- declare interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {
115
+ declare interface FieldMessageBaseProps extends HTMLAttributes<HTMLParagraphElement> {
96
116
  id: string;
97
117
  }
118
+ export { FieldMessageBaseProps }
119
+ export { FieldMessageBaseProps as FieldMessageBaseProps_alias_1 }
120
+
121
+ declare type FieldMessageProps = FieldMessageBaseProps & FieldMessageRecipe;
98
122
  export { FieldMessageProps }
99
123
  export { FieldMessageProps as FieldMessageProps_alias_1 }
100
124
 
125
+ /**
126
+ * This module contains the FieldMessage component.
127
+ * @module
128
+ */
129
+ declare type FieldMessageRecipe = RecipeVariantProps<typeof fieldMessage>;
130
+ export { FieldMessageRecipe }
131
+ export { FieldMessageRecipe as FieldMessageRecipe_alias_1 }
132
+
101
133
  declare function getPosition(position: Positions): GetPositionResult;
102
134
  export { getPosition }
103
135
  export { getPosition as getPosition_alias_1 }
@@ -117,14 +149,7 @@ declare function IconButton(props: IconButtonProps): JSX.Element;
117
149
  export { IconButton }
118
150
  export { IconButton as IconButton_alias_1 }
119
151
 
120
- declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
121
- ariaLabel: string;
122
- palette?: ButtonProps['palette'];
123
- usage?: IconButtonUsage;
124
- shape?: 'circle';
125
- size?: 'sm' | 'lg';
126
- tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
127
- }
152
+ declare type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps;
128
153
  export { IconButtonProps }
129
154
  export { IconButtonProps as IconButtonProps_alias_1 }
130
155
 
@@ -132,22 +157,38 @@ export { IconButtonProps as IconButtonProps_alias_1 }
132
157
  * This module contains the Icon Button component.
133
158
  * @module
134
159
  */
135
- declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
136
- export { IconButtonUsage }
137
- export { IconButtonUsage as IconButtonUsage_alias_1 }
160
+ declare interface IconButtonRawProps extends ButtonHTMLAttributes<HTMLButtonElement> {
161
+ ariaLabel: string;
162
+ tooltipPosition?: Positions;
163
+ }
164
+ export { IconButtonRawProps }
165
+ export { IconButtonRawProps as IconButtonRawProps_alias_1 }
166
+
167
+ declare type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>;
168
+ export { IconButtonRecipeProps }
169
+ export { IconButtonRecipeProps as IconButtonRecipeProps_alias_1 }
138
170
 
139
171
  declare function Input(props: InputProps): JSX_2.Element;
140
172
  export { Input }
141
173
  export { Input as Input_alias_1 }
142
174
 
143
- declare interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'size'> {
175
+ declare interface InputBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'size'> {
144
176
  describedBy?: string;
145
177
  id: string;
146
- size?: 'sm' | 'md' | 'lg';
178
+ startIcon?: ReactNode;
179
+ endIcon?: ReactNode;
147
180
  }
181
+ export { InputBaseProps }
182
+ export { InputBaseProps as InputBaseProps_alias_1 }
183
+
184
+ declare type InputProps = InputBaseProps & InputRecipeProps;
148
185
  export { InputProps }
149
186
  export { InputProps as InputProps_alias_1 }
150
187
 
188
+ declare type InputRecipeProps = RecipeVariantProps<typeof input>;
189
+ export { InputRecipeProps }
190
+ export { InputRecipeProps as InputRecipeProps_alias_1 }
191
+
151
192
  /**
152
193
  * A screen ready friendly label component.
153
194
  * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
@@ -163,17 +204,25 @@ declare function Label(props: PropsWithChildren<LabelProps>): JSX_2.Element;
163
204
  export { Label }
164
205
  export { Label as Label_alias_1 }
165
206
 
166
- /**
167
- * This module contains the Label component.
168
- * @module
169
- */
170
- declare interface LabelProps extends HTMLAttributes<HTMLLabelElement> {
207
+ declare interface LabelBaseProps extends HTMLAttributes<HTMLLabelElement> {
171
208
  htmlFor: string;
172
209
  hidden?: boolean;
173
210
  }
211
+ export { LabelBaseProps }
212
+ export { LabelBaseProps as LabelBaseProps_alias_1 }
213
+
214
+ declare type LabelProps = LabelBaseProps & LabelRecipeProps;
174
215
  export { LabelProps }
175
216
  export { LabelProps as LabelProps_alias_1 }
176
217
 
218
+ /**
219
+ * This module contains the Label component.
220
+ * @module
221
+ */
222
+ declare type LabelRecipeProps = RecipeVariantProps<typeof label>;
223
+ export { LabelRecipeProps }
224
+ export { LabelRecipeProps as LabelRecipeProps_alias_1 }
225
+
177
226
  declare const MODE_KEY = "cerberus-mode";
178
227
  export { MODE_KEY }
179
228
  export { MODE_KEY as MODE_KEY_alias_1 }
@@ -267,18 +316,28 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
267
316
  export { NavTriggerRef }
268
317
  export { NavTriggerRef as NavTriggerRef_alias_1 }
269
318
 
270
- /**
271
- * This module contains the tag component.
272
- * @module
273
- */
274
- declare type NonActionablePalette = ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
275
- export { NonActionablePalette }
276
- export { NonActionablePalette as NonActionablePalette_alias_1 }
277
-
278
319
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
279
320
  export { Positions }
280
321
  export { Positions as Positions_alias_1 }
281
322
 
323
+ declare function Radio(props: PropsWithChildren<RadioProps>): JSX_2.Element;
324
+ export { Radio }
325
+ export { Radio as Radio_alias_1 }
326
+
327
+ declare interface RadioBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
328
+ id: string;
329
+ }
330
+ export { RadioBaseProps }
331
+ export { RadioBaseProps as RadioBaseProps_alias_1 }
332
+
333
+ declare type RadioProps = RadioBaseProps & RadioRecipe;
334
+ export { RadioProps }
335
+ export { RadioProps as RadioProps_alias_1 }
336
+
337
+ declare type RadioRecipe = RecipeVariantProps_2<typeof radio>;
338
+ export { RadioRecipe }
339
+ export { RadioRecipe as RadioRecipe_alias_1 }
340
+
282
341
  /**
283
342
  * Conditionally render its children or an optional fallback component
284
343
  * based on the SolidJS component.
@@ -300,6 +359,12 @@ declare interface ShowProps {
300
359
  export { ShowProps }
301
360
  export { ShowProps as ShowProps_alias_1 }
302
361
 
362
+ declare type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagRecipeProps & {
363
+ onClick?: never;
364
+ };
365
+ export { StaticTagProps }
366
+ export { StaticTagProps as StaticTagProps_alias_1 }
367
+
303
368
  /**
304
369
  * The Tab component provides a tab element to be used in a TabList.
305
370
  * @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)
@@ -424,23 +489,28 @@ export { TabsProps as TabsProps_alias_1 }
424
489
 
425
490
  /**
426
491
  * The Tag component is used to display a meta descriptions.
492
+ * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)
427
493
  * @example
428
494
  * ```tsx
429
495
  * <Tag>Tag</Tag>
430
496
  * ```
431
497
  */
432
- declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JSX.Element;
498
+ declare function Tag(props: PropsWithChildren<TagProps>): JSX.Element;
433
499
  export { Tag }
434
500
  export { Tag as Tag_alias_1 }
435
501
 
436
- declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
437
- palette?: NonActionablePalette;
438
- shape?: 'rounded' | 'pill';
439
- usage?: 'filled' | 'outline';
440
- }
502
+ declare type TagProps = StaticTagProps | ClickableTagProps;
441
503
  export { TagProps }
442
504
  export { TagProps as TagProps_alias_1 }
443
505
 
506
+ /**
507
+ * This module contains the tag component.
508
+ * @module
509
+ */
510
+ declare type TagRecipeProps = RecipeVariantProps_3<typeof tag>;
511
+ export { TagRecipeProps }
512
+ export { TagRecipeProps as TagRecipeProps_alias_1 }
513
+
444
514
  /**
445
515
  * A component that allows the user to input large blocks of text.
446
516
  * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
@@ -453,10 +523,14 @@ export { Textarea as Textarea_alias_1 }
453
523
  * This module contains the Textarea component.
454
524
  * @module
455
525
  */
456
- declare interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
526
+ declare interface TextareaBaseProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
457
527
  describedBy?: string;
458
528
  id: string;
459
529
  }
530
+ export { TextareaBaseProps }
531
+ export { TextareaBaseProps as TextareaBaseProps_alias_1 }
532
+
533
+ declare type TextareaProps = InputRecipeProps & TextareaBaseProps;
460
534
  export { TextareaProps }
461
535
  export { TextareaProps as TextareaProps_alias_1 }
462
536
 
@@ -486,6 +560,29 @@ declare function ThemeProvider(props: PropsWithChildren<unknown>): JSX.Element;
486
560
  export { ThemeProvider }
487
561
  export { ThemeProvider as ThemeProvider_alias_1 }
488
562
 
563
+ declare function Toggle(props: ToggleProps): JSX_2.Element;
564
+ export { Toggle }
565
+ export { Toggle as Toggle_alias_1 }
566
+
567
+ declare type ToggleBase = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id' | 'value'> & {
568
+ describedBy?: string;
569
+ id: string;
570
+ value: string;
571
+ };
572
+ export { ToggleBase }
573
+ export { ToggleBase as ToggleBase_alias_1 }
574
+
575
+ declare interface ToggleHookReturn {
576
+ checked: string;
577
+ handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
578
+ }
579
+ export { ToggleHookReturn }
580
+ export { ToggleHookReturn as ToggleHookReturn_alias_1 }
581
+
582
+ declare type ToggleProps = ToggleBase & ToggleVariantProps;
583
+ export { ToggleProps }
584
+ export { ToggleProps as ToggleProps_alias_1 }
585
+
489
586
  declare function useFieldContext(): FieldContextValue;
490
587
  export { useFieldContext }
491
588
  export { useFieldContext as useFieldContext_alias_1 }
@@ -512,4 +609,15 @@ declare function useThemeContext(): ThemeContextValue<DefaultThemes>;
512
609
  export { useThemeContext }
513
610
  export { useThemeContext as useThemeContext_alias_1 }
514
611
 
612
+ declare function useToggle(options?: UseToggleOptions): ToggleHookReturn;
613
+ export { useToggle }
614
+ export { useToggle as useToggle_alias_1 }
615
+
616
+ declare interface UseToggleOptions {
617
+ checked?: string;
618
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
619
+ }
620
+ export { UseToggleOptions }
621
+ export { UseToggleOptions as UseToggleOptions_alias_1 }
622
+
515
623
  export { }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useTabsKeyboardNavigation
4
- } from "../chunk-BT2B5C7M.js";
4
+ } from "../chunk-S7HBD2A7.js";
5
5
  import "../chunk-DQOYTLGB.js";
6
6
  export {
7
7
  useTabsKeyboardNavigation
@@ -23,4 +23,4 @@ function Button(props) {
23
23
  export {
24
24
  Button
25
25
  };
26
- //# sourceMappingURL=chunk-XFWARXLU.js.map
26
+ //# sourceMappingURL=chunk-2ATICEW3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n RecipeVariantProps<typeof button>\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAmC;AAC5C,SAAS,cAAc;AAiBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,24 @@
1
+ import {
2
+ defaultIcons
3
+ } from "./chunk-5MNCW677.js";
4
+
5
+ // src/config/defineIcons.ts
6
+ function _validateIconsProperties(icons) {
7
+ if (!icons.invalid) {
8
+ throw new Error(
9
+ "The an invalid property must be defined in your custom icons library."
10
+ );
11
+ }
12
+ }
13
+ function defineIcons(icons) {
14
+ _validateIconsProperties(icons);
15
+ $cerberusIcons = icons;
16
+ return $cerberusIcons;
17
+ }
18
+ var $cerberusIcons = defaultIcons;
19
+
20
+ export {
21
+ defineIcons,
22
+ $cerberusIcons
23
+ };
24
+ //# sourceMappingURL=chunk-3CBN7U25.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/defineIcons.ts"],"sourcesContent":["import { defaultIcons, type DefinedIcons } from './cerbIcons'\n\nfunction _validateIconsProperties(icons: DefinedIcons) {\n if (!icons.invalid) {\n throw new Error(\n 'The an invalid property must be defined in your custom icons library.',\n )\n }\n}\n\nexport function defineIcons(icons: DefinedIcons): DefinedIcons {\n _validateIconsProperties(icons)\n $cerberusIcons = icons\n return $cerberusIcons\n}\n\n// Default icons\n\nexport let $cerberusIcons: DefinedIcons = defaultIcons\n"],"mappings":";;;;;AAEA,SAAS,yBAAyB,OAAqB;AACrD,MAAI,CAAC,MAAM,SAAS;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,YAAY,OAAmC;AAC7D,2BAAyB,KAAK;AAC9B,mBAAiB;AACjB,SAAO;AACT;AAIO,IAAI,iBAA+B;","names":[]}
@@ -4,8 +4,7 @@ function Show(props) {
4
4
  const { when, children, fallback } = props;
5
5
  const condition = useMemo(() => when ?? false, [when]);
6
6
  return useMemo(() => {
7
- if (condition)
8
- return children;
7
+ if (condition) return children;
9
8
  return fallback ?? null;
10
9
  }, [condition, children, fallback]);
11
10
  }
@@ -13,4 +12,4 @@ function Show(props) {
13
12
  export {
14
13
  Show
15
14
  };
16
- //# sourceMappingURL=chunk-R4H3352X.js.map
15
+ //# sourceMappingURL=chunk-4O4QFF4S.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI;AAAW,aAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;","names":[]}
@@ -0,0 +1,11 @@
1
+ // src/config/cerbIcons.ts
2
+ import { Checkmark, WarningFilled } from "@cerberus/icons";
3
+ var defaultIcons = {
4
+ invalid: WarningFilled,
5
+ toggleChecked: Checkmark
6
+ };
7
+
8
+ export {
9
+ defaultIcons
10
+ };
11
+ //# sourceMappingURL=chunk-5MNCW677.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import { Checkmark, WarningFilled, type CarbonIconType } from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport interface DefinedIcons {\n invalid: CarbonIconType | ElementType\n toggleChecked: CarbonIconType | ElementType\n}\n\nexport const defaultIcons: DefinedIcons = {\n invalid: WarningFilled,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA,SAAS,WAAW,qBAA0C;AAQvD,IAAM,eAA6B;AAAA,EACxC,SAAS;AAAA,EACT,eAAe;AACjB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Show
3
- } from "./chunk-R4H3352X.js";
3
+ } from "./chunk-4O4QFF4S.js";
4
4
 
5
5
  // src/components/Tag.tsx
6
6
  import { Close } from "@cerberus/icons";
@@ -8,14 +8,11 @@ import { css, cx } from "@cerberus/styled-system/css";
8
8
  import { iconButton, tag } from "@cerberus/styled-system/recipes";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  function Tag(props) {
11
- const { palette, shape: initShape, onClick, usage, ...nativeProps } = props;
11
+ const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
12
+ const palette = (props == null ? void 0 : props.palette) ?? "neutral";
12
13
  const isClosable = Boolean(onClick);
13
14
  const shape = isClosable ? "pill" : initShape;
14
- const closableStyles = isClosable ? css({
15
- bgColor: "action.bg.active",
16
- color: "action.text.initial",
17
- paddingInlineEnd: "0"
18
- }) : "";
15
+ const closableStyles = isClosable ? closableCss : "";
19
16
  return /* @__PURE__ */ jsxs(
20
17
  "span",
21
18
  {
@@ -23,6 +20,7 @@ function Tag(props) {
23
20
  className: cx(
24
21
  nativeProps.className,
25
22
  tag({
23
+ gradient,
26
24
  palette,
27
25
  shape,
28
26
  usage
@@ -48,8 +46,13 @@ function Tag(props) {
48
46
  }
49
47
  );
50
48
  }
49
+ var closableCss = css({
50
+ bgColor: "action.bg.active",
51
+ color: "action.text.initial",
52
+ paddingInlineEnd: "0"
53
+ });
51
54
 
52
55
  export {
53
56
  Tag
54
57
  };
55
- //# sourceMappingURL=chunk-7BXBIDZB.js.map
58
+ //# sourceMappingURL=chunk-5XNLWIZO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\nimport type { RecipeVariantProps } from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type TagRecipeProps = RecipeVariantProps<typeof tag>\n\nexport type StaticTagProps = HTMLAttributes<HTMLSpanElement> &\n TagRecipeProps & {\n onClick?: never\n }\n\nexport type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {\n gradient?: never\n palette?: never\n onClick: () => void\n shape: 'pill'\n usage: 'filled'\n}\n\nexport type TagProps = StaticTagProps | ClickableTagProps\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(props: PropsWithChildren<TagProps>): JSX.Element {\n const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props\n const palette = props?.palette ?? 'neutral'\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const closableStyles = isClosable ? closableCss : ''\n\n return (\n <span\n {...nativeProps}\n className={cx(\n nativeProps.className,\n tag({\n gradient,\n palette,\n shape,\n usage,\n }),\n closableStyles,\n )}\n >\n {props.children}\n\n <Show when={isClosable}>\n <button\n aria-label=\"Close\"\n className={iconButton({\n palette: 'action',\n usage: 'filled',\n size: 'sm',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n\nconst closableCss = css({\n bgColor: 'action.bg.active',\n color: 'action.text.initial',\n paddingInlineEnd: '0',\n})\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAEtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AAyC5B,SAyBM,KAzBN;AARG,SAAS,IAAI,OAAiD;AACnE,QAAM,EAAE,OAAO,WAAW,UAAU,SAAS,OAAO,GAAG,YAAY,IAAI;AACvE,QAAM,WAAU,+BAAO,YAAW;AAClC,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,iBAAiB,aAAa,cAAc;AAElD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,IAAI;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MAEC;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,WAAW;AAAA,cACpB,SAAS;AAAA,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAM,cAAc,IAAI;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,kBAAkB;AACpB,CAAC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Show
3
- } from "./chunk-R4H3352X.js";
3
+ } from "./chunk-4O4QFF4S.js";
4
4
 
5
5
  // src/components/NavMenuLink.tsx
6
6
  import { css, cx } from "@cerberus/styled-system/css";
@@ -45,4 +45,4 @@ function NavMenuLink(props) {
45
45
  export {
46
46
  NavMenuLink
47
47
  };
48
- //# sourceMappingURL=chunk-JA4IX7GN.js.map
48
+ //# sourceMappingURL=chunk-6DIGPXAD.js.map
@@ -0,0 +1,58 @@
1
+ import {
2
+ useFieldContext
3
+ } from "./chunk-ZAU4JVLL.js";
4
+ import {
5
+ $cerberusIcons
6
+ } from "./chunk-3CBN7U25.js";
7
+
8
+ // src/components/Toggle.tsx
9
+ import { cx } from "@cerberus-design/styled-system/css";
10
+ import { hstack, vstack } from "@cerberus-design/styled-system/patterns";
11
+ import {
12
+ toggle
13
+ } from "@cerberus-design/styled-system/recipes";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ function Toggle(props) {
16
+ const { size, describedBy, ...nativeProps } = props;
17
+ const styles = toggle({ size });
18
+ const { invalid, ...state } = useFieldContext();
19
+ const Icon = $cerberusIcons.toggleChecked;
20
+ return /* @__PURE__ */ jsxs(
21
+ "span",
22
+ {
23
+ className: cx("group", styles.track, hstack()),
24
+ "data-checked": props.checked || props.defaultChecked,
25
+ children: [
26
+ /* @__PURE__ */ jsx(
27
+ "input",
28
+ {
29
+ ...nativeProps,
30
+ ...state,
31
+ ...describedBy && { "aria-describedby": describedBy },
32
+ ...invalid && { "aria-invalid": true },
33
+ className: cx("peer", styles.input),
34
+ role: "switch",
35
+ type: "checkbox"
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsx(
39
+ "span",
40
+ {
41
+ className: cx(
42
+ styles.thumb,
43
+ vstack({
44
+ justify: "center"
45
+ })
46
+ ),
47
+ children: /* @__PURE__ */ jsx(Icon, {})
48
+ }
49
+ )
50
+ ]
51
+ }
52
+ );
53
+ }
54
+
55
+ export {
56
+ Toggle
57
+ };
58
+ //# sourceMappingURL=chunk-734PGVLT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Toggle.tsx"],"sourcesContent":["'use client'\n\nimport { cx } from '@cerberus-design/styled-system/css'\nimport { hstack, vstack } from '@cerberus-design/styled-system/patterns'\nimport {\n toggle,\n type ToggleVariantProps,\n} from '@cerberus-design/styled-system/recipes'\nimport type { InputHTMLAttributes } from 'react'\nimport { $cerberusIcons } from '../config/defineIcons'\nimport { useFieldContext } from '../context/field'\n\nexport type ToggleBase = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'id' | 'value'\n> & {\n describedBy?: string\n id: string\n value: string\n}\nexport type ToggleProps = ToggleBase & ToggleVariantProps\n\nexport function Toggle(props: ToggleProps) {\n const { size, describedBy, ...nativeProps } = props\n const styles = toggle({ size })\n const { invalid, ...state } = useFieldContext()\n const Icon = $cerberusIcons.toggleChecked\n\n return (\n <span\n className={cx('group', styles.track, hstack())}\n data-checked={props.checked || props.defaultChecked}\n >\n <input\n {...nativeProps}\n {...state}\n {...(describedBy && { 'aria-describedby': describedBy })}\n {...(invalid && { 'aria-invalid': true })}\n className={cx('peer', styles.input)}\n role=\"switch\"\n type=\"checkbox\"\n />\n <span\n className={cx(\n styles.thumb,\n vstack({\n justify: 'center',\n }),\n )}\n >\n <Icon />\n </span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,QAAQ,cAAc;AAC/B;AAAA,EACE;AAAA,OAEK;AAsBH,SAIE,KAJF;AAPG,SAAS,OAAO,OAAoB;AACzC,QAAM,EAAE,MAAM,aAAa,GAAG,YAAY,IAAI;AAC9C,QAAM,SAAS,OAAO,EAAE,KAAK,CAAC;AAC9B,QAAM,EAAE,SAAS,GAAG,MAAM,IAAI,gBAAgB;AAC9C,QAAM,OAAO,eAAe;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,SAAS,OAAO,OAAO,OAAO,CAAC;AAAA,MAC7C,gBAAc,MAAM,WAAW,MAAM;AAAA,MAErC;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,OAAO,KAAK;AAAA,YAClC,MAAK;AAAA,YACL,MAAK;AAAA;AAAA,QACP;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT,OAAO;AAAA,cACP,OAAO;AAAA,gBACL,SAAS;AAAA,cACX,CAAC;AAAA,YACH;AAAA,YAEA,8BAAC,QAAK;AAAA;AAAA,QACR;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KJUCHZHV.js";
4
4
  import {
5
5
  Show
6
- } from "./chunk-R4H3352X.js";
6
+ } from "./chunk-4O4QFF4S.js";
7
7
 
8
8
  // src/components/NavMenuList.tsx
9
9
  import { useMemo } from "react";
@@ -83,4 +83,4 @@ export {
83
83
  getPosition,
84
84
  NavMenuList
85
85
  };
86
- //# sourceMappingURL=chunk-WSQTX34C.js.map
86
+ //# sourceMappingURL=chunk-G2QMBSK5.js.map
@@ -1,9 +1,9 @@
1
- import {
2
- Show
3
- } from "./chunk-R4H3352X.js";
4
1
  import {
5
2
  useFieldContext
6
3
  } from "./chunk-ZAU4JVLL.js";
4
+ import {
5
+ Show
6
+ } from "./chunk-4O4QFF4S.js";
7
7
 
8
8
  // src/components/Label.tsx
9
9
  import { label } from "@cerberus/styled-system/recipes";
@@ -11,16 +11,17 @@ import { css, cx } from "@cerberus/styled-system/css";
11
11
  import { hstack } from "@cerberus/styled-system/patterns";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  function Label(props) {
14
- const { hidden, ...nativeProps } = props;
15
- const { required } = useFieldContext();
14
+ const { hidden, size, ...nativeProps } = props;
15
+ const { required, disabled } = useFieldContext();
16
16
  const usage = hidden ? "hidden" : "visible";
17
17
  return /* @__PURE__ */ jsxs(
18
18
  "label",
19
19
  {
20
20
  ...nativeProps,
21
+ "data-disabled": disabled,
21
22
  className: cx(
22
23
  nativeProps.className,
23
- label({ usage }),
24
+ label({ size, usage }),
24
25
  hstack({
25
26
  justify: "space-between"
26
27
  })
@@ -45,4 +46,4 @@ function Label(props) {
45
46
  export {
46
47
  Label
47
48
  };
48
- //# sourceMappingURL=chunk-OXVNTE4A.js.map
49
+ //# sourceMappingURL=chunk-HE3HFKYU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Label.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { label } from '@cerberus/styled-system/recipes'\nimport { css, cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { useFieldContext } from '../context/field'\nimport { Show } from './Show'\n\n/**\n * This module contains the Label component.\n * @module\n */\n\nexport type LabelRecipeProps = RecipeVariantProps<typeof label>\nexport interface LabelBaseProps extends HTMLAttributes<HTMLLabelElement> {\n htmlFor: string\n hidden?: boolean\n}\nexport type LabelProps = LabelBaseProps & LabelRecipeProps\n\n/**\n * A screen ready friendly label component.\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Label docs](https://cerberus.digitalu.design/react/label)\n * @example\n * ```tsx\n * <Field required>\n * <Label htmlFor=\"test\">Test Label</Label>\n * </Field>\n * ```\n */\nexport function Label(props: PropsWithChildren<LabelProps>) {\n const { hidden, size, ...nativeProps } = props\n const { required, disabled } = useFieldContext()\n const usage = hidden ? 'hidden' : 'visible'\n\n return (\n <label\n {...nativeProps}\n data-disabled={disabled}\n className={cx(\n nativeProps.className,\n label({ size, usage }),\n hstack({\n justify: 'space-between',\n }),\n )}\n >\n {props.children}\n <Show when={required}>\n <span\n className={css({\n color: 'neutral.text.100',\n fontSize: 'inherit',\n })}\n >\n (required)\n </span>\n </Show>\n </label>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,KAAK,UAAmC;AACjD,SAAS,cAAc;AAiCnB,SAaI,KAbJ;AANG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,QAAQ,MAAM,GAAG,YAAY,IAAI;AACzC,QAAM,EAAE,UAAU,SAAS,IAAI,gBAAgB;AAC/C,QAAM,QAAQ,SAAS,WAAW;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,iBAAe;AAAA,MACf,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM,EAAE,MAAM,MAAM,CAAC;AAAA,QACrB,OAAO;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,cAAM;AAAA,QACP,oBAAC,QAAK,MAAM,UACV;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,OAAO;AAAA,cACP,UAAU;AAAA,YACZ,CAAC;AAAA,YACF;AAAA;AAAA,QAED,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KJUCHZHV.js";
4
4
  import {
5
5
  Show
6
- } from "./chunk-R4H3352X.js";
6
+ } from "./chunk-4O4QFF4S.js";
7
7
  import {
8
8
  createNavTriggerProps
9
9
  } from "./chunk-JF76VIL3.js";
@@ -35,8 +35,7 @@ function NavMenuTrigger(props) {
35
35
  const AsSub = as;
36
36
  const handleClick = useCallback(
37
37
  (e) => {
38
- if (onClick)
39
- return onClick(e);
38
+ if (onClick) return onClick(e);
40
39
  onToggle();
41
40
  },
42
41
  [onClick, onToggle]
@@ -79,4 +78,4 @@ function NavMenuTrigger(props) {
79
78
  export {
80
79
  NavMenuTrigger
81
80
  };
82
- //# sourceMappingURL=chunk-MJB3V6J4.js.map
81
+ //# sourceMappingURL=chunk-RPZAPUCF.js.map