@alixpartners/ui-components 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/ToastProvider-D5LImZ-Q.js +1136 -0
  2. package/dist/assets/Creatable.css +1 -1
  3. package/dist/assets/Dialog.css +1 -1
  4. package/dist/assets/Dropdown.css +1 -1
  5. package/dist/assets/FilePicker.css +1 -1
  6. package/dist/assets/NavBar.css +1 -1
  7. package/dist/assets/SplitButton.css +1 -1
  8. package/dist/assets/TagsFields.css +1 -1
  9. package/dist/assets/Tooltip.css +1 -1
  10. package/dist/components/Banner/Banner.test.js +1 -1
  11. package/dist/components/Button/Button.test.js +124 -3217
  12. package/dist/components/Checkbox/Checkbox.js +7 -6
  13. package/dist/components/Checkbox/Checkbox.test.js +47 -47
  14. package/dist/components/Creatable/Creatable.js +107 -108
  15. package/dist/components/Dialog/Dialog.d.ts +21 -7
  16. package/dist/components/Dialog/Dialog.js +296 -61
  17. package/dist/components/Dialog/Dialog.test.d.ts +1 -0
  18. package/dist/components/Dialog/Dialog.test.js +368 -0
  19. package/dist/components/Dropdown/Dropdown.js +78 -79
  20. package/dist/components/FilePicker/FilePicker.js +6 -6
  21. package/dist/components/FilePicker/FilePicker.test.js +1 -1
  22. package/dist/components/Ghost/Ghost.test.js +6 -6
  23. package/dist/components/Input/Input.test.js +2 -2
  24. package/dist/components/NavBar/NavBar.js +16 -16
  25. package/dist/components/Radio/Radio.js +1 -1
  26. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  27. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  28. package/dist/components/Search/Search.test.js +1 -1
  29. package/dist/components/SplitButton/SplitButton.js +8 -9
  30. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  31. package/dist/components/Tag/Tag.test.js +1 -1
  32. package/dist/components/TagsFields/TagsFields.js +3 -4
  33. package/dist/components/Textarea/Textarea.test.js +2 -2
  34. package/dist/components/Toast/Toast.d.ts +5 -19
  35. package/dist/components/Toast/Toast.js +65 -62
  36. package/dist/components/Toast/Toast.test.js +47 -30
  37. package/dist/components/ToastProvider/ToastContext.d.ts +11 -0
  38. package/dist/components/ToastProvider/ToastProvider.d.ts +19 -0
  39. package/dist/components/ToastProvider/ToastProvider.js +7 -0
  40. package/dist/components/ToastProvider/ToastProvider.test.d.ts +1 -0
  41. package/dist/components/ToastProvider/ToastProvider.test.js +264 -0
  42. package/dist/components/ToastProvider/types.d.ts +54 -0
  43. package/dist/components/ToastProvider/useToast.d.ts +28 -0
  44. package/dist/components/Toggle/Toggle.js +31 -30
  45. package/dist/components/Toggle/Toggle.test.js +9 -9
  46. package/dist/components/Tooltip/Tooltip.js +20 -19
  47. package/dist/{index-2H7slGYV.js → index-7CBv-Jx6.js} +1 -1
  48. package/dist/{index-DpfPnSMn.js → index-BymOxiM6.js} +2 -2
  49. package/dist/index-C-3_YVJ1.js +1539 -0
  50. package/dist/{index-BKtdMA_j.js → index-C4ffg1vf.js} +24 -23
  51. package/dist/{index-BGZDIjm9.js → index-Chv2KjIL.js} +171 -168
  52. package/dist/{index-BJXIvJs4.js → index-CpsmI33B.js} +24 -23
  53. package/dist/index-CxAtPSMM.js +27 -0
  54. package/dist/{index-CjQV7MmW.js → index-DEphED6n.js} +11 -11
  55. package/dist/index-DM51yNMI.js +237 -0
  56. package/dist/{index-CVWHq7Pr.js → index-D_3jWVyV.js} +37 -36
  57. package/dist/index-DkTDHhag.js +3098 -0
  58. package/dist/index-DrR82jOT.js +142 -0
  59. package/dist/magic-string.es-uPKorP4O.js +663 -0
  60. package/dist/main.d.ts +5 -0
  61. package/dist/main.js +48 -42
  62. package/dist/useToast-Cz5MGKnw.js +11 -0
  63. package/dist/{vi.ClIskdbk-CFW_9sOK.js → vi.bdSIJ99Y-017e_Pkz.js} +9494 -10227
  64. package/package.json +6 -3
  65. package/dist/index-DWydnyjJ.js +0 -245
  66. package/dist/index-DieLVN0p.js +0 -1664
  67. package/dist/magic-string.es-D4UQQyt0.js +0 -859
@@ -1,28 +1,42 @@
1
1
  import { DataAttributes } from '../../types/data-attributes';
2
2
  import { ApIcon } from '../../assets/ap-icons-types';
3
- export declare const DialogContext: import('react').Context<HTMLElement | null>;
4
3
  /**
5
4
  * Dialog component that displays modal content with customizable actions and optional illustration.
6
- * Provides a native HTML dialog element with backdrop support, confirmation/cancellation actions, and accessibility features.
5
+ * Provides a Radix UI dialog with backdrop support, confirmation/cancellation actions, and accessibility features.
6
+ * Supports both controlled (via isOpen) and uncontrolled (via children trigger) modes.
7
7
  *
8
8
  * @param {object} props - Dialog component props
9
9
  * @param {React.ReactNode} [props.children] - The trigger element that opens the dialog when clicked (optional when using isOpen prop)
10
- * @param {boolean} [props.isOpen] - Controls whether the dialog is displayed. When provided, the dialog becomes controlled and children trigger is optional
11
- * @param {() => void} [props.onClose] - Callback fired when the dialog is closed (shows close button when provided)
10
+ * @param {boolean} [props.isOpen] - Controls whether the dialog is displayed. When provided, the dialog becomes controlled
11
+ * @param {boolean} [props.defaultOpen] - Initial open state for uncontrolled mode (default: false)
12
+ * @param {() => void} [props.onClose] - Callback fired when the dialog is closed via close button, overlay click, or escape key
13
+ * @param {(open: boolean) => void} [props.onOpenChange] - Callback fired when the open state changes (for more granular control)
14
+ * @param {boolean} [props.showCloseButton] - Whether to show the close button. Defaults to true if onClose is provided
15
+ * @param {boolean} [props.closeOnOverlayClick] - Whether clicking the overlay closes the dialog (default: true)
16
+ * @param {boolean} [props.closeOnEscape] - Whether pressing Escape closes the dialog (default: true)
17
+ * @param {boolean} [props.modal] - Whether the dialog is modal (default: true)
18
+ * @param {HTMLElement} [props.container] - Custom container element for the Portal
12
19
  * @param {string} props.title - The title text displayed at the top of the dialog
13
20
  * @param {string} props.description - The description text displayed below the title
14
21
  * @param {string} [props.illustrationSrc] - Optional source URL for an illustration image displayed above the content
15
22
  * @param {string} [props.confirmButtonText] - Text for the confirm button (button appears when provided)
16
23
  * @param {string} [props.cancelButtonText] - Text for the cancel button (button appears when provided)
17
- * @param {() => void} [props.onConfirm] - Callback fired when the confirm button is clicked (closes dialog automatically)
18
- * @param {() => void} [props.onCancel] - Callback fired when the cancel button is clicked (closes dialog automatically)
24
+ * @param {() => void} [props.onConfirm] - Callback fired when the confirm button is clicked
25
+ * @param {() => void} [props.onCancel] - Callback fired when the cancel button is clicked
19
26
  * @returns {JSX.Element} The rendered Dialog component
20
27
  */
21
28
  type DialogProps = {
22
29
  className?: string;
23
30
  children?: React.ReactNode;
24
31
  isOpen?: boolean;
32
+ defaultOpen?: boolean;
25
33
  onClose?: () => void;
34
+ onOpenChange?: (open: boolean) => void;
35
+ showCloseButton?: boolean;
36
+ closeOnOverlayClick?: boolean;
37
+ closeOnEscape?: boolean;
38
+ modal?: boolean;
39
+ container?: HTMLElement;
26
40
  title: string;
27
41
  description: React.ReactNode;
28
42
  illustrationSrc?: string;
@@ -39,5 +53,5 @@ type DialogProps = {
39
53
  onConfirm?: () => void;
40
54
  onCancel?: () => void;
41
55
  } & DataAttributes;
42
- export default function Dialog({ children, isOpen, onClose, title, description, illustrationSrc, confirmButtonText, cancelButtonText, confirmButtonType, cancelButtonType, confirmButtonVariant, cancelButtonVariant, confirmButtonSize, cancelButtonSize, confirmButtonIcon, cancelButtonIcon, onConfirm, onCancel, className, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
56
+ export default function Dialog({ children, isOpen, defaultOpen, onClose, onOpenChange, showCloseButton, closeOnOverlayClick, closeOnEscape, modal, container, title, description, illustrationSrc, confirmButtonText, cancelButtonText, confirmButtonType, cancelButtonType, confirmButtonVariant, cancelButtonVariant, confirmButtonSize, cancelButtonSize, confirmButtonIcon, cancelButtonIcon, onConfirm, onCancel, className, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
43
57
  export {};
@@ -1,9 +1,242 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
- import { createContext as I, useRef as h, useEffect as P } from "react";
3
- import f from "../Button/Button.js";
4
- import H from "../Icon/Icon.js";
5
- import '../../assets/Dialog.css';const J = "Dialog-module__dialog___r4ljx", a = {
6
- dialog: J,
1
+ import { jsx as r, jsxs as m, Fragment as W } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { useState as he } from "react";
4
+ import k from "../Button/Button.js";
5
+ import Re from "../Icon/Icon.js";
6
+ import { u as ye, d as O, P as h, c as v, b as Ne, f as Ee, g as Ie } from "../../index-DM51yNMI.js";
7
+ import { u as C } from "../../index-7CBv-Jx6.js";
8
+ import { P as Pe, D as be } from "../../index-DrR82jOT.js";
9
+ import { R as Ce, h as Oe, u as Ae, F as xe } from "../../index-Chv2KjIL.js";
10
+ import { P as A } from "../../index-BymOxiM6.js";
11
+ import '../../assets/Dialog.css';var N = "Dialog", [G] = Ne(N), [Te, d] = G(N), L = (e) => {
12
+ const {
13
+ __scopeDialog: a,
14
+ children: i,
15
+ open: t,
16
+ defaultOpen: n,
17
+ onOpenChange: o,
18
+ modal: s = !0
19
+ } = e, c = l.useRef(null), u = l.useRef(null), [f, D] = ye({
20
+ prop: t,
21
+ defaultProp: n ?? !1,
22
+ onChange: o,
23
+ caller: N
24
+ });
25
+ return /* @__PURE__ */ r(
26
+ Te,
27
+ {
28
+ scope: a,
29
+ triggerRef: c,
30
+ contentRef: u,
31
+ contentId: C(),
32
+ titleId: C(),
33
+ descriptionId: C(),
34
+ open: f,
35
+ onOpenChange: D,
36
+ onOpenToggle: l.useCallback(() => D((E) => !E), [D]),
37
+ modal: s,
38
+ children: i
39
+ }
40
+ );
41
+ };
42
+ L.displayName = N;
43
+ var $ = "DialogTrigger", z = l.forwardRef(
44
+ (e, a) => {
45
+ const { __scopeDialog: i, ...t } = e, n = d($, i), o = O(a, n.triggerRef);
46
+ return /* @__PURE__ */ r(
47
+ h.button,
48
+ {
49
+ type: "button",
50
+ "aria-haspopup": "dialog",
51
+ "aria-expanded": n.open,
52
+ "aria-controls": n.contentId,
53
+ "data-state": M(n.open),
54
+ ...t,
55
+ ref: o,
56
+ onClick: v(e.onClick, n.onOpenToggle)
57
+ }
58
+ );
59
+ }
60
+ );
61
+ z.displayName = $;
62
+ var x = "DialogPortal", [Me, B] = G(x, {
63
+ forceMount: void 0
64
+ }), K = (e) => {
65
+ const { __scopeDialog: a, forceMount: i, children: t, container: n } = e, o = d(x, a);
66
+ return /* @__PURE__ */ r(Me, { scope: a, forceMount: i, children: l.Children.map(t, (s) => /* @__PURE__ */ r(A, { present: i || o.open, children: /* @__PURE__ */ r(Pe, { asChild: !0, container: n, children: s }) })) });
67
+ };
68
+ K.displayName = x;
69
+ var y = "DialogOverlay", j = l.forwardRef(
70
+ (e, a) => {
71
+ const i = B(y, e.__scopeDialog), { forceMount: t = i.forceMount, ...n } = e, o = d(y, e.__scopeDialog);
72
+ return o.modal ? /* @__PURE__ */ r(A, { present: t || o.open, children: /* @__PURE__ */ r(Fe, { ...n, ref: a }) }) : null;
73
+ }
74
+ );
75
+ j.displayName = y;
76
+ var we = Ee("DialogOverlay.RemoveScroll"), Fe = l.forwardRef(
77
+ (e, a) => {
78
+ const { __scopeDialog: i, ...t } = e, n = d(y, i);
79
+ return (
80
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
81
+ // ie. when `Overlay` and `Content` are siblings
82
+ /* @__PURE__ */ r(Ce, { as: we, allowPinchZoom: !0, shards: [n.contentRef], children: /* @__PURE__ */ r(
83
+ h.div,
84
+ {
85
+ "data-state": M(n.open),
86
+ ...t,
87
+ ref: a,
88
+ style: { pointerEvents: "auto", ...t.style }
89
+ }
90
+ ) })
91
+ );
92
+ }
93
+ ), _ = "DialogContent", H = l.forwardRef(
94
+ (e, a) => {
95
+ const i = B(_, e.__scopeDialog), { forceMount: t = i.forceMount, ...n } = e, o = d(_, e.__scopeDialog);
96
+ return /* @__PURE__ */ r(A, { present: t || o.open, children: o.modal ? /* @__PURE__ */ r(Se, { ...n, ref: a }) : /* @__PURE__ */ r(We, { ...n, ref: a }) });
97
+ }
98
+ );
99
+ H.displayName = _;
100
+ var Se = l.forwardRef(
101
+ (e, a) => {
102
+ const i = d(_, e.__scopeDialog), t = l.useRef(null), n = O(a, i.contentRef, t);
103
+ return l.useEffect(() => {
104
+ const o = t.current;
105
+ if (o) return Oe(o);
106
+ }, []), /* @__PURE__ */ r(
107
+ V,
108
+ {
109
+ ...e,
110
+ ref: n,
111
+ trapFocus: i.open,
112
+ disableOutsidePointerEvents: !0,
113
+ onCloseAutoFocus: v(e.onCloseAutoFocus, (o) => {
114
+ var s;
115
+ o.preventDefault(), (s = i.triggerRef.current) == null || s.focus();
116
+ }),
117
+ onPointerDownOutside: v(e.onPointerDownOutside, (o) => {
118
+ const s = o.detail.originalEvent, c = s.button === 0 && s.ctrlKey === !0;
119
+ (s.button === 2 || c) && o.preventDefault();
120
+ }),
121
+ onFocusOutside: v(
122
+ e.onFocusOutside,
123
+ (o) => o.preventDefault()
124
+ )
125
+ }
126
+ );
127
+ }
128
+ ), We = l.forwardRef(
129
+ (e, a) => {
130
+ const i = d(_, e.__scopeDialog), t = l.useRef(!1), n = l.useRef(!1);
131
+ return /* @__PURE__ */ r(
132
+ V,
133
+ {
134
+ ...e,
135
+ ref: a,
136
+ trapFocus: !1,
137
+ disableOutsidePointerEvents: !1,
138
+ onCloseAutoFocus: (o) => {
139
+ var s, c;
140
+ (s = e.onCloseAutoFocus) == null || s.call(e, o), o.defaultPrevented || (t.current || (c = i.triggerRef.current) == null || c.focus(), o.preventDefault()), t.current = !1, n.current = !1;
141
+ },
142
+ onInteractOutside: (o) => {
143
+ var u, f;
144
+ (u = e.onInteractOutside) == null || u.call(e, o), o.defaultPrevented || (t.current = !0, o.detail.originalEvent.type === "pointerdown" && (n.current = !0));
145
+ const s = o.target;
146
+ ((f = i.triggerRef.current) == null ? void 0 : f.contains(s)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && n.current && o.preventDefault();
147
+ }
148
+ }
149
+ );
150
+ }
151
+ ), V = l.forwardRef(
152
+ (e, a) => {
153
+ const { __scopeDialog: i, trapFocus: t, onOpenAutoFocus: n, onCloseAutoFocus: o, ...s } = e, c = d(_, i), u = l.useRef(null), f = O(a, u);
154
+ return Ae(), /* @__PURE__ */ m(W, { children: [
155
+ /* @__PURE__ */ r(
156
+ xe,
157
+ {
158
+ asChild: !0,
159
+ loop: !0,
160
+ trapped: t,
161
+ onMountAutoFocus: n,
162
+ onUnmountAutoFocus: o,
163
+ children: /* @__PURE__ */ r(
164
+ be,
165
+ {
166
+ role: "dialog",
167
+ id: c.contentId,
168
+ "aria-describedby": c.descriptionId,
169
+ "aria-labelledby": c.titleId,
170
+ "data-state": M(c.open),
171
+ ...s,
172
+ ref: f,
173
+ onDismiss: () => c.onOpenChange(!1)
174
+ }
175
+ )
176
+ }
177
+ ),
178
+ /* @__PURE__ */ m(W, { children: [
179
+ /* @__PURE__ */ r(ke, { titleId: c.titleId }),
180
+ /* @__PURE__ */ r(Le, { contentRef: u, descriptionId: c.descriptionId })
181
+ ] })
182
+ ] });
183
+ }
184
+ ), T = "DialogTitle", q = l.forwardRef(
185
+ (e, a) => {
186
+ const { __scopeDialog: i, ...t } = e, n = d(T, i);
187
+ return /* @__PURE__ */ r(h.h2, { id: n.titleId, ...t, ref: a });
188
+ }
189
+ );
190
+ q.displayName = T;
191
+ var J = "DialogDescription", Q = l.forwardRef(
192
+ (e, a) => {
193
+ const { __scopeDialog: i, ...t } = e, n = d(J, i);
194
+ return /* @__PURE__ */ r(h.p, { id: n.descriptionId, ...t, ref: a });
195
+ }
196
+ );
197
+ Q.displayName = J;
198
+ var U = "DialogClose", Y = l.forwardRef(
199
+ (e, a) => {
200
+ const { __scopeDialog: i, ...t } = e, n = d(U, i);
201
+ return /* @__PURE__ */ r(
202
+ h.button,
203
+ {
204
+ type: "button",
205
+ ...t,
206
+ ref: a,
207
+ onClick: v(e.onClick, () => n.onOpenChange(!1))
208
+ }
209
+ );
210
+ }
211
+ );
212
+ Y.displayName = U;
213
+ function M(e) {
214
+ return e ? "open" : "closed";
215
+ }
216
+ var Z = "DialogTitleWarning", [nt, X] = Ie(Z, {
217
+ contentName: _,
218
+ titleName: T,
219
+ docsSlug: "dialog"
220
+ }), ke = ({ titleId: e }) => {
221
+ const a = X(Z), i = `\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
222
+
223
+ If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
224
+
225
+ For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;
226
+ return l.useEffect(() => {
227
+ e && (document.getElementById(e) || console.error(i));
228
+ }, [i, e]), null;
229
+ }, Ge = "DialogDescriptionWarning", Le = ({ contentRef: e, descriptionId: a }) => {
230
+ const t = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${X(Ge).contentName}}.`;
231
+ return l.useEffect(() => {
232
+ var o;
233
+ const n = (o = e.current) == null ? void 0 : o.getAttribute("aria-describedby");
234
+ a && n && (document.getElementById(a) || console.warn(t));
235
+ }, [t, e, a]), null;
236
+ }, $e = L, ze = z, Be = K, Ke = j, je = H, He = q, Ve = Q, qe = Y;
237
+ const Je = "Dialog-module__dialog___r4ljx", g = {
238
+ "dialog-overlay": "Dialog-module__dialog-overlay___mgT2B",
239
+ dialog: Je,
7
240
  "dialog-illustration": "Dialog-module__dialog-illustration___IHiQl",
8
241
  "dialog-content": "Dialog-module__dialog-content___3hOGc",
9
242
  "dialog-title": "Dialog-module__dialog-title___KACAJ",
@@ -11,64 +244,66 @@ import '../../assets/Dialog.css';const J = "Dialog-module__dialog___r4ljx", a =
11
244
  "dialog-buttons": "Dialog-module__dialog-buttons___x-v2M",
12
245
  "dialog-close-button": "Dialog-module__dialog-close-button___-PzEz",
13
246
  "dialog-close-button-icon": "Dialog-module__dialog-close-button-icon___BeGg2"
14
- }, K = I(null);
15
- function F({
16
- children: g,
17
- isOpen: d,
18
- onClose: l,
19
- title: v,
20
- description: D,
21
- illustrationSrc: s,
22
- confirmButtonText: _,
23
- cancelButtonText: n,
24
- confirmButtonType: b = "primary",
25
- cancelButtonType: p = "primary",
26
- confirmButtonVariant: N = "default",
27
- cancelButtonVariant: k = "cancel",
28
- confirmButtonSize: x = "md",
29
- cancelButtonSize: y = "md",
30
- confirmButtonIcon: z,
31
- cancelButtonIcon: j,
32
- onConfirm: e,
33
- onCancel: r,
34
- className: M,
35
- ...R
247
+ };
248
+ function rt({
249
+ children: e,
250
+ isOpen: a,
251
+ defaultOpen: i = !1,
252
+ onClose: t,
253
+ onOpenChange: n,
254
+ showCloseButton: o,
255
+ closeOnOverlayClick: s = !0,
256
+ closeOnEscape: c = !0,
257
+ modal: u = !0,
258
+ container: f,
259
+ title: D,
260
+ description: E,
261
+ illustrationSrc: w,
262
+ confirmButtonText: F,
263
+ cancelButtonText: S,
264
+ confirmButtonType: ee = "primary",
265
+ cancelButtonType: te = "primary",
266
+ confirmButtonVariant: oe = "default",
267
+ cancelButtonVariant: ae = "cancel",
268
+ confirmButtonSize: ne = "md",
269
+ cancelButtonSize: re = "md",
270
+ confirmButtonIcon: ie,
271
+ cancelButtonIcon: le,
272
+ onConfirm: I,
273
+ onCancel: P,
274
+ className: se,
275
+ ...ce
36
276
  }) {
37
- const w = h(null), t = h(null);
38
- P(() => {
39
- var i, m;
40
- d !== void 0 && (d ? (i = t.current) == null || i.showModal() : (m = t.current) == null || m.close());
41
- }, [d]);
42
- const A = () => {
43
- var i;
44
- (i = t.current) == null || i.showModal();
45
- }, u = () => {
46
- var i;
47
- l == null || l(), d === void 0 && ((i = t.current) == null || i.close());
48
- }, E = () => {
49
- var i;
50
- e == null || e(), d === void 0 && ((i = t.current) == null || i.close(), l == null || l());
51
- }, G = () => {
52
- var i;
53
- r == null || r(), d === void 0 && ((i = t.current) == null || i.close(), l == null || l());
54
- };
55
- return /* @__PURE__ */ c("div", { className: M, ...R, children: [
56
- g && /* @__PURE__ */ o("div", { ref: w, onClick: A, children: g }),
57
- /* @__PURE__ */ o("dialog", { className: a.dialog, ref: t, onClose: u, children: /* @__PURE__ */ c(K.Provider, { value: t.current, children: [
58
- l && /* @__PURE__ */ o("button", { className: a["dialog-close-button"], onClick: u, children: /* @__PURE__ */ o(H, { className: a["dialog-close-button-icon"], icon: "ap-icon-close" }) }),
59
- s && /* @__PURE__ */ o("div", { className: a["dialog-illustration"], children: /* @__PURE__ */ o("img", { src: s, alt: "Dialog illustration" }) }),
60
- /* @__PURE__ */ c("div", { className: a["dialog-content"], children: [
61
- /* @__PURE__ */ o("h2", { className: a["dialog-title"], children: v }),
62
- /* @__PURE__ */ o("div", { className: a["dialog-description"], children: D })
63
- ] }),
64
- /* @__PURE__ */ c("div", { className: a["dialog-buttons"], children: [
65
- n && /* @__PURE__ */ o(f, { type: p, variant: k, size: y, onClick: G, icon: j, children: n }),
66
- _ && /* @__PURE__ */ o(f, { type: b, variant: N, size: x, onClick: E, icon: z, children: _ })
277
+ const [de, b] = he(i), R = a !== void 0, ue = R ? a : de, ge = o !== void 0 ? o : t !== void 0, fe = (p) => {
278
+ R || b(p), n == null || n(p), p || t == null || t();
279
+ }, pe = (p) => {
280
+ c || p.preventDefault();
281
+ }, me = (p) => {
282
+ s || p.preventDefault();
283
+ }, _e = () => {
284
+ I == null || I(), R || b(!1), t == null || t();
285
+ }, De = () => {
286
+ P == null || P(), R || b(!1), t == null || t();
287
+ }, ve = /* @__PURE__ */ m($e, { open: ue, onOpenChange: fe, modal: u, children: [
288
+ e && /* @__PURE__ */ r(ze, { asChild: !0, children: /* @__PURE__ */ r("div", { children: e }) }),
289
+ /* @__PURE__ */ m(Be, { container: f, children: [
290
+ /* @__PURE__ */ r(Ke, { className: g["dialog-overlay"] }),
291
+ /* @__PURE__ */ m(je, { className: g.dialog, onEscapeKeyDown: pe, onInteractOutside: me, children: [
292
+ ge && /* @__PURE__ */ r(qe, { className: g["dialog-close-button"], "aria-label": "Close dialog", children: /* @__PURE__ */ r(Re, { className: g["dialog-close-button-icon"], icon: "ap-icon-close" }) }),
293
+ w && /* @__PURE__ */ r("div", { className: g["dialog-illustration"], children: /* @__PURE__ */ r("img", { src: w, alt: "Dialog illustration" }) }),
294
+ /* @__PURE__ */ m("div", { className: g["dialog-content"], children: [
295
+ /* @__PURE__ */ r(He, { className: g["dialog-title"], children: D }),
296
+ /* @__PURE__ */ r(Ve, { asChild: !0, children: /* @__PURE__ */ r("div", { className: g["dialog-description"], children: E }) })
297
+ ] }),
298
+ /* @__PURE__ */ m("div", { className: g["dialog-buttons"], children: [
299
+ S && /* @__PURE__ */ r(k, { type: te, variant: ae, size: re, onClick: De, icon: le, children: S }),
300
+ F && /* @__PURE__ */ r(k, { type: ee, variant: oe, size: ne, onClick: _e, icon: ie, children: F })
301
+ ] })
67
302
  ] })
68
- ] }) })
303
+ ] })
69
304
  ] });
305
+ return /* @__PURE__ */ r("div", { className: se, ...ce, children: ve });
70
306
  }
71
307
  export {
72
- K as DialogContext,
73
- F as default
308
+ rt as default
74
309
  };
@@ -0,0 +1 @@
1
+ export {};