@epilot/volt-ui 1.1.2 → 1.1.3

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 (214) hide show
  1. package/dist/components/spinner/spinner.d.ts +12 -0
  2. package/dist/index.cjs.js +51 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.es.js +11793 -133
  5. package/dist/style.css +1 -1
  6. package/package.json +1 -1
  7. package/dist/index.cjs10.js +0 -1
  8. package/dist/index.cjs100.js +0 -1
  9. package/dist/index.cjs101.js +0 -1
  10. package/dist/index.cjs102.js +0 -1
  11. package/dist/index.cjs103.js +0 -1
  12. package/dist/index.cjs104.js +0 -1
  13. package/dist/index.cjs105.js +0 -1
  14. package/dist/index.cjs106.js +0 -1
  15. package/dist/index.cjs107.js +0 -1
  16. package/dist/index.cjs11.js +0 -1
  17. package/dist/index.cjs12.js +0 -1
  18. package/dist/index.cjs13.js +0 -1
  19. package/dist/index.cjs14.js +0 -1
  20. package/dist/index.cjs15.js +0 -1
  21. package/dist/index.cjs16.js +0 -1
  22. package/dist/index.cjs17.js +0 -1
  23. package/dist/index.cjs18.js +0 -1
  24. package/dist/index.cjs19.js +0 -1
  25. package/dist/index.cjs20.js +0 -1
  26. package/dist/index.cjs21.js +0 -1
  27. package/dist/index.cjs22.js +0 -1
  28. package/dist/index.cjs23.js +0 -1
  29. package/dist/index.cjs24.js +0 -1
  30. package/dist/index.cjs25.js +0 -1
  31. package/dist/index.cjs26.js +0 -1
  32. package/dist/index.cjs27.js +0 -1
  33. package/dist/index.cjs28.js +0 -1
  34. package/dist/index.cjs29.js +0 -1
  35. package/dist/index.cjs30.js +0 -1
  36. package/dist/index.cjs31.js +0 -1
  37. package/dist/index.cjs32.js +0 -1
  38. package/dist/index.cjs33.js +0 -1
  39. package/dist/index.cjs34.js +0 -1
  40. package/dist/index.cjs35.js +0 -1
  41. package/dist/index.cjs36.js +0 -1
  42. package/dist/index.cjs37.js +0 -1
  43. package/dist/index.cjs38.js +0 -1
  44. package/dist/index.cjs39.js +0 -1
  45. package/dist/index.cjs4.js +0 -1
  46. package/dist/index.cjs40.js +0 -1
  47. package/dist/index.cjs41.js +0 -5
  48. package/dist/index.cjs42.js +0 -1
  49. package/dist/index.cjs43.js +0 -1
  50. package/dist/index.cjs44.js +0 -1
  51. package/dist/index.cjs45.js +0 -7
  52. package/dist/index.cjs46.js +0 -1
  53. package/dist/index.cjs47.js +0 -1
  54. package/dist/index.cjs48.js +0 -1
  55. package/dist/index.cjs49.js +0 -1
  56. package/dist/index.cjs5.js +0 -1
  57. package/dist/index.cjs50.js +0 -1
  58. package/dist/index.cjs51.js +0 -1
  59. package/dist/index.cjs52.js +0 -1
  60. package/dist/index.cjs53.js +0 -1
  61. package/dist/index.cjs54.js +0 -1
  62. package/dist/index.cjs55.js +0 -1
  63. package/dist/index.cjs56.js +0 -1
  64. package/dist/index.cjs57.js +0 -1
  65. package/dist/index.cjs58.js +0 -1
  66. package/dist/index.cjs59.js +0 -1
  67. package/dist/index.cjs6.js +0 -1
  68. package/dist/index.cjs60.js +0 -1
  69. package/dist/index.cjs61.js +0 -1
  70. package/dist/index.cjs62.js +0 -1
  71. package/dist/index.cjs63.js +0 -1
  72. package/dist/index.cjs64.js +0 -1
  73. package/dist/index.cjs65.js +0 -1
  74. package/dist/index.cjs66.js +0 -1
  75. package/dist/index.cjs67.js +0 -1
  76. package/dist/index.cjs68.js +0 -1
  77. package/dist/index.cjs69.js +0 -1
  78. package/dist/index.cjs7.js +0 -1
  79. package/dist/index.cjs70.js +0 -1
  80. package/dist/index.cjs71.js +0 -1
  81. package/dist/index.cjs72.js +0 -1
  82. package/dist/index.cjs73.js +0 -1
  83. package/dist/index.cjs74.js +0 -1
  84. package/dist/index.cjs75.js +0 -1
  85. package/dist/index.cjs76.js +0 -1
  86. package/dist/index.cjs77.js +0 -1
  87. package/dist/index.cjs78.js +0 -1
  88. package/dist/index.cjs79.js +0 -1
  89. package/dist/index.cjs8.js +0 -1
  90. package/dist/index.cjs80.js +0 -1
  91. package/dist/index.cjs81.js +0 -1
  92. package/dist/index.cjs82.js +0 -1
  93. package/dist/index.cjs83.js +0 -1
  94. package/dist/index.cjs84.js +0 -1
  95. package/dist/index.cjs85.js +0 -1
  96. package/dist/index.cjs86.js +0 -1
  97. package/dist/index.cjs87.js +0 -1
  98. package/dist/index.cjs88.js +0 -1
  99. package/dist/index.cjs89.js +0 -1
  100. package/dist/index.cjs9.js +0 -1
  101. package/dist/index.cjs90.js +0 -1
  102. package/dist/index.cjs91.js +0 -1
  103. package/dist/index.cjs92.js +0 -4
  104. package/dist/index.cjs93.js +0 -1
  105. package/dist/index.cjs94.js +0 -1
  106. package/dist/index.cjs95.js +0 -1
  107. package/dist/index.cjs96.js +0 -1
  108. package/dist/index.cjs97.js +0 -1
  109. package/dist/index.cjs98.js +0 -38
  110. package/dist/index.cjs99.js +0 -1
  111. package/dist/index.es10.js +0 -29
  112. package/dist/index.es100.js +0 -16
  113. package/dist/index.es101.js +0 -68
  114. package/dist/index.es102.js +0 -6
  115. package/dist/index.es103.js +0 -25
  116. package/dist/index.es104.js +0 -25
  117. package/dist/index.es105.js +0 -15
  118. package/dist/index.es106.js +0 -30
  119. package/dist/index.es107.js +0 -7
  120. package/dist/index.es11.js +0 -250
  121. package/dist/index.es12.js +0 -230
  122. package/dist/index.es13.js +0 -34
  123. package/dist/index.es14.js +0 -43
  124. package/dist/index.es15.js +0 -43
  125. package/dist/index.es16.js +0 -115
  126. package/dist/index.es17.js +0 -24
  127. package/dist/index.es18.js +0 -36
  128. package/dist/index.es19.js +0 -137
  129. package/dist/index.es20.js +0 -50
  130. package/dist/index.es21.js +0 -54
  131. package/dist/index.es22.js +0 -74
  132. package/dist/index.es23.js +0 -172
  133. package/dist/index.es24.js +0 -89
  134. package/dist/index.es25.js +0 -113
  135. package/dist/index.es26.js +0 -85
  136. package/dist/index.es27.js +0 -61
  137. package/dist/index.es28.js +0 -73
  138. package/dist/index.es29.js +0 -746
  139. package/dist/index.es30.js +0 -17
  140. package/dist/index.es31.js +0 -2763
  141. package/dist/index.es32.js +0 -62
  142. package/dist/index.es33.js +0 -35
  143. package/dist/index.es34.js +0 -126
  144. package/dist/index.es35.js +0 -862
  145. package/dist/index.es36.js +0 -20
  146. package/dist/index.es37.js +0 -331
  147. package/dist/index.es38.js +0 -132
  148. package/dist/index.es39.js +0 -24
  149. package/dist/index.es4.js +0 -6
  150. package/dist/index.es40.js +0 -243
  151. package/dist/index.es41.js +0 -262
  152. package/dist/index.es42.js +0 -251
  153. package/dist/index.es43.js +0 -238
  154. package/dist/index.es44.js +0 -239
  155. package/dist/index.es45.js +0 -127
  156. package/dist/index.es46.js +0 -163
  157. package/dist/index.es47.js +0 -29
  158. package/dist/index.es48.js +0 -9
  159. package/dist/index.es49.js +0 -70
  160. package/dist/index.es5.js +0 -52
  161. package/dist/index.es50.js +0 -127
  162. package/dist/index.es51.js +0 -17
  163. package/dist/index.es52.js +0 -137
  164. package/dist/index.es53.js +0 -13
  165. package/dist/index.es54.js +0 -221
  166. package/dist/index.es55.js +0 -16
  167. package/dist/index.es56.js +0 -71
  168. package/dist/index.es57.js +0 -36
  169. package/dist/index.es58.js +0 -50
  170. package/dist/index.es59.js +0 -54
  171. package/dist/index.es6.js +0 -66
  172. package/dist/index.es60.js +0 -52
  173. package/dist/index.es61.js +0 -11
  174. package/dist/index.es62.js +0 -11
  175. package/dist/index.es63.js +0 -32
  176. package/dist/index.es64.js +0 -32
  177. package/dist/index.es65.js +0 -48
  178. package/dist/index.es66.js +0 -120
  179. package/dist/index.es67.js +0 -10
  180. package/dist/index.es68.js +0 -183
  181. package/dist/index.es69.js +0 -8
  182. package/dist/index.es7.js +0 -167
  183. package/dist/index.es70.js +0 -27
  184. package/dist/index.es71.js +0 -312
  185. package/dist/index.es72.js +0 -6
  186. package/dist/index.es73.js +0 -50
  187. package/dist/index.es74.js +0 -13
  188. package/dist/index.es75.js +0 -6
  189. package/dist/index.es76.js +0 -50
  190. package/dist/index.es77.js +0 -32
  191. package/dist/index.es78.js +0 -11
  192. package/dist/index.es79.js +0 -50
  193. package/dist/index.es8.js +0 -39
  194. package/dist/index.es80.js +0 -14
  195. package/dist/index.es81.js +0 -208
  196. package/dist/index.es82.js +0 -24
  197. package/dist/index.es83.js +0 -402
  198. package/dist/index.es84.js +0 -17
  199. package/dist/index.es85.js +0 -32
  200. package/dist/index.es86.js +0 -27
  201. package/dist/index.es87.js +0 -31
  202. package/dist/index.es88.js +0 -7
  203. package/dist/index.es89.js +0 -7
  204. package/dist/index.es9.js +0 -33
  205. package/dist/index.es90.js +0 -5
  206. package/dist/index.es91.js +0 -26
  207. package/dist/index.es92.js +0 -112
  208. package/dist/index.es93.js +0 -18
  209. package/dist/index.es94.js +0 -527
  210. package/dist/index.es95.js +0 -130
  211. package/dist/index.es96.js +0 -136
  212. package/dist/index.es97.js +0 -67
  213. package/dist/index.es98.js +0 -71
  214. package/dist/index.es99.js +0 -11
@@ -1,243 +0,0 @@
1
- import * as i from "react";
2
- import { composeEventHandlers as P } from "./index.es48.js";
3
- import { useComposedRefs as O } from "./index.es47.js";
4
- import { createContextScope as G } from "./index.es49.js";
5
- import { DismissableLayer as H } from "./index.es50.js";
6
- import { useFocusGuards as K } from "./index.es51.js";
7
- import { FocusScope as $ } from "./index.es52.js";
8
- import { useId as j } from "./index.es53.js";
9
- import { createPopperScope as _, Anchor as x, Root as U, Content as V, Arrow as W } from "./index.es54.js";
10
- import { Portal as Z } from "./index.es55.js";
11
- import { Presence as w } from "./index.es56.js";
12
- import { Primitive as E } from "./index.es57.js";
13
- import { createSlot as q } from "./index.es58.js";
14
- import { useControllableState as z } from "./index.es59.js";
15
- import { hideOthers as B } from "./index.es60.js";
16
- import J from "./index.es61.js";
17
- import { jsx as p } from "react/jsx-runtime";
18
- var C = "Popover", [b] = G(C, [
19
- _
20
- ]), m = _(), [Q, f] = b(C), F = (o) => {
21
- const {
22
- __scopePopover: n,
23
- children: t,
24
- open: a,
25
- defaultOpen: e,
26
- onOpenChange: r,
27
- modal: s = !1
28
- } = o, c = m(n), u = i.useRef(null), [l, g] = i.useState(!1), [h, d] = z({
29
- prop: a,
30
- defaultProp: e ?? !1,
31
- onChange: r,
32
- caller: C
33
- });
34
- return /* @__PURE__ */ p(U, { ...c, children: /* @__PURE__ */ p(
35
- Q,
36
- {
37
- scope: n,
38
- contentId: j(),
39
- triggerRef: u,
40
- open: h,
41
- onOpenChange: d,
42
- onOpenToggle: i.useCallback(() => d((R) => !R), [d]),
43
- hasCustomAnchor: l,
44
- onCustomAnchorAdd: i.useCallback(() => g(!0), []),
45
- onCustomAnchorRemove: i.useCallback(() => g(!1), []),
46
- modal: s,
47
- children: t
48
- }
49
- ) });
50
- };
51
- F.displayName = C;
52
- var N = "PopoverAnchor", S = i.forwardRef(
53
- (o, n) => {
54
- const { __scopePopover: t, ...a } = o, e = f(N, t), r = m(t), { onCustomAnchorAdd: s, onCustomAnchorRemove: c } = e;
55
- return i.useEffect(() => (s(), () => c()), [s, c]), /* @__PURE__ */ p(x, { ...r, ...a, ref: n });
56
- }
57
- );
58
- S.displayName = N;
59
- var y = "PopoverTrigger", D = i.forwardRef(
60
- (o, n) => {
61
- const { __scopePopover: t, ...a } = o, e = f(y, t), r = m(t), s = O(n, e.triggerRef), c = /* @__PURE__ */ p(
62
- E.button,
63
- {
64
- type: "button",
65
- "aria-haspopup": "dialog",
66
- "aria-expanded": e.open,
67
- "aria-controls": e.contentId,
68
- "data-state": L(e.open),
69
- ...a,
70
- ref: s,
71
- onClick: P(o.onClick, e.onOpenToggle)
72
- }
73
- );
74
- return e.hasCustomAnchor ? c : /* @__PURE__ */ p(x, { asChild: !0, ...r, children: c });
75
- }
76
- );
77
- D.displayName = y;
78
- var A = "PopoverPortal", [X, Y] = b(A, {
79
- forceMount: void 0
80
- }), M = (o) => {
81
- const { __scopePopover: n, forceMount: t, children: a, container: e } = o, r = f(A, n);
82
- return /* @__PURE__ */ p(X, { scope: n, forceMount: t, children: /* @__PURE__ */ p(w, { present: t || r.open, children: /* @__PURE__ */ p(Z, { asChild: !0, container: e, children: a }) }) });
83
- };
84
- M.displayName = A;
85
- var v = "PopoverContent", k = i.forwardRef(
86
- (o, n) => {
87
- const t = Y(v, o.__scopePopover), { forceMount: a = t.forceMount, ...e } = o, r = f(v, o.__scopePopover);
88
- return /* @__PURE__ */ p(w, { present: a || r.open, children: r.modal ? /* @__PURE__ */ p(eo, { ...e, ref: n }) : /* @__PURE__ */ p(ro, { ...e, ref: n }) });
89
- }
90
- );
91
- k.displayName = v;
92
- var oo = q("PopoverContent.RemoveScroll"), eo = i.forwardRef(
93
- (o, n) => {
94
- const t = f(v, o.__scopePopover), a = i.useRef(null), e = O(n, a), r = i.useRef(!1);
95
- return i.useEffect(() => {
96
- const s = a.current;
97
- if (s) return B(s);
98
- }, []), /* @__PURE__ */ p(J, { as: oo, allowPinchZoom: !0, children: /* @__PURE__ */ p(
99
- I,
100
- {
101
- ...o,
102
- ref: e,
103
- trapFocus: t.open,
104
- disableOutsidePointerEvents: !0,
105
- onCloseAutoFocus: P(o.onCloseAutoFocus, (s) => {
106
- var c;
107
- s.preventDefault(), r.current || (c = t.triggerRef.current) == null || c.focus();
108
- }),
109
- onPointerDownOutside: P(
110
- o.onPointerDownOutside,
111
- (s) => {
112
- const c = s.detail.originalEvent, u = c.button === 0 && c.ctrlKey === !0, l = c.button === 2 || u;
113
- r.current = l;
114
- },
115
- { checkForDefaultPrevented: !1 }
116
- ),
117
- onFocusOutside: P(
118
- o.onFocusOutside,
119
- (s) => s.preventDefault(),
120
- { checkForDefaultPrevented: !1 }
121
- )
122
- }
123
- ) });
124
- }
125
- ), ro = i.forwardRef(
126
- (o, n) => {
127
- const t = f(v, o.__scopePopover), a = i.useRef(!1), e = i.useRef(!1);
128
- return /* @__PURE__ */ p(
129
- I,
130
- {
131
- ...o,
132
- ref: n,
133
- trapFocus: !1,
134
- disableOutsidePointerEvents: !1,
135
- onCloseAutoFocus: (r) => {
136
- var s, c;
137
- (s = o.onCloseAutoFocus) == null || s.call(o, r), r.defaultPrevented || (a.current || (c = t.triggerRef.current) == null || c.focus(), r.preventDefault()), a.current = !1, e.current = !1;
138
- },
139
- onInteractOutside: (r) => {
140
- var u, l;
141
- (u = o.onInteractOutside) == null || u.call(o, r), r.defaultPrevented || (a.current = !0, r.detail.originalEvent.type === "pointerdown" && (e.current = !0));
142
- const s = r.target;
143
- ((l = t.triggerRef.current) == null ? void 0 : l.contains(s)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && e.current && r.preventDefault();
144
- }
145
- }
146
- );
147
- }
148
- ), I = i.forwardRef(
149
- (o, n) => {
150
- const {
151
- __scopePopover: t,
152
- trapFocus: a,
153
- onOpenAutoFocus: e,
154
- onCloseAutoFocus: r,
155
- disableOutsidePointerEvents: s,
156
- onEscapeKeyDown: c,
157
- onPointerDownOutside: u,
158
- onFocusOutside: l,
159
- onInteractOutside: g,
160
- ...h
161
- } = o, d = f(v, t), R = m(t);
162
- return K(), /* @__PURE__ */ p(
163
- $,
164
- {
165
- asChild: !0,
166
- loop: !0,
167
- trapped: a,
168
- onMountAutoFocus: e,
169
- onUnmountAutoFocus: r,
170
- children: /* @__PURE__ */ p(
171
- H,
172
- {
173
- asChild: !0,
174
- disableOutsidePointerEvents: s,
175
- onInteractOutside: g,
176
- onEscapeKeyDown: c,
177
- onPointerDownOutside: u,
178
- onFocusOutside: l,
179
- onDismiss: () => d.onOpenChange(!1),
180
- children: /* @__PURE__ */ p(
181
- V,
182
- {
183
- "data-state": L(d.open),
184
- role: "dialog",
185
- id: d.contentId,
186
- ...R,
187
- ...h,
188
- ref: n,
189
- style: {
190
- ...h.style,
191
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
192
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
193
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
194
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
195
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
196
- }
197
- }
198
- )
199
- }
200
- )
201
- }
202
- );
203
- }
204
- ), T = "PopoverClose", to = i.forwardRef(
205
- (o, n) => {
206
- const { __scopePopover: t, ...a } = o, e = f(T, t);
207
- return /* @__PURE__ */ p(
208
- E.button,
209
- {
210
- type: "button",
211
- ...a,
212
- ref: n,
213
- onClick: P(o.onClick, () => e.onOpenChange(!1))
214
- }
215
- );
216
- }
217
- );
218
- to.displayName = T;
219
- var no = "PopoverArrow", ao = i.forwardRef(
220
- (o, n) => {
221
- const { __scopePopover: t, ...a } = o, e = m(t);
222
- return /* @__PURE__ */ p(W, { ...e, ...a, ref: n });
223
- }
224
- );
225
- ao.displayName = no;
226
- function L(o) {
227
- return o ? "open" : "closed";
228
- }
229
- var _o = F, xo = S, wo = D, Eo = M, bo = k;
230
- export {
231
- xo as Anchor,
232
- bo as Content,
233
- F as Popover,
234
- S as PopoverAnchor,
235
- ao as PopoverArrow,
236
- to as PopoverClose,
237
- k as PopoverContent,
238
- M as PopoverPortal,
239
- D as PopoverTrigger,
240
- Eo as Portal,
241
- _o as Root,
242
- wo as Trigger
243
- };
@@ -1,262 +0,0 @@
1
- import * as s from "react";
2
- import { composeEventHandlers as p } from "./index.es48.js";
3
- import { useComposedRefs as _ } from "./index.es47.js";
4
- import { createContextScope as V, createContext as q } from "./index.es49.js";
5
- import { useId as R } from "./index.es53.js";
6
- import { useControllableState as K } from "./index.es59.js";
7
- import { DismissableLayer as U } from "./index.es50.js";
8
- import { FocusScope as Y } from "./index.es52.js";
9
- import { Portal as Z } from "./index.es55.js";
10
- import { Presence as h } from "./index.es56.js";
11
- import { Primitive as m } from "./index.es57.js";
12
- import { useFocusGuards as z } from "./index.es51.js";
13
- import J from "./index.es61.js";
14
- import { hideOthers as Q } from "./index.es60.js";
15
- import { createSlot as X } from "./index.es76.js";
16
- import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
17
- var v = "Dialog", [I, Ne] = V(v), [ee, u] = I(v), x = (e) => {
18
- const {
19
- __scopeDialog: o,
20
- children: n,
21
- open: a,
22
- defaultOpen: r,
23
- onOpenChange: t,
24
- modal: c = !0
25
- } = e, l = s.useRef(null), d = s.useRef(null), [g, C] = K({
26
- prop: a,
27
- defaultProp: r ?? !1,
28
- onChange: t,
29
- caller: v
30
- });
31
- return /* @__PURE__ */ i(
32
- ee,
33
- {
34
- scope: o,
35
- triggerRef: l,
36
- contentRef: d,
37
- contentId: R(),
38
- titleId: R(),
39
- descriptionId: R(),
40
- open: g,
41
- onOpenChange: C,
42
- onOpenToggle: s.useCallback(() => C((H) => !H), [C]),
43
- modal: c,
44
- children: n
45
- }
46
- );
47
- };
48
- x.displayName = v;
49
- var A = "DialogTrigger", T = s.forwardRef(
50
- (e, o) => {
51
- const { __scopeDialog: n, ...a } = e, r = u(A, n), t = _(o, r.triggerRef);
52
- return /* @__PURE__ */ i(
53
- m.button,
54
- {
55
- type: "button",
56
- "aria-haspopup": "dialog",
57
- "aria-expanded": r.open,
58
- "aria-controls": r.contentId,
59
- "data-state": N(r.open),
60
- ...a,
61
- ref: t,
62
- onClick: p(e.onClick, r.onOpenToggle)
63
- }
64
- );
65
- }
66
- );
67
- T.displayName = A;
68
- var E = "DialogPortal", [te, b] = I(E, {
69
- forceMount: void 0
70
- }), M = (e) => {
71
- const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
72
- return /* @__PURE__ */ i(te, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(h, { present: n || t.open, children: /* @__PURE__ */ i(Z, { asChild: !0, container: r, children: c }) })) });
73
- };
74
- M.displayName = E;
75
- var D = "DialogOverlay", w = s.forwardRef(
76
- (e, o) => {
77
- const n = b(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
78
- return t.modal ? /* @__PURE__ */ i(h, { present: a || t.open, children: /* @__PURE__ */ i(re, { ...r, ref: o }) }) : null;
79
- }
80
- );
81
- w.displayName = D;
82
- var oe = X("DialogOverlay.RemoveScroll"), re = s.forwardRef(
83
- (e, o) => {
84
- const { __scopeDialog: n, ...a } = e, r = u(D, n);
85
- return (
86
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
87
- // ie. when `Overlay` and `Content` are siblings
88
- /* @__PURE__ */ i(J, { as: oe, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
89
- m.div,
90
- {
91
- "data-state": N(r.open),
92
- ...a,
93
- ref: o,
94
- style: { pointerEvents: "auto", ...a.style }
95
- }
96
- ) })
97
- );
98
- }
99
- ), f = "DialogContent", S = s.forwardRef(
100
- (e, o) => {
101
- const n = b(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
102
- return /* @__PURE__ */ i(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(ne, { ...r, ref: o }) : /* @__PURE__ */ i(ae, { ...r, ref: o }) });
103
- }
104
- );
105
- S.displayName = f;
106
- var ne = s.forwardRef(
107
- (e, o) => {
108
- const n = u(f, e.__scopeDialog), a = s.useRef(null), r = _(o, n.contentRef, a);
109
- return s.useEffect(() => {
110
- const t = a.current;
111
- if (t) return Q(t);
112
- }, []), /* @__PURE__ */ i(
113
- F,
114
- {
115
- ...e,
116
- ref: r,
117
- trapFocus: n.open,
118
- disableOutsidePointerEvents: !0,
119
- onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
120
- var c;
121
- t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
122
- }),
123
- onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
124
- const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
125
- (c.button === 2 || l) && t.preventDefault();
126
- }),
127
- onFocusOutside: p(
128
- e.onFocusOutside,
129
- (t) => t.preventDefault()
130
- )
131
- }
132
- );
133
- }
134
- ), ae = s.forwardRef(
135
- (e, o) => {
136
- const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
137
- return /* @__PURE__ */ i(
138
- F,
139
- {
140
- ...e,
141
- ref: o,
142
- trapFocus: !1,
143
- disableOutsidePointerEvents: !1,
144
- onCloseAutoFocus: (t) => {
145
- var c, l;
146
- (c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
147
- },
148
- onInteractOutside: (t) => {
149
- var d, g;
150
- (d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
151
- const c = t.target;
152
- ((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
153
- }
154
- }
155
- );
156
- }
157
- ), F = s.forwardRef(
158
- (e, o) => {
159
- const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = _(o, d);
160
- return z(), /* @__PURE__ */ P(O, { children: [
161
- /* @__PURE__ */ i(
162
- Y,
163
- {
164
- asChild: !0,
165
- loop: !0,
166
- trapped: a,
167
- onMountAutoFocus: r,
168
- onUnmountAutoFocus: t,
169
- children: /* @__PURE__ */ i(
170
- U,
171
- {
172
- role: "dialog",
173
- id: l.contentId,
174
- "aria-describedby": l.descriptionId,
175
- "aria-labelledby": l.titleId,
176
- "data-state": N(l.open),
177
- ...c,
178
- ref: g,
179
- onDismiss: () => l.onOpenChange(!1)
180
- }
181
- )
182
- }
183
- ),
184
- /* @__PURE__ */ P(O, { children: [
185
- /* @__PURE__ */ i(ie, { titleId: l.titleId }),
186
- /* @__PURE__ */ i(ce, { contentRef: d, descriptionId: l.descriptionId })
187
- ] })
188
- ] });
189
- }
190
- ), y = "DialogTitle", W = s.forwardRef(
191
- (e, o) => {
192
- const { __scopeDialog: n, ...a } = e, r = u(y, n);
193
- return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
194
- }
195
- );
196
- W.displayName = y;
197
- var k = "DialogDescription", G = s.forwardRef(
198
- (e, o) => {
199
- const { __scopeDialog: n, ...a } = e, r = u(k, n);
200
- return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
201
- }
202
- );
203
- G.displayName = k;
204
- var L = "DialogClose", $ = s.forwardRef(
205
- (e, o) => {
206
- const { __scopeDialog: n, ...a } = e, r = u(L, n);
207
- return /* @__PURE__ */ i(
208
- m.button,
209
- {
210
- type: "button",
211
- ...a,
212
- ref: o,
213
- onClick: p(e.onClick, () => r.onOpenChange(!1))
214
- }
215
- );
216
- }
217
- );
218
- $.displayName = L;
219
- function N(e) {
220
- return e ? "open" : "closed";
221
- }
222
- var B = "DialogTitleWarning", [Pe, j] = q(B, {
223
- contentName: f,
224
- titleName: y,
225
- docsSlug: "dialog"
226
- }), ie = ({ titleId: e }) => {
227
- const o = j(B), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
228
-
229
- If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
230
-
231
- For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
232
- return s.useEffect(() => {
233
- e && (document.getElementById(e) || console.error(n));
234
- }, [n, e]), null;
235
- }, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
236
- const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(se).contentName}}.`;
237
- return s.useEffect(() => {
238
- var t;
239
- const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
240
- o && r && (document.getElementById(o) || console.warn(a));
241
- }, [a, e, o]), null;
242
- }, Oe = x, Ie = T, xe = M, Ae = w, Te = S, be = W, Me = G, we = $;
243
- export {
244
- we as Close,
245
- Te as Content,
246
- Me as Description,
247
- x as Dialog,
248
- $ as DialogClose,
249
- S as DialogContent,
250
- G as DialogDescription,
251
- w as DialogOverlay,
252
- M as DialogPortal,
253
- W as DialogTitle,
254
- T as DialogTrigger,
255
- Ae as Overlay,
256
- xe as Portal,
257
- Oe as Root,
258
- be as Title,
259
- Ie as Trigger,
260
- Pe as WarningProvider,
261
- Ne as createDialogScope
262
- };