@mintplayer/web-components 2.2.0 → 2.3.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.
Files changed (107) hide show
  1. package/a11y/index.mjs +26 -2
  2. package/a11y/src/dismiss-stack.d.ts +25 -0
  3. package/a11y/src/error-text.d.ts +41 -0
  4. package/a11y/src/focus-restore.d.ts +116 -0
  5. package/a11y/src/focus-trap.d.ts +69 -0
  6. package/a11y/src/form-associated.d.ts +48 -0
  7. package/a11y/src/host-aria.d.ts +154 -0
  8. package/a11y/src/index.d.ts +16 -0
  9. package/a11y/src/inert-regions.d.ts +52 -0
  10. package/a11y/src/live-announcer.d.ts +8 -0
  11. package/a11y/src/roving-focus.d.ts +118 -0
  12. package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
  13. package/a11y/src/testing/index.d.ts +1 -0
  14. package/accordion/index.mjs +180 -174
  15. package/accordion/src/components/mp-accordion.d.ts +18 -13
  16. package/calendar/index.mjs +1 -1
  17. package/calendar/src/mp-calendar.element.d.ts +2 -0
  18. package/carousel/index.mjs +211 -164
  19. package/carousel/src/components/mp-carousel.d.ts +1 -0
  20. package/checkbox/index.mjs +1 -1
  21. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  22. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  23. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  24. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  25. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  26. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  27. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  28. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  29. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  30. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  31. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  32. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  33. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  34. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  35. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  36. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  37. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  38. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  39. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  40. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  41. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  42. package/code-snippet/index.mjs +21 -13
  43. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  44. package/datatable/index.mjs +1 -1
  45. package/datatable/src/components/mp-datatable.d.ts +50 -0
  46. package/datatable/src/types/index.d.ts +2 -0
  47. package/datatable/src/types/labels.d.ts +30 -0
  48. package/datepicker/index.mjs +45 -22
  49. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  50. package/datetime-picker/index.mjs +15 -9
  51. package/dock/index.mjs +365 -209
  52. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  53. package/dropdown-menu/index.mjs +135 -90
  54. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  55. package/file-manager/index.mjs +279 -214
  56. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  57. package/file-manager/src/types/messages.d.ts +9 -0
  58. package/multi-range/index.mjs +26 -10
  59. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  60. package/navbar/index.mjs +53 -39
  61. package/navbar/src/components/mp-navbar.d.ts +1 -0
  62. package/otp-input/index.mjs +82 -48
  63. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  64. package/overlay/index.mjs +2 -258
  65. package/overlay/src/overlay-controller.d.ts +64 -4
  66. package/package.json +9 -1
  67. package/pagination/index.mjs +1 -1
  68. package/query-builder/index.mjs +117 -87
  69. package/query-builder/src/model/messages.d.ts +9 -0
  70. package/radio/index.mjs +2 -160
  71. package/radio/src/components/mp-radio.d.ts +58 -3
  72. package/radio-group/index.d.ts +1 -0
  73. package/radio-group/index.mjs +145 -0
  74. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  75. package/radio-group/src/index.d.ts +1 -0
  76. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  77. package/ribbon/index.mjs +316 -304
  78. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  79. package/scheduler/index.mjs +219 -132
  80. package/scheduler/src/components/mp-scheduler.d.ts +3 -0
  81. package/scheduler/src/views/base-view.d.ts +23 -0
  82. package/select/index.mjs +1 -1
  83. package/select/src/components/mp-select.d.ts +60 -3
  84. package/shell/index.mjs +142 -31
  85. package/shell/src/components/mp-shell.d.ts +1 -0
  86. package/signature-pad/index.d.ts +1 -0
  87. package/signature-pad/index.mjs +230 -0
  88. package/signature-pad/src/index.d.ts +2 -0
  89. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  90. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  91. package/signature-pad/src/types/signature.d.ts +12 -0
  92. package/splitter/index.mjs +1 -1
  93. package/splitter/src/components/mp-splitter.d.ts +7 -0
  94. package/tab-control/index.mjs +1 -1
  95. package/tile-manager/index.mjs +110 -93
  96. package/timeline/index.mjs +138 -54
  97. package/timeline/src/components/mp-timeline.d.ts +15 -0
  98. package/timepicker/index.mjs +1 -1
  99. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  100. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  101. package/toggle-button/index.mjs +1 -1
  102. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  103. package/tree-select/index.mjs +233 -121
  104. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  105. package/treeview/index.mjs +1 -1
  106. package/treeview/src/components/mp-treeview.d.ts +10 -1
  107. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
@@ -1,10 +1,12 @@
1
- import { html as d, unsafeCSS as u, LitElement as p, nothing as h } from "lit";
2
- import { query as s } from "lit/decorators.js";
3
- import { OverlayController as c } from "../overlay/index.mjs";
4
- import "../chunks/mp-calendar.element-UC68iDbi.mjs";
1
+ import { html as d, unsafeCSS as u, LitElement as p, nothing as c } from "lit";
2
+ import { query as a } from "lit/decorators.js";
3
+ import { O as h } from "../chunks/overlay-controller-DPt13i8p.mjs";
4
+ import "lit/directives/ref.js";
5
+ import { H as b } from "../chunks/host-aria-WSGs7SPQ.mjs";
6
+ import "../chunks/mp-calendar.element-u6uS31_j.mjs";
5
7
  d`<!-- Rendered dynamically by render(). This file exists only so the codegen-wc
6
8
  target emits a \`styles\` export from the sibling .scss. -->`;
7
- const b = u(`:host {
9
+ const g = u(`:host {
8
10
  display: inline-block;
9
11
  position: relative;
10
12
  box-sizing: border-box;
@@ -95,20 +97,25 @@ button.trigger svg {
95
97
  transition: none !important;
96
98
  }
97
99
  }`);
98
- var g = Object.defineProperty, n = (o, e, t, y) => {
99
- for (var r = void 0, a = o.length - 1, l; a >= 0; a--)
100
- (l = o[a]) && (r = l(e, t, r) || r);
101
- return r && g(e, t, r), r;
100
+ var m = Object.defineProperty, o = (s, e, t, v) => {
101
+ for (var r = void 0, l = s.length - 1, n; l >= 0; l--)
102
+ (n = s[l]) && (r = n(e, t, r) || r);
103
+ return r && m(e, t, r), r;
102
104
  };
103
- const m = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v1h14V3a1 1 0 0 0-1-1H2zm13 3H1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5z"/></svg>';
104
- let f = 0;
105
+ const f = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v1h14V3a1 1 0 0 0-1-1H2zm13 3H1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5z"/></svg>';
106
+ let y = 0;
105
107
  class i extends p {
106
108
  constructor() {
107
- super(...arguments), this.selectedDate = null, this.currentMonth = null, this.disableDateFn = null, this.min = null, this.max = null, this.firstDayOfWeek = 1, this.locale = void 0, this.disabled = !1, this.placeholder = "", this.triggerLabel = "Choose date", this.instanceId = `mp-dp-${++f}`, this.popupId = `${this.instanceId}-popup`, this.overlay = new c(this, {
109
+ super(...arguments), this.selectedDate = null, this.currentMonth = null, this.disableDateFn = null, this.min = null, this.max = null, this.firstDayOfWeek = 1, this.locale = void 0, this.disabled = !1, this.placeholder = "", this.triggerLabel = "Choose date", this.inputLabel = "Selected date", this.ariaLabelForRender = null, this.ariaLabelledByForSync = null, this.ariaDescribedByForSync = null, this.instanceId = `mp-dp-${++y}`, this.popupId = `${this.instanceId}-popup`, this.hostAria = new b(this, {
110
+ referenceTarget: () => this.displayInputEl ?? null
111
+ }), this.overlay = new h(this, {
108
112
  anchor: () => this.inputGroupEl ?? this.triggerEl ?? null,
109
113
  trigger: () => this.triggerEl ?? null,
110
114
  panel: () => this.popupEl ?? null,
111
115
  panelWidth: "anchor-min",
116
+ // APG Date Picker Dialog: opening moves focus onto the calendar grid's
117
+ // roving cell. A slotted consumer calendar wins over the shadow default.
118
+ initialFocus: () => this.popupEl?.querySelector('slot[name="calendar"]')?.assignedElements()[0] ?? this.popupEl?.querySelector("mp-calendar") ?? null,
112
119
  onOpen: () => {
113
120
  this.dispatchEvent(new CustomEvent("opened", { bubbles: !0, composed: !0 }));
114
121
  },
@@ -140,7 +147,7 @@ class i extends p {
140
147
  };
141
148
  }
142
149
  static {
143
- this.styles = [b];
150
+ this.styles = [g];
144
151
  }
145
152
  static {
146
153
  this.properties = {
@@ -153,7 +160,14 @@ class i extends p {
153
160
  locale: { attribute: "locale", type: String, reflect: !0 },
154
161
  disabled: { attribute: "disabled", type: Boolean, reflect: !0 },
155
162
  placeholder: { attribute: "placeholder", type: String, reflect: !0 },
156
- triggerLabel: { attribute: "trigger-label", type: String, reflect: !0 }
163
+ triggerLabel: { attribute: "trigger-label", type: String, reflect: !0 },
164
+ inputLabel: { attribute: "input-label", type: String, reflect: !0 },
165
+ // Phantom property: re-renders when the host aria-label changes. The
166
+ // consumer's aria-label wins over inputLabel, as everywhere in the library.
167
+ ariaLabelForRender: { attribute: "aria-label", type: String, reflect: !1 },
168
+ // Phantom too: reference attributes are re-resolved in updated().
169
+ ariaLabelledByForSync: { attribute: "aria-labelledby", type: String, reflect: !1 },
170
+ ariaDescribedByForSync: { attribute: "aria-describedby", type: String, reflect: !1 }
157
171
  };
158
172
  }
159
173
  /* ---- Public API ---- */
@@ -173,6 +187,11 @@ class i extends p {
173
187
  }) : "";
174
188
  }
175
189
  /* ---- Render ---- */
190
+ // After every render: references point at a specific node, and the display
191
+ // input does not exist before the first render.
192
+ updated() {
193
+ this.hostAria.syncReferences();
194
+ }
176
195
  render() {
177
196
  const e = this.formatDisplay();
178
197
  return d`
@@ -182,8 +201,9 @@ class i extends p {
182
201
  type="text"
183
202
  readonly
184
203
  aria-readonly="true"
204
+ aria-label="${this.getAttribute("aria-label") ?? this.inputLabel}"
185
205
  .value="${e}"
186
- placeholder="${this.placeholder || h}"
206
+ placeholder="${this.placeholder || c}"
187
207
  ?disabled="${this.disabled}"
188
208
  />
189
209
  <button
@@ -196,7 +216,7 @@ class i extends p {
196
216
  ?disabled="${this.disabled}"
197
217
  @click="${this.onTriggerClick}"
198
218
  @keydown="${this.onTriggerKeyDown}"
199
- .innerHTML="${m}"
219
+ .innerHTML="${f}"
200
220
  ></button>
201
221
  </div>
202
222
  <div
@@ -225,14 +245,17 @@ class i extends p {
225
245
  `;
226
246
  }
227
247
  }
228
- n([
229
- s("button.trigger")
248
+ o([
249
+ a("button.trigger")
230
250
  ], i.prototype, "triggerEl");
231
- n([
232
- s(".input-group")
251
+ o([
252
+ a("input.form-control")
253
+ ], i.prototype, "displayInputEl");
254
+ o([
255
+ a(".input-group")
233
256
  ], i.prototype, "inputGroupEl");
234
- n([
235
- s(".popup")
257
+ o([
258
+ a(".popup")
236
259
  ], i.prototype, "popupEl");
237
260
  typeof customElements < "u" && !customElements.get("mp-datepicker") && customElements.define("mp-datepicker", i);
238
261
  export {
@@ -59,6 +59,26 @@ export declare class MpDatepickerElement extends LitElement {
59
59
  type: StringConstructor;
60
60
  reflect: boolean;
61
61
  };
62
+ inputLabel: {
63
+ attribute: string;
64
+ type: StringConstructor;
65
+ reflect: boolean;
66
+ };
67
+ ariaLabelForRender: {
68
+ attribute: string;
69
+ type: StringConstructor;
70
+ reflect: boolean;
71
+ };
72
+ ariaLabelledByForSync: {
73
+ attribute: string;
74
+ type: StringConstructor;
75
+ reflect: boolean;
76
+ };
77
+ ariaDescribedByForSync: {
78
+ attribute: string;
79
+ type: StringConstructor;
80
+ reflect: boolean;
81
+ };
62
82
  };
63
83
  selectedDate: Date | null;
64
84
  currentMonth: Date | null;
@@ -70,9 +90,18 @@ export declare class MpDatepickerElement extends LitElement {
70
90
  disabled: boolean;
71
91
  placeholder: string;
72
92
  triggerLabel: string;
93
+ /** Accessible name for the readonly display input — the one node that had none. */
94
+ inputLabel: string;
95
+ /** Mirror of the host aria-label attribute; exists only to trigger re-renders. */
96
+ ariaLabelForRender: string | null;
97
+ ariaLabelledByForSync: string | null;
98
+ ariaDescribedByForSync: string | null;
73
99
  private readonly instanceId;
74
100
  private readonly popupId;
75
101
  private triggerEl?;
102
+ private displayInputEl?;
103
+ /** Tier-2 naming: host aria-labelledby/-describedby resolve to the display input. */
104
+ private readonly hostAria;
76
105
  private inputGroupEl?;
77
106
  private popupEl?;
78
107
  /**
@@ -90,5 +119,6 @@ export declare class MpDatepickerElement extends LitElement {
90
119
  private onTriggerKeyDown;
91
120
  private onSelectedDateChange;
92
121
  private onCurrentMonthChange;
122
+ protected updated(): void;
93
123
  protected render(): TemplateResult;
94
124
  }
@@ -1,9 +1,9 @@
1
- import { html as d, unsafeCSS as c, LitElement as b, nothing as h } from "lit";
1
+ import { html as d, unsafeCSS as c, LitElement as b, nothing as p } from "lit";
2
2
  import { query as s } from "lit/decorators.js";
3
- import { L as m } from "../chunks/live-announcer-CZDTKulf.mjs";
4
- import { OverlayController as p } from "../overlay/index.mjs";
5
- import "../chunks/mp-calendar.element-UC68iDbi.mjs";
6
- import "../chunks/mp-timepicker.element-BwEiwX92.mjs";
3
+ import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
4
+ import { O as h } from "../chunks/overlay-controller-DPt13i8p.mjs";
5
+ import "../chunks/mp-calendar.element-u6uS31_j.mjs";
6
+ import "../chunks/mp-timepicker.element-Bz393NDQ.mjs";
7
7
  d`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
8
8
  sibling .scss; the template export is intentionally unused. -->`;
9
9
  const g = c(`:host {
@@ -146,11 +146,14 @@ const v = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="cur
146
146
  let C = 0;
147
147
  class r extends b {
148
148
  constructor() {
149
- super(...arguments), this.value = null, this.min = null, this.max = null, this.disableDateFn = null, this.firstDayOfWeek = 1, this.locale = void 0, this.hour12 = "auto", this.step = 15, this.defaultTime = { hour: 0, minute: 0 }, this.placeholder = "", this.showClear = !1, this.disabled = !1, this.inputLabel = "Selected date and time", this.dateButtonLabel = "Choose date", this.timeButtonLabel = "Choose time", this.clearLabel = "Clear", this.todayLabel = "Today", this.nowLabel = "Now", this._openPopup = null, this._calendarMonth = null, this.instanceId = `mp-dtp-${++C}`, this.datePopupId = `${this.instanceId}-popup-date`, this.timePopupId = `${this.instanceId}-popup-time`, this.dateOverlay = new p(this, {
149
+ super(...arguments), this.value = null, this.min = null, this.max = null, this.disableDateFn = null, this.firstDayOfWeek = 1, this.locale = void 0, this.hour12 = "auto", this.step = 15, this.defaultTime = { hour: 0, minute: 0 }, this.placeholder = "", this.showClear = !1, this.disabled = !1, this.inputLabel = "Selected date and time", this.dateButtonLabel = "Choose date", this.timeButtonLabel = "Choose time", this.clearLabel = "Clear", this.todayLabel = "Today", this.nowLabel = "Now", this._openPopup = null, this._calendarMonth = null, this.instanceId = `mp-dtp-${++C}`, this.datePopupId = `${this.instanceId}-popup-date`, this.timePopupId = `${this.instanceId}-popup-time`, this.dateOverlay = new h(this, {
150
150
  anchor: () => this.inputGroupEl ?? this.dateTriggerEl ?? null,
151
151
  trigger: () => this.dateTriggerEl ?? null,
152
152
  panel: () => this.datePopupEl ?? null,
153
153
  panelWidth: "anchor-min",
154
+ // APG Date Picker Dialog: opening moves focus onto the calendar grid's
155
+ // roving cell. A slotted consumer calendar wins over the shadow default.
156
+ initialFocus: () => this.datePopupEl?.querySelector('slot[name="calendar"]')?.assignedElements()[0] ?? this.datePopupEl?.querySelector("mp-calendar") ?? null,
154
157
  onOpen: () => {
155
158
  this.dispatchEvent(
156
159
  new CustomEvent("opened", { detail: "date", bubbles: !0, composed: !0 })
@@ -161,11 +164,14 @@ class r extends b {
161
164
  new CustomEvent("closed", { detail: "date", bubbles: !0, composed: !0 })
162
165
  );
163
166
  }
164
- }), this.timeOverlay = new p(this, {
167
+ }), this.timeOverlay = new h(this, {
165
168
  anchor: () => this.inputGroupEl ?? this.timeTriggerEl ?? null,
166
169
  trigger: () => this.timeTriggerEl ?? null,
167
170
  panel: () => this.timePopupEl ?? null,
168
171
  panelWidth: "anchor-min",
172
+ // Opening moves focus onto the time list's active option (its focus()
173
+ // override lands there). A slotted consumer list wins over the default.
174
+ initialFocus: () => this.timePopupEl?.querySelector('slot[name="time-list"]')?.assignedElements()[0] ?? this.timePopupEl?.querySelector("mp-time-list") ?? null,
169
175
  onOpen: () => {
170
176
  this.dispatchEvent(
171
177
  new CustomEvent("opened", { detail: "time", bubbles: !0, composed: !0 })
@@ -327,7 +333,7 @@ class r extends b {
327
333
  aria-readonly="true"
328
334
  aria-label="${this.inputLabel}"
329
335
  .value="${e}"
330
- placeholder="${this.placeholder || h}"
336
+ placeholder="${this.placeholder || p}"
331
337
  ?disabled="${this.disabled}"
332
338
  />
333
339
  ${i ? d`<button
@@ -337,7 +343,7 @@ class r extends b {
337
343
  ?disabled="${this.disabled}"
338
344
  @click="${this.onClearClick}"
339
345
  .innerHTML="${w}"
340
- ></button>` : h}
346
+ ></button>` : p}
341
347
  <button
342
348
  class="trigger date"
343
349
  type="button"