@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
@@ -1,50 +1,57 @@
1
+ import {
2
+ Toggle
3
+ } from "./chunk-TAZI77TP.js";
4
+ import {
5
+ ConfirmModal,
6
+ useConfirmModal
7
+ } from "./chunk-D3ZXZA3U.js";
8
+ import {
9
+ PromptModal,
10
+ usePromptModal
11
+ } from "./chunk-DGPLSWFJ.js";
12
+ import {
13
+ Portal
14
+ } from "./chunk-4CAT3FHV.js";
1
15
  import {
2
16
  Radio
3
17
  } from "./chunk-WE3JNSNO.js";
4
18
  import {
5
19
  Tab
6
- } from "./chunk-YA2UV2AB.js";
20
+ } from "./chunk-JI4YTPEJ.js";
7
21
  import {
8
22
  TabList
9
- } from "./chunk-5GSXIYD3.js";
23
+ } from "./chunk-X2JMXTBH.js";
10
24
  import {
11
25
  TabPanel
12
- } from "./chunk-YJCWUN33.js";
26
+ } from "./chunk-67S42J4B.js";
13
27
  import {
14
28
  Tag
15
- } from "./chunk-5XNLWIZO.js";
29
+ } from "./chunk-EVEEQRH6.js";
16
30
  import {
17
31
  Textarea
18
32
  } from "./chunk-TCO46FK7.js";
19
33
  import {
20
- Toggle
21
- } from "./chunk-734PGVLT.js";
34
+ Modal
35
+ } from "./chunk-TPFNVGYA.js";
22
36
  import {
23
- Button
24
- } from "./chunk-2ATICEW3.js";
37
+ ModalDescription
38
+ } from "./chunk-UPODPCRD.js";
25
39
  import {
26
- FieldMessage
27
- } from "./chunk-VGHVH2T3.js";
40
+ ModalHeader
41
+ } from "./chunk-2F5TB2EV.js";
28
42
  import {
29
- IconButton
30
- } from "./chunk-SLHX5K6I.js";
43
+ ModalHeading
44
+ } from "./chunk-OGSAAB6K.js";
31
45
  import {
32
- Input
33
- } from "./chunk-X4YQ27D5.js";
34
- import {
35
- Label
36
- } from "./chunk-HE3HFKYU.js";
37
- import {
38
- Field,
39
- useFieldContext
40
- } from "./chunk-ZAU4JVLL.js";
46
+ ModalIcon
47
+ } from "./chunk-G3JEWPLM.js";
41
48
  import {
42
49
  NavMenuLink
43
50
  } from "./chunk-6DIGPXAD.js";
44
51
  import {
45
52
  NavMenuList,
46
53
  getPosition
47
- } from "./chunk-G2QMBSK5.js";
54
+ } from "./chunk-PMCYXRAH.js";
48
55
  import {
49
56
  NavMenuTrigger
50
57
  } from "./chunk-RPZAPUCF.js";
@@ -52,49 +59,91 @@ import {
52
59
  NavMenu,
53
60
  useNavMenuContext
54
61
  } from "./chunk-KJUCHZHV.js";
62
+ import {
63
+ MODE_KEY,
64
+ THEME_KEY,
65
+ ThemeProvider,
66
+ useTheme,
67
+ useThemeContext
68
+ } from "./chunk-SXXWC6UD.js";
69
+ import {
70
+ useToggle
71
+ } from "./chunk-SCQVXJBT.js";
72
+ import {
73
+ Button
74
+ } from "./chunk-2ATICEW3.js";
75
+ import {
76
+ FeatureFlag
77
+ } from "./chunk-VULPMZUW.js";
78
+ import {
79
+ FeatureFlags,
80
+ useFeatureFlags
81
+ } from "./chunk-4M3EUP57.js";
82
+ import {
83
+ FieldMessage
84
+ } from "./chunk-VGHVH2T3.js";
85
+ import {
86
+ IconButton
87
+ } from "./chunk-SLHX5K6I.js";
88
+ import {
89
+ Input
90
+ } from "./chunk-5GEC53G7.js";
91
+ import {
92
+ Label
93
+ } from "./chunk-CU7HXAKM.js";
55
94
  import {
56
95
  Show
57
96
  } from "./chunk-4O4QFF4S.js";
97
+ import {
98
+ Field,
99
+ useFieldContext
100
+ } from "./chunk-ZAU4JVLL.js";
58
101
  import "./chunk-55J6XMHW.js";
59
102
  import {
60
103
  createNavTriggerProps
61
104
  } from "./chunk-JF76VIL3.js";
62
105
  import {
63
106
  useTabsKeyboardNavigation
64
- } from "./chunk-S7HBD2A7.js";
107
+ } from "./chunk-KFUXGX33.js";
65
108
  import {
66
109
  Tabs,
67
110
  TabsContext,
68
111
  useTabsContext
69
- } from "./chunk-DQOYTLGB.js";
112
+ } from "./chunk-7KJIZIAU.js";
113
+ import {
114
+ trapFocus
115
+ } from "./chunk-KESKDLX6.js";
70
116
  import {
71
117
  $cerberusIcons,
72
118
  defineIcons
73
- } from "./chunk-3CBN7U25.js";
74
- import "./chunk-5MNCW677.js";
75
- import {
76
- MODE_KEY,
77
- THEME_KEY,
78
- ThemeProvider,
79
- useTheme,
80
- useThemeContext
81
- } from "./chunk-SXXWC6UD.js";
119
+ } from "./chunk-6TXQZ3PB.js";
120
+ import "./chunk-C45DY4VE.js";
82
121
  import {
83
- useToggle
84
- } from "./chunk-SCQVXJBT.js";
122
+ useModal
123
+ } from "./chunk-TZNYJ3G7.js";
85
124
  export {
86
125
  $cerberusIcons,
87
126
  Button,
127
+ ConfirmModal,
128
+ FeatureFlag,
129
+ FeatureFlags,
88
130
  Field,
89
131
  FieldMessage,
90
132
  IconButton,
91
133
  Input,
92
134
  Label,
93
135
  MODE_KEY,
136
+ Modal,
137
+ ModalDescription,
138
+ ModalHeader,
139
+ ModalHeading,
140
+ ModalIcon,
94
141
  NavMenu,
95
142
  NavMenuLink,
96
143
  NavMenuList,
97
144
  NavMenuTrigger,
145
+ Portal,
146
+ PromptModal,
98
147
  Radio,
99
148
  Show,
100
149
  THEME_KEY,
@@ -110,8 +159,13 @@ export {
110
159
  createNavTriggerProps,
111
160
  defineIcons,
112
161
  getPosition,
162
+ trapFocus,
163
+ useConfirmModal,
164
+ useFeatureFlags,
113
165
  useFieldContext,
166
+ useModal,
114
167
  useNavMenuContext,
168
+ usePromptModal,
115
169
  useTabsContext,
116
170
  useTabsKeyboardNavigation,
117
171
  useTheme,
@@ -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-JIZQFTW6.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":[]}