@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.50

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 (203) hide show
  1. package/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
  2. package/dist/DatePicker.css +1 -1
  3. package/dist/Modal-CjC-CIJ8.js +99 -0
  4. package/dist/assets/icons/index.js +7 -0
  5. package/dist/chevron-down-DgT-uSF9.js +5 -0
  6. package/dist/chevron-right-DYvXLeql.js +7 -0
  7. package/dist/chevron-up-DEfvgPCw.js +54 -0
  8. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +81 -53
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +41 -44
  14. package/dist/components/Badge/Badge.variants.js +52 -13
  15. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  16. package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
  17. package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
  18. package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
  19. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  20. package/dist/components/Button/Button.js +1 -1
  21. package/dist/components/Button/Button.variants.js +108 -98
  22. package/dist/components/Card/Card.variants.js +7 -12
  23. package/dist/components/Checkbox/Checkbox.js +108 -105
  24. package/dist/components/Checkbox/Checkbox.variants.js +34 -7
  25. package/dist/components/Command/Command.js +2 -2
  26. package/dist/components/Command/components/Command.js +1 -1
  27. package/dist/components/Command/components/CommandEmpty.js +1 -1
  28. package/dist/components/Command/components/CommandGroup.js +1 -1
  29. package/dist/components/Command/components/CommandInput.js +2 -2
  30. package/dist/components/Command/components/CommandItem.js +1 -1
  31. package/dist/components/Command/components/CommandList.js +1 -1
  32. package/dist/components/Command/components/CommandSeparator.js +1 -1
  33. package/dist/components/Command/components/DialogContent.js +2 -2
  34. package/dist/components/Command/components/DialogOverlay.js +1 -1
  35. package/dist/components/Counter/Counter.js +210 -0
  36. package/dist/components/Counter/Counter.variants.js +70 -0
  37. package/dist/components/Datepicker/DatePicker.js +1587 -1353
  38. package/dist/components/Divider/Divider.variants.js +1 -1
  39. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  40. package/dist/components/Filter/Filter.js +1 -1
  41. package/dist/components/Filter/Filter.variants.js +8 -7
  42. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
  43. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
  44. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
  45. package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
  46. package/dist/components/Filter/events/index.js +3 -3
  47. package/dist/components/ImageUpload/ImageUpload.js +221 -0
  48. package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
  49. package/dist/components/Input/Input.js +185 -118
  50. package/dist/components/Input/Input.variants.js +24 -19
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
  60. package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
  61. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
  62. package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
  63. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
  64. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
  65. package/dist/components/MultiSelectDropdown/components/index.js +8 -0
  66. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
  67. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
  68. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
  69. package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
  70. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
  71. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  72. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
  73. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
  74. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
  75. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
  76. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  77. package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
  78. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  79. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  80. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  81. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  82. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
  83. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  84. package/dist/components/PieChart/PieChart.js +463 -482
  85. package/dist/components/Radio/Radio.js +47 -44
  86. package/dist/components/Radio/Radio.variants.js +12 -8
  87. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  88. package/dist/components/RadioGroup/RadioGroup.js +10 -10
  89. package/dist/components/Range/Range.js +1 -1
  90. package/dist/components/Select/Select.js +48 -0
  91. package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
  92. package/dist/components/Select/components/List/List.js +172 -0
  93. package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
  94. package/dist/components/Select/components/ListItem/ListItem.js +117 -0
  95. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
  96. package/dist/components/Select/components/Wrapper.js +226 -0
  97. package/dist/components/Select/constants/index.js +4 -0
  98. package/dist/components/Select/constants/pagination.js +4 -0
  99. package/dist/components/Select/contexts/index.js +6 -0
  100. package/dist/components/Select/contexts/select.context.js +36 -0
  101. package/dist/components/Select/contexts/select.hook.js +11 -0
  102. package/dist/components/Select/contexts/select.provider.js +58 -0
  103. package/dist/components/Select/hooks/useNavigationList.js +50 -0
  104. package/dist/components/Select/hooks/useSelect.js +103 -0
  105. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  106. package/dist/components/Slider/Slider.js +1 -1
  107. package/dist/components/Switch/Switch.js +156 -129
  108. package/dist/components/Switch/Switch.variants.js +19 -10
  109. package/dist/components/Tabs/Tabs.js +1 -1
  110. package/dist/components/Tabs/Tabs.variants.js +4 -3
  111. package/dist/components/Tabs/components/Content.js +1 -1
  112. package/dist/components/Tabs/components/List.js +1 -1
  113. package/dist/components/Tabs/components/Trigger.js +1 -1
  114. package/dist/components/Tag/Tag.js +1 -1
  115. package/dist/components/Tag/Tag.variants.js +1 -0
  116. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
  117. package/dist/components/TimePicker/TimePicker.js +1 -1
  118. package/dist/components/TimePicker/TimePicker.variants.js +26 -14
  119. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  120. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
  121. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
  122. package/dist/components/Toast/Toast.js +283 -256
  123. package/dist/components/Toast/Toast.variants.js +37 -24
  124. package/dist/components/Tooltip/Tooltip.js +15 -14
  125. package/dist/components/Tooltip/Tooltip.variants.js +5 -4
  126. package/dist/components/Typography/Typography.js +23 -25
  127. package/dist/components/Typography/Typography.variants.js +55 -52
  128. package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
  129. package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
  130. package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
  131. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
  132. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
  133. package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
  134. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
  135. package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
  136. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
  137. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
  138. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
  139. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  140. package/dist/components/VirtualizedTable/components/index.js +8 -6
  141. package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
  142. package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
  143. package/dist/components/index.js +94 -86
  144. package/dist/contexts/theme.provider.js +0 -1
  145. package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
  146. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  147. package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
  148. package/dist/index-BG8O18ZY.js +93 -0
  149. package/dist/index-BKjcReYh.js +55 -0
  150. package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
  151. package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
  152. package/dist/index-BmVmDQGH.js +662 -0
  153. package/dist/index-BvoZGpli.js +60 -0
  154. package/dist/index-Byr10W8m.js +1873 -0
  155. package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
  156. package/dist/index-CeZcoQDw.js +479 -0
  157. package/dist/index-D6KzX_ef.js +135 -0
  158. package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
  159. package/dist/index-DKfEnhKr.js +200 -0
  160. package/dist/index-DLcqcWxM.js +29 -0
  161. package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
  162. package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
  163. package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
  164. package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
  165. package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
  166. package/dist/index.d.ts +2142 -99
  167. package/dist/index.js +116 -106
  168. package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
  169. package/dist/loader-juvMSJ9L.js +5 -0
  170. package/dist/package.json +43 -33
  171. package/dist/styles.css +1 -1
  172. package/dist/ui/civo-theme.css +194 -168
  173. package/dist/ui/theme.css +27 -0
  174. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  175. package/dist/utils/index.js +534 -501
  176. package/dist/x-BXShoIAM.js +8 -0
  177. package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
  178. package/package.json +43 -33
  179. package/dist/Modal-D-NOEWMX.js +0 -98
  180. package/dist/chevron-down-MZvQoT2F.js +0 -11
  181. package/dist/chevron-right-VYBOBhRt.js +0 -19
  182. package/dist/components/Dropdown/Dropdown.js +0 -42
  183. package/dist/components/Dropdown/components/List/List.js +0 -79
  184. package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
  185. package/dist/components/Dropdown/components/Wrapper.js +0 -205
  186. package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
  187. package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
  188. package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
  189. package/dist/components/Dropdown/contexts/index.js +0 -6
  190. package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
  191. package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
  192. package/dist/components/NumberInput/NumberInput.js +0 -179
  193. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
  194. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
  195. package/dist/index-BITvcJAz.js +0 -423
  196. package/dist/index-BfXxHr_2.js +0 -125
  197. package/dist/index-Cvx4lqTq.js +0 -47
  198. package/dist/index-DBbEcSUG.js +0 -31
  199. package/dist/index-DQH6odE9.js +0 -82
  200. package/dist/index-DzIBBMjs.js +0 -436
  201. package/dist/index-os7vysFS.js +0 -131
  202. /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
  203. /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
@@ -1,82 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as f, Fragment as g } from "react/jsx-runtime";
3
- function d(e, n) {
4
- if (typeof e == "function")
5
- return e(n);
6
- e != null && (e.current = n);
7
- }
8
- function m(...e) {
9
- return (n) => {
10
- let r = !1;
11
- const o = e.map((t) => {
12
- const l = d(t, n);
13
- return !r && typeof l == "function" && (r = !0), l;
14
- });
15
- if (r)
16
- return () => {
17
- for (let t = 0; t < o.length; t++) {
18
- const l = o[t];
19
- typeof l == "function" ? l() : d(e[t], null);
20
- }
21
- };
22
- };
23
- }
24
- function x(...e) {
25
- return i.useCallback(m(...e), e);
26
- }
27
- // @__NO_SIDE_EFFECTS__
28
- function C(e) {
29
- const n = /* @__PURE__ */ b(e), r = i.forwardRef((o, t) => {
30
- const { children: l, ...a } = o, s = i.Children.toArray(l), c = s.find(E);
31
- if (c) {
32
- const u = c.props.children, S = s.map((p) => p === c ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : p);
33
- return /* @__PURE__ */ f(n, { ...a, ref: t, children: i.isValidElement(u) ? i.cloneElement(u, void 0, S) : null });
34
- }
35
- return /* @__PURE__ */ f(n, { ...a, ref: t, children: l });
36
- });
37
- return r.displayName = `${e}.Slot`, r;
38
- }
39
- var I = /* @__PURE__ */ C("Slot");
40
- // @__NO_SIDE_EFFECTS__
41
- function b(e) {
42
- const n = i.forwardRef((r, o) => {
43
- const { children: t, ...l } = r;
44
- if (i.isValidElement(t)) {
45
- const a = h(t), s = R(l, t.props);
46
- return t.type !== i.Fragment && (s.ref = o ? m(o, a) : a), i.cloneElement(t, s);
47
- }
48
- return i.Children.count(t) > 1 ? i.Children.only(null) : null;
49
- });
50
- return n.displayName = `${e}.SlotClone`, n;
51
- }
52
- var y = Symbol("radix.slottable");
53
- // @__NO_SIDE_EFFECTS__
54
- function V(e) {
55
- const n = ({ children: r }) => /* @__PURE__ */ f(g, { children: r });
56
- return n.displayName = `${e}.Slottable`, n.__radixId = y, n;
57
- }
58
- function E(e) {
59
- return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === y;
60
- }
61
- function R(e, n) {
62
- const r = { ...n };
63
- for (const o in n) {
64
- const t = e[o], l = n[o];
65
- /^on[A-Z]/.test(o) ? t && l ? r[o] = (...s) => {
66
- const c = l(...s);
67
- return t(...s), c;
68
- } : t && (r[o] = t) : o === "style" ? r[o] = { ...t, ...l } : o === "className" && (r[o] = [t, l].filter(Boolean).join(" "));
69
- }
70
- return { ...e, ...r };
71
- }
72
- function h(e) {
73
- let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning;
74
- return r ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
75
- }
76
- export {
77
- I as S,
78
- m as a,
79
- V as b,
80
- C as c,
81
- x as u
82
- };
@@ -1,436 +0,0 @@
1
- import * as i from "react";
2
- import { a as Ee, c as he, b as _, d as ye } from "./index-BfXxHr_2.js";
3
- import { u as S, c as De } from "./index-DQH6odE9.js";
4
- import { u as w } from "./index-bwWKd82e.js";
5
- import { D as be } from "./index-Cd2vhaop.js";
6
- import { P as N } from "./index-BITvcJAz.js";
7
- import { u as j } from "./index-0ioNhtNM.js";
8
- import { jsx as l, jsxs as q, Fragment as B } from "react/jsx-runtime";
9
- import { P as Ce } from "./index-ti1b9kqV.js";
10
- import { P as U } from "./index-C1g_chDT.js";
11
- import { R as Ae } from "./Combination-VYaRRJBZ.js";
12
- var x = "focusScope.autoFocusOnMount", L = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, Re = "FocusScope", Q = i.forwardRef((e, o) => {
13
- const {
14
- loop: t = !1,
15
- trapped: n = !1,
16
- onMountAutoFocus: r,
17
- onUnmountAutoFocus: a,
18
- ...d
19
- } = e, [s, y] = i.useState(null), g = j(r), E = j(a), c = i.useRef(null), f = S(o, (u) => y(u)), p = i.useRef({
20
- paused: !1,
21
- pause() {
22
- this.paused = !0;
23
- },
24
- resume() {
25
- this.paused = !1;
26
- }
27
- }).current;
28
- i.useEffect(() => {
29
- if (n) {
30
- let u = function(D) {
31
- if (p.paused || !s) return;
32
- const h = D.target;
33
- s.contains(h) ? c.current = h : C(c.current, { select: !0 });
34
- }, b = function(D) {
35
- if (p.paused || !s) return;
36
- const h = D.relatedTarget;
37
- h !== null && (s.contains(h) || C(c.current, { select: !0 }));
38
- }, v = function(D) {
39
- if (document.activeElement === document.body)
40
- for (const $ of D)
41
- $.removedNodes.length > 0 && C(s);
42
- };
43
- document.addEventListener("focusin", u), document.addEventListener("focusout", b);
44
- const O = new MutationObserver(v);
45
- return s && O.observe(s, { childList: !0, subtree: !0 }), () => {
46
- document.removeEventListener("focusin", u), document.removeEventListener("focusout", b), O.disconnect();
47
- };
48
- }
49
- }, [n, s, p.paused]), i.useEffect(() => {
50
- if (s) {
51
- Z.add(p);
52
- const u = document.activeElement;
53
- if (!s.contains(u)) {
54
- const v = new CustomEvent(x, V);
55
- s.addEventListener(x, g), s.dispatchEvent(v), v.defaultPrevented || (Ne(Fe(X(s)), { select: !0 }), document.activeElement === u && C(s));
56
- }
57
- return () => {
58
- s.removeEventListener(x, g), setTimeout(() => {
59
- const v = new CustomEvent(L, V);
60
- s.addEventListener(L, E), s.dispatchEvent(v), v.defaultPrevented || C(u ?? document.body, { select: !0 }), s.removeEventListener(L, E), Z.remove(p);
61
- }, 0);
62
- };
63
- }
64
- }, [s, g, E, p]);
65
- const P = i.useCallback(
66
- (u) => {
67
- if (!t && !n || p.paused) return;
68
- const b = u.key === "Tab" && !u.altKey && !u.ctrlKey && !u.metaKey, v = document.activeElement;
69
- if (b && v) {
70
- const O = u.currentTarget, [D, h] = Oe(O);
71
- D && h ? !u.shiftKey && v === h ? (u.preventDefault(), t && C(D, { select: !0 })) : u.shiftKey && v === D && (u.preventDefault(), t && C(h, { select: !0 })) : v === O && u.preventDefault();
72
- }
73
- },
74
- [t, n, p.paused]
75
- );
76
- return /* @__PURE__ */ l(N.div, { tabIndex: -1, ...d, ref: f, onKeyDown: P });
77
- });
78
- Q.displayName = Re;
79
- function Ne(e, { select: o = !1 } = {}) {
80
- const t = document.activeElement;
81
- for (const n of e)
82
- if (C(n, { select: o }), document.activeElement !== t) return;
83
- }
84
- function Oe(e) {
85
- const o = X(e), t = Y(o, e), n = Y(o.reverse(), e);
86
- return [t, n];
87
- }
88
- function X(e) {
89
- const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
90
- acceptNode: (n) => {
91
- const r = n.tagName === "INPUT" && n.type === "hidden";
92
- return n.disabled || n.hidden || r ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
93
- }
94
- });
95
- for (; t.nextNode(); ) o.push(t.currentNode);
96
- return o;
97
- }
98
- function Y(e, o) {
99
- for (const t of e)
100
- if (!_e(t, { upTo: o })) return t;
101
- }
102
- function _e(e, { upTo: o }) {
103
- if (getComputedStyle(e).visibility === "hidden") return !0;
104
- for (; e; ) {
105
- if (o !== void 0 && e === o) return !1;
106
- if (getComputedStyle(e).display === "none") return !0;
107
- e = e.parentElement;
108
- }
109
- return !1;
110
- }
111
- function Pe(e) {
112
- return e instanceof HTMLInputElement && "select" in e;
113
- }
114
- function C(e, { select: o = !1 } = {}) {
115
- if (e && e.focus) {
116
- const t = document.activeElement;
117
- e.focus({ preventScroll: !0 }), e !== t && Pe(e) && o && e.select();
118
- }
119
- }
120
- var Z = Te();
121
- function Te() {
122
- let e = [];
123
- return {
124
- add(o) {
125
- const t = e[0];
126
- o !== t && t?.pause(), e = z(e, o), e.unshift(o);
127
- },
128
- remove(o) {
129
- e = z(e, o), e[0]?.resume();
130
- }
131
- };
132
- }
133
- function z(e, o) {
134
- const t = [...e], n = t.indexOf(o);
135
- return n !== -1 && t.splice(n, 1), t;
136
- }
137
- function Fe(e) {
138
- return e.filter((o) => o.tagName !== "A");
139
- }
140
- var k = 0;
141
- function Ie() {
142
- i.useEffect(() => {
143
- const e = document.querySelectorAll("[data-radix-focus-guard]");
144
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), k++, () => {
145
- k === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), k--;
146
- };
147
- }, []);
148
- }
149
- function J() {
150
- const e = document.createElement("span");
151
- 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;
152
- }
153
- var Se = function(e) {
154
- if (typeof document > "u")
155
- return null;
156
- var o = Array.isArray(e) ? e[0] : e;
157
- return o.ownerDocument.body;
158
- }, R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {}, W = 0, ee = function(e) {
159
- return e && (e.host || ee(e.parentNode));
160
- }, Me = function(e, o) {
161
- return o.map(function(t) {
162
- if (e.contains(t))
163
- return t;
164
- var n = ee(t);
165
- return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
166
- }).filter(function(t) {
167
- return !!t;
168
- });
169
- }, we = function(e, o, t, n) {
170
- var r = Me(o, Array.isArray(e) ? e : [e]);
171
- F[t] || (F[t] = /* @__PURE__ */ new WeakMap());
172
- var a = F[t], d = [], s = /* @__PURE__ */ new Set(), y = new Set(r), g = function(c) {
173
- !c || s.has(c) || (s.add(c), g(c.parentNode));
174
- };
175
- r.forEach(g);
176
- var E = function(c) {
177
- !c || y.has(c) || Array.prototype.forEach.call(c.children, function(f) {
178
- if (s.has(f))
179
- E(f);
180
- else
181
- try {
182
- var p = f.getAttribute(n), P = p !== null && p !== "false", u = (R.get(f) || 0) + 1, b = (a.get(f) || 0) + 1;
183
- R.set(f, u), a.set(f, b), d.push(f), u === 1 && P && T.set(f, !0), b === 1 && f.setAttribute(t, "true"), P || f.setAttribute(n, "true");
184
- } catch (v) {
185
- console.error("aria-hidden: cannot operate on ", f, v);
186
- }
187
- });
188
- };
189
- return E(o), s.clear(), W++, function() {
190
- d.forEach(function(c) {
191
- var f = R.get(c) - 1, p = a.get(c) - 1;
192
- R.set(c, f), a.set(c, p), f || (T.has(c) || c.removeAttribute(n), T.delete(c)), p || c.removeAttribute(t);
193
- }), W--, W || (R = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {});
194
- };
195
- }, xe = function(e, o, t) {
196
- t === void 0 && (t = "data-aria-hidden");
197
- var n = Array.from(Array.isArray(e) ? e : [e]), r = Se(e);
198
- return r ? (n.push.apply(n, Array.from(r.querySelectorAll("[aria-live]"))), we(n, r, t, "aria-hidden")) : function() {
199
- return null;
200
- };
201
- }, M = "Dialog", [te, tt] = he(M), [Le, m] = te(M), oe = (e) => {
202
- const {
203
- __scopeDialog: o,
204
- children: t,
205
- open: n,
206
- defaultOpen: r,
207
- onOpenChange: a,
208
- modal: d = !0
209
- } = e, s = i.useRef(null), y = i.useRef(null), [g, E] = Ee({
210
- prop: n,
211
- defaultProp: r ?? !1,
212
- onChange: a,
213
- caller: M
214
- });
215
- return /* @__PURE__ */ l(
216
- Le,
217
- {
218
- scope: o,
219
- triggerRef: s,
220
- contentRef: y,
221
- contentId: w(),
222
- titleId: w(),
223
- descriptionId: w(),
224
- open: g,
225
- onOpenChange: E,
226
- onOpenToggle: i.useCallback(() => E((c) => !c), [E]),
227
- modal: d,
228
- children: t
229
- }
230
- );
231
- };
232
- oe.displayName = M;
233
- var ne = "DialogTrigger", re = i.forwardRef(
234
- (e, o) => {
235
- const { __scopeDialog: t, ...n } = e, r = m(ne, t), a = S(o, r.triggerRef);
236
- return /* @__PURE__ */ l(
237
- N.button,
238
- {
239
- type: "button",
240
- "aria-haspopup": "dialog",
241
- "aria-expanded": r.open,
242
- "aria-controls": r.contentId,
243
- "data-state": H(r.open),
244
- ...n,
245
- ref: a,
246
- onClick: _(e.onClick, r.onOpenToggle)
247
- }
248
- );
249
- }
250
- );
251
- re.displayName = ne;
252
- var K = "DialogPortal", [ke, ae] = te(K, {
253
- forceMount: void 0
254
- }), se = (e) => {
255
- const { __scopeDialog: o, forceMount: t, children: n, container: r } = e, a = m(K, o);
256
- return /* @__PURE__ */ l(ke, { scope: o, forceMount: t, children: i.Children.map(n, (d) => /* @__PURE__ */ l(U, { present: t || a.open, children: /* @__PURE__ */ l(Ce, { asChild: !0, container: r, children: d }) })) });
257
- };
258
- se.displayName = K;
259
- var I = "DialogOverlay", ie = i.forwardRef(
260
- (e, o) => {
261
- const t = ae(I, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(I, e.__scopeDialog);
262
- return a.modal ? /* @__PURE__ */ l(U, { present: n || a.open, children: /* @__PURE__ */ l(Ue, { ...r, ref: o }) }) : null;
263
- }
264
- );
265
- ie.displayName = I;
266
- var We = De("DialogOverlay.RemoveScroll"), Ue = i.forwardRef(
267
- (e, o) => {
268
- const { __scopeDialog: t, ...n } = e, r = m(I, t);
269
- return (
270
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
271
- // ie. when `Overlay` and `Content` are siblings
272
- /* @__PURE__ */ l(Ae, { as: We, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ l(
273
- N.div,
274
- {
275
- "data-state": H(r.open),
276
- ...n,
277
- ref: o,
278
- style: { pointerEvents: "auto", ...n.style }
279
- }
280
- ) })
281
- );
282
- }
283
- ), A = "DialogContent", ce = i.forwardRef(
284
- (e, o) => {
285
- const t = ae(A, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(A, e.__scopeDialog);
286
- return /* @__PURE__ */ l(U, { present: n || a.open, children: a.modal ? /* @__PURE__ */ l(Ke, { ...r, ref: o }) : /* @__PURE__ */ l(Ge, { ...r, ref: o }) });
287
- }
288
- );
289
- ce.displayName = A;
290
- var Ke = i.forwardRef(
291
- (e, o) => {
292
- const t = m(A, e.__scopeDialog), n = i.useRef(null), r = S(o, t.contentRef, n);
293
- return i.useEffect(() => {
294
- const a = n.current;
295
- if (a) return xe(a);
296
- }, []), /* @__PURE__ */ l(
297
- ue,
298
- {
299
- ...e,
300
- ref: r,
301
- trapFocus: t.open,
302
- disableOutsidePointerEvents: !0,
303
- onCloseAutoFocus: _(e.onCloseAutoFocus, (a) => {
304
- a.preventDefault(), t.triggerRef.current?.focus();
305
- }),
306
- onPointerDownOutside: _(e.onPointerDownOutside, (a) => {
307
- const d = a.detail.originalEvent, s = d.button === 0 && d.ctrlKey === !0;
308
- (d.button === 2 || s) && a.preventDefault();
309
- }),
310
- onFocusOutside: _(
311
- e.onFocusOutside,
312
- (a) => a.preventDefault()
313
- )
314
- }
315
- );
316
- }
317
- ), Ge = i.forwardRef(
318
- (e, o) => {
319
- const t = m(A, e.__scopeDialog), n = i.useRef(!1), r = i.useRef(!1);
320
- return /* @__PURE__ */ l(
321
- ue,
322
- {
323
- ...e,
324
- ref: o,
325
- trapFocus: !1,
326
- disableOutsidePointerEvents: !1,
327
- onCloseAutoFocus: (a) => {
328
- e.onCloseAutoFocus?.(a), a.defaultPrevented || (n.current || t.triggerRef.current?.focus(), a.preventDefault()), n.current = !1, r.current = !1;
329
- },
330
- onInteractOutside: (a) => {
331
- e.onInteractOutside?.(a), a.defaultPrevented || (n.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
332
- const d = a.target;
333
- t.triggerRef.current?.contains(d) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
334
- }
335
- }
336
- );
337
- }
338
- ), ue = i.forwardRef(
339
- (e, o) => {
340
- const { __scopeDialog: t, trapFocus: n, onOpenAutoFocus: r, onCloseAutoFocus: a, ...d } = e, s = m(A, t), y = i.useRef(null), g = S(o, y);
341
- return Ie(), /* @__PURE__ */ q(B, { children: [
342
- /* @__PURE__ */ l(
343
- Q,
344
- {
345
- asChild: !0,
346
- loop: !0,
347
- trapped: n,
348
- onMountAutoFocus: r,
349
- onUnmountAutoFocus: a,
350
- children: /* @__PURE__ */ l(
351
- be,
352
- {
353
- role: "dialog",
354
- id: s.contentId,
355
- "aria-describedby": s.descriptionId,
356
- "aria-labelledby": s.titleId,
357
- "data-state": H(s.open),
358
- ...d,
359
- ref: g,
360
- onDismiss: () => s.onOpenChange(!1)
361
- }
362
- )
363
- }
364
- ),
365
- /* @__PURE__ */ q(B, { children: [
366
- /* @__PURE__ */ l(He, { titleId: s.titleId }),
367
- /* @__PURE__ */ l(je, { contentRef: y, descriptionId: s.descriptionId })
368
- ] })
369
- ] });
370
- }
371
- ), G = "DialogTitle", le = i.forwardRef(
372
- (e, o) => {
373
- const { __scopeDialog: t, ...n } = e, r = m(G, t);
374
- return /* @__PURE__ */ l(N.h2, { id: r.titleId, ...n, ref: o });
375
- }
376
- );
377
- le.displayName = G;
378
- var fe = "DialogDescription", de = i.forwardRef(
379
- (e, o) => {
380
- const { __scopeDialog: t, ...n } = e, r = m(fe, t);
381
- return /* @__PURE__ */ l(N.p, { id: r.descriptionId, ...n, ref: o });
382
- }
383
- );
384
- de.displayName = fe;
385
- var pe = "DialogClose", ve = i.forwardRef(
386
- (e, o) => {
387
- const { __scopeDialog: t, ...n } = e, r = m(pe, t);
388
- return /* @__PURE__ */ l(
389
- N.button,
390
- {
391
- type: "button",
392
- ...n,
393
- ref: o,
394
- onClick: _(e.onClick, () => r.onOpenChange(!1))
395
- }
396
- );
397
- }
398
- );
399
- ve.displayName = pe;
400
- function H(e) {
401
- return e ? "open" : "closed";
402
- }
403
- var me = "DialogTitleWarning", [ot, ge] = ye(me, {
404
- contentName: A,
405
- titleName: G,
406
- docsSlug: "dialog"
407
- }), He = ({ titleId: e }) => {
408
- const o = ge(me), t = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
409
-
410
- If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
411
-
412
- For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
413
- return i.useEffect(() => {
414
- e && (document.getElementById(e) || console.error(t));
415
- }, [t, e]), null;
416
- }, $e = "DialogDescriptionWarning", je = ({ contentRef: e, descriptionId: o }) => {
417
- const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge($e).contentName}}.`;
418
- return i.useEffect(() => {
419
- const r = e.current?.getAttribute("aria-describedby");
420
- o && r && (document.getElementById(o) || console.warn(n));
421
- }, [n, e, o]), null;
422
- }, nt = oe, rt = re, at = se, st = ie, it = ce, ct = le, ut = de, lt = ve;
423
- export {
424
- it as C,
425
- le as D,
426
- st as O,
427
- at as P,
428
- nt as R,
429
- ct as T,
430
- ot as W,
431
- se as a,
432
- lt as b,
433
- tt as c,
434
- ut as d,
435
- rt as e
436
- };
@@ -1,131 +0,0 @@
1
- import { jsx as i, jsxs as O } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { c as w, b as M } from "./index-BfXxHr_2.js";
4
- import { u, b as x } from "./index-DQH6odE9.js";
5
- import { c as A, R as I, P as $, O as L, W as F, C as G, T as W, d as j, b as v, e as B } from "./index-DzIBBMjs.js";
6
- import { Button as Y } from "./components/Button/Button.js";
7
- import { cn as k } from "./utils/index.js";
8
- var D = "AlertDialog", [q, le] = w(D, [
9
- A
10
- ]), s = A(), f = (e) => {
11
- const { __scopeAlertDialog: o, ...r } = e, a = s(o);
12
- return /* @__PURE__ */ i(I, { ...a, ...r, modal: !0 });
13
- };
14
- f.displayName = D;
15
- var H = "AlertDialogTrigger", m = l.forwardRef(
16
- (e, o) => {
17
- const { __scopeAlertDialog: r, ...a } = e, t = s(r);
18
- return /* @__PURE__ */ i(B, { ...t, ...a, ref: o });
19
- }
20
- );
21
- m.displayName = H;
22
- var V = "AlertDialogPortal", y = (e) => {
23
- const { __scopeAlertDialog: o, ...r } = e, a = s(o);
24
- return /* @__PURE__ */ i($, { ...a, ...r });
25
- };
26
- y.displayName = V;
27
- var z = "AlertDialogOverlay", _ = l.forwardRef(
28
- (e, o) => {
29
- const { __scopeAlertDialog: r, ...a } = e, t = s(r);
30
- return /* @__PURE__ */ i(L, { ...t, ...a, ref: o });
31
- }
32
- );
33
- _.displayName = z;
34
- var n = "AlertDialogContent", [J, K] = q(n), Q = x("AlertDialogContent"), N = l.forwardRef(
35
- (e, o) => {
36
- const { __scopeAlertDialog: r, children: a, ...t } = e, d = s(r), p = l.useRef(null), b = u(o, p), g = l.useRef(null);
37
- return /* @__PURE__ */ i(
38
- F,
39
- {
40
- contentName: n,
41
- titleName: h,
42
- docsSlug: "alert-dialog",
43
- children: /* @__PURE__ */ i(J, { scope: r, cancelRef: g, children: /* @__PURE__ */ O(
44
- G,
45
- {
46
- role: "alertdialog",
47
- ...d,
48
- ...t,
49
- ref: b,
50
- onOpenAutoFocus: M(t.onOpenAutoFocus, (c) => {
51
- c.preventDefault(), g.current?.focus({ preventScroll: !0 });
52
- }),
53
- onPointerDownOutside: (c) => c.preventDefault(),
54
- onInteractOutside: (c) => c.preventDefault(),
55
- children: [
56
- /* @__PURE__ */ i(Q, { children: a }),
57
- /* @__PURE__ */ i(X, { contentRef: p })
58
- ]
59
- }
60
- ) })
61
- }
62
- );
63
- }
64
- );
65
- N.displayName = n;
66
- var h = "AlertDialogTitle", C = l.forwardRef(
67
- (e, o) => {
68
- const { __scopeAlertDialog: r, ...a } = e, t = s(r);
69
- return /* @__PURE__ */ i(W, { ...t, ...a, ref: o });
70
- }
71
- );
72
- C.displayName = h;
73
- var R = "AlertDialogDescription", E = l.forwardRef((e, o) => {
74
- const { __scopeAlertDialog: r, ...a } = e, t = s(r);
75
- return /* @__PURE__ */ i(j, { ...t, ...a, ref: o });
76
- });
77
- E.displayName = R;
78
- var U = "AlertDialogAction", P = l.forwardRef(
79
- (e, o) => {
80
- const { __scopeAlertDialog: r, ...a } = e, t = s(r);
81
- return /* @__PURE__ */ i(v, { ...t, ...a, ref: o });
82
- }
83
- );
84
- P.displayName = U;
85
- var S = "AlertDialogCancel", T = l.forwardRef(
86
- (e, o) => {
87
- const { __scopeAlertDialog: r, ...a } = e, { cancelRef: t } = K(S, r), d = s(r), p = u(o, t);
88
- return /* @__PURE__ */ i(v, { ...d, ...a, ref: p });
89
- }
90
- );
91
- T.displayName = S;
92
- var X = ({ contentRef: e }) => {
93
- const o = `\`${n}\` requires a description for the component to be accessible for screen reader users.
94
-
95
- You can add a description to the \`${n}\` by passing a \`${R}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
96
-
97
- 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 \`${n}\`. 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.
98
-
99
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
100
- return l.useEffect(() => {
101
- document.getElementById(
102
- e.current?.getAttribute("aria-describedby")
103
- ) || console.warn(o);
104
- }, [o, e]), null;
105
- }, se = f, Z = m, ne = y, ce = _, pe = N, de = P, ge = T, ue = C, Ae = E;
106
- const ve = ({
107
- "data-theme": e,
108
- className: o,
109
- text: r,
110
- onOpen: a
111
- }) => /* @__PURE__ */ i(Z, { asChild: !0, children: /* @__PURE__ */ i(
112
- Y,
113
- {
114
- type: "button",
115
- "data-theme": e,
116
- className: k(o),
117
- onClick: a,
118
- children: r
119
- }
120
- ) });
121
- export {
122
- ve as A,
123
- pe as C,
124
- Ae as D,
125
- ce as O,
126
- ne as P,
127
- se as R,
128
- ue as T,
129
- ge as a,
130
- de as b
131
- };