@mintplayer/web-components 2.1.1 → 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 (128) 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.d.ts +1 -0
  15. package/accordion/index.mjs +549 -0
  16. package/accordion/src/components/index.d.ts +3 -0
  17. package/accordion/src/components/mp-accordion-tab.d.ts +30 -0
  18. package/accordion/src/components/mp-accordion.d.ts +66 -0
  19. package/accordion/src/index.d.ts +3 -0
  20. package/accordion/src/styles/index.d.ts +1 -0
  21. package/calendar/index.mjs +1 -1
  22. package/calendar/src/mp-calendar.element.d.ts +2 -0
  23. package/carousel/index.d.ts +1 -0
  24. package/carousel/index.mjs +994 -0
  25. package/carousel/src/components/index.d.ts +1 -0
  26. package/carousel/src/components/mp-carousel.d.ts +58 -0
  27. package/carousel/src/index.d.ts +3 -0
  28. package/carousel/src/styles/index.d.ts +1 -0
  29. package/carousel/src/types/carousel.d.ts +10 -0
  30. package/carousel/src/types/index.d.ts +1 -0
  31. package/checkbox/index.mjs +1 -1
  32. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  33. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  34. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  35. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  36. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  37. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  38. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  39. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  40. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  41. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  42. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  43. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  44. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  45. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  46. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  47. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  48. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  49. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  50. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  51. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  52. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  53. package/code-snippet/index.mjs +21 -13
  54. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  55. package/datatable/index.mjs +1 -1
  56. package/datatable/src/components/mp-datatable.d.ts +50 -0
  57. package/datatable/src/types/index.d.ts +2 -0
  58. package/datatable/src/types/labels.d.ts +30 -0
  59. package/datepicker/index.mjs +45 -22
  60. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  61. package/datetime-picker/index.mjs +15 -9
  62. package/dock/index.mjs +365 -209
  63. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  64. package/dropdown-menu/index.mjs +135 -90
  65. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  66. package/file-manager/index.mjs +279 -214
  67. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  68. package/file-manager/src/types/messages.d.ts +9 -0
  69. package/multi-range/index.mjs +26 -10
  70. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  71. package/navbar/index.mjs +53 -39
  72. package/navbar/src/components/mp-navbar.d.ts +1 -0
  73. package/otp-input/index.mjs +82 -48
  74. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  75. package/overlay/index.mjs +2 -258
  76. package/overlay/src/overlay-controller.d.ts +64 -4
  77. package/package.json +21 -1
  78. package/pagination/index.mjs +1 -1
  79. package/query-builder/index.mjs +117 -87
  80. package/query-builder/src/model/messages.d.ts +9 -0
  81. package/radio/index.mjs +2 -160
  82. package/radio/src/components/mp-radio.d.ts +58 -3
  83. package/radio-group/index.d.ts +1 -0
  84. package/radio-group/index.mjs +145 -0
  85. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  86. package/radio-group/src/index.d.ts +1 -0
  87. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  88. package/ribbon/index.mjs +316 -304
  89. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  90. package/scheduler/index.mjs +219 -132
  91. package/scheduler/src/components/mp-scheduler.d.ts +3 -0
  92. package/scheduler/src/views/base-view.d.ts +23 -0
  93. package/select/index.mjs +1 -1
  94. package/select/src/components/mp-select.d.ts +60 -3
  95. package/shell/index.mjs +142 -31
  96. package/shell/src/components/mp-shell.d.ts +1 -0
  97. package/signature-pad/index.d.ts +1 -0
  98. package/signature-pad/index.mjs +230 -0
  99. package/signature-pad/src/index.d.ts +2 -0
  100. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  101. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  102. package/signature-pad/src/types/signature.d.ts +12 -0
  103. package/splitter/index.mjs +1 -1
  104. package/splitter/src/components/mp-splitter.d.ts +7 -0
  105. package/splitter/src/index.d.ts +1 -1
  106. package/swiper-core/index.d.ts +1 -0
  107. package/swiper-core/index.mjs +184 -0
  108. package/swiper-core/src/index-machine.d.ts +59 -0
  109. package/swiper-core/src/index.d.ts +4 -0
  110. package/swiper-core/src/keymap.d.ts +2 -0
  111. package/swiper-core/src/models/index.d.ts +1 -0
  112. package/swiper-core/src/models/types.d.ts +99 -0
  113. package/swiper-core/src/pointer-arbiter.d.ts +45 -0
  114. package/tab-control/index.mjs +1 -1
  115. package/tile-manager/index.mjs +110 -93
  116. package/timeline/index.mjs +138 -54
  117. package/timeline/src/components/mp-timeline.d.ts +15 -0
  118. package/timepicker/index.mjs +1 -1
  119. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  120. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  121. package/toggle-button/index.mjs +1 -1
  122. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  123. package/tree-select/index.mjs +233 -121
  124. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  125. package/treeview/index.mjs +1 -1
  126. package/treeview/src/components/mp-treeview.d.ts +10 -1
  127. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
  128. package/dropdown/src/styles/dropdown.styles.d.ts +0 -2
@@ -1,4 +1,5 @@
1
1
  import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import { InitialFocusTarget } from '@mintplayer/web-components/a11y';
2
3
  export type OverlayOriginX = 'start' | 'center' | 'end';
3
4
  export type OverlayOriginY = 'top' | 'center' | 'bottom';
4
5
  export interface OverlayPosition {
@@ -38,6 +39,31 @@ export interface OverlayControllerOptions {
38
39
  * explicitly when `anchor` is a non-focusable wrapper.
39
40
  */
40
41
  trigger?: () => HTMLElement | null;
42
+ /**
43
+ * Where focus goes when the overlay opens.
44
+ *
45
+ * Default `'none'` — the controller also backs menus and comboboxes, where
46
+ * APG requires focus to *stay* on the trigger while `aria-activedescendant`
47
+ * tracks the highlighted option. `'none'` means "the consumer manages focus",
48
+ * not "nobody does".
49
+ *
50
+ * Any overlay marked `role="dialog"` should pass `'first'` or a specific
51
+ * element (a date picker focuses the selected day cell, per APG's Date Picker
52
+ * Dialog). Before this option existed, `open()` never touched focus at all, so
53
+ * every such popup opened behind the user's focus and was announced only if
54
+ * they guessed to press Tab.
55
+ */
56
+ initialFocus?: InitialFocusTarget;
57
+ /**
58
+ * Contain Tab within the panel while open. Default false.
59
+ *
60
+ * Set this only for genuinely modal surfaces. It does **not** set
61
+ * `aria-modal` or mark background content `inert` — the controller cannot
62
+ * know whether its host is a dialog or a menu, and claiming `aria-modal` on a
63
+ * non-modal popup hides the page from assistive tech while it stays visible
64
+ * to everyone else. That call belongs to the consuming component.
65
+ */
66
+ modal?: boolean;
41
67
  /**
42
68
  * Ordered list of position candidates. The first one that produces a
43
69
  * panel rect fully inside the viewport (minus `viewportMargin`) is used.
@@ -90,11 +116,15 @@ declare const DEFAULT_POSITIONS: OverlayPosition[];
90
116
  * return on close. M1+ build out behaviour.
91
117
  */
92
118
  export declare class OverlayController implements ReactiveController {
93
- private static readonly openStack;
94
119
  /**
95
- * Allocate a frame on top of the shared overlay stack. Use this from code
96
- * paths that don't own a full `OverlayController` instance. Pair every
120
+ * Allocate a frame on the document's dismiss stack. Use this from code paths
121
+ * that don't own a full `OverlayController` instance. Pair every
97
122
  * `pushFrame()` with a `releaseFrame(token)`.
123
+ *
124
+ * These delegate to the shared stack in `@mintplayer/web-components/a11y`
125
+ * rather than owning a private static, so web-component overlays and Angular
126
+ * overlays (via `BsOverlayStackService`, now a facade over the same array)
127
+ * cannot each believe they are top-most and both consume one Escape.
98
128
  */
99
129
  static pushFrame(): symbol;
100
130
  static releaseFrame(token: symbol): void;
@@ -104,8 +134,23 @@ export declare class OverlayController implements ReactiveController {
104
134
  private _open;
105
135
  private mouseDownAttached;
106
136
  private stackToken;
107
- /** Anchor used by the last positioning pass. Drives focus-return on close. */
137
+ /** Anchor used by the last positioning pass. Last-resort focus-return target. */
108
138
  private activeAnchor;
139
+ /**
140
+ * Element that had focus when `open()` ran. Primary focus-return target.
141
+ *
142
+ * Captured rather than configured, because the configured `trigger` was
143
+ * optional, untyped for focusability, and failed silently: `focus()` on a
144
+ * non-focusable element is a no-op, so an overlay whose `anchor` was a plain
145
+ * wrapper `<div>` and whose `trigger` was unset stranded the user on `<body>`.
146
+ * Five of nine consumers omitted `trigger`, and four of those worked only by
147
+ * coincidence. Capturing removes the failure mode entirely and makes nesting
148
+ * correct for free — each frame restores whatever it interrupted, so
149
+ * unwinding nested overlays walks focus back out one level at a time, which a
150
+ * fixed `trigger` cannot do.
151
+ */
152
+ private restoreTo;
153
+ private readonly focusTrap;
109
154
  /** rAF id for the next scheduled position() call. 0 = none scheduled. */
110
155
  private positionFrame;
111
156
  /** True while scroll-tracking listeners are attached. */
@@ -121,6 +166,21 @@ export declare class OverlayController implements ReactiveController {
121
166
  get isOpen(): boolean;
122
167
  open(): Promise<void>;
123
168
  close(returnFocus?: boolean): void;
169
+ /**
170
+ * Focus-return target, in order of preference: whatever had focus when this
171
+ * overlay opened, then the explicitly configured trigger, then the
172
+ * positioning anchor.
173
+ *
174
+ * The captured element wins because it is right in the cases a configured
175
+ * trigger gets wrong (nested overlays, programmatic opens), and it degrades
176
+ * to the same answer in the common case — the user activated the trigger, so
177
+ * the trigger is what had focus. It is skipped when it has since been
178
+ * detached, or when it is inside the panel that is about to be hidden.
179
+ */
180
+ private resolveReturnTarget;
181
+ private isInsidePanel;
182
+ /** Move focus into the panel per `initialFocus`. Default is to leave it alone. */
183
+ private moveFocusIn;
124
184
  toggle(): Promise<void>;
125
185
  /**
126
186
  * Resolve the list of candidate anchors from `anchor()`. Single-element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/web-components",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,6 +29,10 @@
29
29
  "types": "./a11y/index.d.ts",
30
30
  "import": "./a11y/index.mjs"
31
31
  },
32
+ "./accordion": {
33
+ "types": "./accordion/index.d.ts",
34
+ "import": "./accordion/index.mjs"
35
+ },
32
36
  "./calendar": {
33
37
  "types": "./calendar/index.d.ts",
34
38
  "import": "./calendar/index.mjs"
@@ -37,6 +41,10 @@
37
41
  "types": "./card/index.d.ts",
38
42
  "import": "./card/index.mjs"
39
43
  },
44
+ "./carousel": {
45
+ "types": "./carousel/index.d.ts",
46
+ "import": "./carousel/index.mjs"
47
+ },
40
48
  "./checkbox": {
41
49
  "types": "./checkbox/index.d.ts",
42
50
  "import": "./checkbox/index.mjs"
@@ -97,6 +105,10 @@
97
105
  "types": "./radio/index.d.ts",
98
106
  "import": "./radio/index.mjs"
99
107
  },
108
+ "./radio-group": {
109
+ "types": "./radio-group/index.d.ts",
110
+ "import": "./radio-group/index.mjs"
111
+ },
100
112
  "./ribbon": {
101
113
  "types": "./ribbon/index.d.ts",
102
114
  "import": "./ribbon/index.mjs"
@@ -117,10 +129,18 @@
117
129
  "types": "./shell/index.d.ts",
118
130
  "import": "./shell/index.mjs"
119
131
  },
132
+ "./signature-pad": {
133
+ "types": "./signature-pad/index.d.ts",
134
+ "import": "./signature-pad/index.mjs"
135
+ },
120
136
  "./splitter": {
121
137
  "types": "./splitter/index.d.ts",
122
138
  "import": "./splitter/index.mjs"
123
139
  },
140
+ "./swiper-core": {
141
+ "types": "./swiper-core/index.d.ts",
142
+ "import": "./swiper-core/index.mjs"
143
+ },
124
144
  "./tab-control": {
125
145
  "types": "./tab-control/index.d.ts",
126
146
  "import": "./tab-control/index.mjs"
@@ -1,4 +1,4 @@
1
- import { M as o, b as n } from "../chunks/mp-pagination-BGxsawFL.mjs";
1
+ import { M as o, b as n } from "../chunks/mp-pagination-Dea75mD4.mjs";
2
2
  export {
3
3
  o as MpPagination,
4
4
  n as buildPaginationLayout