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