@konstructio/ui 0.0.2

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 (256) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +19 -0
  3. package/dist/AlertDialogTrigger-BIbxXexQ.js +553 -0
  4. package/dist/Combination-Cmu9JRkv.js +479 -0
  5. package/dist/Modal-CO0_SnXD.js +909 -0
  6. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  7. package/dist/chevron-up-Cmu1oXfj.js +54 -0
  8. package/dist/components/AlertDialog/AlertDialog.d.ts +3 -0
  9. package/dist/components/AlertDialog/AlertDialog.js +54 -0
  10. package/dist/components/AlertDialog/AlertDialog.types.d.ts +13 -0
  11. package/dist/components/AlertDialog/AlertDialog.types.js +1 -0
  12. package/dist/components/AlertDialog/AlertDialog.variants.d.ts +3 -0
  13. package/dist/components/AlertDialog/AlertDialog.variants.js +16 -0
  14. package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +3 -0
  15. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +10 -0
  16. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +6 -0
  17. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +1 -0
  18. package/dist/components/AlertDialog/components/index.d.ts +1 -0
  19. package/dist/components/AlertDialog/components/index.js +4 -0
  20. package/dist/components/AlertDialog/hooks/index.d.ts +1 -0
  21. package/dist/components/AlertDialog/hooks/index.js +4 -0
  22. package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +7 -0
  23. package/dist/components/AlertDialog/hooks/useAlertDialog.js +10 -0
  24. package/dist/components/Autocomplete/Autocomplete.d.ts +3 -0
  25. package/dist/components/Autocomplete/Autocomplete.js +84 -0
  26. package/dist/components/Autocomplete/Autocomplete.types.d.ts +18 -0
  27. package/dist/components/Autocomplete/Autocomplete.types.js +1 -0
  28. package/dist/components/Autocomplete/Autocomplete.variants.d.ts +8 -0
  29. package/dist/components/Autocomplete/Autocomplete.variants.js +61 -0
  30. package/dist/components/Autocomplete/components/List.d.ts +3 -0
  31. package/dist/components/Autocomplete/components/List.js +57 -0
  32. package/dist/components/Autocomplete/components/List.types.d.ts +13 -0
  33. package/dist/components/Autocomplete/components/List.types.js +1 -0
  34. package/dist/components/Autocomplete/components/List.variants.d.ts +16 -0
  35. package/dist/components/Autocomplete/components/List.variants.js +81 -0
  36. package/dist/components/Autocomplete/hooks/index.d.ts +2 -0
  37. package/dist/components/Autocomplete/hooks/index.js +6 -0
  38. package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +17 -0
  39. package/dist/components/Autocomplete/hooks/useAutocomplete.js +81 -0
  40. package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +10 -0
  41. package/dist/components/Autocomplete/hooks/useNavigationList.js +78 -0
  42. package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
  43. package/dist/components/Breadcrumb/Breadcrumb.js +460 -0
  44. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +11 -0
  45. package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
  46. package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +12 -0
  47. package/dist/components/Breadcrumb/Breadcrumb.variants.js +61 -0
  48. package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +3 -0
  49. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +5 -0
  50. package/dist/components/Button/Button.d.ts +4 -0
  51. package/dist/components/Button/Button.js +42 -0
  52. package/dist/components/Button/Button.types.d.ts +7 -0
  53. package/dist/components/Button/Button.types.js +1 -0
  54. package/dist/components/Button/Button.variants.d.ts +6 -0
  55. package/dist/components/Button/Button.variants.js +102 -0
  56. package/dist/components/Checkbox/Checkbox.d.ts +3 -0
  57. package/dist/components/Checkbox/Checkbox.js +233 -0
  58. package/dist/components/Checkbox/Checkbox.types.d.ts +12 -0
  59. package/dist/components/Checkbox/Checkbox.types.js +1 -0
  60. package/dist/components/Checkbox/Checkbox.variants.d.ts +9 -0
  61. package/dist/components/Checkbox/Checkbox.variants.js +82 -0
  62. package/dist/components/Dropdown/Dropdown.d.ts +3 -0
  63. package/dist/components/Dropdown/Dropdown.js +10 -0
  64. package/dist/components/Dropdown/Dropdown.types.d.ts +15 -0
  65. package/dist/components/Dropdown/Dropdown.types.js +1 -0
  66. package/dist/components/Dropdown/Dropdown.variants.d.ts +3 -0
  67. package/dist/components/Dropdown/Dropdown.variants.js +45 -0
  68. package/dist/components/Dropdown/components/EmptyList.d.ts +2 -0
  69. package/dist/components/Dropdown/components/EmptyList.js +5 -0
  70. package/dist/components/Dropdown/components/List/List.d.ts +3 -0
  71. package/dist/components/Dropdown/components/List/List.js +25 -0
  72. package/dist/components/Dropdown/components/List/List.types.d.ts +8 -0
  73. package/dist/components/Dropdown/components/List/List.types.js +1 -0
  74. package/dist/components/Dropdown/components/List/List.variants.d.ts +3 -0
  75. package/dist/components/Dropdown/components/List/List.variants.js +34 -0
  76. package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +3 -0
  77. package/dist/components/Dropdown/components/ListItem/ListItem.js +29 -0
  78. package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +4 -0
  79. package/dist/components/Dropdown/components/ListItem/ListItem.types.js +1 -0
  80. package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +3 -0
  81. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +19 -0
  82. package/dist/components/Dropdown/components/Wrapper.d.ts +3 -0
  83. package/dist/components/Dropdown/components/Wrapper.js +90 -0
  84. package/dist/components/Dropdown/components/index.d.ts +3 -0
  85. package/dist/components/Dropdown/components/index.js +8 -0
  86. package/dist/components/Dropdown/contexts/dropdown.context.d.ts +8 -0
  87. package/dist/components/Dropdown/contexts/dropdown.context.js +14 -0
  88. package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +2 -0
  89. package/dist/components/Dropdown/contexts/dropdown.hook.js +11 -0
  90. package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +2 -0
  91. package/dist/components/Dropdown/contexts/dropdown.provider.js +11 -0
  92. package/dist/components/Dropdown/contexts/index.d.ts +2 -0
  93. package/dist/components/Dropdown/contexts/index.js +6 -0
  94. package/dist/components/Dropdown/hooks/useDropdown.d.ts +11 -0
  95. package/dist/components/Dropdown/hooks/useDropdown.js +65 -0
  96. package/dist/components/Dropdown/hooks/useNavigationList.d.ts +8 -0
  97. package/dist/components/Dropdown/hooks/useNavigationList.js +66 -0
  98. package/dist/components/Input/Input.d.ts +3 -0
  99. package/dist/components/Input/Input.js +178 -0
  100. package/dist/components/Input/Input.types.d.ts +9 -0
  101. package/dist/components/Input/Input.types.js +1 -0
  102. package/dist/components/Input/Input.variants.d.ts +4 -0
  103. package/dist/components/Input/Input.variants.js +43 -0
  104. package/dist/components/Modal/Modal.d.ts +8 -0
  105. package/dist/components/Modal/Modal.js +10 -0
  106. package/dist/components/Modal/Modal.types.d.ts +12 -0
  107. package/dist/components/Modal/Modal.types.js +1 -0
  108. package/dist/components/Modal/components/Body/Body.d.ts +3 -0
  109. package/dist/components/Modal/components/Body/Body.js +7 -0
  110. package/dist/components/Modal/components/Body/Body.types.d.ts +5 -0
  111. package/dist/components/Modal/components/Body/Body.types.js +1 -0
  112. package/dist/components/Modal/components/Footer/Footer.d.ts +3 -0
  113. package/dist/components/Modal/components/Footer/Footer.js +6 -0
  114. package/dist/components/Modal/components/Footer/Footer.types.d.ts +5 -0
  115. package/dist/components/Modal/components/Footer/Footer.types.js +1 -0
  116. package/dist/components/Modal/components/Header/Header.d.ts +3 -0
  117. package/dist/components/Modal/components/Header/Header.js +6 -0
  118. package/dist/components/Modal/components/Header/Header.types.d.ts +5 -0
  119. package/dist/components/Modal/components/Header/Header.types.js +1 -0
  120. package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +3 -0
  121. package/dist/components/Modal/components/Wrapper/Wrapper.js +13 -0
  122. package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +7 -0
  123. package/dist/components/Modal/components/Wrapper/Wrapper.types.js +1 -0
  124. package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +6 -0
  125. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +48 -0
  126. package/dist/components/Modal/components/index.d.ts +4 -0
  127. package/dist/components/Modal/components/index.js +10 -0
  128. package/dist/components/Modal/contexts/Modal.context.d.ts +2 -0
  129. package/dist/components/Modal/contexts/Modal.context.js +20 -0
  130. package/dist/components/Modal/contexts/Modal.provider.d.ts +4 -0
  131. package/dist/components/Modal/contexts/Modal.provider.js +26 -0
  132. package/dist/components/Modal/contexts/Modal.types.d.ts +9 -0
  133. package/dist/components/Modal/contexts/Modal.types.js +1 -0
  134. package/dist/components/Modal/contexts/index.d.ts +1 -0
  135. package/dist/components/Modal/contexts/index.js +4 -0
  136. package/dist/components/Modal/hooks/index.d.ts +1 -0
  137. package/dist/components/Modal/hooks/index.js +4 -0
  138. package/dist/components/Modal/hooks/useModal.d.ts +9 -0
  139. package/dist/components/Modal/hooks/useModal.js +27 -0
  140. package/dist/components/NumberInput/NumberInput.d.ts +3 -0
  141. package/dist/components/NumberInput/NumberInput.js +181 -0
  142. package/dist/components/NumberInput/NumberInput.types.d.ts +11 -0
  143. package/dist/components/NumberInput/NumberInput.types.js +1 -0
  144. package/dist/components/NumberInput/NumberInput.variants.d.ts +11 -0
  145. package/dist/components/NumberInput/NumberInput.variants.js +78 -0
  146. package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
  147. package/dist/components/ProgressBar/ProgressBar.js +37 -0
  148. package/dist/components/ProgressBar/ProgressBar.types.d.ts +8 -0
  149. package/dist/components/ProgressBar/ProgressBar.types.js +1 -0
  150. package/dist/components/ProgressBar/ProgressBar.variants.d.ts +7 -0
  151. package/dist/components/ProgressBar/ProgressBar.variants.js +62 -0
  152. package/dist/components/Radio/Radio.d.ts +3 -0
  153. package/dist/components/Radio/Radio.js +58 -0
  154. package/dist/components/Radio/Radio.types.d.ts +12 -0
  155. package/dist/components/Radio/Radio.types.js +1 -0
  156. package/dist/components/Radio/Radio.variants.d.ts +3 -0
  157. package/dist/components/Radio/Radio.variants.js +49 -0
  158. package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
  159. package/dist/components/RadioGroup/RadioGroup.js +37 -0
  160. package/dist/components/RadioGroup/RadioGroup.types.d.ts +11 -0
  161. package/dist/components/RadioGroup/RadioGroup.types.js +1 -0
  162. package/dist/components/Range/Range.d.ts +3 -0
  163. package/dist/components/Range/Range.js +70 -0
  164. package/dist/components/Range/Range.types.d.ts +13 -0
  165. package/dist/components/Range/Range.types.js +1 -0
  166. package/dist/components/Range/Range.variants.d.ts +14 -0
  167. package/dist/components/Range/Range.variants.js +93 -0
  168. package/dist/components/Slider/Slider.d.ts +3 -0
  169. package/dist/components/Slider/Slider.js +52 -0
  170. package/dist/components/Slider/Slider.types.d.ts +13 -0
  171. package/dist/components/Slider/Slider.types.js +1 -0
  172. package/dist/components/Slider/Slider.variants.d.ts +11 -0
  173. package/dist/components/Slider/Slider.variants.js +69 -0
  174. package/dist/components/Switch/Switch.d.ts +3 -0
  175. package/dist/components/Switch/Switch.js +176 -0
  176. package/dist/components/Switch/Switch.types.d.ts +10 -0
  177. package/dist/components/Switch/Switch.types.js +1 -0
  178. package/dist/components/Switch/Switch.variants.d.ts +6 -0
  179. package/dist/components/Switch/Switch.variants.js +58 -0
  180. package/dist/components/Tag/Tag.d.ts +3 -0
  181. package/dist/components/Tag/Tag.js +6 -0
  182. package/dist/components/Tag/Tag.types.d.ts +4 -0
  183. package/dist/components/Tag/Tag.types.js +1 -0
  184. package/dist/components/Tag/Tag.variants.d.ts +3 -0
  185. package/dist/components/Tag/Tag.variants.js +31 -0
  186. package/dist/components/TagSelect/TagSelect.d.ts +3 -0
  187. package/dist/components/TagSelect/TagSelect.js +75 -0
  188. package/dist/components/TagSelect/TagSelect.types.d.ts +9 -0
  189. package/dist/components/TagSelect/TagSelect.types.js +1 -0
  190. package/dist/components/TagSelect/TagSelect.variants.d.ts +9 -0
  191. package/dist/components/TagSelect/TagSelect.variants.js +83 -0
  192. package/dist/components/TagSelect/hooks/useTagSelect.d.ts +9 -0
  193. package/dist/components/TagSelect/hooks/useTagSelect.js +39 -0
  194. package/dist/components/TextArea/TextArea.d.ts +3 -0
  195. package/dist/components/TextArea/TextArea.js +34 -0
  196. package/dist/components/TextArea/TextArea.types.d.ts +10 -0
  197. package/dist/components/TextArea/TextArea.types.js +1 -0
  198. package/dist/components/TextArea/TextArea.variants.d.ts +3 -0
  199. package/dist/components/TextArea/TextArea.variants.js +34 -0
  200. package/dist/components/Toast/Toast.d.ts +3 -0
  201. package/dist/components/Toast/Toast.js +471 -0
  202. package/dist/components/Toast/Toast.types.d.ts +12 -0
  203. package/dist/components/Toast/Toast.types.js +1 -0
  204. package/dist/components/Toast/Toast.variants.d.ts +9 -0
  205. package/dist/components/Toast/Toast.variants.js +74 -0
  206. package/dist/components/Tooltip/Tooltip.d.ts +3 -0
  207. package/dist/components/Tooltip/Tooltip.js +42 -0
  208. package/dist/components/Tooltip/Tooltip.types.d.ts +8 -0
  209. package/dist/components/Tooltip/Tooltip.types.js +1 -0
  210. package/dist/components/Tooltip/Tooltip.variants.d.ts +8 -0
  211. package/dist/components/Tooltip/Tooltip.variants.js +93 -0
  212. package/dist/components/Tooltip/hooks/useTooltip.d.ts +4 -0
  213. package/dist/components/Tooltip/hooks/useTooltip.js +25 -0
  214. package/dist/components/index.d.ts +19 -0
  215. package/dist/components/index.js +40 -0
  216. package/dist/contexts/index.d.ts +3 -0
  217. package/dist/contexts/index.js +8 -0
  218. package/dist/contexts/theme.context.d.ts +6 -0
  219. package/dist/contexts/theme.context.js +10 -0
  220. package/dist/contexts/theme.hook.d.ts +7 -0
  221. package/dist/contexts/theme.hook.js +9 -0
  222. package/dist/contexts/theme.provider.d.ts +7 -0
  223. package/dist/contexts/theme.provider.js +17 -0
  224. package/dist/hooks/index.d.ts +1 -0
  225. package/dist/hooks/index.js +4 -0
  226. package/dist/hooks/useToggle.d.ts +1 -0
  227. package/dist/hooks/useToggle.js +11 -0
  228. package/dist/index-2K8qjK4R.js +145 -0
  229. package/dist/index-2hJuj4UN.js +19069 -0
  230. package/dist/index-4qm4jAkj.js +92 -0
  231. package/dist/index-8vgf-x5i.js +118 -0
  232. package/dist/index-BJ7FQg17.js +35 -0
  233. package/dist/index-B_GWswUP.js +71 -0
  234. package/dist/index-BqM_XclQ.js +94 -0
  235. package/dist/index-BwYCDOHZ.js +44 -0
  236. package/dist/index-BxeV34ij.js +32 -0
  237. package/dist/index-CCavb-1K.js +57 -0
  238. package/dist/index-DFbnnPzA.js +423 -0
  239. package/dist/index-DQMInta3.js +663 -0
  240. package/dist/index.d.ts +4 -0
  241. package/dist/index.js +50 -0
  242. package/dist/js.cookie-OLEfuq_g.js +74 -0
  243. package/dist/package.json +118 -0
  244. package/dist/plugins/index.d.ts +1 -0
  245. package/dist/plugins/index.js +4 -0
  246. package/dist/plugins/konstruct.d.ts +4 -0
  247. package/dist/plugins/konstruct.js +104 -0
  248. package/dist/plugins/utils/colors.d.ts +206 -0
  249. package/dist/plugins/utils/colors.js +626 -0
  250. package/dist/styles.css +1 -0
  251. package/dist/styles.d.ts +0 -0
  252. package/dist/styles.js +1 -0
  253. package/dist/useBreadcrumb-BSMnc4Fu.js +341 -0
  254. package/dist/utils/index.d.ts +4 -0
  255. package/dist/utils/index.js +2278 -0
  256. package/package.json +118 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2024] [Jesús Manuel Fuentes Trejo]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # Konstruct React Component Library
2
+
3
+ This repository contains a set of reusable and customizable React components built for **Konstruct**'s infrastructure and Kubernetes products. These components aim to streamline the development process, ensuring consistency and high-quality UI for **Kubefirst**, **Colony**, and other future projects.
4
+
5
+ ## Features:
6
+
7
+ - **Reusable**: Designed to be used across different projects, reducing development time and effort.
8
+ - **Customizable**: Easily adjustable to fit specific needs or branding requirements.
9
+ - **Responsive**: Optimized for all screen sizes, ensuring a seamless experience on both desktop and mobile.
10
+ - **Accessible**: Built with accessibility in mind, following best practices to ensure compatibility with all users.
11
+ - **Tailwind CSS Integration**: Seamlessly integrated with Tailwind CSS for rapid UI development and easy theming.
12
+
13
+ ## Installation:
14
+
15
+ Provide instructions on how to install and use the components within your projects.
16
+
17
+ ## Contribution:
18
+
19
+ Guidelines for contributing to the repository.
@@ -0,0 +1,553 @@
1
+ import { jsx as c, jsxs as U, Fragment as j } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { u as xe, b as Y, c as ee, d as R, e as Le, a as ke } from "./index-8vgf-x5i.js";
4
+ import { u as O, S as We, a as $e } from "./index-CCavb-1K.js";
5
+ import { D as Ue, P as Ge } from "./index-2K8qjK4R.js";
6
+ import { P } from "./index-BJ7FQg17.js";
7
+ import { P as G } from "./index-B_GWswUP.js";
8
+ import { R as Ke } from "./Combination-Cmu9JRkv.js";
9
+ import "./contexts/theme.context.js";
10
+ import { useTheme as Be } from "./contexts/theme.hook.js";
11
+ import "./js.cookie-OLEfuq_g.js";
12
+ import { Button as He } from "./components/Button/Button.js";
13
+ var qe = i.useId || (() => {
14
+ }), Ve = 0;
15
+ function x(e) {
16
+ const [o, t] = i.useState(qe());
17
+ return xe(() => {
18
+ e || t((r) => r ?? String(Ve++));
19
+ }, [e]), e || (o ? `radix-${o}` : "");
20
+ }
21
+ var L = "focusScope.autoFocusOnMount", k = "focusScope.autoFocusOnUnmount", Z = { bubbles: !1, cancelable: !0 }, je = "FocusScope", te = i.forwardRef((e, o) => {
22
+ const {
23
+ loop: t = !1,
24
+ trapped: r = !1,
25
+ onMountAutoFocus: n,
26
+ onUnmountAutoFocus: a,
27
+ ...l
28
+ } = e, [s, g] = i.useState(null), f = Y(n), D = Y(a), u = i.useRef(null), p = O(o, (d) => g(d)), v = i.useRef({
29
+ paused: !1,
30
+ pause() {
31
+ this.paused = !0;
32
+ },
33
+ resume() {
34
+ this.paused = !1;
35
+ }
36
+ }).current;
37
+ i.useEffect(() => {
38
+ if (r) {
39
+ let d = function(h) {
40
+ if (v.paused || !s) return;
41
+ const E = h.target;
42
+ s.contains(E) ? u.current = E : b(u.current, { select: !0 });
43
+ }, C = function(h) {
44
+ if (v.paused || !s) return;
45
+ const E = h.relatedTarget;
46
+ E !== null && (s.contains(E) || b(u.current, { select: !0 }));
47
+ }, m = function(h) {
48
+ if (document.activeElement === document.body)
49
+ for (const V of h)
50
+ V.removedNodes.length > 0 && b(s);
51
+ };
52
+ document.addEventListener("focusin", d), document.addEventListener("focusout", C);
53
+ const S = new MutationObserver(m);
54
+ return s && S.observe(s, { childList: !0, subtree: !0 }), () => {
55
+ document.removeEventListener("focusin", d), document.removeEventListener("focusout", C), S.disconnect();
56
+ };
57
+ }
58
+ }, [r, s, v.paused]), i.useEffect(() => {
59
+ if (s) {
60
+ J.add(v);
61
+ const d = document.activeElement;
62
+ if (!s.contains(d)) {
63
+ const m = new CustomEvent(L, Z);
64
+ s.addEventListener(L, f), s.dispatchEvent(m), m.defaultPrevented || (Ye(Xe(oe(s)), { select: !0 }), document.activeElement === d && b(s));
65
+ }
66
+ return () => {
67
+ s.removeEventListener(L, f), setTimeout(() => {
68
+ const m = new CustomEvent(k, Z);
69
+ s.addEventListener(k, D), s.dispatchEvent(m), m.defaultPrevented || b(d ?? document.body, { select: !0 }), s.removeEventListener(k, D), J.remove(v);
70
+ }, 0);
71
+ };
72
+ }
73
+ }, [s, f, D, v]);
74
+ const I = i.useCallback(
75
+ (d) => {
76
+ if (!t && !r || v.paused) return;
77
+ const C = d.key === "Tab" && !d.altKey && !d.ctrlKey && !d.metaKey, m = document.activeElement;
78
+ if (C && m) {
79
+ const S = d.currentTarget, [h, E] = Ze(S);
80
+ h && E ? !d.shiftKey && m === E ? (d.preventDefault(), t && b(h, { select: !0 })) : d.shiftKey && m === h && (d.preventDefault(), t && b(E, { select: !0 })) : m === S && d.preventDefault();
81
+ }
82
+ },
83
+ [t, r, v.paused]
84
+ );
85
+ return /* @__PURE__ */ c(P.div, { tabIndex: -1, ...l, ref: p, onKeyDown: I });
86
+ });
87
+ te.displayName = je;
88
+ function Ye(e, { select: o = !1 } = {}) {
89
+ const t = document.activeElement;
90
+ for (const r of e)
91
+ if (b(r, { select: o }), document.activeElement !== t) return;
92
+ }
93
+ function Ze(e) {
94
+ const o = oe(e), t = z(o, e), r = z(o.reverse(), e);
95
+ return [t, r];
96
+ }
97
+ function oe(e) {
98
+ const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
99
+ acceptNode: (r) => {
100
+ const n = r.tagName === "INPUT" && r.type === "hidden";
101
+ return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
102
+ }
103
+ });
104
+ for (; t.nextNode(); ) o.push(t.currentNode);
105
+ return o;
106
+ }
107
+ function z(e, o) {
108
+ for (const t of e)
109
+ if (!ze(t, { upTo: o })) return t;
110
+ }
111
+ function ze(e, { upTo: o }) {
112
+ if (getComputedStyle(e).visibility === "hidden") return !0;
113
+ for (; e; ) {
114
+ if (o !== void 0 && e === o) return !1;
115
+ if (getComputedStyle(e).display === "none") return !0;
116
+ e = e.parentElement;
117
+ }
118
+ return !1;
119
+ }
120
+ function Je(e) {
121
+ return e instanceof HTMLInputElement && "select" in e;
122
+ }
123
+ function b(e, { select: o = !1 } = {}) {
124
+ if (e && e.focus) {
125
+ const t = document.activeElement;
126
+ e.focus({ preventScroll: !0 }), e !== t && Je(e) && o && e.select();
127
+ }
128
+ }
129
+ var J = Qe();
130
+ function Qe() {
131
+ let e = [];
132
+ return {
133
+ add(o) {
134
+ const t = e[0];
135
+ o !== t && (t == null || t.pause()), e = Q(e, o), e.unshift(o);
136
+ },
137
+ remove(o) {
138
+ var t;
139
+ e = Q(e, o), (t = e[0]) == null || t.resume();
140
+ }
141
+ };
142
+ }
143
+ function Q(e, o) {
144
+ const t = [...e], r = t.indexOf(o);
145
+ return r !== -1 && t.splice(r, 1), t;
146
+ }
147
+ function Xe(e) {
148
+ return e.filter((o) => o.tagName !== "A");
149
+ }
150
+ var W = 0;
151
+ function et() {
152
+ i.useEffect(() => {
153
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
154
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? X()), document.body.insertAdjacentElement("beforeend", e[1] ?? X()), W++, () => {
155
+ W === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), W--;
156
+ };
157
+ }, []);
158
+ }
159
+ function X() {
160
+ const e = document.createElement("span");
161
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
162
+ }
163
+ var tt = function(e) {
164
+ if (typeof document > "u")
165
+ return null;
166
+ var o = Array.isArray(e) ? e[0] : e;
167
+ return o.ownerDocument.body;
168
+ }, _ = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), w = {}, $ = 0, re = function(e) {
169
+ return e && (e.host || re(e.parentNode));
170
+ }, ot = function(e, o) {
171
+ return o.map(function(t) {
172
+ if (e.contains(t))
173
+ return t;
174
+ var r = re(t);
175
+ return r && e.contains(r) ? r : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
176
+ }).filter(function(t) {
177
+ return !!t;
178
+ });
179
+ }, rt = function(e, o, t, r) {
180
+ var n = ot(o, Array.isArray(e) ? e : [e]);
181
+ w[t] || (w[t] = /* @__PURE__ */ new WeakMap());
182
+ var a = w[t], l = [], s = /* @__PURE__ */ new Set(), g = new Set(n), f = function(u) {
183
+ !u || s.has(u) || (s.add(u), f(u.parentNode));
184
+ };
185
+ n.forEach(f);
186
+ var D = function(u) {
187
+ !u || g.has(u) || Array.prototype.forEach.call(u.children, function(p) {
188
+ if (s.has(p))
189
+ D(p);
190
+ else
191
+ try {
192
+ var v = p.getAttribute(r), I = v !== null && v !== "false", d = (_.get(p) || 0) + 1, C = (a.get(p) || 0) + 1;
193
+ _.set(p, d), a.set(p, C), l.push(p), d === 1 && I && M.set(p, !0), C === 1 && p.setAttribute(t, "true"), I || p.setAttribute(r, "true");
194
+ } catch (m) {
195
+ console.error("aria-hidden: cannot operate on ", p, m);
196
+ }
197
+ });
198
+ };
199
+ return D(o), s.clear(), $++, function() {
200
+ l.forEach(function(u) {
201
+ var p = _.get(u) - 1, v = a.get(u) - 1;
202
+ _.set(u, p), a.set(u, v), p || (M.has(u) || u.removeAttribute(r), M.delete(u)), v || u.removeAttribute(t);
203
+ }), $--, $ || (_ = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), w = {});
204
+ };
205
+ }, nt = function(e, o, t) {
206
+ t === void 0 && (t = "data-aria-hidden");
207
+ var r = Array.from(Array.isArray(e) ? e : [e]), n = tt(e);
208
+ return n ? (r.push.apply(r, Array.from(n.querySelectorAll("[aria-live]"))), rt(r, n, t, "aria-hidden")) : function() {
209
+ return null;
210
+ };
211
+ }, K = "Dialog", [ne, ae] = ee(K), [at, A] = ne(K), se = (e) => {
212
+ const {
213
+ __scopeDialog: o,
214
+ children: t,
215
+ open: r,
216
+ defaultOpen: n,
217
+ onOpenChange: a,
218
+ modal: l = !0
219
+ } = e, s = i.useRef(null), g = i.useRef(null), [f = !1, D] = ke({
220
+ prop: r,
221
+ defaultProp: n,
222
+ onChange: a
223
+ });
224
+ return /* @__PURE__ */ c(
225
+ at,
226
+ {
227
+ scope: o,
228
+ triggerRef: s,
229
+ contentRef: g,
230
+ contentId: x(),
231
+ titleId: x(),
232
+ descriptionId: x(),
233
+ open: f,
234
+ onOpenChange: D,
235
+ onOpenToggle: i.useCallback(() => D((u) => !u), [D]),
236
+ modal: l,
237
+ children: t
238
+ }
239
+ );
240
+ };
241
+ se.displayName = K;
242
+ var ie = "DialogTrigger", ce = i.forwardRef(
243
+ (e, o) => {
244
+ const { __scopeDialog: t, ...r } = e, n = A(ie, t), a = O(o, n.triggerRef);
245
+ return /* @__PURE__ */ c(
246
+ P.button,
247
+ {
248
+ type: "button",
249
+ "aria-haspopup": "dialog",
250
+ "aria-expanded": n.open,
251
+ "aria-controls": n.contentId,
252
+ "data-state": q(n.open),
253
+ ...r,
254
+ ref: a,
255
+ onClick: R(e.onClick, n.onOpenToggle)
256
+ }
257
+ );
258
+ }
259
+ );
260
+ ce.displayName = ie;
261
+ var B = "DialogPortal", [st, le] = ne(B, {
262
+ forceMount: void 0
263
+ }), ue = (e) => {
264
+ const { __scopeDialog: o, forceMount: t, children: r, container: n } = e, a = A(B, o);
265
+ return /* @__PURE__ */ c(st, { scope: o, forceMount: t, children: i.Children.map(r, (l) => /* @__PURE__ */ c(G, { present: t || a.open, children: /* @__PURE__ */ c(Ge, { asChild: !0, container: n, children: l }) })) });
266
+ };
267
+ ue.displayName = B;
268
+ var F = "DialogOverlay", de = i.forwardRef(
269
+ (e, o) => {
270
+ const t = le(F, e.__scopeDialog), { forceMount: r = t.forceMount, ...n } = e, a = A(F, e.__scopeDialog);
271
+ return a.modal ? /* @__PURE__ */ c(G, { present: r || a.open, children: /* @__PURE__ */ c(it, { ...n, ref: o }) }) : null;
272
+ }
273
+ );
274
+ de.displayName = F;
275
+ var it = i.forwardRef(
276
+ (e, o) => {
277
+ const { __scopeDialog: t, ...r } = e, n = A(F, t);
278
+ return (
279
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
280
+ // ie. when `Overlay` and `Content` are siblings
281
+ /* @__PURE__ */ c(Ke, { as: We, allowPinchZoom: !0, shards: [n.contentRef], children: /* @__PURE__ */ c(
282
+ P.div,
283
+ {
284
+ "data-state": q(n.open),
285
+ ...r,
286
+ ref: o,
287
+ style: { pointerEvents: "auto", ...r.style }
288
+ }
289
+ ) })
290
+ );
291
+ }
292
+ ), N = "DialogContent", fe = i.forwardRef(
293
+ (e, o) => {
294
+ const t = le(N, e.__scopeDialog), { forceMount: r = t.forceMount, ...n } = e, a = A(N, e.__scopeDialog);
295
+ return /* @__PURE__ */ c(G, { present: r || a.open, children: a.modal ? /* @__PURE__ */ c(ct, { ...n, ref: o }) : /* @__PURE__ */ c(lt, { ...n, ref: o }) });
296
+ }
297
+ );
298
+ fe.displayName = N;
299
+ var ct = i.forwardRef(
300
+ (e, o) => {
301
+ const t = A(N, e.__scopeDialog), r = i.useRef(null), n = O(o, t.contentRef, r);
302
+ return i.useEffect(() => {
303
+ const a = r.current;
304
+ if (a) return nt(a);
305
+ }, []), /* @__PURE__ */ c(
306
+ pe,
307
+ {
308
+ ...e,
309
+ ref: n,
310
+ trapFocus: t.open,
311
+ disableOutsidePointerEvents: !0,
312
+ onCloseAutoFocus: R(e.onCloseAutoFocus, (a) => {
313
+ var l;
314
+ a.preventDefault(), (l = t.triggerRef.current) == null || l.focus();
315
+ }),
316
+ onPointerDownOutside: R(e.onPointerDownOutside, (a) => {
317
+ const l = a.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
318
+ (l.button === 2 || s) && a.preventDefault();
319
+ }),
320
+ onFocusOutside: R(
321
+ e.onFocusOutside,
322
+ (a) => a.preventDefault()
323
+ )
324
+ }
325
+ );
326
+ }
327
+ ), lt = i.forwardRef(
328
+ (e, o) => {
329
+ const t = A(N, e.__scopeDialog), r = i.useRef(!1), n = i.useRef(!1);
330
+ return /* @__PURE__ */ c(
331
+ pe,
332
+ {
333
+ ...e,
334
+ ref: o,
335
+ trapFocus: !1,
336
+ disableOutsidePointerEvents: !1,
337
+ onCloseAutoFocus: (a) => {
338
+ var l, s;
339
+ (l = e.onCloseAutoFocus) == null || l.call(e, a), a.defaultPrevented || (r.current || (s = t.triggerRef.current) == null || s.focus(), a.preventDefault()), r.current = !1, n.current = !1;
340
+ },
341
+ onInteractOutside: (a) => {
342
+ var g, f;
343
+ (g = e.onInteractOutside) == null || g.call(e, a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (n.current = !0));
344
+ const l = a.target;
345
+ ((f = t.triggerRef.current) == null ? void 0 : f.contains(l)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && n.current && a.preventDefault();
346
+ }
347
+ }
348
+ );
349
+ }
350
+ ), pe = i.forwardRef(
351
+ (e, o) => {
352
+ const { __scopeDialog: t, trapFocus: r, onOpenAutoFocus: n, onCloseAutoFocus: a, ...l } = e, s = A(N, t), g = i.useRef(null), f = O(o, g);
353
+ return et(), /* @__PURE__ */ U(j, { children: [
354
+ /* @__PURE__ */ c(
355
+ te,
356
+ {
357
+ asChild: !0,
358
+ loop: !0,
359
+ trapped: r,
360
+ onMountAutoFocus: n,
361
+ onUnmountAutoFocus: a,
362
+ children: /* @__PURE__ */ c(
363
+ Ue,
364
+ {
365
+ role: "dialog",
366
+ id: s.contentId,
367
+ "aria-describedby": s.descriptionId,
368
+ "aria-labelledby": s.titleId,
369
+ "data-state": q(s.open),
370
+ ...l,
371
+ ref: f,
372
+ onDismiss: () => s.onOpenChange(!1)
373
+ }
374
+ )
375
+ }
376
+ ),
377
+ /* @__PURE__ */ U(j, { children: [
378
+ /* @__PURE__ */ c(dt, { titleId: s.titleId }),
379
+ /* @__PURE__ */ c(pt, { contentRef: g, descriptionId: s.descriptionId })
380
+ ] })
381
+ ] });
382
+ }
383
+ ), H = "DialogTitle", ge = i.forwardRef(
384
+ (e, o) => {
385
+ const { __scopeDialog: t, ...r } = e, n = A(H, t);
386
+ return /* @__PURE__ */ c(P.h2, { id: n.titleId, ...r, ref: o });
387
+ }
388
+ );
389
+ ge.displayName = H;
390
+ var ve = "DialogDescription", me = i.forwardRef(
391
+ (e, o) => {
392
+ const { __scopeDialog: t, ...r } = e, n = A(ve, t);
393
+ return /* @__PURE__ */ c(P.p, { id: n.descriptionId, ...r, ref: o });
394
+ }
395
+ );
396
+ me.displayName = ve;
397
+ var De = "DialogClose", Ae = i.forwardRef(
398
+ (e, o) => {
399
+ const { __scopeDialog: t, ...r } = e, n = A(De, t);
400
+ return /* @__PURE__ */ c(
401
+ P.button,
402
+ {
403
+ type: "button",
404
+ ...r,
405
+ ref: o,
406
+ onClick: R(e.onClick, () => n.onOpenChange(!1))
407
+ }
408
+ );
409
+ }
410
+ );
411
+ Ae.displayName = De;
412
+ function q(e) {
413
+ return e ? "open" : "closed";
414
+ }
415
+ var Ee = "DialogTitleWarning", [ut, he] = Le(Ee, {
416
+ contentName: N,
417
+ titleName: H,
418
+ docsSlug: "dialog"
419
+ }), dt = ({ titleId: e }) => {
420
+ const o = he(Ee), t = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
421
+
422
+ If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
423
+
424
+ For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
425
+ return i.useEffect(() => {
426
+ e && (document.getElementById(e) || console.error(t));
427
+ }, [t, e]), null;
428
+ }, ft = "DialogDescriptionWarning", pt = ({ contentRef: e, descriptionId: o }) => {
429
+ const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${he(ft).contentName}}.`;
430
+ return i.useEffect(() => {
431
+ var a;
432
+ const n = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
433
+ o && n && (document.getElementById(o) || console.warn(r));
434
+ }, [r, e, o]), null;
435
+ }, gt = se, vt = ce, mt = ue, Dt = de, At = fe, Et = ge, ht = me, ye = Ae, Ce = "AlertDialog", [yt, Gt] = ee(Ce, [
436
+ ae
437
+ ]), y = ae(), be = (e) => {
438
+ const { __scopeAlertDialog: o, ...t } = e, r = y(o);
439
+ return /* @__PURE__ */ c(gt, { ...r, ...t, modal: !0 });
440
+ };
441
+ be.displayName = Ce;
442
+ var Ct = "AlertDialogTrigger", Ne = i.forwardRef(
443
+ (e, o) => {
444
+ const { __scopeAlertDialog: t, ...r } = e, n = y(t);
445
+ return /* @__PURE__ */ c(vt, { ...n, ...r, ref: o });
446
+ }
447
+ );
448
+ Ne.displayName = Ct;
449
+ var bt = "AlertDialogPortal", _e = (e) => {
450
+ const { __scopeAlertDialog: o, ...t } = e, r = y(o);
451
+ return /* @__PURE__ */ c(mt, { ...r, ...t });
452
+ };
453
+ _e.displayName = bt;
454
+ var Nt = "AlertDialogOverlay", Re = i.forwardRef(
455
+ (e, o) => {
456
+ const { __scopeAlertDialog: t, ...r } = e, n = y(t);
457
+ return /* @__PURE__ */ c(Dt, { ...n, ...r, ref: o });
458
+ }
459
+ );
460
+ Re.displayName = Nt;
461
+ var T = "AlertDialogContent", [_t, Rt] = yt(T), Te = i.forwardRef(
462
+ (e, o) => {
463
+ const { __scopeAlertDialog: t, children: r, ...n } = e, a = y(t), l = i.useRef(null), s = O(o, l), g = i.useRef(null);
464
+ return /* @__PURE__ */ c(
465
+ ut,
466
+ {
467
+ contentName: T,
468
+ titleName: Oe,
469
+ docsSlug: "alert-dialog",
470
+ children: /* @__PURE__ */ c(_t, { scope: t, cancelRef: g, children: /* @__PURE__ */ U(
471
+ At,
472
+ {
473
+ role: "alertdialog",
474
+ ...a,
475
+ ...n,
476
+ ref: s,
477
+ onOpenAutoFocus: R(n.onOpenAutoFocus, (f) => {
478
+ var D;
479
+ f.preventDefault(), (D = g.current) == null || D.focus({ preventScroll: !0 });
480
+ }),
481
+ onPointerDownOutside: (f) => f.preventDefault(),
482
+ onInteractOutside: (f) => f.preventDefault(),
483
+ children: [
484
+ /* @__PURE__ */ c($e, { children: r }),
485
+ /* @__PURE__ */ c(Ot, { contentRef: l })
486
+ ]
487
+ }
488
+ ) })
489
+ }
490
+ );
491
+ }
492
+ );
493
+ Te.displayName = T;
494
+ var Oe = "AlertDialogTitle", Pe = i.forwardRef(
495
+ (e, o) => {
496
+ const { __scopeAlertDialog: t, ...r } = e, n = y(t);
497
+ return /* @__PURE__ */ c(Et, { ...n, ...r, ref: o });
498
+ }
499
+ );
500
+ Pe.displayName = Oe;
501
+ var Se = "AlertDialogDescription", Ie = i.forwardRef((e, o) => {
502
+ const { __scopeAlertDialog: t, ...r } = e, n = y(t);
503
+ return /* @__PURE__ */ c(ht, { ...n, ...r, ref: o });
504
+ });
505
+ Ie.displayName = Se;
506
+ var Tt = "AlertDialogAction", Me = i.forwardRef(
507
+ (e, o) => {
508
+ const { __scopeAlertDialog: t, ...r } = e, n = y(t);
509
+ return /* @__PURE__ */ c(ye, { ...n, ...r, ref: o });
510
+ }
511
+ );
512
+ Me.displayName = Tt;
513
+ var we = "AlertDialogCancel", Fe = i.forwardRef(
514
+ (e, o) => {
515
+ const { __scopeAlertDialog: t, ...r } = e, { cancelRef: n } = Rt(we, t), a = y(t), l = O(o, n);
516
+ return /* @__PURE__ */ c(ye, { ...a, ...r, ref: l });
517
+ }
518
+ );
519
+ Fe.displayName = we;
520
+ var Ot = ({ contentRef: e }) => {
521
+ const o = `\`${T}\` requires a description for the component to be accessible for screen reader users.
522
+
523
+ You can add a description to the \`${T}\` by passing a \`${Se}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
524
+
525
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${T}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
526
+
527
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
528
+ return i.useEffect(() => {
529
+ var r;
530
+ document.getElementById(
531
+ (r = e.current) == null ? void 0 : r.getAttribute("aria-describedby")
532
+ ) || console.warn(o);
533
+ }, [o, e]), null;
534
+ }, Kt = be, Pt = Ne, Bt = _e, Ht = Re, qt = Te, Vt = Me, jt = Fe, Yt = Pe, Zt = Ie;
535
+ const zt = ({
536
+ text: e,
537
+ theme: o,
538
+ onOpen: t
539
+ }) => {
540
+ const { theme: r } = Be();
541
+ return /* @__PURE__ */ c(Pt, { asChild: !0, children: /* @__PURE__ */ c(He, { type: "button", theme: o ?? r, onClick: t, children: e }) });
542
+ };
543
+ export {
544
+ zt as A,
545
+ qt as C,
546
+ Zt as D,
547
+ Ht as O,
548
+ Bt as P,
549
+ Kt as R,
550
+ Yt as T,
551
+ jt as a,
552
+ Vt as b
553
+ };