ics-ui-kit 0.1.0-alpha.12 → 0.1.0-alpha.13

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 (227) hide show
  1. package/dist/Button-DQtBfU9y.js +57 -0
  2. package/dist/Button-DQtBfU9y.js.map +1 -0
  3. package/dist/{Button-DhfE69q0.js → ButtonBase-BEM8SNmT.js} +27 -56
  4. package/dist/ButtonBase-BEM8SNmT.js.map +1 -0
  5. package/dist/CarouselItem-pSHe0ufN.js +1500 -0
  6. package/dist/CarouselItem-pSHe0ufN.js.map +1 -0
  7. package/dist/CheckboxField-i_-dPpFM.js +370 -0
  8. package/dist/CheckboxField-i_-dPpFM.js.map +1 -0
  9. package/dist/Divider-C0Ss5GJT.js +47 -0
  10. package/dist/{Divider-D3NvaU8c.js.map → Divider-C0Ss5GJT.js.map} +1 -1
  11. package/dist/Field-3XJNFTql.js +78 -0
  12. package/dist/Field-3XJNFTql.js.map +1 -0
  13. package/dist/FieldLabel-CAbVan3E.js +97 -0
  14. package/dist/FieldLabel-CAbVan3E.js.map +1 -0
  15. package/dist/FormBody-4HptEjhb.js +103 -0
  16. package/dist/FormBody-4HptEjhb.js.map +1 -0
  17. package/dist/{IconButton-BUPs2kEo.js → IconButton-BkBsOIf5.js} +15 -15
  18. package/dist/{IconButton-BUPs2kEo.js.map → IconButton-BkBsOIf5.js.map} +1 -1
  19. package/dist/ImagePlaceholder-CNAKQWTh.js +45 -0
  20. package/dist/ImagePlaceholder-CNAKQWTh.js.map +1 -0
  21. package/dist/ImagePreview-DHi7A8md.js +156 -0
  22. package/dist/ImagePreview-DHi7A8md.js.map +1 -0
  23. package/dist/ImageUploader-46sxdmt5.js +123 -0
  24. package/dist/ImageUploader-46sxdmt5.js.map +1 -0
  25. package/dist/IsolatedStylesWrapper-WgaoHh7y.js +179 -0
  26. package/dist/IsolatedStylesWrapper-WgaoHh7y.js.map +1 -0
  27. package/dist/Modal-D33MSQot.js +125 -0
  28. package/dist/Modal-D33MSQot.js.map +1 -0
  29. package/dist/ScrollShadowContainer-ByNH68Kg.js +636 -0
  30. package/dist/ScrollShadowContainer-ByNH68Kg.js.map +1 -0
  31. package/dist/Toggle-7AlEmn8A.js +104 -0
  32. package/dist/Toggle-7AlEmn8A.js.map +1 -0
  33. package/dist/ToggleGroup-CT453MNp.js +200 -0
  34. package/dist/ToggleGroup-CT453MNp.js.map +1 -0
  35. package/dist/Tooltip-C4BbGF2_.js +372 -0
  36. package/dist/Tooltip-C4BbGF2_.js.map +1 -0
  37. package/dist/{bundle-mjs-D6wdQkGI.js → bundle-mjs-LhQum_e3.js} +676 -425
  38. package/dist/bundle-mjs-LhQum_e3.js.map +1 -0
  39. package/dist/check-C-TqZgvb.js.map +1 -1
  40. package/dist/chevron-right-CobOebzi.js.map +1 -1
  41. package/dist/components/badge.js +1 -1
  42. package/dist/components/button/icon-button/IconButton.stories.d.ts +330 -2
  43. package/dist/components/button/loading-button/LoadingButton.d.ts +249 -0
  44. package/dist/components/button/loading-button/LoadingButton.stories.d.ts +219 -0
  45. package/dist/components/button.js +6 -5
  46. package/dist/components/button.js.map +1 -1
  47. package/dist/components/carousel.js +65 -1532
  48. package/dist/components/carousel.js.map +1 -1
  49. package/dist/components/checkbox.js +1 -1
  50. package/dist/components/divider/content-divider/ContentDivider.d.ts +14 -0
  51. package/dist/components/divider/content-divider/ContentDivider.stories.d.ts +7 -0
  52. package/dist/components/divider/index.d.ts +1 -0
  53. package/dist/components/divider.js +45 -2
  54. package/dist/components/divider.js.map +1 -1
  55. package/dist/components/drawer/templates/drawer-footer-template/DrawerFooterTemplate.d.ts +3 -0
  56. package/dist/components/drawer.js +450 -447
  57. package/dist/components/drawer.js.map +1 -1
  58. package/dist/components/dropdown.js +37 -33
  59. package/dist/components/dropdown.js.map +1 -1
  60. package/dist/components/empty-state/EmptyState.d.ts +2 -2
  61. package/dist/components/empty-state.js +1 -1
  62. package/dist/components/empty-state.js.map +1 -1
  63. package/dist/components/field/Field.d.ts +35 -0
  64. package/dist/components/field.js +1 -1
  65. package/dist/components/form/components/form-header/FormHeader.d.ts +2 -2
  66. package/dist/components/form.js +289 -288
  67. package/dist/components/form.js.map +1 -1
  68. package/dist/components/gallery/Gallery.d.ts +21 -0
  69. package/dist/components/gallery/Gallery.stories.d.ts +26 -0
  70. package/dist/components/gallery/index.d.ts +1 -0
  71. package/dist/components/gallery.d.ts +2 -0
  72. package/dist/components/gallery.js +130 -0
  73. package/dist/components/gallery.js.map +1 -0
  74. package/dist/components/icon-tooltip/IconTooltip.d.ts +2 -1
  75. package/dist/components/image-placeholder.js +2 -42
  76. package/dist/components/image-placeholder.js.map +1 -1
  77. package/dist/components/image-preview/ImagePreview.d.ts +6 -6
  78. package/dist/components/image-preview.js +2 -136
  79. package/dist/components/image-preview.js.map +1 -1
  80. package/dist/components/image-uploader.js +2 -118
  81. package/dist/components/image-uploader.js.map +1 -1
  82. package/dist/components/input/file-input/FileInput.d.ts +3 -1
  83. package/dist/components/input-otp.js +1 -1
  84. package/dist/components/input-otp.js.map +1 -1
  85. package/dist/components/input.js +176 -195
  86. package/dist/components/input.js.map +1 -1
  87. package/dist/components/isolated-styles-wrapper/IsolatedStylesWrapper.d.ts +1 -1
  88. package/dist/components/label/Label.stories.d.ts +0 -2
  89. package/dist/components/label/field-label/FieldLabel.d.ts +11 -0
  90. package/dist/components/label/field-label/FieldLabel.stories.d.ts +1 -0
  91. package/dist/components/label/field-label/components/RequiredIcon.d.ts +5 -0
  92. package/dist/components/label.js +1 -1
  93. package/dist/components/loading/Loading.d.ts +4 -4
  94. package/dist/components/loading.js +2 -2
  95. package/dist/components/loading.js.map +1 -1
  96. package/dist/components/modal.js +12 -122
  97. package/dist/components/modal.js.map +1 -1
  98. package/dist/components/option-group.js +1 -1
  99. package/dist/components/popover.js +34 -31
  100. package/dist/components/popover.js.map +1 -1
  101. package/dist/components/scheduler.js +11 -11
  102. package/dist/components/scheduler.js.map +1 -1
  103. package/dist/components/scroll-shadow-container/ScrollShadowContainer.d.ts +1 -0
  104. package/dist/components/scroll-shadow-container.js +1 -1
  105. package/dist/components/select.js +487 -519
  106. package/dist/components/select.js.map +1 -1
  107. package/dist/components/shortcut/Shortcut.d.ts +14 -14
  108. package/dist/components/shortcut/Shortcut.stories.d.ts +7 -7
  109. package/dist/components/shortcut.js +16 -16
  110. package/dist/components/shortcut.js.map +1 -1
  111. package/dist/components/skeleton/Skeleton.d.ts +1 -0
  112. package/dist/components/skeleton/Skeleton.stories.d.ts +7 -0
  113. package/dist/components/skeleton/index.d.ts +1 -0
  114. package/dist/components/skeleton.d.ts +2 -0
  115. package/dist/components/skeleton.js +33 -0
  116. package/dist/components/skeleton.js.map +1 -0
  117. package/dist/components/switch.js +147 -126
  118. package/dist/components/switch.js.map +1 -1
  119. package/dist/components/tabs.js +9 -8
  120. package/dist/components/tabs.js.map +1 -1
  121. package/dist/components/tag.js +3 -3
  122. package/dist/components/toast.js +4 -4
  123. package/dist/components/toast.js.map +1 -1
  124. package/dist/components/toggle-group.js +1 -1
  125. package/dist/components/toggle.js +1 -1
  126. package/dist/components/tooltip/Tooltip.stories.d.ts +7 -0
  127. package/dist/components/tooltip/index.d.ts +1 -0
  128. package/dist/components/tooltip.d.ts +2 -0
  129. package/dist/components/tooltip.js +8 -0
  130. package/dist/components/tooltip.js.map +1 -0
  131. package/dist/createLucideIcon-DgrNxRV5.js.map +1 -1
  132. package/dist/design-tokens.source.json +1 -1
  133. package/dist/download-CVOGyQ0e.js.map +1 -1
  134. package/dist/downloadFile-yZV-aaO2.js +15 -0
  135. package/dist/downloadFile-yZV-aaO2.js.map +1 -0
  136. package/dist/index-B6K06mzp.js +67 -0
  137. package/dist/index-B6K06mzp.js.map +1 -0
  138. package/dist/index-BCZIl2rL.js +68 -0
  139. package/dist/index-BCZIl2rL.js.map +1 -0
  140. package/dist/index-BZPx6jYI.js.map +1 -1
  141. package/dist/index-Bj6ZBhqh.js +105 -0
  142. package/dist/index-Bj6ZBhqh.js.map +1 -0
  143. package/dist/index-ByaXH_ih.js.map +1 -1
  144. package/dist/index-CACw01gt.js +702 -0
  145. package/dist/index-CACw01gt.js.map +1 -0
  146. package/dist/index-COBL2CQB.js +14 -0
  147. package/dist/index-COBL2CQB.js.map +1 -0
  148. package/dist/index-CR-odn5-.js.map +1 -1
  149. package/dist/{index-BjbwEU_d.js → index-ClwWa5fz.js} +20 -20
  150. package/dist/index-ClwWa5fz.js.map +1 -0
  151. package/dist/{index-DwbC6luJ.js → index-Cx4x7Bv2.js} +52 -50
  152. package/dist/index-Cx4x7Bv2.js.map +1 -0
  153. package/dist/index-CzNelU6n.js +55 -0
  154. package/dist/index-CzNelU6n.js.map +1 -0
  155. package/dist/index-DBsc8nMF.js +43 -0
  156. package/dist/index-DBsc8nMF.js.map +1 -0
  157. package/dist/index-Mbnk_gHS.js +102 -0
  158. package/dist/index-Mbnk_gHS.js.map +1 -0
  159. package/dist/index-bhXb51Q1.js +215 -0
  160. package/dist/index-bhXb51Q1.js.map +1 -0
  161. package/dist/index-n71RB2rx.js +1592 -0
  162. package/dist/index-n71RB2rx.js.map +1 -0
  163. package/dist/index-rKs9bXHr.js +7 -0
  164. package/dist/index-rKs9bXHr.js.map +1 -0
  165. package/dist/lib/utils/file/downloadFile.d.ts +2 -0
  166. package/dist/lib/utils/image/imageConverter.d.ts +23 -0
  167. package/dist/styles-scoped.css +72 -18
  168. package/dist/styles.css +72 -18
  169. package/dist/{utils-DGzAmwok.js → utils-BK4mPzkB.js} +2 -2
  170. package/dist/utils-BK4mPzkB.js.map +1 -0
  171. package/dist/x-JgjNP5oH.js.map +1 -1
  172. package/package.json +1 -1
  173. package/dist/Button-DhfE69q0.js.map +0 -1
  174. package/dist/CheckboxField-CL1Tc7P4.js +0 -257
  175. package/dist/CheckboxField-CL1Tc7P4.js.map +0 -1
  176. package/dist/Divider-D3NvaU8c.js +0 -46
  177. package/dist/Field-COOo8o9f.js +0 -80
  178. package/dist/Field-COOo8o9f.js.map +0 -1
  179. package/dist/FieldLabel-BGxT_RaE.js +0 -64
  180. package/dist/FieldLabel-BGxT_RaE.js.map +0 -1
  181. package/dist/FormBody-DM52shm4.js +0 -101
  182. package/dist/FormBody-DM52shm4.js.map +0 -1
  183. package/dist/IsolatedStylesWrapper-B_Qu75eR.js +0 -555
  184. package/dist/IsolatedStylesWrapper-B_Qu75eR.js.map +0 -1
  185. package/dist/ScrollShadowContainer-DSKr3_fV.js +0 -690
  186. package/dist/ScrollShadowContainer-DSKr3_fV.js.map +0 -1
  187. package/dist/Toggle-BuYtICWv.js +0 -129
  188. package/dist/Toggle-BuYtICWv.js.map +0 -1
  189. package/dist/ToggleGroup-CMyUAz04.js +0 -467
  190. package/dist/ToggleGroup-CMyUAz04.js.map +0 -1
  191. package/dist/bundle-mjs-D6wdQkGI.js.map +0 -1
  192. package/dist/floating-ui.react-dom-CWfR7VfF.js +0 -1346
  193. package/dist/floating-ui.react-dom-CWfR7VfF.js.map +0 -1
  194. package/dist/index-0WznJ1QS.js +0 -276
  195. package/dist/index-0WznJ1QS.js.map +0 -1
  196. package/dist/index-BjbwEU_d.js.map +0 -1
  197. package/dist/index-BqriTm0o.js +0 -47
  198. package/dist/index-BqriTm0o.js.map +0 -1
  199. package/dist/index-C6bvrqL8.js +0 -563
  200. package/dist/index-C6bvrqL8.js.map +0 -1
  201. package/dist/index-C6t9z3on.js +0 -97
  202. package/dist/index-C6t9z3on.js.map +0 -1
  203. package/dist/index-CaQG3DzJ.js +0 -64
  204. package/dist/index-CaQG3DzJ.js.map +0 -1
  205. package/dist/index-ChTGHCkY.js +0 -255
  206. package/dist/index-ChTGHCkY.js.map +0 -1
  207. package/dist/index-D808y1pT.js +0 -178
  208. package/dist/index-D808y1pT.js.map +0 -1
  209. package/dist/index-DE3fiSzl.js +0 -28
  210. package/dist/index-DE3fiSzl.js.map +0 -1
  211. package/dist/index-DPws5oAn.js +0 -90
  212. package/dist/index-DPws5oAn.js.map +0 -1
  213. package/dist/index-DeUgDpdG.js +0 -80
  214. package/dist/index-DeUgDpdG.js.map +0 -1
  215. package/dist/index-DvquTpxI.js +0 -140
  216. package/dist/index-DvquTpxI.js.map +0 -1
  217. package/dist/index-DwbC6luJ.js.map +0 -1
  218. package/dist/index-Ncxt32Wo.js +0 -174
  219. package/dist/index-Ncxt32Wo.js.map +0 -1
  220. package/dist/index-U7y6nBZR.js +0 -179
  221. package/dist/index-U7y6nBZR.js.map +0 -1
  222. package/dist/index-pysSAa5G.js +0 -57
  223. package/dist/index-pysSAa5G.js.map +0 -1
  224. package/dist/tooltip-DI3_ZKNk.js +0 -365
  225. package/dist/tooltip-DI3_ZKNk.js.map +0 -1
  226. package/dist/utils-DGzAmwok.js.map +0 -1
  227. /package/dist/components/{ui/tooltip.d.ts → tooltip/Tooltip.d.ts} +0 -0
@@ -1,563 +0,0 @@
1
- var Xe = Object.defineProperty, je = Object.defineProperties;
2
- var Ge = Object.getOwnPropertyDescriptors;
3
- var K = Object.getOwnPropertySymbols;
4
- var fe = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
5
- var le = (e, n, t) => n in e ? Xe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, v = (e, n) => {
6
- for (var t in n || (n = {}))
7
- fe.call(n, t) && le(e, t, n[t]);
8
- if (K)
9
- for (var t of K(n))
10
- pe.call(n, t) && le(e, t, n[t]);
11
- return e;
12
- }, w = (e, n) => je(e, Ge(n));
13
- var N = (e, n) => {
14
- var t = {};
15
- for (var r in e)
16
- fe.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
17
- if (e != null && K)
18
- for (var r of K(e))
19
- n.indexOf(r) < 0 && pe.call(e, r) && (t[r] = e[r]);
20
- return t;
21
- };
22
- import * as i from "react";
23
- import { a as D, u as k, c as X } from "./index-BqriTm0o.js";
24
- import { P as F, d as qe } from "./index-Ncxt32Wo.js";
25
- import { jsx as A } from "react/jsx-runtime";
26
- import { u as Ve, o as Ze, s as Je, f as Qe, a as et, b as tt, h as nt, l as rt, c as ot } from "./floating-ui.react-dom-CWfR7VfF.js";
27
- import { u as Y, c as st } from "./index-DeUgDpdG.js";
28
- import at from "react-dom";
29
- function it(e, n = globalThis == null ? void 0 : globalThis.document) {
30
- const t = D(e);
31
- i.useEffect(() => {
32
- const r = (s) => {
33
- s.key === "Escape" && t(s);
34
- };
35
- return n.addEventListener("keydown", r, { capture: !0 }), () => n.removeEventListener("keydown", r, { capture: !0 });
36
- }, [t, n]);
37
- }
38
- var ct = "DismissableLayer", V = "dismissableLayer.update", dt = "dismissableLayer.pointerDownOutside", ut = "dismissableLayer.focusOutside", he, Pe = i.createContext({
39
- layers: /* @__PURE__ */ new Set(),
40
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
41
- branches: /* @__PURE__ */ new Set()
42
- }), lt = i.forwardRef(
43
- (e, n) => {
44
- var _;
45
- const H = e, {
46
- disableOutsidePointerEvents: t = !1,
47
- onEscapeKeyDown: r,
48
- onPointerDownOutside: s,
49
- onFocusOutside: a,
50
- onInteractOutside: c,
51
- onDismiss: o
52
- } = H, l = N(H, [
53
- "disableOutsidePointerEvents",
54
- "onEscapeKeyDown",
55
- "onPointerDownOutside",
56
- "onFocusOutside",
57
- "onInteractOutside",
58
- "onDismiss"
59
- ]), d = i.useContext(Pe), [f, C] = i.useState(null), y = (_ = f == null ? void 0 : f.ownerDocument) != null ? _ : globalThis == null ? void 0 : globalThis.document, [, E] = i.useState({}), S = k(n, (h) => C(h)), b = Array.from(d.layers), [u] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), g = b.indexOf(u), p = f ? b.indexOf(f) : -1, x = d.layersWithOutsidePointerEventsDisabled.size > 0, m = p >= g, P = ht((h) => {
60
- const L = h.target, I = [...d.branches].some((M) => M.contains(L));
61
- !m || I || (s == null || s(h), c == null || c(h), h.defaultPrevented || o == null || o());
62
- }, y), O = mt((h) => {
63
- const L = h.target;
64
- [...d.branches].some((M) => M.contains(L)) || (a == null || a(h), c == null || c(h), h.defaultPrevented || o == null || o());
65
- }, y);
66
- return it((h) => {
67
- p === d.layers.size - 1 && (r == null || r(h), !h.defaultPrevented && o && (h.preventDefault(), o()));
68
- }, y), i.useEffect(() => {
69
- if (f)
70
- return t && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (he = y.body.style.pointerEvents, y.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(f)), d.layers.add(f), me(), () => {
71
- t && d.layersWithOutsidePointerEventsDisabled.size === 1 && (y.body.style.pointerEvents = he);
72
- };
73
- }, [f, y, t, d]), i.useEffect(() => () => {
74
- f && (d.layers.delete(f), d.layersWithOutsidePointerEventsDisabled.delete(f), me());
75
- }, [f, d]), i.useEffect(() => {
76
- const h = () => E({});
77
- return document.addEventListener(V, h), () => document.removeEventListener(V, h);
78
- }, []), /* @__PURE__ */ A(
79
- F.div,
80
- w(v({}, l), {
81
- ref: S,
82
- style: v({
83
- pointerEvents: x ? m ? "auto" : "none" : void 0
84
- }, e.style),
85
- onFocusCapture: X(e.onFocusCapture, O.onFocusCapture),
86
- onBlurCapture: X(e.onBlurCapture, O.onBlurCapture),
87
- onPointerDownCapture: X(
88
- e.onPointerDownCapture,
89
- P.onPointerDownCapture
90
- )
91
- })
92
- );
93
- }
94
- );
95
- lt.displayName = ct;
96
- var ft = "DismissableLayerBranch", pt = i.forwardRef((e, n) => {
97
- const t = i.useContext(Pe), r = i.useRef(null), s = k(n, r);
98
- return i.useEffect(() => {
99
- const a = r.current;
100
- if (a)
101
- return t.branches.add(a), () => {
102
- t.branches.delete(a);
103
- };
104
- }, [t.branches]), /* @__PURE__ */ A(F.div, w(v({}, e), { ref: s }));
105
- });
106
- pt.displayName = ft;
107
- function ht(e, n = globalThis == null ? void 0 : globalThis.document) {
108
- const t = D(e), r = i.useRef(!1), s = i.useRef(() => {
109
- });
110
- return i.useEffect(() => {
111
- const a = (o) => {
112
- if (o.target && !r.current) {
113
- let l = function() {
114
- we(
115
- dt,
116
- t,
117
- d,
118
- { discrete: !0 }
119
- );
120
- };
121
- const d = { originalEvent: o };
122
- o.pointerType === "touch" ? (n.removeEventListener("click", s.current), s.current = l, n.addEventListener("click", s.current, { once: !0 })) : l();
123
- } else
124
- n.removeEventListener("click", s.current);
125
- r.current = !1;
126
- }, c = window.setTimeout(() => {
127
- n.addEventListener("pointerdown", a);
128
- }, 0);
129
- return () => {
130
- window.clearTimeout(c), n.removeEventListener("pointerdown", a), n.removeEventListener("click", s.current);
131
- };
132
- }, [n, t]), {
133
- // ensures we check React component tree (not just DOM tree)
134
- onPointerDownCapture: () => r.current = !0
135
- };
136
- }
137
- function mt(e, n = globalThis == null ? void 0 : globalThis.document) {
138
- const t = D(e), r = i.useRef(!1);
139
- return i.useEffect(() => {
140
- const s = (a) => {
141
- a.target && !r.current && we(ut, t, { originalEvent: a }, {
142
- discrete: !1
143
- });
144
- };
145
- return n.addEventListener("focusin", s), () => n.removeEventListener("focusin", s);
146
- }, [n, t]), {
147
- onFocusCapture: () => r.current = !0,
148
- onBlurCapture: () => r.current = !1
149
- };
150
- }
151
- function me() {
152
- const e = new CustomEvent(V);
153
- document.dispatchEvent(e);
154
- }
155
- function we(e, n, t, { discrete: r }) {
156
- const s = t.originalEvent.target, a = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: t });
157
- n && s.addEventListener(e, n, { once: !0 }), r ? qe(s, a) : s.dispatchEvent(a);
158
- }
159
- var j = 0;
160
- function zt() {
161
- i.useEffect(() => {
162
- var n, t;
163
- const e = document.querySelectorAll("[data-radix-focus-guard]");
164
- return document.body.insertAdjacentElement("afterbegin", (n = e[0]) != null ? n : ve()), document.body.insertAdjacentElement("beforeend", (t = e[1]) != null ? t : ve()), j++, () => {
165
- j === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((r) => r.remove()), j--;
166
- };
167
- }, []);
168
- }
169
- function ve() {
170
- const e = document.createElement("span");
171
- 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;
172
- }
173
- var G = "focusScope.autoFocusOnMount", q = "focusScope.autoFocusOnUnmount", Ee = { bubbles: !1, cancelable: !0 }, vt = "FocusScope", Et = i.forwardRef((e, n) => {
174
- const b = e, {
175
- loop: t = !1,
176
- trapped: r = !1,
177
- onMountAutoFocus: s,
178
- onUnmountAutoFocus: a
179
- } = b, c = N(b, [
180
- "loop",
181
- "trapped",
182
- "onMountAutoFocus",
183
- "onUnmountAutoFocus"
184
- ]), [o, l] = i.useState(null), d = D(s), f = D(a), C = i.useRef(null), y = k(n, (u) => l(u)), E = i.useRef({
185
- paused: !1,
186
- pause() {
187
- this.paused = !0;
188
- },
189
- resume() {
190
- this.paused = !1;
191
- }
192
- }).current;
193
- i.useEffect(() => {
194
- if (r) {
195
- let u = function(m) {
196
- if (E.paused || !o) return;
197
- const P = m.target;
198
- o.contains(P) ? C.current = P : R(C.current, { select: !0 });
199
- }, g = function(m) {
200
- if (E.paused || !o) return;
201
- const P = m.relatedTarget;
202
- P !== null && (o.contains(P) || R(C.current, { select: !0 }));
203
- }, p = function(m) {
204
- if (document.activeElement === document.body)
205
- for (const O of m)
206
- O.removedNodes.length > 0 && R(o);
207
- };
208
- document.addEventListener("focusin", u), document.addEventListener("focusout", g);
209
- const x = new MutationObserver(p);
210
- return o && x.observe(o, { childList: !0, subtree: !0 }), () => {
211
- document.removeEventListener("focusin", u), document.removeEventListener("focusout", g), x.disconnect();
212
- };
213
- }
214
- }, [r, o, E.paused]), i.useEffect(() => {
215
- if (o) {
216
- be.add(E);
217
- const u = document.activeElement;
218
- if (!o.contains(u)) {
219
- const p = new CustomEvent(G, Ee);
220
- o.addEventListener(G, d), o.dispatchEvent(p), p.defaultPrevented || (yt(At(Ae(o)), { select: !0 }), document.activeElement === u && R(o));
221
- }
222
- return () => {
223
- o.removeEventListener(G, d), setTimeout(() => {
224
- const p = new CustomEvent(q, Ee);
225
- o.addEventListener(q, f), o.dispatchEvent(p), p.defaultPrevented || R(u != null ? u : document.body, { select: !0 }), o.removeEventListener(q, f), be.remove(E);
226
- }, 0);
227
- };
228
- }
229
- }, [o, d, f, E]);
230
- const S = i.useCallback(
231
- (u) => {
232
- if (!t && !r || E.paused) return;
233
- const g = u.key === "Tab" && !u.altKey && !u.ctrlKey && !u.metaKey, p = document.activeElement;
234
- if (g && p) {
235
- const x = u.currentTarget, [m, P] = bt(x);
236
- m && P ? !u.shiftKey && p === P ? (u.preventDefault(), t && R(m, { select: !0 })) : u.shiftKey && p === m && (u.preventDefault(), t && R(P, { select: !0 })) : p === x && u.preventDefault();
237
- }
238
- },
239
- [t, r, E.paused]
240
- );
241
- return /* @__PURE__ */ A(F.div, w(v({ tabIndex: -1 }, c), { ref: y, onKeyDown: S }));
242
- });
243
- Et.displayName = vt;
244
- function yt(e, { select: n = !1 } = {}) {
245
- const t = document.activeElement;
246
- for (const r of e)
247
- if (R(r, { select: n }), document.activeElement !== t) return;
248
- }
249
- function bt(e) {
250
- const n = Ae(e), t = ye(n, e), r = ye(n.reverse(), e);
251
- return [t, r];
252
- }
253
- function Ae(e) {
254
- const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
255
- acceptNode: (r) => {
256
- const s = r.tagName === "INPUT" && r.type === "hidden";
257
- return r.disabled || r.hidden || s ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
258
- }
259
- });
260
- for (; t.nextNode(); ) n.push(t.currentNode);
261
- return n;
262
- }
263
- function ye(e, n) {
264
- for (const t of e)
265
- if (!gt(t, { upTo: n })) return t;
266
- }
267
- function gt(e, { upTo: n }) {
268
- if (getComputedStyle(e).visibility === "hidden") return !0;
269
- for (; e; ) {
270
- if (n !== void 0 && e === n) return !1;
271
- if (getComputedStyle(e).display === "none") return !0;
272
- e = e.parentElement;
273
- }
274
- return !1;
275
- }
276
- function Pt(e) {
277
- return e instanceof HTMLInputElement && "select" in e;
278
- }
279
- function R(e, { select: n = !1 } = {}) {
280
- if (e && e.focus) {
281
- const t = document.activeElement;
282
- e.focus({ preventScroll: !0 }), e !== t && Pt(e) && n && e.select();
283
- }
284
- }
285
- var be = wt();
286
- function wt() {
287
- let e = [];
288
- return {
289
- add(n) {
290
- const t = e[0];
291
- n !== t && (t == null || t.pause()), e = ge(e, n), e.unshift(n);
292
- },
293
- remove(n) {
294
- var t;
295
- e = ge(e, n), (t = e[0]) == null || t.resume();
296
- }
297
- };
298
- }
299
- function ge(e, n) {
300
- const t = [...e], r = t.indexOf(n);
301
- return r !== -1 && t.splice(r, 1), t;
302
- }
303
- function At(e) {
304
- return e.filter((n) => n.tagName !== "A");
305
- }
306
- var Ct = "Arrow", Ce = i.forwardRef((e, n) => {
307
- const c = e, { children: t, width: r = 10, height: s = 5 } = c, a = N(c, ["children", "width", "height"]);
308
- return /* @__PURE__ */ A(
309
- F.svg,
310
- w(v({}, a), {
311
- ref: n,
312
- width: r,
313
- height: s,
314
- viewBox: "0 0 30 10",
315
- preserveAspectRatio: "none",
316
- children: e.asChild ? t : /* @__PURE__ */ A("polygon", { points: "0,0 30,0 15,10" })
317
- })
318
- );
319
- });
320
- Ce.displayName = Ct;
321
- var xt = Ce;
322
- function Ot(e) {
323
- const [n, t] = i.useState(void 0);
324
- return Y(() => {
325
- if (e) {
326
- t({ width: e.offsetWidth, height: e.offsetHeight });
327
- const r = new ResizeObserver((s) => {
328
- if (!Array.isArray(s) || !s.length)
329
- return;
330
- const a = s[0];
331
- let c, o;
332
- if ("borderBoxSize" in a) {
333
- const l = a.borderBoxSize, d = Array.isArray(l) ? l[0] : l;
334
- c = d.inlineSize, o = d.blockSize;
335
- } else
336
- c = e.offsetWidth, o = e.offsetHeight;
337
- t({ width: c, height: o });
338
- });
339
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
340
- } else
341
- t(void 0);
342
- }, [e]), n;
343
- }
344
- var Z = "Popper", [xe, $t] = st(Z), [St, Oe] = xe(Z), Se = (e) => {
345
- const { __scopePopper: n, children: t } = e, [r, s] = i.useState(null);
346
- return /* @__PURE__ */ A(St, { scope: n, anchor: r, onAnchorChange: s, children: t });
347
- };
348
- Se.displayName = Z;
349
- var Ne = "PopperAnchor", Re = i.forwardRef(
350
- (e, n) => {
351
- const l = e, { __scopePopper: t, virtualRef: r } = l, s = N(l, ["__scopePopper", "virtualRef"]), a = Oe(Ne, t), c = i.useRef(null), o = k(n, c);
352
- return i.useEffect(() => {
353
- a.onAnchorChange((r == null ? void 0 : r.current) || c.current);
354
- }), r ? null : /* @__PURE__ */ A(F.div, w(v({}, s), { ref: o }));
355
- }
356
- );
357
- Re.displayName = Ne;
358
- var J = "PopperContent", [Nt, Rt] = xe(J), Fe = i.forwardRef(
359
- (e, n) => {
360
- var ne, re, oe, se, ae, ie, ce, de;
361
- const te = e, {
362
- __scopePopper: t,
363
- side: r = "bottom",
364
- sideOffset: s = 0,
365
- align: a = "center",
366
- alignOffset: c = 0,
367
- arrowPadding: o = 0,
368
- avoidCollisions: l = !0,
369
- collisionBoundary: d = [],
370
- collisionPadding: f = 0,
371
- sticky: C = "partial",
372
- hideWhenDetached: y = !1,
373
- updatePositionStrategy: E = "optimized",
374
- onPlaced: S
375
- } = te, b = N(te, [
376
- "__scopePopper",
377
- "side",
378
- "sideOffset",
379
- "align",
380
- "alignOffset",
381
- "arrowPadding",
382
- "avoidCollisions",
383
- "collisionBoundary",
384
- "collisionPadding",
385
- "sticky",
386
- "hideWhenDetached",
387
- "updatePositionStrategy",
388
- "onPlaced"
389
- ]), u = Oe(J, t), [g, p] = i.useState(null), x = k(n, (W) => p(W)), [m, P] = i.useState(null), O = Ot(m), H = (ne = O == null ? void 0 : O.width) != null ? ne : 0, _ = (re = O == null ? void 0 : O.height) != null ? re : 0, h = r + (a !== "center" ? "-" + a : ""), L = typeof f == "number" ? f : v({ top: 0, right: 0, bottom: 0, left: 0 }, f), I = Array.isArray(d) ? d : [d], M = I.length > 0, U = {
390
- padding: L,
391
- boundary: I.filter(Lt),
392
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
393
- altBoundary: M
394
- }, { refs: _e, floatingStyles: Q, placement: Ie, isPositioned: B, middlewareData: T } = Ve({
395
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
396
- strategy: "fixed",
397
- placement: h,
398
- whileElementsMounted: (...W) => ot(...W, {
399
- animationFrame: E === "always"
400
- }),
401
- elements: {
402
- reference: u.anchor
403
- },
404
- middleware: [
405
- Ze({ mainAxis: s + _, alignmentAxis: c }),
406
- l && Je(v({
407
- mainAxis: !0,
408
- crossAxis: !1,
409
- limiter: C === "partial" ? rt() : void 0
410
- }, U)),
411
- l && Qe(v({}, U)),
412
- et(w(v({}, U), {
413
- apply: ({ elements: W, rects: ue, availableWidth: ze, availableHeight: $e }) => {
414
- const { width: Ke, height: Ye } = ue.reference, $ = W.floating.style;
415
- $.setProperty("--radix-popper-available-width", `${ze}px`), $.setProperty("--radix-popper-available-height", `${$e}px`), $.setProperty("--radix-popper-anchor-width", `${Ke}px`), $.setProperty("--radix-popper-anchor-height", `${Ye}px`);
416
- }
417
- })),
418
- m && tt({ element: m, padding: o }),
419
- Tt({ arrowWidth: H, arrowHeight: _ }),
420
- y && nt(v({ strategy: "referenceHidden" }, U))
421
- ]
422
- }), [ee, Me] = De(Ie), z = D(S);
423
- Y(() => {
424
- B && (z == null || z());
425
- }, [B, z]);
426
- const We = (oe = T.arrow) == null ? void 0 : oe.x, ke = (se = T.arrow) == null ? void 0 : se.y, He = ((ae = T.arrow) == null ? void 0 : ae.centerOffset) !== 0, [Ue, Be] = i.useState();
427
- return Y(() => {
428
- g && Be(window.getComputedStyle(g).zIndex);
429
- }, [g]), /* @__PURE__ */ A(
430
- "div",
431
- {
432
- ref: _e.setFloating,
433
- "data-radix-popper-content-wrapper": "",
434
- style: v(w(v({}, Q), {
435
- transform: B ? Q.transform : "translate(0, -200%)",
436
- // keep off the page when measuring
437
- minWidth: "max-content",
438
- zIndex: Ue,
439
- "--radix-popper-transform-origin": [
440
- (ie = T.transformOrigin) == null ? void 0 : ie.x,
441
- (ce = T.transformOrigin) == null ? void 0 : ce.y
442
- ].join(" ")
443
- }), ((de = T.hide) == null ? void 0 : de.referenceHidden) && {
444
- visibility: "hidden",
445
- pointerEvents: "none"
446
- }),
447
- dir: e.dir,
448
- children: /* @__PURE__ */ A(
449
- Nt,
450
- {
451
- scope: t,
452
- placedSide: ee,
453
- onArrowChange: P,
454
- arrowX: We,
455
- arrowY: ke,
456
- shouldHideArrow: He,
457
- children: /* @__PURE__ */ A(
458
- F.div,
459
- w(v({
460
- "data-side": ee,
461
- "data-align": Me
462
- }, b), {
463
- ref: x,
464
- style: w(v({}, b.style), {
465
- // if the PopperContent hasn't been placed yet (not all measurements done)
466
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
467
- animation: B ? void 0 : "none"
468
- })
469
- })
470
- )
471
- }
472
- )
473
- }
474
- );
475
- }
476
- );
477
- Fe.displayName = J;
478
- var Le = "PopperArrow", Ft = {
479
- top: "bottom",
480
- right: "left",
481
- bottom: "top",
482
- left: "right"
483
- }, Te = i.forwardRef(function(n, t) {
484
- const o = n, { __scopePopper: r } = o, s = N(o, ["__scopePopper"]), a = Rt(Le, r), c = Ft[a.placedSide];
485
- return (
486
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
487
- // doesn't report size as we'd expect on SVG elements.
488
- // it reports their bounding box which is effectively the largest path inside the SVG.
489
- /* @__PURE__ */ A(
490
- "span",
491
- {
492
- ref: a.onArrowChange,
493
- style: {
494
- position: "absolute",
495
- left: a.arrowX,
496
- top: a.arrowY,
497
- [c]: 0,
498
- transformOrigin: {
499
- top: "",
500
- right: "0 0",
501
- bottom: "center 0",
502
- left: "100% 0"
503
- }[a.placedSide],
504
- transform: {
505
- top: "translateY(100%)",
506
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
507
- bottom: "rotate(180deg)",
508
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
509
- }[a.placedSide],
510
- visibility: a.shouldHideArrow ? "hidden" : void 0
511
- },
512
- children: /* @__PURE__ */ A(
513
- xt,
514
- w(v({}, s), {
515
- ref: t,
516
- style: w(v({}, s.style), {
517
- // ensures the element can be measured correctly (mostly for if SVG)
518
- display: "block"
519
- })
520
- })
521
- )
522
- }
523
- )
524
- );
525
- });
526
- Te.displayName = Le;
527
- function Lt(e) {
528
- return e !== null;
529
- }
530
- var Tt = (e) => ({
531
- name: "transformOrigin",
532
- options: e,
533
- fn(n) {
534
- var u, g, p, x, m;
535
- const { placement: t, rects: r, middlewareData: s } = n, c = ((u = s.arrow) == null ? void 0 : u.centerOffset) !== 0, o = c ? 0 : e.arrowWidth, l = c ? 0 : e.arrowHeight, [d, f] = De(t), C = { start: "0%", center: "50%", end: "100%" }[f], y = ((p = (g = s.arrow) == null ? void 0 : g.x) != null ? p : 0) + o / 2, E = ((m = (x = s.arrow) == null ? void 0 : x.y) != null ? m : 0) + l / 2;
536
- let S = "", b = "";
537
- return d === "bottom" ? (S = c ? C : `${y}px`, b = `${-l}px`) : d === "top" ? (S = c ? C : `${y}px`, b = `${r.floating.height + l}px`) : d === "right" ? (S = `${-l}px`, b = c ? C : `${E}px`) : d === "left" && (S = `${r.floating.width + l}px`, b = c ? C : `${E}px`), { data: { x: S, y: b } };
538
- }
539
- });
540
- function De(e) {
541
- const [n, t = "center"] = e.split("-");
542
- return [n, t];
543
- }
544
- var Kt = Se, Yt = Re, Xt = Fe, jt = Te, Dt = "Portal", _t = i.forwardRef((e, n) => {
545
- var l;
546
- const o = e, { container: t } = o, r = N(o, ["container"]), [s, a] = i.useState(!1);
547
- Y(() => a(!0), []);
548
- const c = t || s && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
549
- return c ? at.createPortal(/* @__PURE__ */ A(F.div, w(v({}, r), { ref: n })), c) : null;
550
- });
551
- _t.displayName = Dt;
552
- export {
553
- Yt as A,
554
- Xt as C,
555
- lt as D,
556
- Et as F,
557
- _t as P,
558
- Kt as R,
559
- jt as a,
560
- $t as c,
561
- zt as u
562
- };
563
- //# sourceMappingURL=index-C6bvrqL8.js.map