@dialpad/dialtone-vue 3.75.2 → 3.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,113 @@
1
- import { _ as C, D as w, b as S, X as k, h as L, d as x, g as O, Y as F, Z as B, $ as H } from "./DtEmojiPicker-454f372c.js";
2
- import { resolveComponent as d, openBlock as r, createBlock as a, withKeys as p, withModifiers as v, withCtx as u, createVNode as g, createElementBlock as E, normalizeClass as h, renderSlot as y, createCommentVNode as f, mergeProps as A, Teleport as I, createElementVNode as b, resolveDynamicComponent as D, toHandlers as R } from "vue";
3
- const V = {
1
+ import { _, D as O, h as P, c as S, X as D, d as F, g as L, Y as H, Z as N, $ as x } from "./DtEmojiPicker-16507e3f.js";
2
+ import { resolveComponent as r, openBlock as l, createElementBlock as y, renderSlot as d, createVNode as m, createCommentVNode as p, createTextVNode as V, toDisplayString as R, createElementVNode as g, createBlock as f, withKeys as C, withModifiers as E, withCtx as u, mergeProps as w, normalizeClass as v, Teleport as $, resolveDynamicComponent as q, toHandlers as K } from "vue";
3
+ const A = ["base", "error", "info", "success", "warning"], z = ["alert", "alertdialog", "status"], M = /* @__PURE__ */ new Map([
4
+ ["info", "info"],
5
+ ["success", "check-circle"],
6
+ ["warning", "alert-triangle"],
7
+ ["error", "alert-circle"],
8
+ ["base", "bell"]
9
+ ]), W = {
10
+ name: "DtNoticeIcon",
11
+ components: {
12
+ DtIcon: O
13
+ },
14
+ props: {
15
+ /**
16
+ * Kind of icon
17
+ * @values base, error, info, success, warning
18
+ */
19
+ kind: {
20
+ type: String,
21
+ default: "base",
22
+ validate(e) {
23
+ return A.includes(e);
24
+ }
25
+ }
26
+ },
27
+ data() {
28
+ return {
29
+ hasSlotContent: P
30
+ };
31
+ },
32
+ computed: {
33
+ defaultIcon() {
34
+ return M.get(this.kind);
35
+ }
36
+ }
37
+ }, j = {
38
+ key: 0,
39
+ "aria-hidden": "true",
40
+ class: "d-notice__icon"
41
+ };
42
+ function U(e, t, o, i, s, n) {
43
+ const c = r("dt-icon");
44
+ return n.defaultIcon || s.hasSlotContent(e.$slots.default) ? (l(), y("div", j, [
45
+ d(e.$slots, "default", {}, () => [
46
+ m(c, {
47
+ name: n.defaultIcon,
48
+ size: "400"
49
+ }, null, 8, ["name"])
50
+ ])
51
+ ])) : p("", !0);
52
+ }
53
+ const G = /* @__PURE__ */ _(W, [["render", U]]), Y = {
54
+ name: "DtNoticeContent",
55
+ props: {
56
+ /**
57
+ * Title header of the notice. This can be left blank to remove the title from the notice entirely.
58
+ */
59
+ title: {
60
+ type: String,
61
+ default: ""
62
+ },
63
+ /**
64
+ * ID for the title element of the component. Useful for aria-describedby
65
+ * or aria-labelledby or any other reason you may need an id to refer to the title.
66
+ */
67
+ titleId: {
68
+ type: String,
69
+ default: void 0
70
+ },
71
+ /**
72
+ * ID for the content element of the component. Useful for aria-describedby
73
+ * or aria-labelledby or any other reason you may need an id to refer to the content.
74
+ */
75
+ contentId: {
76
+ type: String,
77
+ default: void 0
78
+ }
79
+ },
80
+ data() {
81
+ return {
82
+ hasSlotContent: P
83
+ };
84
+ }
85
+ }, Z = {
86
+ class: "d-notice__content",
87
+ "data-qa": "notice-content"
88
+ }, X = ["id"], J = ["id"];
89
+ function Q(e, t, o, i, s, n) {
90
+ return l(), y("div", Z, [
91
+ o.title || s.hasSlotContent(e.$slots.titleOverride) ? (l(), y("p", {
92
+ key: 0,
93
+ id: o.titleId,
94
+ class: "d-notice__title",
95
+ "data-qa": "notice-content-title"
96
+ }, [
97
+ d(e.$slots, "titleOverride", {}, () => [
98
+ V(R(o.title), 1)
99
+ ])
100
+ ], 8, X)) : p("", !0),
101
+ g("p", {
102
+ id: o.contentId,
103
+ class: "d-notice__message",
104
+ "data-qa": "notice-content-message"
105
+ }, [
106
+ d(e.$slots, "default")
107
+ ], 8, J)
108
+ ]);
109
+ }
110
+ const ee = /* @__PURE__ */ _(Y, [["render", Q]]), k = {
4
111
  props: {
5
112
  /**
6
113
  * If true, a hidden close button is included for screen readers
@@ -39,10 +146,10 @@ const V = {
39
146
  a visually hidden close button and you must set the visuallyHiddenCloseLabel prop.`);
40
147
  }
41
148
  }
42
- }, N = {
149
+ }, te = {
43
150
  name: "SrOnlyCloseButton",
44
151
  components: {
45
- DtIcon: w,
152
+ DtIcon: O,
46
153
  DtButton: S
47
154
  },
48
155
  props: {
@@ -62,23 +169,103 @@ const V = {
62
169
  }
63
170
  }
64
171
  };
65
- function K(e, t, o, s, i, n) {
66
- const c = d("dt-icon"), m = d("dt-button");
67
- return r(), a(m, {
172
+ function oe(e, t, o, i, s, n) {
173
+ const c = r("dt-icon"), h = r("dt-button");
174
+ return l(), f(h, {
68
175
  id: "sr-only-close-button",
69
176
  "data-qa": "dt-sr-only-close-button",
70
177
  class: "d-vi-visible-sr",
71
178
  "aria-label": o.visuallyHiddenCloseLabel,
72
179
  onClick: n.close,
73
- onKeydown: p(v(n.close, ["prevent", "stop"]), ["space"])
180
+ onKeydown: C(E(n.close, ["prevent", "stop"]), ["space"])
74
181
  }, {
75
182
  default: u(() => [
76
- g(c, { name: "close" })
183
+ m(c, { name: "close" })
77
184
  ]),
78
185
  _: 1
79
186
  }, 8, ["aria-label", "onClick", "onKeydown"]);
80
187
  }
81
- const q = /* @__PURE__ */ C(N, [["render", K]]), T = ':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])', z = `${T}:not([tabindex="-1"])`, M = "button,[href],input,select,textarea,details,[tabindex]", W = {
188
+ const I = /* @__PURE__ */ _(te, [["render", oe]]), ne = {
189
+ name: "DtNoticeAction",
190
+ components: {
191
+ DtIcon: O,
192
+ DtButton: S,
193
+ SrOnlyCloseButton: I
194
+ },
195
+ mixins: [k],
196
+ props: {
197
+ /**
198
+ * Props for the notice close button.
199
+ */
200
+ closeButtonProps: {
201
+ type: Object,
202
+ default: () => ({})
203
+ },
204
+ /**
205
+ * Hides the close button from the notice
206
+ * @values true, false
207
+ */
208
+ hideClose: {
209
+ type: Boolean,
210
+ default: !1
211
+ }
212
+ },
213
+ emits: [
214
+ /**
215
+ * Close button click event
216
+ *
217
+ * @event close
218
+ */
219
+ "close"
220
+ ],
221
+ created() {
222
+ !this.hideClose && !this.closeButtonProps.ariaLabel && console.error("Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.");
223
+ },
224
+ mounted() {
225
+ this.hideClose || (this.lastFocusedElement = document.activeElement);
226
+ },
227
+ beforeUnmount() {
228
+ var e;
229
+ (e = this.lastFocusedElement) == null || e.focus();
230
+ },
231
+ methods: {
232
+ close() {
233
+ this.$emit("close");
234
+ }
235
+ }
236
+ }, se = {
237
+ class: "d-notice__actions",
238
+ "data-qa": "notice-content-actions"
239
+ };
240
+ function ie(e, t, o, i, s, n) {
241
+ const c = r("dt-icon"), h = r("dt-button"), b = r("sr-only-close-button");
242
+ return l(), y("div", se, [
243
+ d(e.$slots, "default"),
244
+ o.hideClose ? p("", !0) : (l(), f(h, w({
245
+ key: 0,
246
+ ref: "closeButton",
247
+ "data-qa": "dt-notice-action-close-button",
248
+ size: "sm",
249
+ importance: "clear",
250
+ circle: "",
251
+ "aria-label": o.closeButtonProps.ariaLabel ? o.closeButtonProps.ariaLabel : "Close"
252
+ }, o.closeButtonProps, { onClick: n.close }), {
253
+ icon: u(() => [
254
+ m(c, {
255
+ name: "close",
256
+ size: "200"
257
+ })
258
+ ]),
259
+ _: 1
260
+ }, 16, ["aria-label", "onClick"])),
261
+ e.showVisuallyHiddenClose ? (l(), f(b, {
262
+ key: 1,
263
+ "visually-hidden-close-label": e.visuallyHiddenCloseLabel,
264
+ onClose: n.close
265
+ }, null, 8, ["visually-hidden-close-label", "onClose"])) : p("", !0)
266
+ ]);
267
+ }
268
+ const le = /* @__PURE__ */ _(ne, [["render", ie]]), B = ':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])', ae = `${B}:not([tabindex="-1"])`, re = "button,[href],input,select,textarea,details,[tabindex]", de = {
82
269
  methods: {
83
270
  /**
84
271
  * get the first focusable element in your component, includes tabindex="-1".
@@ -122,9 +309,9 @@ const q = /* @__PURE__ */ C(N, [["render", K]]), T = ':not(:disabled):not([aria-
122
309
  * @param {bool} includeNegativeTabIndex - will include tabindex="-1" in the list of focusable elements.
123
310
  */
124
311
  _getFocusableElements(e = this.$el, t = !1) {
125
- return e ? [...e.querySelectorAll(M)].filter((s) => {
126
- const i = window.getComputedStyle(s);
127
- return i.getPropertyValue("display") !== "none" && i.getPropertyValue("visibility") !== "hidden" && s.matches(t ? T : z);
312
+ return e ? [...e.querySelectorAll(re)].filter((i) => {
313
+ const s = window.getComputedStyle(i);
314
+ return s.getPropertyValue("display") !== "none" && s.getPropertyValue("visibility") !== "hidden" && i.matches(t ? B : ae);
128
315
  }) : [];
129
316
  },
130
317
  /**
@@ -136,32 +323,32 @@ const q = /* @__PURE__ */ C(N, [["render", K]]), T = ':not(:disabled):not([aria-
136
323
  focusTrappedTabPress(e, t) {
137
324
  if (!(e.key === "Tab"))
138
325
  return;
139
- const s = this._getFocusableElements(t);
140
- if (!s.length) {
326
+ const i = this._getFocusableElements(t);
327
+ if (!i.length) {
141
328
  e.preventDefault();
142
329
  return;
143
330
  }
144
- const i = this._getFirstFocusElement(s), n = s[s.length - 1];
145
- e.shiftKey ? document.activeElement === i && (n.focus(), e.preventDefault()) : document.activeElement === n && (i.focus(), e.preventDefault());
331
+ const s = this._getFirstFocusElement(i), n = i[i.length - 1];
332
+ e.shiftKey ? document.activeElement === s && (n.focus(), e.preventDefault()) : document.activeElement === n && (s.focus(), e.preventDefault());
146
333
  }
147
334
  }
148
- }, P = {
335
+ }, T = {
149
336
  none: void 0,
150
337
  small: "d-p4",
151
338
  medium: "d-p8",
152
339
  large: "d-p16"
153
- }, j = {
340
+ }, ce = {
154
341
  none: void 0,
155
342
  small: "d-pl4",
156
343
  medium: "d-pl8",
157
344
  large: "d-pl16"
158
- }, G = ["dialog", "menu", "listbox", "tree", "grid"], U = ["", "anchor"], Y = ["none", "dialog", "first"], Z = ["parent", "body"], $ = [
159
- ...k
160
- ], X = {
345
+ }, ue = ["dialog", "menu", "listbox", "tree", "grid"], pe = ["", "anchor"], he = ["none", "dialog", "first"], fe = ["parent", "body"], me = [
346
+ ...D
347
+ ], ye = {
161
348
  name: "PopoverHeaderFooter",
162
349
  components: {
163
350
  DtButton: S,
164
- DtIcon: w
351
+ DtIcon: O
165
352
  },
166
353
  props: {
167
354
  // eslint-disable-next-line vue/require-default-prop
@@ -207,7 +394,7 @@ const q = /* @__PURE__ */ C(N, [["render", K]]), T = ':not(:disabled):not([aria-
207
394
  ],
208
395
  data() {
209
396
  return {
210
- hasSlotContent: L
397
+ hasSlotContent: P
211
398
  };
212
399
  },
213
400
  methods: {
@@ -218,23 +405,23 @@ const q = /* @__PURE__ */ C(N, [["render", K]]), T = ':not(:disabled):not([aria-
218
405
  }
219
406
  }
220
407
  };
221
- function J(e, t, o, s, i, n) {
222
- const c = d("dt-icon"), m = d("dt-button");
223
- return r(), E("div", {
408
+ function ve(e, t, o, i, s, n) {
409
+ const c = r("dt-icon"), h = r("dt-button");
410
+ return l(), y("div", {
224
411
  "data-qa": "dt-popover-header-footer",
225
- class: h({
412
+ class: v({
226
413
  "d-popover__header": o.type === "header",
227
414
  "d-popover__footer": o.type === "footer"
228
415
  })
229
416
  }, [
230
- i.hasSlotContent(e.$slots.content) ? (r(), E("div", {
417
+ s.hasSlotContent(e.$slots.content) ? (l(), y("div", {
231
418
  key: 0,
232
419
  "data-qa": "dt-popover-header-footer-content",
233
- class: h(["d-to-ellipsis", "d-w100p", o.contentClass])
420
+ class: v(["d-to-ellipsis", "d-w100p", o.contentClass])
234
421
  }, [
235
- y(e.$slots, "content")
236
- ], 2)) : f("", !0),
237
- o.showCloseButton ? (r(), a(m, A({
422
+ d(e.$slots, "content")
423
+ ], 2)) : p("", !0),
424
+ o.showCloseButton ? (l(), f(h, w({
238
425
  key: 1,
239
426
  ref: "popover__close-button",
240
427
  "data-qa": "dt-popover-close",
@@ -243,30 +430,30 @@ function J(e, t, o, s, i, n) {
243
430
  kind: "muted",
244
431
  circle: ""
245
432
  }, o.closeButtonProps, {
246
- onClick: t[0] || (t[0] = (_) => e.$emit("close"))
433
+ onClick: t[0] || (t[0] = (b) => e.$emit("close"))
247
434
  }), {
248
435
  icon: u(() => [
249
- g(c, {
436
+ m(c, {
250
437
  name: "close",
251
438
  size: "300"
252
439
  })
253
440
  ]),
254
441
  _: 1
255
- }, 16)) : f("", !0)
442
+ }, 16)) : p("", !0)
256
443
  ], 2);
257
444
  }
258
- const Q = /* @__PURE__ */ C(X, [["render", J]]);
259
- const ee = {
445
+ const _e = /* @__PURE__ */ _(ye, [["render", ve]]);
446
+ const be = {
260
447
  name: "DtPopover",
261
448
  /********************
262
449
  * CHILD COMPONENTS *
263
450
  ********************/
264
451
  components: {
265
- SrOnlyCloseButton: q,
266
- DtLazyShow: x,
267
- PopoverHeaderFooter: Q
452
+ SrOnlyCloseButton: I,
453
+ DtLazyShow: F,
454
+ PopoverHeaderFooter: _e
268
455
  },
269
- mixins: [W, V],
456
+ mixins: [de, k],
270
457
  props: {
271
458
  /**
272
459
  * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.
@@ -309,7 +496,7 @@ const ee = {
309
496
  role: {
310
497
  type: String,
311
498
  default: "dialog",
312
- validator: (e) => G.includes(e)
499
+ validator: (e) => ue.includes(e)
313
500
  },
314
501
  /**
315
502
  * ID of the element that serves as the label for the popover content.
@@ -345,7 +532,7 @@ const ee = {
345
532
  padding: {
346
533
  type: String,
347
534
  default: "large",
348
- validator: (e) => Object.keys(P).some((t) => t === e)
535
+ validator: (e) => Object.keys(T).some((t) => t === e)
349
536
  },
350
537
  /**
351
538
  * Additional class name for the content wrapper element.
@@ -362,7 +549,7 @@ const ee = {
362
549
  contentWidth: {
363
550
  type: String,
364
551
  default: "",
365
- validator: (e) => U.includes(e)
552
+ validator: (e) => pe.includes(e)
366
553
  },
367
554
  /**
368
555
  * Whether to apply transition on initial render in the content lazy show component.
@@ -392,7 +579,7 @@ const ee = {
392
579
  id: {
393
580
  type: String,
394
581
  default() {
395
- return O();
582
+ return L();
396
583
  }
397
584
  },
398
585
  /**
@@ -496,7 +683,7 @@ const ee = {
496
683
  sticky: {
497
684
  type: [Boolean, String],
498
685
  default: !1,
499
- validator: (e) => $.includes(e)
686
+ validator: (e) => me.includes(e)
500
687
  },
501
688
  /**
502
689
  * Determines maximum height for the popover before overflow.
@@ -554,7 +741,7 @@ const ee = {
554
741
  initialFocusElement: {
555
742
  type: [String, HTMLElement],
556
743
  default: "first",
557
- validator: (e) => Y.includes(e) || e instanceof HTMLElement || e.startsWith("#")
744
+ validator: (e) => he.includes(e) || e instanceof HTMLElement || e.startsWith("#")
558
745
  },
559
746
  /**
560
747
  * If the popover should open pressing up or down arrow key on the anchor element.
@@ -573,7 +760,7 @@ const ee = {
573
760
  appendTo: {
574
761
  type: [HTMLElement, String],
575
762
  default: "body",
576
- validator: (e) => Z.includes(e) || e instanceof HTMLElement
763
+ validator: (e) => fe.includes(e) || e instanceof HTMLElement
577
764
  }
578
765
  },
579
766
  emits: [
@@ -599,15 +786,15 @@ const ee = {
599
786
  ],
600
787
  data() {
601
788
  return {
602
- POPOVER_PADDING_CLASSES: P,
603
- POPOVER_HEADER_FOOTER_PADDING_CLASSES: j,
789
+ POPOVER_PADDING_CLASSES: T,
790
+ POPOVER_HEADER_FOOTER_PADDING_CLASSES: ce,
604
791
  intersectionObserver: null,
605
792
  isOutsideViewport: !1,
606
793
  isOpen: !1,
607
794
  toAppear: !1,
608
795
  anchorEl: null,
609
796
  popoverContentEl: null,
610
- hasSlotContent: L
797
+ hasSlotContent: P
611
798
  };
612
799
  },
613
800
  computed: {
@@ -628,7 +815,7 @@ const ee = {
628
815
  return this.isOutsideViewport && this.modal ? "calc(100vh - var(--space-300))" : this.maxHeight;
629
816
  },
630
817
  labelledBy() {
631
- return this.ariaLabelledby || !this.ariaLabel && O("DtPopover__anchor");
818
+ return this.ariaLabelledby || !this.ariaLabel && L("DtPopover__anchor");
632
819
  }
633
820
  },
634
821
  watch: {
@@ -703,15 +890,15 @@ const ee = {
703
890
  ******************/
704
891
  methods: {
705
892
  hasIntersectedViewport(e) {
706
- var s;
707
- const t = (s = e == null ? void 0 : e[0]) == null ? void 0 : s.target;
893
+ var i;
894
+ const t = (i = e == null ? void 0 : e[0]) == null ? void 0 : i.target;
708
895
  if (!t)
709
896
  return;
710
- const o = F(t);
897
+ const o = H(t);
711
898
  this.isOutsideViewport = o.bottom || o.top;
712
899
  },
713
900
  popperOptions() {
714
- return B({
901
+ return N({
715
902
  fallbackPlacements: this.fallbackPlacements,
716
903
  tether: this.tether,
717
904
  hasHideModifierEnabled: !0
@@ -727,9 +914,9 @@ const ee = {
727
914
  (e = this.anchorEl) != null && e.closest(".d-zi-drawer") ? 650 : 300;
728
915
  },
729
916
  defaultToggleOpen(e) {
730
- var t, o, s;
917
+ var t, o, i;
731
918
  if (!this.openOnContext && (this.open === null || this.open === void 0)) {
732
- if (!((t = this.anchorEl) != null && t.contains(e.target)) && !((o = this.anchorEl) != null && o.isEqualNode(e.target)) || (s = this.anchorEl) != null && s.disabled)
919
+ if (!((t = this.anchorEl) != null && t.contains(e.target)) && !((o = this.anchorEl) != null && o.isEqualNode(e.target)) || (i = this.anchorEl) != null && i.disabled)
733
920
  return;
734
921
  this.toggleOpen();
735
922
  }
@@ -801,9 +988,9 @@ const ee = {
801
988
  this.initialFocusElement === "dialog" && this.$refs.content.$el.focus(), this.initialFocusElement.startsWith("#") && this.focusInitialElementById(), this.initialFocusElement === "first" && this.focusFirstElementIfNeeded(this.$refs.popover__content), this.initialFocusElement instanceof HTMLElement && this.initialFocusElement.focus();
802
989
  },
803
990
  focusInitialElementById() {
804
- var t, o, s;
991
+ var t, o, i;
805
992
  const e = (o = (t = this.$refs.content) == null ? void 0 : t.$el) == null ? void 0 : o.querySelector(this.initialFocusElement);
806
- e ? e.focus() : console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.'), e ? e.focus() : (s = this.$refs.content) == null || s.$el.focus();
993
+ e ? e.focus() : console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.'), e ? e.focus() : (i = this.$refs.content) == null || i.$el.focus();
807
994
  },
808
995
  onResize() {
809
996
  this.closePopover();
@@ -821,12 +1008,12 @@ const ee = {
821
1008
  await this.$nextTick(), this.popoverContentEl.style.width = `${(e = this.anchorEl) == null ? void 0 : e.clientWidth}px`;
822
1009
  },
823
1010
  focusFirstElementIfNeeded(e) {
824
- var o, s;
825
- this._getFocusableElements(e, !0).length !== 0 ? this.focusFirstElement(e) : this.showCloseButton ? (o = this.$refs.popover__header) == null || o.focusCloseButton() : (s = this.$refs.content) == null || s.$el.focus();
1011
+ var o, i;
1012
+ this._getFocusableElements(e, !0).length !== 0 ? this.focusFirstElement(e) : this.showCloseButton ? (o = this.$refs.popover__header) == null || o.focusCloseButton() : (i = this.$refs.content) == null || i.$el.focus();
826
1013
  },
827
1014
  initTippyInstance() {
828
1015
  var e, t;
829
- this.tip = H(this.anchorEl, {
1016
+ this.tip = x(this.anchorEl, {
830
1017
  popperOptions: this.popperOptions(),
831
1018
  contentElement: this.popoverContentEl,
832
1019
  placement: this.placement,
@@ -844,62 +1031,62 @@ const ee = {
844
1031
  });
845
1032
  }
846
1033
  }
847
- }, te = ["aria-hidden"], oe = ["id", "tabindex"];
848
- function ne(e, t, o, s, i, n) {
849
- const c = d("popover-header-footer"), m = d("sr-only-close-button"), _ = d("dt-lazy-show");
850
- return r(), E("div", null, [
851
- o.modal && i.isOpen ? (r(), a(I, {
1034
+ }, Ce = ["aria-hidden"], ge = ["id", "tabindex"];
1035
+ function Ee(e, t, o, i, s, n) {
1036
+ const c = r("popover-header-footer"), h = r("sr-only-close-button"), b = r("dt-lazy-show");
1037
+ return l(), y("div", null, [
1038
+ o.modal && s.isOpen ? (l(), f($, {
852
1039
  key: 0,
853
1040
  to: "body"
854
1041
  }, [
855
- b("div", {
1042
+ g("div", {
856
1043
  class: "d-modal--transparent",
857
- "aria-hidden": o.modal && i.isOpen ? "false" : "true",
858
- onClick: t[0] || (t[0] = v(() => {
1044
+ "aria-hidden": o.modal && s.isOpen ? "false" : "true",
1045
+ onClick: t[0] || (t[0] = E(() => {
859
1046
  }, ["prevent", "stop"]))
860
- }, null, 8, te)
861
- ])) : f("", !0),
862
- (r(), a(D(o.elementType), {
1047
+ }, null, 8, Ce)
1048
+ ])) : p("", !0),
1049
+ (l(), f(q(o.elementType), {
863
1050
  ref: "popover",
864
- class: h(["d-popover", { "d-popover__anchor--opened": i.isOpen }]),
1051
+ class: v(["d-popover", { "d-popover__anchor--opened": s.isOpen }]),
865
1052
  "data-qa": "dt-popover-container"
866
1053
  }, {
867
1054
  default: u(() => [
868
- b("div", {
1055
+ g("div", {
869
1056
  id: !o.ariaLabelledby && n.labelledBy,
870
1057
  ref: "anchor",
871
1058
  "data-qa": "dt-popover-anchor",
872
1059
  tabindex: o.openOnContext ? 0 : void 0,
873
- onClickCapture: t[1] || (t[1] = (...l) => n.defaultToggleOpen && n.defaultToggleOpen(...l)),
874
- onContextmenu: t[2] || (t[2] = (...l) => n.onContext && n.onContext(...l)),
1060
+ onClickCapture: t[1] || (t[1] = (...a) => n.defaultToggleOpen && n.defaultToggleOpen(...a)),
1061
+ onContextmenu: t[2] || (t[2] = (...a) => n.onContext && n.onContext(...a)),
875
1062
  onKeydown: [
876
- t[3] || (t[3] = p(v((...l) => n.onArrowKeyPress && n.onArrowKeyPress(...l), ["prevent"]), ["up"])),
877
- t[4] || (t[4] = p(v((...l) => n.onArrowKeyPress && n.onArrowKeyPress(...l), ["prevent"]), ["down"])),
878
- t[6] || (t[6] = p((l) => e.$emit("keydown", l), ["enter"])),
879
- t[7] || (t[7] = p((l) => e.$emit("keydown", l), ["space"]))
1063
+ t[3] || (t[3] = C(E((...a) => n.onArrowKeyPress && n.onArrowKeyPress(...a), ["prevent"]), ["up"])),
1064
+ t[4] || (t[4] = C(E((...a) => n.onArrowKeyPress && n.onArrowKeyPress(...a), ["prevent"]), ["down"])),
1065
+ t[6] || (t[6] = C((a) => e.$emit("keydown", a), ["enter"])),
1066
+ t[7] || (t[7] = C((a) => e.$emit("keydown", a), ["space"]))
880
1067
  ],
881
- onKeydownCapture: t[5] || (t[5] = p((...l) => n.closePopover && n.closePopover(...l), ["escape"]))
1068
+ onKeydownCapture: t[5] || (t[5] = C((...a) => n.closePopover && n.closePopover(...a), ["escape"]))
882
1069
  }, [
883
- y(e.$slots, "anchor", {
1070
+ d(e.$slots, "anchor", {
884
1071
  attrs: {
885
- "aria-expanded": i.isOpen.toString(),
1072
+ "aria-expanded": s.isOpen.toString(),
886
1073
  "aria-controls": o.id,
887
1074
  "aria-haspopup": o.role
888
1075
  }
889
1076
  })
890
- ], 40, oe),
891
- g(_, A({
1077
+ ], 40, ge),
1078
+ m(b, w({
892
1079
  id: o.id,
893
1080
  ref: "content",
894
1081
  role: o.role,
895
1082
  "data-qa": "dt-popover",
896
- "aria-hidden": `${!i.isOpen}`,
1083
+ "aria-hidden": `${!s.isOpen}`,
897
1084
  "aria-labelledby": n.labelledBy,
898
1085
  "aria-label": o.ariaLabel,
899
1086
  "aria-modal": `${!o.modal}`,
900
1087
  transition: o.transition,
901
- show: i.isOpen,
902
- appear: i.toAppear,
1088
+ show: s.isOpen,
1089
+ appear: s.toAppear,
903
1090
  class: ["d-popover__dialog", { "d-popover__dialog--modal": o.modal }, o.dialogClass],
904
1091
  style: {
905
1092
  "max-height": n.calculatedMaxHeight,
@@ -907,12 +1094,12 @@ function ne(e, t, o, s, i, n) {
907
1094
  },
908
1095
  css: e.$attrs.css,
909
1096
  tabindex: o.contentTabindex
910
- }, R(n.popoverListeners)), {
1097
+ }, K(n.popoverListeners)), {
911
1098
  default: u(() => [
912
- i.hasSlotContent(e.$slots.headerContent) || o.showCloseButton ? (r(), a(c, {
1099
+ s.hasSlotContent(e.$slots.headerContent) || o.showCloseButton ? (l(), f(c, {
913
1100
  key: 0,
914
1101
  ref: "popover__header",
915
- class: h(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[o.padding]),
1102
+ class: v(s.POPOVER_HEADER_FOOTER_PADDING_CLASSES[o.padding]),
916
1103
  "content-class": o.headerClass,
917
1104
  type: "header",
918
1105
  "show-close-button": o.showCloseButton,
@@ -920,38 +1107,38 @@ function ne(e, t, o, s, i, n) {
920
1107
  onClose: n.closePopover
921
1108
  }, {
922
1109
  content: u(() => [
923
- y(e.$slots, "headerContent", { close: n.closePopover })
1110
+ d(e.$slots, "headerContent", { close: n.closePopover })
924
1111
  ]),
925
1112
  _: 3
926
- }, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : f("", !0),
927
- b("div", {
1113
+ }, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : p("", !0),
1114
+ g("div", {
928
1115
  ref: "popover__content",
929
1116
  "data-qa": "dt-popover-content",
930
- class: h([
1117
+ class: v([
931
1118
  "d-popover__content",
932
- i.POPOVER_PADDING_CLASSES[o.padding],
1119
+ s.POPOVER_PADDING_CLASSES[o.padding],
933
1120
  o.contentClass
934
1121
  ])
935
1122
  }, [
936
- y(e.$slots, "content", { close: n.closePopover })
1123
+ d(e.$slots, "content", { close: n.closePopover })
937
1124
  ], 2),
938
- i.hasSlotContent(e.$slots.footerContent) ? (r(), a(c, {
1125
+ s.hasSlotContent(e.$slots.footerContent) ? (l(), f(c, {
939
1126
  key: 1,
940
1127
  ref: "popover__footer",
941
1128
  type: "footer",
942
- class: h(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[o.padding]),
1129
+ class: v(s.POPOVER_HEADER_FOOTER_PADDING_CLASSES[o.padding]),
943
1130
  "content-class": o.footerClass
944
1131
  }, {
945
1132
  content: u(() => [
946
- y(e.$slots, "footerContent", { close: n.closePopover })
1133
+ d(e.$slots, "footerContent", { close: n.closePopover })
947
1134
  ]),
948
1135
  _: 3
949
- }, 8, ["class", "content-class"])) : f("", !0),
950
- e.showVisuallyHiddenClose ? (r(), a(m, {
1136
+ }, 8, ["class", "content-class"])) : p("", !0),
1137
+ e.showVisuallyHiddenClose ? (l(), f(h, {
951
1138
  key: 2,
952
1139
  "visually-hidden-close-label": e.visuallyHiddenCloseLabel,
953
1140
  onClose: n.closePopover
954
- }, null, 8, ["visually-hidden-close-label", "onClose"])) : f("", !0)
1141
+ }, null, 8, ["visually-hidden-close-label", "onClose"])) : p("", !0)
955
1142
  ]),
956
1143
  _: 3
957
1144
  }, 16, ["id", "role", "aria-hidden", "aria-labelledby", "aria-label", "aria-modal", "transition", "show", "appear", "class", "style", "css", "tabindex"])
@@ -960,16 +1147,173 @@ function ne(e, t, o, s, i, n) {
960
1147
  }, 8, ["class"]))
961
1148
  ]);
962
1149
  }
963
- const le = /* @__PURE__ */ C(ee, [["render", ne]]);
1150
+ const ke = /* @__PURE__ */ _(be, [["render", Ee]]), Oe = {
1151
+ name: "DtNotice",
1152
+ components: {
1153
+ DtNoticeIcon: G,
1154
+ DtNoticeContent: ee,
1155
+ DtNoticeAction: le
1156
+ },
1157
+ mixins: [k],
1158
+ props: {
1159
+ /**
1160
+ * Sets an ID on the title element of the component. Useful for aria-describedby
1161
+ * or aria-labelledby or any other reason you may need an id to refer to the title.
1162
+ */
1163
+ titleId: {
1164
+ type: String,
1165
+ default: void 0
1166
+ },
1167
+ /**
1168
+ * Sets an ID on the content element of the component. Useful for aria-describedby
1169
+ * or aria-labelledby or any other reason you may need an id to refer to the content.
1170
+ */
1171
+ contentId: {
1172
+ type: String,
1173
+ default: void 0
1174
+ },
1175
+ /**
1176
+ * Title header of the notice. This can be left blank to remove the title from the notice entirely.
1177
+ */
1178
+ title: {
1179
+ type: String,
1180
+ default: ""
1181
+ },
1182
+ /**
1183
+ * Provides a role for the notice. 'status' is used to communicate a message. 'alert' is used to communicate an
1184
+ * important message that does not contain any interactive elements. 'alertdialog' is used to communicate an
1185
+ * important message that does contain interactive elements.
1186
+ * @values alert, alertdialog, status
1187
+ */
1188
+ role: {
1189
+ type: String,
1190
+ default: "status",
1191
+ validate(e) {
1192
+ return z.includes(e);
1193
+ }
1194
+ },
1195
+ /**
1196
+ * Used in scenarios where the message needs to visually dominate the screen.
1197
+ * This will also change the aria role from status to alert.
1198
+ * @values true, false
1199
+ */
1200
+ important: {
1201
+ type: Boolean,
1202
+ default: !1
1203
+ },
1204
+ /**
1205
+ * Severity level of the notice, sets the icon and background
1206
+ * @values base, error, info, success, warning
1207
+ */
1208
+ kind: {
1209
+ type: String,
1210
+ default: "base",
1211
+ validate(e) {
1212
+ return A.includes(e);
1213
+ }
1214
+ },
1215
+ /**
1216
+ * Props for the notice close button.
1217
+ */
1218
+ closeButtonProps: {
1219
+ type: Object,
1220
+ default: () => ({})
1221
+ },
1222
+ /**
1223
+ * Hides the close button from the notice
1224
+ * @values true, false
1225
+ */
1226
+ hideClose: {
1227
+ type: Boolean,
1228
+ default: !1
1229
+ }
1230
+ },
1231
+ emits: [
1232
+ /**
1233
+ * Close button click event
1234
+ *
1235
+ * @event close
1236
+ */
1237
+ "close",
1238
+ /**
1239
+ * Native button click event
1240
+ *
1241
+ * @event click
1242
+ * @type {PointerEvent | KeyboardEvent}
1243
+ */
1244
+ "click"
1245
+ ],
1246
+ computed: {
1247
+ noticeClass() {
1248
+ return [
1249
+ "d-notice",
1250
+ {
1251
+ error: "d-notice--error",
1252
+ info: "d-notice--info",
1253
+ success: "d-notice--success",
1254
+ warning: "d-notice--warning",
1255
+ base: "d-notice--base"
1256
+ }[this.kind],
1257
+ { "d-notice--important": this.important }
1258
+ ];
1259
+ }
1260
+ }
1261
+ };
1262
+ function Pe(e, t, o, i, s, n) {
1263
+ const c = r("dt-notice-icon"), h = r("dt-notice-content"), b = r("dt-notice-action");
1264
+ return l(), y("aside", {
1265
+ class: v(n.noticeClass),
1266
+ "data-qa": "notice"
1267
+ }, [
1268
+ m(c, { kind: o.kind }, {
1269
+ default: u(() => [
1270
+ d(e.$slots, "icon")
1271
+ ]),
1272
+ _: 3
1273
+ }, 8, ["kind"]),
1274
+ m(h, {
1275
+ "title-id": o.titleId,
1276
+ "content-id": o.contentId,
1277
+ title: o.title,
1278
+ role: o.role
1279
+ }, {
1280
+ titleOverride: u(() => [
1281
+ d(e.$slots, "titleOverride")
1282
+ ]),
1283
+ default: u(() => [
1284
+ d(e.$slots, "default")
1285
+ ]),
1286
+ _: 3
1287
+ }, 8, ["title-id", "content-id", "title", "role"]),
1288
+ m(b, {
1289
+ "hide-close": o.hideClose,
1290
+ "close-button-props": o.closeButtonProps,
1291
+ "visually-hidden-close": e.visuallyHiddenClose,
1292
+ "visually-hidden-close-label": e.visuallyHiddenCloseLabel,
1293
+ onClose: t[0] || (t[0] = (a) => e.$emit("close"))
1294
+ }, {
1295
+ default: u(() => [
1296
+ d(e.$slots, "action")
1297
+ ]),
1298
+ _: 3
1299
+ }, 8, ["hide-close", "close-button-props", "visually-hidden-close", "visually-hidden-close-label"])
1300
+ ], 2);
1301
+ }
1302
+ const Le = /* @__PURE__ */ _(Oe, [["render", Pe]]);
964
1303
  export {
965
- le as D,
966
- W as M,
967
- Z as P,
968
- q as S,
969
- V as a,
970
- U as b,
971
- P as c,
972
- j as d,
973
- G as e,
974
- Y as f
1304
+ G as D,
1305
+ de as M,
1306
+ A as N,
1307
+ fe as P,
1308
+ k as S,
1309
+ ee as a,
1310
+ le as b,
1311
+ ke as c,
1312
+ I as d,
1313
+ pe as e,
1314
+ Le as f,
1315
+ T as g,
1316
+ ce as h,
1317
+ ue as i,
1318
+ he as j
975
1319
  };