@cerberus-design/react 0.6.1 → 0.7.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 (213) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.ts +336 -4
  2. package/build/legacy/aria-helpers/tabs.aria.js +2 -2
  3. package/build/legacy/aria-helpers/trap-focus.aria.js +7 -0
  4. package/build/legacy/aria-helpers/trap-focus.aria.js.map +1 -0
  5. package/build/legacy/chunk-2F5TB2EV.js +25 -0
  6. package/build/legacy/chunk-2F5TB2EV.js.map +1 -0
  7. package/build/legacy/chunk-4CAT3FHV.js +11 -0
  8. package/build/legacy/chunk-4CAT3FHV.js.map +1 -0
  9. package/build/legacy/chunk-4M3EUP57.js +22 -0
  10. package/build/legacy/chunk-4M3EUP57.js.map +1 -0
  11. package/build/{modern/chunk-X4YQ27D5.js → legacy/chunk-5GEC53G7.js} +5 -5
  12. package/build/legacy/{chunk-YJCWUN33.js → chunk-67S42J4B.js} +5 -16
  13. package/build/legacy/chunk-67S42J4B.js.map +1 -0
  14. package/build/legacy/{chunk-3CBN7U25.js → chunk-6TXQZ3PB.js} +6 -3
  15. package/build/legacy/chunk-6TXQZ3PB.js.map +1 -0
  16. package/build/legacy/{chunk-DQOYTLGB.js → chunk-7KJIZIAU.js} +9 -5
  17. package/build/legacy/chunk-7KJIZIAU.js.map +1 -0
  18. package/build/legacy/chunk-C45DY4VE.js +17 -0
  19. package/build/legacy/chunk-C45DY4VE.js.map +1 -0
  20. package/build/{modern/chunk-HE3HFKYU.js → legacy/chunk-CU7HXAKM.js} +5 -5
  21. package/build/legacy/{chunk-HE3HFKYU.js.map → chunk-CU7HXAKM.js.map} +1 -1
  22. package/build/legacy/chunk-D3ZXZA3U.js +155 -0
  23. package/build/legacy/chunk-D3ZXZA3U.js.map +1 -0
  24. package/build/legacy/chunk-DGPLSWFJ.js +208 -0
  25. package/build/legacy/chunk-DGPLSWFJ.js.map +1 -0
  26. package/build/legacy/{chunk-5XNLWIZO.js → chunk-EVEEQRH6.js} +2 -2
  27. package/build/legacy/chunk-EVEEQRH6.js.map +1 -0
  28. package/build/legacy/chunk-G3JEWPLM.js +29 -0
  29. package/build/legacy/chunk-G3JEWPLM.js.map +1 -0
  30. package/build/legacy/chunk-JI4YTPEJ.js +47 -0
  31. package/build/legacy/chunk-JI4YTPEJ.js.map +1 -0
  32. package/build/legacy/chunk-KESKDLX6.js +30 -0
  33. package/build/legacy/chunk-KESKDLX6.js.map +1 -0
  34. package/build/legacy/{chunk-S7HBD2A7.js → chunk-KFUXGX33.js} +2 -2
  35. package/build/legacy/chunk-OGSAAB6K.js +12 -0
  36. package/build/legacy/chunk-OGSAAB6K.js.map +1 -0
  37. package/build/{modern/chunk-G2QMBSK5.js → legacy/chunk-PMCYXRAH.js} +2 -2
  38. package/build/legacy/chunk-PMCYXRAH.js.map +1 -0
  39. package/build/legacy/{chunk-734PGVLT.js → chunk-TAZI77TP.js} +2 -2
  40. package/build/legacy/chunk-TPFNVGYA.js +21 -0
  41. package/build/legacy/chunk-TPFNVGYA.js.map +1 -0
  42. package/build/legacy/chunk-TZNYJ3G7.js +25 -0
  43. package/build/legacy/chunk-TZNYJ3G7.js.map +1 -0
  44. package/build/legacy/chunk-UPODPCRD.js +12 -0
  45. package/build/legacy/chunk-UPODPCRD.js.map +1 -0
  46. package/build/legacy/chunk-VULPMZUW.js +18 -0
  47. package/build/legacy/chunk-VULPMZUW.js.map +1 -0
  48. package/build/{modern/chunk-5GSXIYD3.js → legacy/chunk-X2JMXTBH.js} +6 -8
  49. package/build/{modern/chunk-5GSXIYD3.js.map → legacy/chunk-X2JMXTBH.js.map} +1 -1
  50. package/build/legacy/components/FeatureFlag.js +10 -0
  51. package/build/legacy/components/FeatureFlag.js.map +1 -0
  52. package/build/legacy/components/Input.js +4 -4
  53. package/build/legacy/components/Label.js +2 -2
  54. package/build/legacy/components/Modal.js +7 -0
  55. package/build/legacy/components/Modal.js.map +1 -0
  56. package/build/legacy/components/ModalDescription.js +7 -0
  57. package/build/legacy/components/ModalDescription.js.map +1 -0
  58. package/build/legacy/components/ModalHeader.js +7 -0
  59. package/build/legacy/components/ModalHeader.js.map +1 -0
  60. package/build/legacy/components/ModalHeading.js +7 -0
  61. package/build/legacy/components/ModalHeading.js.map +1 -0
  62. package/build/legacy/components/ModalIcon.js +7 -0
  63. package/build/legacy/components/ModalIcon.js.map +1 -0
  64. package/build/legacy/components/NavMenuList.js +1 -1
  65. package/build/legacy/components/Portal.js +7 -0
  66. package/build/legacy/components/Portal.js.map +1 -0
  67. package/build/legacy/components/Tab.js +3 -3
  68. package/build/legacy/components/TabList.js +2 -2
  69. package/build/legacy/components/TabPanel.js +2 -2
  70. package/build/legacy/components/Tag.js +1 -1
  71. package/build/legacy/components/Toggle.js +3 -3
  72. package/build/legacy/config/cerbIcons.js +1 -1
  73. package/build/legacy/config/defineIcons.js +2 -2
  74. package/build/legacy/context/confirm-modal.js +22 -0
  75. package/build/legacy/context/confirm-modal.js.map +1 -0
  76. package/build/legacy/context/feature-flags.js +10 -0
  77. package/build/legacy/context/feature-flags.js.map +1 -0
  78. package/build/legacy/context/prompt-modal.js +25 -0
  79. package/build/legacy/context/prompt-modal.js.map +1 -0
  80. package/build/legacy/context/tabs.js +1 -1
  81. package/build/legacy/hooks/useModal.js +8 -0
  82. package/build/legacy/hooks/useModal.js.map +1 -0
  83. package/build/legacy/index.js +89 -35
  84. package/build/modern/_tsup-dts-rollup.d.ts +336 -4
  85. package/build/modern/aria-helpers/tabs.aria.js +2 -2
  86. package/build/modern/aria-helpers/trap-focus.aria.js +7 -0
  87. package/build/modern/aria-helpers/trap-focus.aria.js.map +1 -0
  88. package/build/modern/chunk-2F5TB2EV.js +25 -0
  89. package/build/modern/chunk-2F5TB2EV.js.map +1 -0
  90. package/build/modern/chunk-4CAT3FHV.js +11 -0
  91. package/build/modern/chunk-4CAT3FHV.js.map +1 -0
  92. package/build/modern/chunk-4M3EUP57.js +22 -0
  93. package/build/modern/chunk-4M3EUP57.js.map +1 -0
  94. package/build/{legacy/chunk-X4YQ27D5.js → modern/chunk-5GEC53G7.js} +5 -5
  95. package/build/modern/{chunk-YJCWUN33.js → chunk-67S42J4B.js} +5 -16
  96. package/build/modern/chunk-67S42J4B.js.map +1 -0
  97. package/build/modern/{chunk-3CBN7U25.js → chunk-6TXQZ3PB.js} +6 -3
  98. package/build/modern/chunk-6TXQZ3PB.js.map +1 -0
  99. package/build/modern/{chunk-DQOYTLGB.js → chunk-7KJIZIAU.js} +9 -5
  100. package/build/modern/chunk-7KJIZIAU.js.map +1 -0
  101. package/build/modern/chunk-C45DY4VE.js +17 -0
  102. package/build/modern/chunk-C45DY4VE.js.map +1 -0
  103. package/build/modern/chunk-C5HLLGME.js +23 -0
  104. package/build/modern/chunk-C5HLLGME.js.map +1 -0
  105. package/build/{legacy/chunk-HE3HFKYU.js → modern/chunk-CU7HXAKM.js} +5 -5
  106. package/build/modern/{chunk-HE3HFKYU.js.map → chunk-CU7HXAKM.js.map} +1 -1
  107. package/build/modern/chunk-G3JEWPLM.js +29 -0
  108. package/build/modern/chunk-G3JEWPLM.js.map +1 -0
  109. package/build/modern/chunk-HBEEHHON.js +46 -0
  110. package/build/modern/chunk-HBEEHHON.js.map +1 -0
  111. package/build/modern/chunk-JIZQFTW6.js +29 -0
  112. package/build/modern/chunk-JIZQFTW6.js.map +1 -0
  113. package/build/modern/{chunk-S7HBD2A7.js → chunk-KFUXGX33.js} +2 -2
  114. package/build/modern/chunk-OGSAAB6K.js +12 -0
  115. package/build/modern/chunk-OGSAAB6K.js.map +1 -0
  116. package/build/{legacy/chunk-G2QMBSK5.js → modern/chunk-PMCYXRAH.js} +2 -2
  117. package/build/modern/chunk-PMCYXRAH.js.map +1 -0
  118. package/build/modern/chunk-TAVCJ54A.js +154 -0
  119. package/build/modern/chunk-TAVCJ54A.js.map +1 -0
  120. package/build/modern/{chunk-734PGVLT.js → chunk-TAZI77TP.js} +2 -2
  121. package/build/modern/chunk-TPFNVGYA.js +21 -0
  122. package/build/modern/chunk-TPFNVGYA.js.map +1 -0
  123. package/build/modern/chunk-UPODPCRD.js +12 -0
  124. package/build/modern/chunk-UPODPCRD.js.map +1 -0
  125. package/build/modern/chunk-VULPMZUW.js +18 -0
  126. package/build/modern/chunk-VULPMZUW.js.map +1 -0
  127. package/build/modern/chunk-WWG5QWXY.js +207 -0
  128. package/build/modern/chunk-WWG5QWXY.js.map +1 -0
  129. package/build/{legacy/chunk-5GSXIYD3.js → modern/chunk-X2JMXTBH.js} +6 -8
  130. package/build/{legacy/chunk-5GSXIYD3.js.map → modern/chunk-X2JMXTBH.js.map} +1 -1
  131. package/build/modern/{chunk-SLIOCQBZ.js → chunk-Z6IWNVPN.js} +2 -2
  132. package/build/modern/chunk-Z6IWNVPN.js.map +1 -0
  133. package/build/modern/components/FeatureFlag.js +10 -0
  134. package/build/modern/components/FeatureFlag.js.map +1 -0
  135. package/build/modern/components/Input.js +4 -4
  136. package/build/modern/components/Label.js +2 -2
  137. package/build/modern/components/Modal.js +7 -0
  138. package/build/modern/components/Modal.js.map +1 -0
  139. package/build/modern/components/ModalDescription.js +7 -0
  140. package/build/modern/components/ModalDescription.js.map +1 -0
  141. package/build/modern/components/ModalHeader.js +7 -0
  142. package/build/modern/components/ModalHeader.js.map +1 -0
  143. package/build/modern/components/ModalHeading.js +7 -0
  144. package/build/modern/components/ModalHeading.js.map +1 -0
  145. package/build/modern/components/ModalIcon.js +7 -0
  146. package/build/modern/components/ModalIcon.js.map +1 -0
  147. package/build/modern/components/NavMenuList.js +1 -1
  148. package/build/modern/components/Portal.js +7 -0
  149. package/build/modern/components/Portal.js.map +1 -0
  150. package/build/modern/components/Tab.js +3 -3
  151. package/build/modern/components/TabList.js +2 -2
  152. package/build/modern/components/TabPanel.js +2 -2
  153. package/build/modern/components/Tag.js +1 -1
  154. package/build/modern/components/Toggle.js +3 -3
  155. package/build/modern/config/cerbIcons.js +1 -1
  156. package/build/modern/config/defineIcons.js +2 -2
  157. package/build/modern/context/confirm-modal.js +22 -0
  158. package/build/modern/context/confirm-modal.js.map +1 -0
  159. package/build/modern/context/feature-flags.js +10 -0
  160. package/build/modern/context/feature-flags.js.map +1 -0
  161. package/build/modern/context/prompt-modal.js +25 -0
  162. package/build/modern/context/prompt-modal.js.map +1 -0
  163. package/build/modern/context/tabs.js +1 -1
  164. package/build/modern/hooks/useModal.js +8 -0
  165. package/build/modern/hooks/useModal.js.map +1 -0
  166. package/build/modern/index.js +89 -35
  167. package/package.json +3 -2
  168. package/src/aria-helpers/trap-focus.aria.ts +29 -0
  169. package/src/components/FeatureFlag.tsx +14 -0
  170. package/src/components/Label.tsx +1 -1
  171. package/src/components/Modal.tsx +37 -0
  172. package/src/components/ModalDescription.tsx +23 -0
  173. package/src/components/ModalHeader.tsx +37 -0
  174. package/src/components/ModalHeading.tsx +23 -0
  175. package/src/components/ModalIcon.tsx +28 -0
  176. package/src/components/NavMenuList.tsx +1 -1
  177. package/src/components/Portal.tsx +22 -0
  178. package/src/components/Tab.tsx +3 -84
  179. package/src/components/TabList.tsx +2 -4
  180. package/src/components/TabPanel.tsx +3 -14
  181. package/src/components/Tag.tsx +1 -1
  182. package/src/config/cerbIcons.ts +11 -2
  183. package/src/config/defineIcons.ts +6 -3
  184. package/src/context/confirm-modal.tsx +185 -0
  185. package/src/context/feature-flags.tsx +60 -0
  186. package/src/context/prompt-modal.tsx +232 -0
  187. package/src/context/tabs.tsx +15 -5
  188. package/src/hooks/useModal.ts +34 -0
  189. package/src/index.ts +12 -0
  190. package/build/legacy/chunk-3CBN7U25.js.map +0 -1
  191. package/build/legacy/chunk-5MNCW677.js +0 -11
  192. package/build/legacy/chunk-5MNCW677.js.map +0 -1
  193. package/build/legacy/chunk-5XNLWIZO.js.map +0 -1
  194. package/build/legacy/chunk-DQOYTLGB.js.map +0 -1
  195. package/build/legacy/chunk-G2QMBSK5.js.map +0 -1
  196. package/build/legacy/chunk-YA2UV2AB.js +0 -126
  197. package/build/legacy/chunk-YA2UV2AB.js.map +0 -1
  198. package/build/legacy/chunk-YJCWUN33.js.map +0 -1
  199. package/build/modern/chunk-3CBN7U25.js.map +0 -1
  200. package/build/modern/chunk-5MNCW677.js +0 -11
  201. package/build/modern/chunk-5MNCW677.js.map +0 -1
  202. package/build/modern/chunk-DQOYTLGB.js.map +0 -1
  203. package/build/modern/chunk-G2QMBSK5.js.map +0 -1
  204. package/build/modern/chunk-SLIOCQBZ.js.map +0 -1
  205. package/build/modern/chunk-SUP7U42W.js +0 -125
  206. package/build/modern/chunk-SUP7U42W.js.map +0 -1
  207. package/build/modern/chunk-YJCWUN33.js.map +0 -1
  208. /package/build/legacy/{chunk-X4YQ27D5.js.map → chunk-5GEC53G7.js.map} +0 -0
  209. /package/build/legacy/{chunk-S7HBD2A7.js.map → chunk-KFUXGX33.js.map} +0 -0
  210. /package/build/legacy/{chunk-734PGVLT.js.map → chunk-TAZI77TP.js.map} +0 -0
  211. /package/build/modern/{chunk-X4YQ27D5.js.map → chunk-5GEC53G7.js.map} +0 -0
  212. /package/build/modern/{chunk-S7HBD2A7.js.map → chunk-KFUXGX33.js.map} +0 -0
  213. /package/build/modern/{chunk-734PGVLT.js.map → chunk-TAZI77TP.js.map} +0 -0
@@ -6,25 +6,32 @@ import { ChangeEvent } from 'react';
6
6
  import { Context } from 'react';
7
7
  import { ElementType } from 'react';
8
8
  import { fieldMessage } from '@cerberus/styled-system/recipes';
9
+ import { ForwardRefExoticComponent } from 'react';
9
10
  import { HTMLAttributes } from 'react';
10
11
  import { iconButton } from '@cerberus/styled-system/recipes';
11
12
  import { input } from '@cerberus/styled-system/recipes';
12
13
  import type { InputHTMLAttributes } from 'react';
13
14
  import { JSX as JSX_2 } from 'react/jsx-runtime';
15
+ import type { KeyboardEventHandler } from 'react';
14
16
  import { label } from '@cerberus/styled-system/recipes';
17
+ import { ModalIconVariantProps } from '@cerberus-design/styled-system/recipes';
15
18
  import { MutableRefObject } from 'react';
19
+ import type { Pretty } from '@cerberus-design/styled-system/types';
16
20
  import { PropsWithChildren } from 'react';
17
21
  import { radio } from '@cerberus-design/styled-system/recipes';
18
22
  import { ReactNode } from 'react';
23
+ import { ReactPortal } from 'react';
19
24
  import { RecipeVariantProps } from '@cerberus/styled-system/css';
20
25
  import type { RecipeVariantProps as RecipeVariantProps_2 } from '@cerberus-design/styled-system/types';
21
26
  import type { RecipeVariantProps as RecipeVariantProps_3 } from '@cerberus/styled-system/types';
27
+ import { RefAttributes } from 'react';
22
28
  import { RefObject } from 'react';
29
+ import { TabsVariantProps } from '@cerberus-design/styled-system/recipes';
23
30
  import { tag } from '@cerberus/styled-system/recipes';
24
31
  import type { TextareaHTMLAttributes } from 'react';
25
32
  import { ToggleVariantProps } from '@cerberus-design/styled-system/recipes';
26
33
 
27
- declare let $cerberusIcons: DefinedIcons;
34
+ declare let $cerberusIcons: Required<DefinedIcons>;
28
35
  export { $cerberusIcons }
29
36
  export { $cerberusIcons as $cerberusIcons_alias_1 }
30
37
 
@@ -58,6 +65,45 @@ declare type ColorModes = 'light' | 'dark';
58
65
  export { ColorModes }
59
66
  export { ColorModes as ColorModes_alias_1 }
60
67
 
68
+ /**
69
+ * Provides a confirm modal to the app.
70
+ * @example
71
+ * ```tsx
72
+ * // Wrap the Provider around the root of the feature.
73
+ * <ConfirmModal>
74
+ * <SomeFeatureSection />
75
+ * </ConfirmModal>
76
+ *
77
+ * // Use the hook to show the confirm modal.
78
+ * const confirm = useConfirmModal()
79
+ *
80
+ * const handleClick = useCallback(async () => {
81
+ * const userConsent = await confirm.show({
82
+ * heading: 'Add new payment method?',
83
+ * description:
84
+ * 'This will add a new payment method to your account to be billed for future purchases.',
85
+ * actionText: 'Yes, add payment method',
86
+ * cancelText: 'No, cancel',
87
+ * })
88
+ * setConsent(userConsent)
89
+ * }, [confirm])
90
+ * ```
91
+ */
92
+ declare function ConfirmModal(props: PropsWithChildren<ConfirmModalProviderProps>): JSX_2.Element;
93
+ export { ConfirmModal }
94
+ export { ConfirmModal as ConfirmModal_alias_1 }
95
+
96
+ declare interface ConfirmModalProviderProps {
97
+ }
98
+ export { ConfirmModalProviderProps }
99
+ export { ConfirmModalProviderProps as ConfirmModalProviderProps_alias_1 }
100
+
101
+ declare interface ConfirmModalValue {
102
+ show: (options: ShowConfirmModalOptions) => Promise<boolean>;
103
+ }
104
+ export { ConfirmModalValue }
105
+ export { ConfirmModalValue as ConfirmModalValue_alias_1 }
106
+
61
107
  declare function createNavTriggerProps(values: NavTriggerAriaValues): NavTriggerAriaReturn;
62
108
  export { createNavTriggerProps }
63
109
  export { createNavTriggerProps as createNavTriggerProps_alias_1 }
@@ -73,14 +119,68 @@ export { DefaultThemes }
73
119
  export { DefaultThemes as DefaultThemes_alias_1 }
74
120
 
75
121
  export declare interface DefinedIcons {
122
+ confirmModal?: CarbonIconType | ElementType;
123
+ promptModal?: CarbonIconType | ElementType;
76
124
  invalid: CarbonIconType | ElementType;
77
- toggleChecked: CarbonIconType | ElementType;
125
+ toggleChecked?: CarbonIconType | ElementType;
78
126
  }
79
127
 
80
- declare function defineIcons(icons: DefinedIcons): DefinedIcons;
128
+ declare function defineIcons(icons: DefinedIcons): Required<DefinedIcons>;
81
129
  export { defineIcons }
82
130
  export { defineIcons as defineIcons_alias_1 }
83
131
 
132
+ declare function FeatureFlag(props: PropsWithChildren<FeatureFlagProps>): JSX_2.Element;
133
+ export { FeatureFlag }
134
+ export { FeatureFlag as FeatureFlag_alias_1 }
135
+
136
+ declare interface FeatureFlagProps {
137
+ flag: string;
138
+ }
139
+ export { FeatureFlagProps }
140
+ export { FeatureFlagProps as FeatureFlagProps_alias_1 }
141
+
142
+ declare interface FeatureFlagProviderProps {
143
+ flags: FeatureFlagValue;
144
+ }
145
+ export { FeatureFlagProviderProps }
146
+ export { FeatureFlagProviderProps as FeatureFlagProviderProps_alias_1 }
147
+
148
+ /**
149
+ * Provides feature flags to the application.
150
+ * @param flags - The flags data for the provider.
151
+ * @example
152
+ * ```tsx
153
+ * // This should be a JSON file or a server response.
154
+ * const flags = {
155
+ * featureOne: true,
156
+ * featureTwo: false
157
+ * }
158
+ *
159
+ * // Wrap the Provider around the root of your application.
160
+ * <FeatureFlags flags={flags}>
161
+ * <FeatureFlag flag="featureOne">
162
+ * This is visible.
163
+ * </FeatureFlag>
164
+ * <FeatureFlag flag="featureTwo">
165
+ * This is hidden.
166
+ * </FeatureFlag>
167
+ * </FeatureFlags>
168
+ * ```
169
+ */
170
+ declare function FeatureFlags(props: PropsWithChildren<FeatureFlagProviderProps>): JSX_2.Element;
171
+ export { FeatureFlags }
172
+ export { FeatureFlags as FeatureFlags_alias_1 }
173
+
174
+ /**
175
+ * This module provides a context and hook for feature flags.
176
+ * @module
177
+ */
178
+ declare interface FeatureFlagValue {
179
+ [key: string]: boolean;
180
+ }
181
+ export { FeatureFlagValue }
182
+ export { FeatureFlagValue as FeatureFlagValue_alias_1 }
183
+
84
184
  declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
85
185
  export { Field }
86
186
  export { Field as Field_alias_1 }
@@ -223,6 +323,108 @@ declare type LabelRecipeProps = RecipeVariantProps<typeof label>;
223
323
  export { LabelRecipeProps }
224
324
  export { LabelRecipeProps as LabelRecipeProps_alias_1 }
225
325
 
326
+ /**
327
+ * The Modal component is the root element for a customizable modal.
328
+ * @example
329
+ * ```tsx
330
+ * const { modalRef } = useModal()
331
+ *
332
+ * <Modal ref={modalRef}>
333
+ * <ModalIcon icon={$cerberusIcons.alert} />
334
+ * <h2>Modal Heading</h2>
335
+ * <p>Modal description</p>
336
+ * </Modal>
337
+ * ```
338
+ */
339
+ declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDialogElement>>;
340
+ export { Modal }
341
+ export { Modal as Modal_alias_1 }
342
+
343
+ /**
344
+ * The ModalDescription component is a heading element for a customizable modal.
345
+ * @example
346
+ * ```tsx
347
+ * <Modal>
348
+ * <ModalDescription>Modal Heading</ModalDescription>
349
+ * </Modal>
350
+ * ```
351
+ */
352
+ declare function ModalDescription(props: ModalDescriptionProps): JSX_2.Element;
353
+ export { ModalDescription }
354
+ export { ModalDescription as ModalDescription_alias_1 }
355
+
356
+ /**
357
+ * This module contains the ModalDescription component for a customizable modal.
358
+ * @module
359
+ */
360
+ declare type ModalDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
361
+ export { ModalDescriptionProps }
362
+ export { ModalDescriptionProps as ModalDescriptionProps_alias_1 }
363
+
364
+ /**
365
+ * The ModalHeader component is a header element for a customizable modal.
366
+ * @example
367
+ * ```tsx
368
+ * <Modal>
369
+ * <ModalHeader>
370
+ * <h2>Modal Heading</h2>
371
+ * </ModalHeader>
372
+ * </Modal>
373
+ * ```
374
+ */
375
+ declare function ModalHeader(props: ModalHeaderProps): JSX_2.Element;
376
+ export { ModalHeader }
377
+ export { ModalHeader as ModalHeader_alias_1 }
378
+
379
+ /**
380
+ * This module contains the ModalHeader component for a customizable modal.
381
+ * @module
382
+ */
383
+ declare type ModalHeaderProps = HTMLAttributes<HTMLDivElement>;
384
+ export { ModalHeaderProps }
385
+ export { ModalHeaderProps as ModalHeaderProps_alias_1 }
386
+
387
+ /**
388
+ * The ModalHeading component is a heading element for a customizable modal.
389
+ * @example
390
+ * ```tsx
391
+ * <Modal>
392
+ * <ModalHeading>Modal Heading</ModalHeading>
393
+ * </Modal>
394
+ * ```
395
+ */
396
+ declare function ModalHeading(props: ModalHeadingProps): JSX_2.Element;
397
+ export { ModalHeading }
398
+ export { ModalHeading as ModalHeading_alias_1 }
399
+
400
+ /**
401
+ * This module contains the ModalHeading component for a customizable modal.
402
+ * @module
403
+ */
404
+ declare type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>;
405
+ export { ModalHeadingProps }
406
+ export { ModalHeadingProps as ModalHeadingProps_alias_1 }
407
+
408
+ declare function ModalIcon(props: PropsWithChildren<ModalIconProps>): JSX_2.Element;
409
+ export { ModalIcon }
410
+ export { ModalIcon as ModalIcon_alias_1 }
411
+
412
+ declare type ModalIconBaseProps = HTMLAttributes<HTMLDivElement>;
413
+ export { ModalIconBaseProps }
414
+ export { ModalIconBaseProps as ModalIconBaseProps_alias_1 }
415
+
416
+ declare type ModalIconProps = ModalIconBaseProps & ModalIconVariantProps;
417
+ export { ModalIconProps }
418
+ export { ModalIconProps as ModalIconProps_alias_1 }
419
+
420
+ /**
421
+ * This module contains the Modal root component for a customizable modal.
422
+ * @module
423
+ */
424
+ declare type ModalProps = HTMLAttributes<HTMLDialogElement>;
425
+ export { ModalProps }
426
+ export { ModalProps as ModalProps_alias_1 }
427
+
226
428
  declare const MODE_KEY = "cerberus-mode";
227
429
  export { MODE_KEY }
228
430
  export { MODE_KEY as MODE_KEY_alias_1 }
@@ -316,10 +518,75 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
316
518
  export { NavTriggerRef }
317
519
  export { NavTriggerRef as NavTriggerRef_alias_1 }
318
520
 
521
+ /**
522
+ * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
523
+ * @param container - The props for the Portal component.
524
+ * @returns ReactPortal
525
+ */
526
+ declare function Portal(props: PropsWithChildren<PortalProps>): ReactPortal;
527
+ export { Portal }
528
+ export { Portal as Portal_alias_1 }
529
+
530
+ /**
531
+ * This module is the Portal component.
532
+ * @module
533
+ */
534
+ declare interface PortalProps {
535
+ container?: Element | DocumentFragment;
536
+ key?: null | string;
537
+ }
538
+ export { PortalProps }
539
+ export { PortalProps as PortalProps_alias_1 }
540
+
319
541
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
320
542
  export { Positions }
321
543
  export { Positions as Positions_alias_1 }
322
544
 
545
+ /**
546
+ * Provides a prompt modal to the app.
547
+ * @example
548
+ * ```tsx
549
+ * // Wrap the Provider around the root of the feature.
550
+ * <PromptModal>
551
+ * <SomeFeatureSection />
552
+ * </PromptModal>
553
+ *
554
+ * // Use the hook to show the prompt modal.
555
+ * const prompt = usePromptModal()
556
+ *
557
+ * const handleClick = useCallback(async () => {
558
+ * const accepted = await prompt.show({
559
+ * kind: 'destructive',
560
+ * heading: 'Delete channel?',
561
+ * description:
562
+ * 'This will permanently delete a channel on your account. There is no going back.',
563
+ * key: CHANNEL_NAME,
564
+ * actionText: 'Yes, delete channel',
565
+ * cancelText: 'No, cancel',
566
+ * })
567
+ * // do something with accepted
568
+ * }, [prompt])
569
+ * ```
570
+ */
571
+ declare function PromptModal(props: PropsWithChildren<PromptModalProviderProps>): JSX_2.Element;
572
+ export { PromptModal }
573
+ export { PromptModal as PromptModal_alias_1 }
574
+
575
+ declare interface PromptModalProviderProps {
576
+ }
577
+ export { PromptModalProviderProps }
578
+ export { PromptModalProviderProps as PromptModalProviderProps_alias_1 }
579
+
580
+ declare interface PromptModalValue {
581
+ show: (options: ShowPromptModalOptions) => Promise<string>;
582
+ }
583
+ export { PromptModalValue }
584
+ export { PromptModalValue as PromptModalValue_alias_1 }
585
+
586
+ declare type PromptShowResult = ((value: string | PromiseLike<string>) => void) | null;
587
+ export { PromptShowResult }
588
+ export { PromptShowResult as PromptShowResult_alias_1 }
589
+
323
590
  declare function Radio(props: PropsWithChildren<RadioProps>): JSX_2.Element;
324
591
  export { Radio }
325
592
  export { Radio as Radio_alias_1 }
@@ -352,6 +619,35 @@ declare function Show(props: PropsWithChildren<ShowProps>): ReactNode;
352
619
  export { Show }
353
620
  export { Show as Show_alias_1 }
354
621
 
622
+ /**
623
+ * This module provides a context and hook for the confirm modal.
624
+ * @module
625
+ */
626
+ declare interface ShowConfirmModalOptions {
627
+ kind?: 'destructive' | 'non-destructive';
628
+ heading: string;
629
+ description?: string;
630
+ actionText: string;
631
+ cancelText: string;
632
+ }
633
+ export { ShowConfirmModalOptions }
634
+ export { ShowConfirmModalOptions as ShowConfirmModalOptions_alias_1 }
635
+
636
+ /**
637
+ * This module provides a context and hook for the prompt modal.
638
+ * @module
639
+ */
640
+ declare interface ShowPromptModalOptions {
641
+ kind?: 'destructive' | 'non-destructive';
642
+ heading: string;
643
+ description?: string;
644
+ key: string;
645
+ actionText: string;
646
+ cancelText: string;
647
+ }
648
+ export { ShowPromptModalOptions }
649
+ export { ShowPromptModalOptions as ShowPromptModalOptions_alias_1 }
650
+
355
651
  declare interface ShowProps {
356
652
  when: boolean | null | undefined;
357
653
  fallback?: ReactNode;
@@ -359,6 +655,10 @@ declare interface ShowProps {
359
655
  export { ShowProps }
360
656
  export { ShowProps as ShowProps_alias_1 }
361
657
 
658
+ declare type ShowResult = ((value: boolean | PromiseLike<boolean>) => void) | null;
659
+ export { ShowResult }
660
+ export { ShowResult as ShowResult_alias_1 }
661
+
362
662
  declare type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagRecipeProps & {
363
663
  onClick?: never;
364
664
  };
@@ -442,6 +742,7 @@ export { TabProps as TabProps_alias_1 }
442
742
 
443
743
  /**
444
744
  * The Tabs component provides a context to manage tab state.
745
+ * @param id - the id of the tabs component,
445
746
  * @param active - the default active tab id,
446
747
  * @param cache - whether to cache the active tab state in local storage
447
748
  * @example
@@ -458,7 +759,7 @@ export { TabProps as TabProps_alias_1 }
458
759
  * </Tabs>
459
760
  * ```
460
761
  */
461
- declare function Tabs(props: PropsWithChildren<TabsProps>): JSX.Element;
762
+ declare function Tabs(props: PropsWithChildren<TabsProps & TabsVariantProps>): JSX.Element;
462
763
  export { Tabs }
463
764
  export { Tabs as Tabs_alias_1 }
464
765
 
@@ -474,6 +775,7 @@ declare interface TabsContextValue {
474
775
  tabs: MutableRefObject<HTMLButtonElement[]>;
475
776
  id: string;
476
777
  active: string;
778
+ styles: Pretty<Record<'tabList' | 'tab' | 'tabPanel', string>>;
477
779
  onTabUpdate: (active: string) => void;
478
780
  }
479
781
  export { TabsContextValue }
@@ -583,14 +885,44 @@ declare type ToggleProps = ToggleBase & ToggleVariantProps;
583
885
  export { ToggleProps }
584
886
  export { ToggleProps as ToggleProps_alias_1 }
585
887
 
888
+ declare function trapFocus(modalRef: RefObject<HTMLDialogElement>): KeyboardEventHandler<HTMLDialogElement>;
889
+ export { trapFocus }
890
+ export { trapFocus as trapFocus_alias_1 }
891
+
892
+ declare function useConfirmModal(): ConfirmModalValue;
893
+ export { useConfirmModal }
894
+ export { useConfirmModal as useConfirmModal_alias_1 }
895
+
896
+ declare function useFeatureFlags(key: string): boolean;
897
+ export { useFeatureFlags }
898
+ export { useFeatureFlags as useFeatureFlags_alias_1 }
899
+
586
900
  declare function useFieldContext(): FieldContextValue;
587
901
  export { useFieldContext }
588
902
  export { useFieldContext as useFieldContext_alias_1 }
589
903
 
904
+ declare function useModal(): UseModalReturnValue;
905
+ export { useModal }
906
+ export { useModal as useModal_alias_1 }
907
+
908
+ /**
909
+ * This module provides a hook for using a custom modal.
910
+ * @module
911
+ */
912
+ declare interface UseModalReturnValue {
913
+ modalRef: RefObject<HTMLDialogElement>;
914
+ show: () => void;
915
+ close: () => void;
916
+ }
917
+
590
918
  declare function useNavMenuContext(): NavMenuContextValue;
591
919
  export { useNavMenuContext }
592
920
  export { useNavMenuContext as useNavMenuContext_alias_1 }
593
921
 
922
+ declare function usePromptModal(): PromptModalValue;
923
+ export { usePromptModal }
924
+ export { usePromptModal as usePromptModal_alias_1 }
925
+
594
926
  declare function useTabsContext(): TabsContextValue;
595
927
  export { useTabsContext }
596
928
  export { useTabsContext as useTabsContext_alias_1 }
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  useTabsKeyboardNavigation
4
- } from "../chunk-S7HBD2A7.js";
5
- import "../chunk-DQOYTLGB.js";
4
+ } from "../chunk-KFUXGX33.js";
5
+ import "../chunk-7KJIZIAU.js";
6
6
  export {
7
7
  useTabsKeyboardNavigation
8
8
  };
@@ -0,0 +1,7 @@
1
+ import {
2
+ trapFocus
3
+ } from "../chunk-KESKDLX6.js";
4
+ export {
5
+ trapFocus
6
+ };
7
+ //# sourceMappingURL=trap-focus.aria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,25 @@
1
+ // src/components/ModalHeader.tsx
2
+ import { cx } from "@cerberus-design/styled-system/css";
3
+ import { vstack } from "@cerberus-design/styled-system/patterns";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function ModalHeader(props) {
6
+ return /* @__PURE__ */ jsx(
7
+ "div",
8
+ {
9
+ ...props,
10
+ className: cx(
11
+ props.className,
12
+ vstack({
13
+ alignItems: "flex-start",
14
+ gap: "4",
15
+ mb: "8"
16
+ })
17
+ )
18
+ }
19
+ );
20
+ }
21
+
22
+ export {
23
+ ModalHeader
24
+ };
25
+ //# sourceMappingURL=chunk-2F5TB2EV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/ModalHeader.tsx"],"sourcesContent":["import { cx } from '@cerberus-design/styled-system/css'\nimport { vstack } from '@cerberus-design/styled-system/patterns'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeader component for a customizable modal.\n * @module\n */\n\nexport type ModalHeaderProps = HTMLAttributes<HTMLDivElement>\n\n/**\n * The ModalHeader component is a header element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeader>\n * <h2>Modal Heading</h2>\n * </ModalHeader>\n * </Modal>\n * ```\n */\nexport function ModalHeader(props: ModalHeaderProps) {\n return (\n <div\n {...props}\n className={cx(\n props.className,\n vstack({\n alignItems: 'flex-start',\n gap: '4',\n mb: '8',\n }),\n )}\n />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,cAAc;AAuBnB;AAFG,SAAS,YAAY,OAAyB;AACnD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,KAAK;AAAA,UACL,IAAI;AAAA,QACN,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,11 @@
1
+ // src/components/Portal.tsx
2
+ import { createPortal } from "react-dom";
3
+ function Portal(props) {
4
+ const container = props.container || document.body;
5
+ return createPortal(props.children, container, props.key);
6
+ }
7
+
8
+ export {
9
+ Portal
10
+ };
11
+ //# sourceMappingURL=chunk-4CAT3FHV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Portal.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n container?: Element | DocumentFragment\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @param container - The props for the Portal component.\n * @returns ReactPortal\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n}\n"],"mappings":";AACA,SAAS,oBAAoB;AAiBtB,SAAS,OAAO,OAAuC;AAC5D,QAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,SAAO,aAAa,MAAM,UAAU,WAAW,MAAM,GAAG;AAC1D;","names":[]}
@@ -0,0 +1,22 @@
1
+ // src/context/feature-flags.tsx
2
+ import { createContext, useContext } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var FeatureFlagContext = createContext(null);
5
+ function FeatureFlags(props) {
6
+ return /* @__PURE__ */ jsx(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
7
+ }
8
+ function useFeatureFlags(key) {
9
+ const context = useContext(FeatureFlagContext);
10
+ if (context === null) {
11
+ throw new Error(
12
+ "useFeatureFlag must be used within a FeatureFlags Provider"
13
+ );
14
+ }
15
+ return context[key] ?? false;
16
+ }
17
+
18
+ export {
19
+ FeatureFlags,
20
+ useFeatureFlags
21
+ };
22
+ //# sourceMappingURL=chunk-4M3EUP57.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/feature-flags.tsx"],"sourcesContent":["'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\n\n/**\n * This module provides a context and hook for feature flags.\n * @module\n */\n\nexport interface FeatureFlagValue {\n [key: string]: boolean\n}\n\nconst FeatureFlagContext = createContext<FeatureFlagValue | null>(null)\n\nexport interface FeatureFlagProviderProps {\n flags: FeatureFlagValue\n}\n\n/**\n * Provides feature flags to the application.\n * @param flags - The flags data for the provider.\n * @example\n * ```tsx\n * // This should be a JSON file or a server response.\n * const flags = {\n * featureOne: true,\n * featureTwo: false\n * }\n *\n * // Wrap the Provider around the root of your application.\n * <FeatureFlags flags={flags}>\n * <FeatureFlag flag=\"featureOne\">\n * This is visible.\n * </FeatureFlag>\n * <FeatureFlag flag=\"featureTwo\">\n * This is hidden.\n * </FeatureFlag>\n * </FeatureFlags>\n * ```\n */\nexport function FeatureFlags(\n props: PropsWithChildren<FeatureFlagProviderProps>,\n) {\n return (\n <FeatureFlagContext.Provider value={props.flags}>\n {props.children}\n </FeatureFlagContext.Provider>\n )\n}\n\nexport function useFeatureFlags(key: string): boolean {\n const context = useContext(FeatureFlagContext)\n if (context === null) {\n throw new Error(\n 'useFeatureFlag must be used within a FeatureFlags Provider',\n )\n }\n return context[key] ?? false\n}\n"],"mappings":";AAEA,SAAS,eAAe,kBAA0C;AA2C9D;AAhCJ,IAAM,qBAAqB,cAAuC,IAAI;AA4B/D,SAAS,aACd,OACA;AACA,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,OACvC,gBAAM,UACT;AAEJ;AAEO,SAAS,gBAAgB,KAAsB;AACpD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,QAAQ,GAAG,KAAK;AACzB;","names":[]}
@@ -1,12 +1,12 @@
1
- import {
2
- useFieldContext
3
- } from "./chunk-ZAU4JVLL.js";
4
1
  import {
5
2
  Show
6
3
  } from "./chunk-4O4QFF4S.js";
4
+ import {
5
+ useFieldContext
6
+ } from "./chunk-ZAU4JVLL.js";
7
7
  import {
8
8
  $cerberusIcons
9
- } from "./chunk-3CBN7U25.js";
9
+ } from "./chunk-6TXQZ3PB.js";
10
10
 
11
11
  // src/components/Input.tsx
12
12
  import { input } from "@cerberus/styled-system/recipes";
@@ -39,4 +39,4 @@ function Input(props) {
39
39
  export {
40
40
  Input
41
41
  };
42
- //# sourceMappingURL=chunk-X4YQ27D5.js.map
42
+ //# sourceMappingURL=chunk-5GEC53G7.js.map
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-4O4QFF4S.js";
4
4
  import {
5
5
  useTabsContext
6
- } from "./chunk-DQOYTLGB.js";
6
+ } from "./chunk-7KJIZIAU.js";
7
7
 
8
8
  // src/components/TabPanel.tsx
9
- import { css, cx } from "@cerberus/styled-system/css";
9
+ import { cx } from "@cerberus/styled-system/css";
10
10
  import { useMemo } from "react";
11
11
  import { jsx } from "react/jsx-runtime";
12
12
  function TabPanel(props) {
13
13
  const { tab, ...nativeProps } = props;
14
- const { active } = useTabsContext();
14
+ const { active, styles } = useTabsContext();
15
15
  const isActive = useMemo(() => active === tab, [active, tab]);
16
16
  return /* @__PURE__ */ jsx(Show, { when: isActive, children: /* @__PURE__ */ jsx(
17
17
  "div",
@@ -19,18 +19,7 @@ function TabPanel(props) {
19
19
  ...nativeProps,
20
20
  ...isActive && { tabIndex: 0 },
21
21
  "aria-labelledby": tab,
22
- className: cx(
23
- nativeProps.className,
24
- css({
25
- rounded: "md",
26
- _focusVisible: {
27
- boxShadow: "none",
28
- outline: "3px solid",
29
- outlineColor: "action.border.focus",
30
- outlineOffset: "2px"
31
- }
32
- })
33
- ),
22
+ className: cx(nativeProps.className, styles.tabPanel),
34
23
  id: `panel:${tab}`,
35
24
  role: "tabpanel"
36
25
  }
@@ -40,4 +29,4 @@ function TabPanel(props) {
40
29
  export {
41
30
  TabPanel
42
31
  };
43
- //# sourceMappingURL=chunk-YJCWUN33.js.map
32
+ //# sourceMappingURL=chunk-67S42J4B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/TabPanel.tsx"],"sourcesContent":["'use client'\n\nimport { cx } from '@cerberus/styled-system/css'\nimport { useMemo, type HTMLAttributes } from 'react'\nimport { useTabsContext } from '../context/tabs'\nimport { Show } from './Show'\n\n/**\n * This module provides a TabPanel component.\n * @module\n */\n\nexport interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {\n tab: string\n}\n\n/**\n * The TabPanel component provides a panel element to be used in a Tabs provider.\n * @param tab - the value of the tab that will be tracked as the active tab and used for aria attributes\n * @example\n * ```tsx\n * <TabPanel tab=\"overview\">\n * Overview content\n * </TabPanel>\n * ```\n */\nexport function TabPanel(props: TabPanelProps) {\n const { tab, ...nativeProps } = props\n const { active, styles } = useTabsContext()\n const isActive = useMemo(() => active === tab, [active, tab])\n\n return (\n <Show when={isActive}>\n <div\n {...nativeProps}\n {...(isActive && { tabIndex: 0 })}\n aria-labelledby={tab}\n className={cx(nativeProps.className, styles.tabPanel)}\n id={`panel:${tab}`}\n role=\"tabpanel\"\n />\n </Show>\n )\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,eAAoC;AA8BvC;AAPC,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,KAAK,GAAG,YAAY,IAAI;AAChC,QAAM,EAAE,QAAQ,OAAO,IAAI,eAAe;AAC1C,QAAM,WAAW,QAAQ,MAAM,WAAW,KAAK,CAAC,QAAQ,GAAG,CAAC;AAE5D,SACE,oBAAC,QAAK,MAAM,UACV;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,YAAY,EAAE,UAAU,EAAE;AAAA,MAC/B,mBAAiB;AAAA,MACjB,WAAW,GAAG,YAAY,WAAW,OAAO,QAAQ;AAAA,MACpD,IAAI,SAAS,GAAG;AAAA,MAChB,MAAK;AAAA;AAAA,EACP,GACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultIcons
3
- } from "./chunk-5MNCW677.js";
3
+ } from "./chunk-C45DY4VE.js";
4
4
 
5
5
  // src/config/defineIcons.ts
6
6
  function _validateIconsProperties(icons) {
@@ -12,7 +12,10 @@ function _validateIconsProperties(icons) {
12
12
  }
13
13
  function defineIcons(icons) {
14
14
  _validateIconsProperties(icons);
15
- $cerberusIcons = icons;
15
+ $cerberusIcons = {
16
+ ...defaultIcons,
17
+ ...icons
18
+ };
16
19
  return $cerberusIcons;
17
20
  }
18
21
  var $cerberusIcons = defaultIcons;
@@ -21,4 +24,4 @@ export {
21
24
  defineIcons,
22
25
  $cerberusIcons
23
26
  };
24
- //# sourceMappingURL=chunk-3CBN7U25.js.map
27
+ //# sourceMappingURL=chunk-6TXQZ3PB.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): Required<DefinedIcons> {\n _validateIconsProperties(icons)\n $cerberusIcons = {\n ...defaultIcons,\n ...icons,\n } as Required<DefinedIcons>\n return $cerberusIcons\n}\n\n// Default icons\n\nexport let $cerberusIcons = defaultIcons as Required<DefinedIcons>\n"],"mappings":";;;;;AAEA,SAAS,yBAAyB,OAAqB;AACrD,MAAI,CAAC,MAAM,SAAS;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,YAAY,OAA6C;AACvE,2BAAyB,KAAK;AAC9B,mBAAiB;AAAA,IACf,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACA,SAAO;AACT;AAIO,IAAI,iBAAiB;","names":[]}