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