@stenajs-webui/modal 23.20.1 → 23.20.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/index.es.js CHANGED
@@ -1,22 +1,22 @@
1
- import L from "react-modal";
1
+ import F from "react-modal";
2
2
  import { jsx as t, jsxs as a, Fragment as K } from "react/jsx-runtime";
3
- import { useRef as w, useState as R, useEffect as Oe, createContext as Ie, useReducer as Ae, useCallback as z, useMemo as me, createElement as ue, useContext as Te } from "react";
4
- import Me from "react-draggable";
3
+ import { useRef as w, useState as E, useEffect as ze, createContext as Ae, useReducer as Te, useCallback as O, useMemo as ue, createElement as _e, useContext as Me } from "react";
4
+ import Re from "react-draggable";
5
5
  import c from "classnames";
6
- import { exhaustSwitchCase as Re, Spacing as F, Row as p, Space as Q, Heading as te, useEventCallback as Ee, Column as v, Box as B, Indent as We, Txt as He, Text as Z } from "@stenajs-webui/core";
7
- import { Icon as be, FlatButton as Ne, stenaTimes as Se, Spinner as je, CloseButton as oe, stenaTimesThick as Pe, CircledIcon as we } from "@stenajs-webui/elements";
8
- import { cssColor as Be } from "@stenajs-webui/theme";
9
- import { ToastContainer as qe, toast as Ge } from "react-toastify";
10
- import './index.css';const Lo = (e) => {
11
- L.setAppElement(e);
12
- }, Ve = "_overlay_quvmp_1", Xe = "_modal_quvmp_31", Ye = "_content_quvmp_41", Ue = "_isDraggable_quvmp_70", Je = "_footer_quvmp_101", Ke = "_stickyFooter_quvmp_105", k = {
13
- overlay: Ve,
14
- modal: Xe,
15
- content: Ye,
16
- isDraggable: Ue,
17
- footer: Je,
18
- stickyFooter: Ke
19
- }, $e = "draggable-modal-handle", xe = "draggable-modal-cancel", Qe = ({
6
+ import { exhaustSwitchCase as Ee, Spacing as I, Row as p, Space as Q, Heading as te, useEventCallback as We, Column as C, Box as B, Indent as He, Txt as Se, Text as Z } from "@stenajs-webui/core";
7
+ import { Icon as Ne, FlatButton as we, stenaTimes as je, Spinner as Pe, CloseButton as oe, stenaTimesThick as Ge, CircledIcon as Be } from "@stenajs-webui/elements";
8
+ import { cssColor as $e } from "@stenajs-webui/theme";
9
+ import { ToastContainer as Ve, toast as qe } from "react-toastify";
10
+ import './index.css';const Fo = (e) => {
11
+ F.setAppElement(e);
12
+ }, Xe = "_overlay_zoch3_1", Ye = "_modal_zoch3_33", Ue = "_content_zoch3_43", Je = "_isDraggable_zoch3_72", Ke = "_footer_zoch3_103", Qe = "_stickyFooter_zoch3_107", L = {
13
+ overlay: Xe,
14
+ modal: Ye,
15
+ content: Ue,
16
+ isDraggable: Je,
17
+ footer: Ke,
18
+ stickyFooter: Qe
19
+ }, ke = "draggable-modal-handle", xe = "draggable-modal-cancel", Ze = ({
20
20
  width: e,
21
21
  maxWidth: o,
22
22
  draggable: n = !1,
@@ -25,15 +25,15 @@ import './index.css';const Lo = (e) => {
25
25
  }) => {
26
26
  const i = w(null);
27
27
  return /* @__PURE__ */ t(
28
- L,
28
+ F,
29
29
  {
30
- overlayClassName: k.overlay,
31
- className: k.modal,
30
+ overlayClassName: L.overlay,
31
+ className: L.modal,
32
32
  ...r,
33
33
  children: /* @__PURE__ */ t(
34
- Me,
34
+ Re,
35
35
  {
36
- handle: `.${$e}`,
36
+ handle: `.${ke}`,
37
37
  cancel: `.${xe}, button, [role="tooltip"]`,
38
38
  bounds: ".ReactModal__Overlay",
39
39
  disabled: !n,
@@ -45,8 +45,8 @@ import './index.css';const Lo = (e) => {
45
45
  "--swui-modal-width": e,
46
46
  "--swui-modal-max-width": o
47
47
  },
48
- className: c(k.content, {
49
- [k.isDraggable]: n
48
+ className: c(L.content, {
49
+ [L.isDraggable]: n
50
50
  }),
51
51
  ref: i,
52
52
  children: s
@@ -56,18 +56,18 @@ import './index.css';const Lo = (e) => {
56
56
  )
57
57
  }
58
58
  );
59
- }, Ze = "_portal_17ze5_1", et = "_overlay_17ze5_4", tt = "_content_17ze5_9", ot = "_floating_17ze5_15", nt = "_slideFromLeft_17ze5_29", st = "_slideFromRight_17ze5_30", rt = "_afterOpen_17ze5_36", at = "_beforeClose_17ze5_40", lt = "_slideFromTop_17ze5_45", ct = "_slideFromBottom_17ze5_46", f = {
60
- portal: Ze,
61
- overlay: et,
62
- content: tt,
63
- floating: ot,
64
- slideFromLeft: nt,
65
- slideFromRight: st,
66
- afterOpen: rt,
67
- beforeClose: at,
68
- slideFromTop: lt,
69
- slideFromBottom: ct
70
- }, zo = ({
59
+ }, et = "_portal_194oy_1", tt = "_overlay_194oy_4", ot = "_content_194oy_9", nt = "_floating_194oy_18", st = "_slideFromLeft_194oy_32", rt = "_slideFromRight_194oy_33", at = "_afterOpen_194oy_39", lt = "_beforeClose_194oy_43", ct = "_slideFromTop_194oy_48", it = "_slideFromBottom_194oy_49", f = {
60
+ portal: et,
61
+ overlay: tt,
62
+ content: ot,
63
+ floating: nt,
64
+ slideFromLeft: st,
65
+ slideFromRight: rt,
66
+ afterOpen: at,
67
+ beforeClose: lt,
68
+ slideFromTop: ct,
69
+ slideFromBottom: it
70
+ }, Oo = ({
71
71
  background: e,
72
72
  zIndex: o,
73
73
  children: n,
@@ -78,7 +78,7 @@ import './index.css';const Lo = (e) => {
78
78
  }) => {
79
79
  const { height: l, width: h } = m;
80
80
  return /* @__PURE__ */ t(
81
- L,
81
+ F,
82
82
  {
83
83
  closeTimeoutMS: 250,
84
84
  portalClassName: f.portal,
@@ -90,7 +90,7 @@ import './index.css';const Lo = (e) => {
90
90
  className: {
91
91
  base: c(
92
92
  f.content,
93
- it(s),
93
+ dt(s),
94
94
  i && f.floating
95
95
  ),
96
96
  afterOpen: f.afterOpen,
@@ -99,10 +99,11 @@ import './index.css';const Lo = (e) => {
99
99
  style: { content: { width: h, height: l, background: e }, overlay: { zIndex: o } },
100
100
  parentSelector: r ? () => r : void 0,
101
101
  ...m,
102
+ bodyOpenClassName: "swui-drawer-body-open",
102
103
  children: n
103
104
  }
104
105
  );
105
- }, it = (e) => {
106
+ }, dt = (e) => {
106
107
  switch (e) {
107
108
  case "left":
108
109
  return f.slideFromLeft;
@@ -113,20 +114,20 @@ import './index.css';const Lo = (e) => {
113
114
  case "bottom":
114
115
  return f.slideFromBottom;
115
116
  default:
116
- return Re(e, f.slideFromLeft);
117
+ return Ee(e, f.slideFromLeft);
117
118
  }
118
- }, Fo = ({
119
+ }, Io = ({
119
120
  header: e,
120
121
  contentRight: o,
121
122
  onRequestClose: n,
122
123
  icon: s
123
124
  }) => /* @__PURE__ */ t(
124
- F,
125
+ I,
125
126
  {
126
127
  position: "sticky",
127
128
  top: 0,
128
129
  zIndex: 100,
129
- background: Be("--lhds-color-ui-50"),
130
+ background: $e("--lhds-color-ui-50"),
130
131
  children: /* @__PURE__ */ a(
131
132
  p,
132
133
  {
@@ -136,15 +137,15 @@ import './index.css';const Lo = (e) => {
136
137
  children: [
137
138
  /* @__PURE__ */ a(p, { alignItems: "center", gap: 2, children: [
138
139
  /* @__PURE__ */ t(Q, { num: 1 }),
139
- s && /* @__PURE__ */ t(be, { icon: s, size: 24 }),
140
+ s && /* @__PURE__ */ t(Ne, { icon: s, size: 24 }),
140
141
  /* @__PURE__ */ t(te, { variant: "h4", children: e })
141
142
  ] }),
142
143
  /* @__PURE__ */ a(p, { gap: 1, children: [
143
144
  o,
144
145
  /* @__PURE__ */ t(
145
- Ne,
146
+ we,
146
147
  {
147
- leftIcon: Se,
148
+ leftIcon: je,
148
149
  onClick: n,
149
150
  variant: "danger"
150
151
  }
@@ -155,19 +156,19 @@ import './index.css';const Lo = (e) => {
155
156
  }
156
157
  )
157
158
  }
158
- ), dt = "_overlay_1gix5_1", mt = "_modal_1gix5_31", ut = "_content_1gix5_38", Y = {
159
- overlay: dt,
160
- modal: mt,
161
- content: ut
162
- }, _t = { overlay: { justifyContent: "center" } }, Oo = ({
159
+ ), mt = "_overlay_1xtk3_1", ut = "_modal_1xtk3_33", _t = "_content_1xtk3_40", Y = {
160
+ overlay: mt,
161
+ modal: ut,
162
+ content: _t
163
+ }, ft = { overlay: { justifyContent: "center" } }, zo = ({
163
164
  children: e,
164
165
  ...o
165
166
  }) => /* @__PURE__ */ t(
166
- L,
167
+ F,
167
168
  {
168
169
  overlayClassName: Y.overlay,
169
170
  className: Y.modal,
170
- style: _t,
171
+ style: ft,
171
172
  ...o,
172
173
  children: /* @__PURE__ */ t(
173
174
  "div",
@@ -178,46 +179,46 @@ import './index.css';const Lo = (e) => {
178
179
  }
179
180
  )
180
181
  }
181
- ), ft = "_overlay_nbrrn_1", gt = "_afterOpen_nbrrn_24", pt = "_beforeClose_nbrrn_24", ht = "_modal_nbrrn_36", yt = "_content_nbrrn_59", x = {
182
- overlay: ft,
183
- afterOpen: gt,
184
- beforeClose: pt,
185
- modal: ht,
186
- content: yt
187
- }, _e = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), Ct = ({
182
+ ), gt = "_overlay_20o05_1", pt = "_afterOpen_20o05_29", ht = "_beforeClose_20o05_29", yt = "_modal_20o05_41", Ct = "_content_20o05_64", k = {
183
+ overlay: gt,
184
+ afterOpen: pt,
185
+ beforeClose: ht,
186
+ modal: yt,
187
+ content: Ct
188
+ }, fe = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), vt = ({
188
189
  children: e,
189
190
  background: o,
190
191
  className: n,
191
192
  overlayClassName: s,
192
193
  ...r
193
194
  }) => {
194
- const i = w(null), [m, l] = R(_e ? "auto" : void 0), h = {
195
+ const i = w(null), [m, l] = E(fe ? "auto" : void 0), h = {
195
196
  overlay: { justifyContent: "center" },
196
197
  content: {
197
198
  "--swui-modal-content-bg-color": o
198
199
  }
199
- }, u = Ee(() => {
200
- if (!_e)
200
+ }, u = We(() => {
201
+ if (!fe)
201
202
  return;
202
203
  const y = i.current;
203
204
  y && l(
204
205
  y.scrollHeight > y.clientHeight ? "stable" : "auto"
205
206
  );
206
207
  });
207
- return Oe(() => (window.addEventListener("resize", u), document.addEventListener("DOMContentLoaded", u), () => {
208
+ return ze(() => (window.addEventListener("resize", u), document.addEventListener("DOMContentLoaded", u), () => {
208
209
  window.removeEventListener("resize", u), document.removeEventListener("DOMContentLoaded", u);
209
210
  }), [u]), /* @__PURE__ */ t(
210
- L,
211
+ F,
211
212
  {
212
213
  overlayClassName: {
213
- base: c(s, x.overlay),
214
- beforeClose: x.beforeClose,
215
- afterOpen: x.afterOpen
214
+ base: c(s, k.overlay),
215
+ beforeClose: k.beforeClose,
216
+ afterOpen: k.afterOpen
216
217
  },
217
218
  className: {
218
- base: c(n, x.modal),
219
- beforeClose: x.beforeClose,
220
- afterOpen: x.afterOpen
219
+ base: c(n, k.modal),
220
+ beforeClose: k.beforeClose,
221
+ afterOpen: k.afterOpen
221
222
  },
222
223
  style: h,
223
224
  closeTimeoutMS: 250,
@@ -226,7 +227,7 @@ import './index.css';const Lo = (e) => {
226
227
  children: /* @__PURE__ */ t(
227
228
  "div",
228
229
  {
229
- className: x.content,
230
+ className: k.content,
230
231
  style: {
231
232
  "--swui-modal-width": "fit-content",
232
233
  scrollbarGutter: m
@@ -237,25 +238,25 @@ import './index.css';const Lo = (e) => {
237
238
  )
238
239
  }
239
240
  );
240
- }, vt = "_modal_4fwgb_1", bt = "_overlay_4fwgb_13", fe = {
241
- modal: vt,
242
- overlay: bt
243
- }, Io = ({
241
+ }, bt = "_modal_4fwgb_1", Nt = "_overlay_4fwgb_13", ge = {
242
+ modal: bt,
243
+ overlay: Nt
244
+ }, Ao = ({
244
245
  headerIconLeft: e,
245
246
  headerText: o,
246
247
  shouldCloseOnOverlayClick: n = !1,
247
248
  shouldCloseOnEsc: s = !1,
248
249
  ...r
249
250
  }) => /* @__PURE__ */ t(
250
- L,
251
+ F,
251
252
  {
252
253
  ...r,
253
254
  isOpen: !0,
254
255
  shouldCloseOnOverlayClick: n,
255
256
  shouldCloseOnEsc: s,
256
- className: fe.modal,
257
- overlayClassName: fe.overlay,
258
- children: /* @__PURE__ */ a(v, { spacing: 2, alignItems: "center", children: [
257
+ className: ge.modal,
258
+ overlayClassName: ge.overlay,
259
+ children: /* @__PURE__ */ a(C, { spacing: 2, alignItems: "center", children: [
259
260
  /* @__PURE__ */ t(
260
261
  B,
261
262
  {
@@ -266,22 +267,22 @@ import './index.css';const Lo = (e) => {
266
267
  borderRadius: "50%",
267
268
  background: "white",
268
269
  shadow: "modal",
269
- children: /* @__PURE__ */ t(je, { size: "small" })
270
+ children: /* @__PURE__ */ t(Pe, { size: "small" })
270
271
  }
271
272
  ),
272
273
  (e || o) && /* @__PURE__ */ a(K, { children: [
273
- /* @__PURE__ */ t(F, {}),
274
+ /* @__PURE__ */ t(I, {}),
274
275
  /* @__PURE__ */ a(p, { indent: 2, children: [
275
276
  e && /* @__PURE__ */ a(K, { children: [
276
- /* @__PURE__ */ t(be, { size: 14, icon: e, color: "white" }),
277
- /* @__PURE__ */ t(We, {})
277
+ /* @__PURE__ */ t(Ne, { size: 14, icon: e, color: "white" }),
278
+ /* @__PURE__ */ t(He, {})
278
279
  ] }),
279
280
  o && /* @__PURE__ */ t(te, { variant: "h4", color: "white", children: o })
280
281
  ] })
281
282
  ] })
282
283
  ] })
283
284
  }
284
- ), Nt = ({
285
+ ), wt = ({
285
286
  onRequestClose: e,
286
287
  header: o,
287
288
  headerText: n,
@@ -292,10 +293,10 @@ import './index.css';const Lo = (e) => {
292
293
  spacing: 2,
293
294
  indent: 2,
294
295
  borderBottom: "1px solid var(--lhds-color-ui-300)",
295
- className: $e,
296
+ className: ke,
296
297
  children: [
297
298
  /* @__PURE__ */ a(p, { flex: 1, indent: !0, alignItems: "center", children: [
298
- n && /* @__PURE__ */ t(He, { className: xe, size: "large", children: n }),
299
+ n && /* @__PURE__ */ t(Se, { className: xe, size: "large", children: n }),
299
300
  o
300
301
  ] }),
301
302
  /* @__PURE__ */ t(B, { alignSelf: "flex-start", children: /* @__PURE__ */ t(
@@ -307,7 +308,7 @@ import './index.css';const Lo = (e) => {
307
308
  ) })
308
309
  ]
309
310
  }
310
- ), Ao = ({
311
+ ), To = ({
311
312
  header: e,
312
313
  headerText: o,
313
314
  children: n,
@@ -320,14 +321,14 @@ import './index.css';const Lo = (e) => {
320
321
  disableStickyFooter: u = !1,
321
322
  ...y
322
323
  }) => /* @__PURE__ */ a(
323
- Qe,
324
+ Ze,
324
325
  {
325
326
  ...y,
326
327
  onRequestClose: m,
327
328
  draggable: i,
328
329
  children: [
329
330
  /* @__PURE__ */ t(
330
- Nt,
331
+ wt,
331
332
  {
332
333
  onRequestClose: m,
333
334
  header: e,
@@ -339,15 +340,15 @@ import './index.css';const Lo = (e) => {
339
340
  h && /* @__PURE__ */ t(
340
341
  B,
341
342
  {
342
- className: c(k.footer, {
343
- [k.stickyFooter]: !u
343
+ className: c(L.footer, {
344
+ [L.stickyFooter]: !u
344
345
  }),
345
346
  children: h
346
347
  }
347
348
  )
348
349
  ]
349
350
  }
350
- ), To = ({ children: e }) => /* @__PURE__ */ t(v, { indent: 2, spacing: 2, children: e }), ee = Ie(
351
+ ), Mo = ({ children: e }) => /* @__PURE__ */ t(C, { indent: 2, spacing: 2, children: e }), ee = Ae(
351
352
  void 0
352
353
  );
353
354
  function ne(e, {
@@ -359,54 +360,55 @@ function ne(e, {
359
360
  dialogStyle: m,
360
361
  divInsteadOfDialog: l,
361
362
  disableCloseOnClickOutside: h,
362
- elementId: u,
363
- onResolve: y,
364
- onReject: C,
365
- className: E,
363
+ blockScroll: u = !0,
364
+ elementId: y,
365
+ onResolve: v,
366
+ onReject: x,
367
+ className: se,
366
368
  background: W,
367
369
  label: H,
368
370
  labelledby: S,
369
371
  describedby: j
370
372
  }) {
371
- const Le = w(null), _ = o ?? Le, [P, ze] = Ae((d) => d + 1, 0), se = w(null), q = w(null), b = w(void 0), O = w(!1), I = w(null), [re, A] = R(!1), [G, D] = R(!1), [ae, N] = R(!1), V = e, Fe = z(
372
- (d) => (se.current = new Promise(
373
- (g, de) => {
374
- q.current = g, I.current = de;
373
+ const Fe = w(null), _ = o ?? Fe, [P, Oe] = Te((d) => d + 1, 0), re = w(null), G = w(null), b = w(void 0), z = w(!1), A = w(null), [ae, T] = E(!1), [V, D] = E(!1), [le, N] = E(!1), q = e, Ie = O(
374
+ (d) => (re.current = new Promise(
375
+ (g, me) => {
376
+ G.current = g, A.current = me;
375
377
  }
376
- ), N(!1), A(!0), D(!0), ze(), O.current = !1, b.current = d, n ? _.current?.showModal() : _.current?.show(), se.current),
378
+ ), N(!1), T(!0), D(!0), Oe(), z.current = !1, b.current = d, n ? _.current?.showModal() : _.current?.show(), re.current),
377
379
  [_, n]
378
- ), le = z(
380
+ ), ce = O(
379
381
  (d) => {
380
- O.current = !0, N(!0), A(!1), l ? setTimeout(() => {
381
- N(!1), D(!1), q.current?.(d), b.current = void 0, y?.();
382
+ z.current = !0, N(!0), T(!1), l ? setTimeout(() => {
383
+ N(!1), D(!1), G.current?.(d), b.current = void 0, v?.();
382
384
  }, 300) : _.current?.addEventListener(
383
385
  "animationend",
384
386
  (g) => {
385
- g.stopPropagation(), N(!1), D(!1), _.current?.close(), q.current?.(d), b.current = void 0, y?.();
387
+ g.stopPropagation(), N(!1), D(!1), _.current?.close(), G.current?.(d), b.current = void 0, v?.();
386
388
  },
387
389
  { once: !0 }
388
390
  );
389
391
  },
390
- [_, y, l]
391
- ), $ = z(
392
+ [_, v, l]
393
+ ), $ = O(
392
394
  (d) => {
393
- O.current = !0, N(!0), A(!1), l ? setTimeout(() => {
394
- N(!1), D(!1), I.current?.(d), C?.(), b.current = void 0;
395
+ z.current = !0, N(!0), T(!1), l ? setTimeout(() => {
396
+ N(!1), D(!1), A.current?.(d), x?.(), b.current = void 0;
395
397
  }, 300) : _.current?.addEventListener(
396
398
  "animationend",
397
399
  (g) => {
398
- g.stopPropagation(), N(!1), D(!1), _.current?.close(), I.current?.(d), C?.(), b.current = void 0;
400
+ g.stopPropagation(), N(!1), D(!1), _.current?.close(), A.current?.(d), x?.(), b.current = void 0;
399
401
  },
400
402
  { once: !0 }
401
403
  );
402
404
  },
403
- [_, l, C]
404
- ), ce = z(
405
+ [_, l, x]
406
+ ), ie = O(
405
407
  (d) => {
406
- d.stopPropagation(), O.current || (N(!1), A(!1), D(!1), I.current?.(), C?.(), b.current = void 0);
408
+ d.stopPropagation(), z.current || (N(!1), T(!1), D(!1), A.current?.(), x?.(), b.current = void 0);
407
409
  },
408
- [C]
409
- ), ie = z(
410
+ [x]
411
+ ), de = O(
410
412
  (d) => {
411
413
  if (d.target !== _.current)
412
414
  return;
@@ -414,73 +416,78 @@ function ne(e, {
414
416
  g.top <= d.clientY && d.clientY <= g.top + g.height && g.left <= d.clientX && d.clientX <= g.left + g.width || $();
415
417
  },
416
418
  [_, $]
417
- ), X = me(
418
- () => ({ resolve: le, reject: $ }),
419
- [$, le]
419
+ ), X = ue(
420
+ () => ({ resolve: ce, reject: $ }),
421
+ [$, ce]
420
422
  );
421
- return [me(
423
+ return [ue(
422
424
  () => l ? /* @__PURE__ */ t(
423
- Ct,
425
+ vt,
424
426
  {
425
- isOpen: re,
427
+ isOpen: ae,
426
428
  onRequestClose: $,
427
429
  background: W,
428
430
  contentLabel: H,
429
- id: u,
431
+ id: y,
430
432
  aria: { modal: !0, labelledby: S, describedby: j },
431
- children: /* @__PURE__ */ t(ee.Provider, { value: X, children: G && /* @__PURE__ */ ue(V, { ...b.current, key: P }) })
433
+ children: /* @__PURE__ */ t(ee.Provider, { value: X, children: V && /* @__PURE__ */ _e(q, { ...b.current, key: P }) })
432
434
  }
433
435
  ) : /* @__PURE__ */ t(
434
436
  "dialog",
435
437
  {
436
- onClick: h ? void 0 : ie,
437
- onClose: ce,
438
+ onClick: h ? void 0 : de,
439
+ onClose: ie,
438
440
  ref: _,
439
- id: u,
440
- className: c("swui-dialog", E, ae && r),
441
+ id: y,
442
+ className: c(
443
+ u && "swui-block-scroll",
444
+ se,
445
+ le && r
446
+ ),
441
447
  "aria-label": H,
442
448
  "aria-labelledby": S,
443
449
  "aria-describedby": j,
444
450
  style: { background: W, ...m },
445
- children: /* @__PURE__ */ t("div", { style: i, className: s, children: G && /* @__PURE__ */ t(ee.Provider, { value: X, children: /* @__PURE__ */ ue(V, { ...b.current, key: P }) }) })
451
+ children: /* @__PURE__ */ t("div", { style: i, className: s, children: V && /* @__PURE__ */ t(ee.Provider, { value: X, children: /* @__PURE__ */ _e(q, { ...b.current, key: P }) }) })
446
452
  }
447
453
  ),
448
454
  [
449
455
  l,
450
- re,
456
+ ae,
451
457
  $,
452
458
  W,
453
459
  H,
454
- u,
460
+ y,
455
461
  S,
456
462
  j,
457
463
  X,
458
- G,
459
464
  V,
465
+ q,
460
466
  P,
461
467
  h,
468
+ u,
469
+ de,
462
470
  ie,
463
- ce,
464
471
  _,
465
- E,
466
- ae,
472
+ se,
473
+ le,
467
474
  r,
468
475
  m,
469
476
  i,
470
477
  s
471
478
  ]
472
- ), { show: Fe, reject: $ }];
479
+ ), { show: Ie, reject: $ }];
473
480
  }
474
- const Mo = () => {
475
- const e = Te(ee);
481
+ const Ro = () => {
482
+ const e = Me(ee);
476
483
  if (e == null)
477
484
  throw new Error("useDialogPromise is being used outside of dialog.");
478
485
  return e;
479
- }, wt = "_alertDialog_14t8t_1", Bt = "_closing_14t8t_22", U = {
480
- alertDialog: wt,
481
- closing: Bt
486
+ }, Bt = "_alertDialog_14t8t_1", $t = "_closing_14t8t_22", U = {
487
+ alertDialog: Bt,
488
+ closing: $t
482
489
  };
483
- function Ro(e, o) {
490
+ function Eo(e, o) {
484
491
  return ne(e, {
485
492
  ...o,
486
493
  modal: !0,
@@ -492,42 +499,45 @@ function Ro(e, o) {
492
499
  className: c(o?.className, U.alertDialog)
493
500
  });
494
501
  }
495
- const $t = "_drawerDialog_11g6r_1", xt = "_left_11g6r_13", Dt = "_right_11g6r_14", kt = "_contentWrapper_11g6r_19", Lt = "_slideInLeft_11g6r_1", zt = "_closing_11g6r_36", Ft = "_slideOutLeft_11g6r_1", Ot = "_slideInRight_11g6r_1", It = "_slideOutRight_11g6r_1", At = "_top_11g6r_54", Tt = "_bottom_11g6r_55", Mt = "_slideInTop_11g6r_1", Rt = "_slideOutTop_11g6r_1", Et = "_slideInBottom_11g6r_1", Wt = "_slideOutBottom_11g6r_1", T = {
496
- drawerDialog: $t,
502
+ const kt = "_drawerDialog_11g6r_1", xt = "_left_11g6r_13", Dt = "_right_11g6r_14", Lt = "_contentWrapper_11g6r_19", Ft = "_slideInLeft_11g6r_1", Ot = "_closing_11g6r_36", It = "_slideOutLeft_11g6r_1", zt = "_slideInRight_11g6r_1", At = "_slideOutRight_11g6r_1", Tt = "_top_11g6r_54", Mt = "_bottom_11g6r_55", Rt = "_slideInTop_11g6r_1", Et = "_slideOutTop_11g6r_1", Wt = "_slideInBottom_11g6r_1", Ht = "_slideOutBottom_11g6r_1", M = {
503
+ drawerDialog: kt,
497
504
  left: xt,
498
505
  right: Dt,
499
- contentWrapper: kt,
500
- slideInLeft: Lt,
501
- closing: zt,
502
- slideOutLeft: Ft,
503
- slideInRight: Ot,
504
- slideOutRight: It,
505
- top: At,
506
- bottom: Tt,
507
- slideInTop: Mt,
508
- slideOutTop: Rt,
509
- slideInBottom: Et,
510
- slideOutBottom: Wt
506
+ contentWrapper: Lt,
507
+ slideInLeft: Ft,
508
+ closing: Ot,
509
+ slideOutLeft: It,
510
+ slideInRight: zt,
511
+ slideOutRight: At,
512
+ top: Tt,
513
+ bottom: Mt,
514
+ slideInTop: Rt,
515
+ slideOutTop: Et,
516
+ slideInBottom: Wt,
517
+ slideOutBottom: Ht
511
518
  };
512
- function Eo(e, o = "left", n) {
519
+ function Wo(e, o = "left", n) {
513
520
  return ne(e, {
514
521
  ...n,
515
522
  disableCloseOnClickOutside: !0,
516
523
  modal: !1,
517
- closingClassName: c(n?.closingClassName, T.closing),
524
+ // Drawers never block page scroll. The drawer's own scroll is kept from
525
+ // chaining to the page by overscroll-behavior on its content.
526
+ blockScroll: !1,
527
+ closingClassName: c(n?.closingClassName, M.closing),
518
528
  contentWrapperClassName: c(
519
529
  n?.contentWrapperClassName,
520
- T.contentWrapper
530
+ M.contentWrapper
521
531
  ),
522
- className: c(n?.className, T.drawerDialog, T[o])
532
+ className: c(n?.className, M.drawerDialog, M[o])
523
533
  });
524
534
  }
525
- const Ht = "_modalDialog_iw29e_1", St = "_closing_iw29e_37", jt = "_contentWrapper_iw29e_101", J = {
526
- modalDialog: Ht,
527
- closing: St,
528
- contentWrapper: jt
535
+ const St = "_modalDialog_iw29e_1", jt = "_closing_iw29e_37", Pt = "_contentWrapper_iw29e_101", J = {
536
+ modalDialog: St,
537
+ closing: jt,
538
+ contentWrapper: Pt
529
539
  };
530
- function Wo(e, o) {
540
+ function Ho(e, o) {
531
541
  return ne(e, {
532
542
  ...o,
533
543
  modal: !0,
@@ -543,34 +553,34 @@ const De = ({
543
553
  headingLevel: e = "h2",
544
554
  size: o = "medium",
545
555
  children: n
546
- }) => /* @__PURE__ */ t(te, { variant: o === "medium" ? "h3" : "h1", as: e, children: n }), Pt = "_modalActionButtons_zeqa6_1", qt = {
547
- modalActionButtons: Pt
548
- }, Gt = ({
556
+ }) => /* @__PURE__ */ t(te, { variant: o === "medium" ? "h3" : "h1", as: e, children: n }), Gt = "_modalActionButtons_zeqa6_1", Vt = {
557
+ modalActionButtons: Gt
558
+ }, qt = ({
549
559
  children: e
550
560
  }) => /* @__PURE__ */ a(B, { width: "100%", children: [
551
- /* @__PURE__ */ t(F, {}),
552
- /* @__PURE__ */ t("div", { className: qt.modalActionButtons, children: e })
553
- ] }), Vt = "_modalBody_ozynq_1", ge = {
554
- modalBody: Vt
555
- }, Xt = ({
561
+ /* @__PURE__ */ t(I, {}),
562
+ /* @__PURE__ */ t("div", { className: Vt.modalActionButtons, children: e })
563
+ ] }), Xt = "_modalBody_ozynq_1", pe = {
564
+ modalBody: Xt
565
+ }, Yt = ({
556
566
  gap: e = 3,
557
567
  variant: o = "normal",
558
568
  className: n,
559
569
  ...s
560
570
  }) => /* @__PURE__ */ t(
561
- v,
571
+ C,
562
572
  {
563
- className: c(ge.modalBody, ge[o], n),
573
+ className: c(pe.modalBody, pe[o], n),
564
574
  indent: o === "relaxed" ? 5 : 3,
565
575
  spacing: o === "relaxed" ? 5 : 3,
566
576
  gap: e,
567
577
  ...s
568
578
  }
569
- ), Yt = ({
579
+ ), Ut = ({
570
580
  children: e,
571
581
  maxWidth: o
572
582
  }) => /* @__PURE__ */ t(
573
- v,
583
+ C,
574
584
  {
575
585
  flex: 1,
576
586
  height: "100%",
@@ -578,31 +588,31 @@ const De = ({
578
588
  maxWidth: o,
579
589
  children: e
580
590
  }
581
- ), Ut = (e) => /* @__PURE__ */ t(
582
- Ne,
591
+ ), Jt = (e) => /* @__PURE__ */ t(
592
+ we,
583
593
  {
584
594
  size: "large",
585
595
  variant: "danger",
586
- leftIcon: Pe,
596
+ leftIcon: Ge,
587
597
  ...e
588
598
  }
589
- ), Jt = ({
599
+ ), Kt = ({
590
600
  heading: e,
591
601
  headingLevel: o,
592
602
  headingSize: n,
593
603
  onClickClose: s,
594
604
  closeButtonAriaLabel: r
595
- }) => /* @__PURE__ */ t(v, { children: /* @__PURE__ */ a(p, { justifyContent: "space-between", alignItems: "center", gap: 2, children: [
605
+ }) => /* @__PURE__ */ t(C, { children: /* @__PURE__ */ a(p, { justifyContent: "space-between", alignItems: "center", gap: 2, children: [
596
606
  e ? /* @__PURE__ */ t(De, { headingLevel: o, size: n, children: e }) : /* @__PURE__ */ t("div", {}),
597
607
  s ? /* @__PURE__ */ t(
598
- Ut,
608
+ Jt,
599
609
  {
600
610
  onClick: s,
601
611
  size: n,
602
612
  "aria-label": r
603
613
  }
604
614
  ) : null
605
- ] }) }), Ho = ({
615
+ ] }) }), So = ({
606
616
  icon: e,
607
617
  buttons: o,
608
618
  heading: n,
@@ -611,16 +621,16 @@ const De = ({
611
621
  maxWidth: i,
612
622
  minWidth: m,
613
623
  ...l
614
- }) => /* @__PURE__ */ t(Yt, { children: /* @__PURE__ */ a(Xt, { gap: 0, children: [
624
+ }) => /* @__PURE__ */ t(Ut, { children: /* @__PURE__ */ a(Yt, { gap: 0, children: [
615
625
  l.onClickClose && /* @__PURE__ */ t(
616
- Jt,
626
+ Kt,
617
627
  {
618
628
  onClickClose: l.onClickClose,
619
629
  closeButtonAriaLabel: l.closeButtonAriaLabel
620
630
  }
621
631
  ),
622
632
  /* @__PURE__ */ a(
623
- v,
633
+ C,
624
634
  {
625
635
  gap: 2,
626
636
  flexDirection: "column",
@@ -629,21 +639,21 @@ const De = ({
629
639
  minWidth: m,
630
640
  children: [
631
641
  e && /* @__PURE__ */ a(K, { children: [
632
- !l.onClickClose && /* @__PURE__ */ t(F, {}),
633
- /* @__PURE__ */ t(we, { icon: e, size: "large" }),
634
- /* @__PURE__ */ t(F, {})
642
+ !l.onClickClose && /* @__PURE__ */ t(I, {}),
643
+ /* @__PURE__ */ t(Be, { icon: e, size: "large" }),
644
+ /* @__PURE__ */ t(I, {})
635
645
  ] }),
636
646
  /* @__PURE__ */ t(De, { children: n }),
637
647
  s && /* @__PURE__ */ t(Z, { textAlign: "center", children: s }),
638
648
  r,
639
- o && /* @__PURE__ */ t(Gt, { children: o })
649
+ o && /* @__PURE__ */ t(qt, { children: o })
640
650
  ]
641
651
  }
642
652
  )
643
- ] }) }), Kt = "_modalFooter_1ypno_1", Qt = "_sticky_1ypno_10", pe = {
644
- modalFooter: Kt,
645
- sticky: Qt
646
- }, So = ({
653
+ ] }) }), Qt = "_modalFooter_1ypno_1", Zt = "_sticky_1ypno_10", he = {
654
+ modalFooter: Qt,
655
+ sticky: Zt
656
+ }, jo = ({
647
657
  sticky: e,
648
658
  zIndex: o = 4,
649
659
  gap: n = 2,
@@ -652,22 +662,22 @@ const De = ({
652
662
  }) => /* @__PURE__ */ t(
653
663
  p,
654
664
  {
655
- className: c(pe.modalFooter, e && pe.sticky, s),
665
+ className: c(he.modalFooter, e && he.sticky, s),
656
666
  shadow: "var(--swui-sticky-footer-shadow)",
657
667
  zIndex: o,
658
668
  gap: n,
659
669
  ...r
660
670
  }
661
- ), Zt = "_unreadDot_l8bni_1", eo = "_dot_l8bni_4", he = {
662
- unreadDot: Zt,
663
- dot: eo
664
- }, to = ({ children: e }) => /* @__PURE__ */ a("div", { className: he.unreadDot, children: [
671
+ ), eo = "_unreadDot_l8bni_1", to = "_dot_l8bni_4", ye = {
672
+ unreadDot: eo,
673
+ dot: to
674
+ }, oo = ({ children: e }) => /* @__PURE__ */ a("div", { className: ye.unreadDot, children: [
665
675
  e,
666
- /* @__PURE__ */ t("div", { className: he.dot })
667
- ] }), oo = "_notificationHeader_1rl25_1", no = "_timestamp_1rl25_2", ye = {
668
- notificationHeader: oo,
669
- timestamp: no
670
- }, ke = ({
676
+ /* @__PURE__ */ t("div", { className: ye.dot })
677
+ ] }), no = "_notificationHeader_1rl25_1", so = "_timestamp_1rl25_2", Ce = {
678
+ notificationHeader: no,
679
+ timestamp: so
680
+ }, Le = ({
671
681
  text: e,
672
682
  timestamp: o,
673
683
  icon: n,
@@ -680,14 +690,14 @@ const De = ({
680
690
  iconBackgroundColor: u,
681
691
  forceCloseButtonAlignment: y
682
692
  }) => {
683
- const C = n ? /* @__PURE__ */ t(
684
- we,
693
+ const v = n ? /* @__PURE__ */ t(
694
+ Be,
685
695
  {
686
696
  size: "small",
687
697
  icon: n,
688
698
  "aria-label": s,
689
699
  variant: "whiteBg",
690
- backgroundColor: u || so(l, h)
700
+ backgroundColor: u || ro(l, h)
691
701
  }
692
702
  ) : void 0;
693
703
  return /* @__PURE__ */ a(
@@ -696,20 +706,20 @@ const De = ({
696
706
  alignItems: "flex-start",
697
707
  justifyContent: "space-between",
698
708
  "data-comp": "NotificationHeader",
699
- className: ye.notificationHeader,
709
+ className: Ce.notificationHeader,
700
710
  gap: 2,
701
711
  children: [
702
712
  /* @__PURE__ */ a(p, { gap: 2, alignItems: "flex-start", children: [
703
- r && /* @__PURE__ */ t(v, { justifyContent: "center", children: r }),
704
- !r && C && /* @__PURE__ */ t(p, { alignItems: "center", height: "40px", children: l ? /* @__PURE__ */ t(to, { children: C }) : C }),
713
+ r && /* @__PURE__ */ t(C, { justifyContent: "center", children: r }),
714
+ !r && v && /* @__PURE__ */ t(p, { alignItems: "center", height: "40px", children: l ? /* @__PURE__ */ t(oo, { children: v }) : v }),
705
715
  /* @__PURE__ */ a(B, { minHeight: 20, justifyContent: "center", flex: 1, gap: 0.5, children: [
706
716
  n || m || y ? /* @__PURE__ */ t(Q, { num: 0.5 }) : null,
707
717
  /* @__PURE__ */ t(Z, { variant: "bold", children: e }),
708
- o && /* @__PURE__ */ t("div", { className: ye.timestamp, children: /* @__PURE__ */ t(
718
+ o && /* @__PURE__ */ t("div", { className: Ce.timestamp, children: /* @__PURE__ */ t(
709
719
  Z,
710
720
  {
711
721
  size: "small",
712
- color: Be(
722
+ color: $e(
713
723
  l ? "--lhds-color-blue-600" : "--lhds-color-ui-600"
714
724
  ),
715
725
  children: o
@@ -717,21 +727,21 @@ const De = ({
717
727
  ) })
718
728
  ] })
719
729
  ] }),
720
- i && /* @__PURE__ */ t(v, { justifyContent: "center", children: i }),
730
+ i && /* @__PURE__ */ t(C, { justifyContent: "center", children: i }),
721
731
  m && /* @__PURE__ */ t(p, { alignItems: "center", height: "40px", width: "40px", children: /* @__PURE__ */ t(oe, { onClick: m }) })
722
732
  ]
723
733
  }
724
734
  );
725
- }, so = (e, o) => {
735
+ }, ro = (e, o) => {
726
736
  if (!(!e && o === "standard"))
727
737
  return "--lhds-color-ui-50";
728
- }, ro = "_notification_tpz0j_1", ao = "_body_tpz0j_10", lo = "_standard_tpz0j_15", co = "_unread_tpz0j_16", io = "_danger_tpz0j_21", M = {
729
- notification: ro,
730
- body: ao,
731
- standard: lo,
732
- unread: co,
733
- danger: io
734
- }, jo = ({
738
+ }, ao = "_notification_tpz0j_1", lo = "_body_tpz0j_10", co = "_standard_tpz0j_15", io = "_unread_tpz0j_16", mo = "_danger_tpz0j_21", R = {
739
+ notification: ao,
740
+ body: lo,
741
+ standard: co,
742
+ unread: io,
743
+ danger: mo
744
+ }, Po = ({
735
745
  variant: e = "standard",
736
746
  children: o,
737
747
  unread: n,
@@ -741,26 +751,26 @@ const De = ({
741
751
  {
742
752
  "data-comp": "Notification",
743
753
  className: c(
744
- M.notification,
745
- M[e],
746
- n && M.unread
754
+ R.notification,
755
+ R[e],
756
+ n && R.unread
747
757
  ),
748
758
  children: [
749
- /* @__PURE__ */ t(ke, { ...s, unread: n, variant: e }),
750
- o && /* @__PURE__ */ t(v, { className: M.body, children: o })
759
+ /* @__PURE__ */ t(Le, { ...s, unread: n, variant: e }),
760
+ o && /* @__PURE__ */ t(C, { className: R.body, children: o })
751
761
  ]
752
762
  }
753
- ), mo = "_notificationList_1rkvu_1", uo = {
754
- notificationList: mo
755
- }, Po = ({
763
+ ), uo = "_notificationList_1rkvu_1", _o = {
764
+ notificationList: uo
765
+ }, Go = ({
756
766
  children: e
757
- }) => /* @__PURE__ */ a("div", { "data-comp": "NotificationList", className: uo.notificationList, children: [
767
+ }) => /* @__PURE__ */ a("div", { "data-comp": "NotificationList", className: _o.notificationList, children: [
758
768
  e,
759
769
  /* @__PURE__ */ t("div", {})
760
- ] }), _o = "_toast_1ifzt_1", fo = "_body_1ifzt_2", Ce = {
761
- toast: _o,
762
- body: fo
763
- }, qo = ({
770
+ ] }), fo = "_toast_1ifzt_1", go = "_body_1ifzt_2", ve = {
771
+ toast: fo,
772
+ body: go
773
+ }, Vo = ({
764
774
  children: e,
765
775
  width: o = 364,
766
776
  maxWidth: n,
@@ -768,37 +778,37 @@ const De = ({
768
778
  }) => /* @__PURE__ */ a(
769
779
  B,
770
780
  {
771
- className: Ce.toast,
781
+ className: ve.toast,
772
782
  "data-comp": "Toast",
773
783
  width: o,
774
784
  maxWidth: n,
775
785
  children: [
776
- /* @__PURE__ */ t(ke, { forceCloseButtonAlignment: !0, ...s }),
777
- e && /* @__PURE__ */ t("div", { className: Ce.body, children: e })
786
+ /* @__PURE__ */ t(Le, { forceCloseButtonAlignment: !0, ...s }),
787
+ e && /* @__PURE__ */ t("div", { className: ve.body, children: e })
778
788
  ]
779
789
  }
780
- ), go = "_toastBox_1lvsy_1", po = "_clickable_1lvsy_8", ve = {
781
- toastBox: go,
782
- clickable: po
783
- }, Go = ({ className: e, ...o }) => /* @__PURE__ */ t(
790
+ ), po = "_toastBox_1lvsy_1", ho = "_clickable_1lvsy_8", be = {
791
+ toastBox: po,
792
+ clickable: ho
793
+ }, qo = ({ className: e, ...o }) => /* @__PURE__ */ t(
784
794
  B,
785
795
  {
786
796
  as: o.onClick ? "button" : void 0,
787
797
  className: c(
788
798
  e,
789
- ve.toastBox,
790
- o.onClick && ve.clickable
799
+ be.toastBox,
800
+ o.onClick && be.clickable
791
801
  ),
792
802
  "data-comp": "Toast",
793
803
  role: "alert",
794
804
  ...o
795
805
  }
796
- ), ho = "_toastContainer_1rek2_1", yo = {
797
- toastContainer: ho
798
- }, Vo = ({ ...e }) => /* @__PURE__ */ t(
799
- qe,
806
+ ), yo = "_toastContainer_1rek2_1", Co = {
807
+ toastContainer: yo
808
+ }, Xo = ({ ...e }) => /* @__PURE__ */ t(
809
+ Ve,
800
810
  {
801
- className: yo.toastContainer,
811
+ className: Co.toastContainer,
802
812
  closeButton: ({ closeToast: o }) => /* @__PURE__ */ t(oe, { onClick: o }),
803
813
  hideProgressBar: !0,
804
814
  pauseOnFocusLoss: !1,
@@ -806,42 +816,42 @@ const De = ({
806
816
  draggable: !1,
807
817
  ...e
808
818
  }
809
- ), Xo = (e, o) => Ge(e, o);
819
+ ), Yo = (e, o) => qe(e, o);
810
820
  export {
811
- Oo as Alert,
812
- Qe as BaseWindow,
821
+ zo as Alert,
822
+ Ze as BaseWindow,
813
823
  xe as DRAGGABLE_CANCEL_CLASSNAME,
814
- $e as DRAGGABLE_HANDLE_CLASSNAME,
824
+ ke as DRAGGABLE_HANDLE_CLASSNAME,
815
825
  ee as DialogContext,
816
- zo as Drawer,
817
- Fo as DrawerHeader,
818
- Ho as InfoAlert,
819
- Io as LoadingModal,
820
- Ct as Modal,
821
- Gt as ModalActionButtons,
822
- Xt as ModalBody,
823
- Ut as ModalCloseButton,
824
- Yt as ModalContainer,
825
- So as ModalFooter,
826
- Jt as ModalHeader,
826
+ Oo as Drawer,
827
+ Io as DrawerHeader,
828
+ So as InfoAlert,
829
+ Ao as LoadingModal,
830
+ vt as Modal,
831
+ qt as ModalActionButtons,
832
+ Yt as ModalBody,
833
+ Jt as ModalCloseButton,
834
+ Ut as ModalContainer,
835
+ jo as ModalFooter,
836
+ Kt as ModalHeader,
827
837
  De as ModalHeading,
828
- jo as Notification,
829
- ke as NotificationHeader,
830
- Po as NotificationList,
831
- qo as Toast,
832
- Go as ToastBox,
833
- Vo as ToastContainer,
834
- to as UnreadDot,
835
- Ao as Window,
836
- To as WindowFooter,
837
- Nt as WindowHeader,
838
- so as getIconBgColorFromVariant,
839
- Lo as setupDeclarativeModals,
840
- Xo as showToast,
841
- Ro as useAlertDialog,
838
+ Po as Notification,
839
+ Le as NotificationHeader,
840
+ Go as NotificationList,
841
+ Vo as Toast,
842
+ qo as ToastBox,
843
+ Xo as ToastContainer,
844
+ oo as UnreadDot,
845
+ To as Window,
846
+ Mo as WindowFooter,
847
+ wt as WindowHeader,
848
+ ro as getIconBgColorFromVariant,
849
+ Fo as setupDeclarativeModals,
850
+ Yo as showToast,
851
+ Eo as useAlertDialog,
842
852
  ne as useDialog,
843
- Mo as useDialogPromise,
844
- Eo as useDrawerDialog,
845
- Wo as useModalDialog
853
+ Ro as useDialogPromise,
854
+ Wo as useDrawerDialog,
855
+ Ho as useModalDialog
846
856
  };
847
857
  //# sourceMappingURL=index.es.js.map