@alixpartners/ui-components 2.5.7 → 2.6.1
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.
- package/README.md +97 -97
- package/dist/RichTextEditor-JH6YBGiw.js +541 -0
- package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
- package/dist/assets/CorusHeader.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/Tab.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.test.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js +1 -1
- package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
- package/dist/components/CorusHeader/CorusHeader.js +45 -44
- package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
- package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
- package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
- package/dist/components/CorusHeader/DropdownMenu.js +6 -5
- package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
- package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
- package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
- package/dist/components/Creatable/Creatable.d.ts +1 -1
- package/dist/components/Creatable/Creatable.js +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/Datepicker.test.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.js +183 -203
- package/dist/components/Dialog/Dialog.test.js +227 -202
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.js +179 -172
- package/dist/components/FilePicker/FilePicker.d.ts +9 -9
- package/dist/components/FilePicker/FilePicker.test.js +2 -2
- package/dist/components/Ghost/Ghost.d.ts +1 -1
- package/dist/components/Ghost/Ghost.test.js +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/Illustration/Illustration.d.ts +1 -1
- package/dist/components/Illustration/Illustration.test.js +1 -1
- package/dist/components/Input/Input.test.js +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logos/LogosGallery.d.ts +1 -1
- package/dist/components/NavBar/NavBar.d.ts +1 -1
- package/dist/components/NavBar/NavBar.js +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +11 -11
- package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.test.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.js +3 -3
- package/dist/components/SplitButton/SplitButton.test.js +1 -1
- package/dist/components/Tab/Tab.d.ts +5 -1
- package/dist/components/Tab/Tab.js +28 -24
- package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.test.js +1 -1
- package/dist/components/TagsFields/TagsFields.d.ts +1 -1
- package/dist/components/TagsFields/TagsFields.js +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.test.js +1 -1
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
- package/dist/components/ToastProvider/ToastProvider.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +211 -126
- package/dist/components/Toggle/Toggle.test.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +60 -61
- package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
- package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
- package/dist/index-B4szHVNJ.js +248 -0
- package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
- package/dist/index-Bq1FiX6B.js +93 -0
- package/dist/index-CE9NpYQR.js +604 -0
- package/dist/index-CHy8gqvu.js +353 -0
- package/dist/index-CarlZuEo.js +1610 -0
- package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
- package/dist/index-DH9SO8qV.js +221 -0
- package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
- package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
- package/dist/index-kgC_DL6e.js +216 -0
- package/dist/main.js +3 -3
- package/dist/storybook-docs-page.d.ts +1 -1
- package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
- package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
- package/dist/web.config +8 -8
- package/package.json +94 -94
- package/dist/RichTextEditor-kTQEDSL0.js +0 -477
- package/dist/index-C8H9A55g.js +0 -222
- package/dist/index-CCnm5-ML.js +0 -230
- package/dist/index-CfIcUHKK.js +0 -70
- package/dist/index-ChQc_Cm6.js +0 -1544
- package/dist/index-CmGGeUr0.js +0 -142
- package/dist/index-Ii4UOx3H.js +0 -599
- package/dist/index-z_kiwVc3.js +0 -237
|
@@ -1,122 +1,123 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import { P as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { jsx as i, Fragment as he, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useState as Re } from "react";
|
|
4
|
+
import { u as ye, a as C, P as h, c as v, b as Pe, e as be } from "../../index-B4szHVNJ.js";
|
|
5
|
+
import { u as E } from "../../index-6DGSlWJb.js";
|
|
6
|
+
import { P as Oe, u as Ne, D as Ie } from "../../index-kgC_DL6e.js";
|
|
7
|
+
import { R as Ee, h as Ce, u as xe, F as Ae } from "../../index-BVZdJVFB.js";
|
|
8
|
+
import { P as x } from "../../index-Bq1FiX6B.js";
|
|
9
|
+
import { c as we } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import S from "../Button/Button.js";
|
|
11
|
+
import Me from "../Icon/Icon.js";
|
|
12
|
+
import '../../assets/Dialog.css';var P = "Dialog", [k] = Pe(P), [Fe, u] = k(P), L = (e) => {
|
|
12
13
|
const {
|
|
13
|
-
__scopeDialog:
|
|
14
|
-
children:
|
|
14
|
+
__scopeDialog: l,
|
|
15
|
+
children: r,
|
|
15
16
|
open: t,
|
|
16
|
-
defaultOpen:
|
|
17
|
+
defaultOpen: a,
|
|
17
18
|
onOpenChange: o,
|
|
18
|
-
modal:
|
|
19
|
-
} = e, c =
|
|
19
|
+
modal: n = !0
|
|
20
|
+
} = e, c = s.useRef(null), g = s.useRef(null), [_, m] = ye({
|
|
20
21
|
prop: t,
|
|
21
|
-
defaultProp:
|
|
22
|
+
defaultProp: a ?? !1,
|
|
22
23
|
onChange: o,
|
|
23
|
-
caller:
|
|
24
|
+
caller: P
|
|
24
25
|
});
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
26
|
+
return /* @__PURE__ */ i(
|
|
27
|
+
Fe,
|
|
27
28
|
{
|
|
28
|
-
scope:
|
|
29
|
+
scope: l,
|
|
29
30
|
triggerRef: c,
|
|
30
|
-
contentRef:
|
|
31
|
-
contentId:
|
|
32
|
-
titleId:
|
|
33
|
-
descriptionId:
|
|
34
|
-
open:
|
|
35
|
-
onOpenChange:
|
|
36
|
-
onOpenToggle:
|
|
37
|
-
modal:
|
|
38
|
-
children:
|
|
31
|
+
contentRef: g,
|
|
32
|
+
contentId: E(),
|
|
33
|
+
titleId: E(),
|
|
34
|
+
descriptionId: E(),
|
|
35
|
+
open: _,
|
|
36
|
+
onOpenChange: m,
|
|
37
|
+
onOpenToggle: s.useCallback(() => m((b) => !b), [m]),
|
|
38
|
+
modal: n,
|
|
39
|
+
children: r
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
|
-
L.displayName =
|
|
43
|
-
var
|
|
44
|
-
(e,
|
|
45
|
-
const { __scopeDialog:
|
|
46
|
-
return /* @__PURE__ */
|
|
43
|
+
L.displayName = P;
|
|
44
|
+
var G = "DialogTrigger", j = s.forwardRef(
|
|
45
|
+
(e, l) => {
|
|
46
|
+
const { __scopeDialog: r, ...t } = e, a = u(G, r), o = C(l, a.triggerRef);
|
|
47
|
+
return /* @__PURE__ */ i(
|
|
47
48
|
h.button,
|
|
48
49
|
{
|
|
49
50
|
type: "button",
|
|
50
51
|
"aria-haspopup": "dialog",
|
|
51
|
-
"aria-expanded":
|
|
52
|
-
"aria-controls":
|
|
53
|
-
"data-state":
|
|
52
|
+
"aria-expanded": a.open,
|
|
53
|
+
"aria-controls": a.open ? a.contentId : void 0,
|
|
54
|
+
"data-state": w(a.open),
|
|
54
55
|
...t,
|
|
55
56
|
ref: o,
|
|
56
|
-
onClick: v(e.onClick,
|
|
57
|
+
onClick: v(e.onClick, a.onOpenToggle)
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
);
|
|
61
|
-
|
|
62
|
-
var
|
|
62
|
+
j.displayName = G;
|
|
63
|
+
var A = "DialogPortal", [Te, z] = k(A, {
|
|
63
64
|
forceMount: void 0
|
|
64
65
|
}), K = (e) => {
|
|
65
|
-
const { __scopeDialog:
|
|
66
|
-
return /* @__PURE__ */
|
|
66
|
+
const { __scopeDialog: l, forceMount: r, children: t, container: a } = e, o = u(A, l);
|
|
67
|
+
return /* @__PURE__ */ i(Te, { scope: l, forceMount: r, children: s.Children.map(t, (n) => /* @__PURE__ */ i(x, { present: r || o.open, children: /* @__PURE__ */ i(Oe, { asChild: !0, container: a, children: n }) })) });
|
|
67
68
|
};
|
|
68
|
-
K.displayName =
|
|
69
|
-
var y = "DialogOverlay",
|
|
70
|
-
(e,
|
|
71
|
-
const
|
|
72
|
-
return o.modal ? /* @__PURE__ */
|
|
69
|
+
K.displayName = A;
|
|
70
|
+
var y = "DialogOverlay", H = s.forwardRef(
|
|
71
|
+
(e, l) => {
|
|
72
|
+
const r = z(y, e.__scopeDialog), { forceMount: t = r.forceMount, ...a } = e, o = u(y, e.__scopeDialog);
|
|
73
|
+
return o.modal ? /* @__PURE__ */ i(x, { present: t || o.open, children: /* @__PURE__ */ i(ke, { ...a, ref: l }) }) : null;
|
|
73
74
|
}
|
|
74
75
|
);
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
(e,
|
|
78
|
-
const { __scopeDialog:
|
|
76
|
+
H.displayName = y;
|
|
77
|
+
var Se = be("DialogOverlay.RemoveScroll"), ke = s.forwardRef(
|
|
78
|
+
(e, l) => {
|
|
79
|
+
const { __scopeDialog: r, ...t } = e, a = u(y, r), o = Ne(), n = C(l, o);
|
|
79
80
|
return (
|
|
80
81
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
81
82
|
// ie. when `Overlay` and `Content` are siblings
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ i(Ee, { as: Se, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ i(
|
|
83
84
|
h.div,
|
|
84
85
|
{
|
|
85
|
-
"data-state":
|
|
86
|
+
"data-state": w(a.open),
|
|
86
87
|
...t,
|
|
87
|
-
ref:
|
|
88
|
+
ref: n,
|
|
88
89
|
style: { pointerEvents: "auto", ...t.style }
|
|
89
90
|
}
|
|
90
91
|
) })
|
|
91
92
|
);
|
|
92
93
|
}
|
|
93
|
-
),
|
|
94
|
-
(e,
|
|
95
|
-
const
|
|
96
|
-
return /* @__PURE__ */
|
|
94
|
+
), p = "DialogContent", J = s.forwardRef(
|
|
95
|
+
(e, l) => {
|
|
96
|
+
const r = z(p, e.__scopeDialog), { forceMount: t = r.forceMount, ...a } = e, o = u(p, e.__scopeDialog);
|
|
97
|
+
return /* @__PURE__ */ i(x, { present: t || o.open, children: o.modal ? /* @__PURE__ */ i(Le, { ...a, ref: l }) : /* @__PURE__ */ i(Ge, { ...a, ref: l }) });
|
|
97
98
|
}
|
|
98
99
|
);
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
(e,
|
|
102
|
-
const
|
|
103
|
-
return
|
|
100
|
+
J.displayName = p;
|
|
101
|
+
var Le = s.forwardRef(
|
|
102
|
+
(e, l) => {
|
|
103
|
+
const r = u(p, e.__scopeDialog), t = s.useRef(null), a = C(l, r.contentRef, t);
|
|
104
|
+
return s.useEffect(() => {
|
|
104
105
|
const o = t.current;
|
|
105
|
-
if (o) return
|
|
106
|
-
}, []), /* @__PURE__ */
|
|
107
|
-
|
|
106
|
+
if (o) return Ce(o);
|
|
107
|
+
}, []), /* @__PURE__ */ i(
|
|
108
|
+
B,
|
|
108
109
|
{
|
|
109
110
|
...e,
|
|
110
|
-
ref:
|
|
111
|
-
trapFocus:
|
|
112
|
-
disableOutsidePointerEvents:
|
|
111
|
+
ref: a,
|
|
112
|
+
trapFocus: r.open,
|
|
113
|
+
disableOutsidePointerEvents: r.open,
|
|
113
114
|
onCloseAutoFocus: v(e.onCloseAutoFocus, (o) => {
|
|
114
|
-
var
|
|
115
|
-
o.preventDefault(), (
|
|
115
|
+
var n;
|
|
116
|
+
o.preventDefault(), (n = r.triggerRef.current) == null || n.focus();
|
|
116
117
|
}),
|
|
117
118
|
onPointerDownOutside: v(e.onPointerDownOutside, (o) => {
|
|
118
|
-
const
|
|
119
|
-
(
|
|
119
|
+
const n = o.detail.originalEvent, c = n.button === 0 && n.ctrlKey === !0;
|
|
120
|
+
(n.button === 2 || c) && o.preventDefault();
|
|
120
121
|
}),
|
|
121
122
|
onFocusOutside: v(
|
|
122
123
|
e.onFocusOutside,
|
|
@@ -125,185 +126,164 @@ var Se = l.forwardRef(
|
|
|
125
126
|
}
|
|
126
127
|
);
|
|
127
128
|
}
|
|
128
|
-
),
|
|
129
|
-
(e,
|
|
130
|
-
const
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
|
|
129
|
+
), Ge = s.forwardRef(
|
|
130
|
+
(e, l) => {
|
|
131
|
+
const r = u(p, e.__scopeDialog), t = s.useRef(!1), a = s.useRef(!1);
|
|
132
|
+
return /* @__PURE__ */ i(
|
|
133
|
+
B,
|
|
133
134
|
{
|
|
134
135
|
...e,
|
|
135
|
-
ref:
|
|
136
|
+
ref: l,
|
|
136
137
|
trapFocus: !1,
|
|
137
138
|
disableOutsidePointerEvents: !1,
|
|
138
139
|
onCloseAutoFocus: (o) => {
|
|
139
|
-
var
|
|
140
|
-
(
|
|
140
|
+
var n, c;
|
|
141
|
+
(n = e.onCloseAutoFocus) == null || n.call(e, o), o.defaultPrevented || (t.current || (c = r.triggerRef.current) == null || c.focus(), o.preventDefault()), t.current = !1, a.current = !1;
|
|
141
142
|
},
|
|
142
143
|
onInteractOutside: (o) => {
|
|
143
|
-
var
|
|
144
|
-
(
|
|
145
|
-
const
|
|
146
|
-
((
|
|
144
|
+
var g, _;
|
|
145
|
+
(g = e.onInteractOutside) == null || g.call(e, o), o.defaultPrevented || (t.current = !0, o.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
146
|
+
const n = o.target;
|
|
147
|
+
((_ = r.triggerRef.current) == null ? void 0 : _.contains(n)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && a.current && o.preventDefault();
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
);
|
|
150
151
|
}
|
|
151
|
-
),
|
|
152
|
-
(e,
|
|
153
|
-
const { __scopeDialog:
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
] });
|
|
152
|
+
), B = s.forwardRef(
|
|
153
|
+
(e, l) => {
|
|
154
|
+
const { __scopeDialog: r, trapFocus: t, onOpenAutoFocus: a, onCloseAutoFocus: o, ...n } = e, c = u(p, r);
|
|
155
|
+
return xe(), /* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(
|
|
156
|
+
Ae,
|
|
157
|
+
{
|
|
158
|
+
asChild: !0,
|
|
159
|
+
loop: !0,
|
|
160
|
+
trapped: t,
|
|
161
|
+
onMountAutoFocus: a,
|
|
162
|
+
onUnmountAutoFocus: o,
|
|
163
|
+
children: /* @__PURE__ */ i(
|
|
164
|
+
Ie,
|
|
165
|
+
{
|
|
166
|
+
role: "dialog",
|
|
167
|
+
id: c.contentId,
|
|
168
|
+
"aria-describedby": c.descriptionId,
|
|
169
|
+
"aria-labelledby": c.titleId,
|
|
170
|
+
"data-state": w(c.open),
|
|
171
|
+
...n,
|
|
172
|
+
ref: l,
|
|
173
|
+
deferPointerDownOutside: !0,
|
|
174
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
) });
|
|
183
179
|
}
|
|
184
|
-
),
|
|
185
|
-
(e,
|
|
186
|
-
const { __scopeDialog:
|
|
187
|
-
return /* @__PURE__ */
|
|
180
|
+
), Q = "DialogTitle", U = s.forwardRef(
|
|
181
|
+
(e, l) => {
|
|
182
|
+
const { __scopeDialog: r, ...t } = e, a = u(Q, r);
|
|
183
|
+
return /* @__PURE__ */ i(h.h2, { id: a.titleId, ...t, ref: l });
|
|
188
184
|
}
|
|
189
185
|
);
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
(e,
|
|
193
|
-
const { __scopeDialog:
|
|
194
|
-
return /* @__PURE__ */
|
|
186
|
+
U.displayName = Q;
|
|
187
|
+
var V = "DialogDescription", Y = s.forwardRef(
|
|
188
|
+
(e, l) => {
|
|
189
|
+
const { __scopeDialog: r, ...t } = e, a = u(V, r);
|
|
190
|
+
return /* @__PURE__ */ i(h.p, { id: a.descriptionId, ...t, ref: l });
|
|
195
191
|
}
|
|
196
192
|
);
|
|
197
|
-
|
|
198
|
-
var
|
|
199
|
-
(e,
|
|
200
|
-
const { __scopeDialog:
|
|
201
|
-
return /* @__PURE__ */
|
|
193
|
+
Y.displayName = V;
|
|
194
|
+
var Z = "DialogClose", $ = s.forwardRef(
|
|
195
|
+
(e, l) => {
|
|
196
|
+
const { __scopeDialog: r, ...t } = e, a = u(Z, r);
|
|
197
|
+
return /* @__PURE__ */ i(
|
|
202
198
|
h.button,
|
|
203
199
|
{
|
|
204
200
|
type: "button",
|
|
205
201
|
...t,
|
|
206
|
-
ref:
|
|
207
|
-
onClick: v(e.onClick, () =>
|
|
202
|
+
ref: l,
|
|
203
|
+
onClick: v(e.onClick, () => a.onOpenChange(!1))
|
|
208
204
|
}
|
|
209
205
|
);
|
|
210
206
|
}
|
|
211
207
|
);
|
|
212
|
-
|
|
213
|
-
function
|
|
208
|
+
$.displayName = Z;
|
|
209
|
+
function w(e) {
|
|
214
210
|
return e ? "open" : "closed";
|
|
215
211
|
}
|
|
216
|
-
|
|
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 = {
|
|
212
|
+
const je = "Dialog-module__dialog___r4ljx", d = {
|
|
238
213
|
"dialog-overlay": "Dialog-module__dialog-overlay___mgT2B",
|
|
239
|
-
dialog:
|
|
214
|
+
dialog: je,
|
|
215
|
+
"dialog-width-auto": "Dialog-module__dialog-width-auto___96jJl",
|
|
216
|
+
"dialog-scrollable": "Dialog-module__dialog-scrollable___1ch32",
|
|
240
217
|
"dialog-illustration": "Dialog-module__dialog-illustration___IHiQl",
|
|
218
|
+
"dialog-buttons": "Dialog-module__dialog-buttons___x-v2M",
|
|
241
219
|
"dialog-content": "Dialog-module__dialog-content___3hOGc",
|
|
242
|
-
"dialog-title": "Dialog-module__dialog-title___KACAJ",
|
|
243
220
|
"dialog-description": "Dialog-module__dialog-description___hL8fm",
|
|
244
|
-
"dialog-
|
|
221
|
+
"dialog-title": "Dialog-module__dialog-title___KACAJ",
|
|
245
222
|
"dialog-close-button": "Dialog-module__dialog-close-button___-PzEz",
|
|
246
223
|
"dialog-close-button-icon": "Dialog-module__dialog-close-button-icon___BeGg2"
|
|
247
224
|
};
|
|
248
|
-
function
|
|
225
|
+
function $e({
|
|
249
226
|
children: e,
|
|
250
|
-
isOpen:
|
|
251
|
-
defaultOpen:
|
|
227
|
+
isOpen: l,
|
|
228
|
+
defaultOpen: r = !1,
|
|
252
229
|
onClose: t,
|
|
253
|
-
onOpenChange:
|
|
230
|
+
onOpenChange: a,
|
|
254
231
|
showCloseButton: o,
|
|
255
|
-
closeOnOverlayClick:
|
|
232
|
+
closeOnOverlayClick: n = !0,
|
|
256
233
|
closeOnEscape: c = !0,
|
|
257
|
-
modal:
|
|
258
|
-
container:
|
|
259
|
-
title:
|
|
260
|
-
description:
|
|
261
|
-
|
|
234
|
+
modal: g = !0,
|
|
235
|
+
container: _,
|
|
236
|
+
title: m,
|
|
237
|
+
description: b,
|
|
238
|
+
descriptionScrollable: q,
|
|
239
|
+
widthAuto: W,
|
|
240
|
+
illustrationSrc: M,
|
|
262
241
|
confirmButtonText: F,
|
|
263
|
-
|
|
242
|
+
confirmButtonDisabled: X,
|
|
243
|
+
cancelButtonText: T,
|
|
264
244
|
confirmButtonType: ee = "primary",
|
|
265
|
-
cancelButtonType:
|
|
266
|
-
confirmButtonVariant:
|
|
245
|
+
cancelButtonType: oe = "primary",
|
|
246
|
+
confirmButtonVariant: te = "default",
|
|
267
247
|
cancelButtonVariant: ae = "cancel",
|
|
268
|
-
confirmButtonSize:
|
|
248
|
+
confirmButtonSize: ie = "md",
|
|
269
249
|
cancelButtonSize: re = "md",
|
|
270
|
-
confirmButtonIcon:
|
|
271
|
-
cancelButtonIcon:
|
|
272
|
-
onConfirm:
|
|
273
|
-
onCancel:
|
|
250
|
+
confirmButtonIcon: le,
|
|
251
|
+
cancelButtonIcon: ne,
|
|
252
|
+
onConfirm: O,
|
|
253
|
+
onCancel: N,
|
|
274
254
|
className: se,
|
|
275
255
|
...ce
|
|
276
256
|
}) {
|
|
277
|
-
const [de,
|
|
278
|
-
R ||
|
|
279
|
-
},
|
|
280
|
-
c ||
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
|
|
257
|
+
const [de, I] = Re(r), R = l !== void 0, ue = R ? l : de, ge = o !== void 0 ? o : t !== void 0, fe = (f) => {
|
|
258
|
+
R || I(f), a == null || a(f), f || t == null || t();
|
|
259
|
+
}, _e = (f) => {
|
|
260
|
+
c || f.preventDefault();
|
|
261
|
+
}, pe = (f) => {
|
|
262
|
+
n || f.preventDefault();
|
|
263
|
+
}, me = () => {
|
|
264
|
+
O == null || O(), R || I(!1), t == null || t();
|
|
285
265
|
}, De = () => {
|
|
286
|
-
|
|
287
|
-
}, ve = /* @__PURE__ */
|
|
288
|
-
e && /* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
ge && /* @__PURE__ */
|
|
293
|
-
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
266
|
+
N == null || N(), R || I(!1), t == null || t();
|
|
267
|
+
}, ve = /* @__PURE__ */ D(L, { open: ue, onOpenChange: fe, modal: g, children: [
|
|
268
|
+
e && /* @__PURE__ */ i(j, { asChild: !0, children: /* @__PURE__ */ i("div", { children: e }) }),
|
|
269
|
+
/* @__PURE__ */ D(K, { container: _, children: [
|
|
270
|
+
/* @__PURE__ */ i(H, { className: d["dialog-overlay"] }),
|
|
271
|
+
/* @__PURE__ */ D(J, { className: we(d.dialog, q && d["dialog-scrollable"], W && d["dialog-width-auto"]), onEscapeKeyDown: _e, onInteractOutside: pe, children: [
|
|
272
|
+
ge && /* @__PURE__ */ i($, { className: d["dialog-close-button"], "aria-label": "Close dialog", children: /* @__PURE__ */ i(Me, { className: d["dialog-close-button-icon"], icon: "ap-icon-close" }) }),
|
|
273
|
+
M && /* @__PURE__ */ i("div", { className: d["dialog-illustration"], children: /* @__PURE__ */ i("img", { src: M, alt: "Dialog illustration" }) }),
|
|
274
|
+
/* @__PURE__ */ D("div", { className: d["dialog-content"], children: [
|
|
275
|
+
/* @__PURE__ */ i(U, { className: d["dialog-title"], children: m }),
|
|
276
|
+
/* @__PURE__ */ i(Y, { asChild: !0, children: /* @__PURE__ */ i("div", { className: d["dialog-description"], children: b }) })
|
|
297
277
|
] }),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
|
|
300
|
-
F && /* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ D("div", { className: d["dialog-buttons"], children: [
|
|
279
|
+
T && /* @__PURE__ */ i(S, { type: oe, variant: ae, size: re, onClick: De, icon: ne, children: T }),
|
|
280
|
+
F && /* @__PURE__ */ i(S, { type: ee, variant: te, size: ie, onClick: me, icon: le, disabled: X, children: F })
|
|
301
281
|
] })
|
|
302
282
|
] })
|
|
303
283
|
] })
|
|
304
284
|
] });
|
|
305
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ i("div", { className: se, ...ce, children: ve });
|
|
306
286
|
}
|
|
307
287
|
export {
|
|
308
|
-
|
|
288
|
+
$e as default
|
|
309
289
|
};
|