@m3e/web 2.5.16 → 2.6.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 (62) hide show
  1. package/dist/TextOverflowElement.js +3605 -0
  2. package/dist/TextOverflowElement.js.map +1 -0
  3. package/dist/TextOverflowElement.min.js +7 -0
  4. package/dist/TextOverflowElement.min.js.map +1 -0
  5. package/dist/all.js +1565 -6
  6. package/dist/all.js.map +1 -1
  7. package/dist/all.min.js +89 -81
  8. package/dist/all.min.js.map +1 -1
  9. package/dist/badge.js +2 -1
  10. package/dist/badge.js.map +1 -1
  11. package/dist/badge.min.js +1 -1
  12. package/dist/badge.min.js.map +1 -1
  13. package/dist/core.js +415 -3968
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.min.js +1 -1
  16. package/dist/core.min.js.map +1 -1
  17. package/dist/css-custom-data.json +590 -0
  18. package/dist/custom-elements.json +4385 -611
  19. package/dist/html-custom-data.json +251 -0
  20. package/dist/list.js +12 -4
  21. package/dist/list.js.map +1 -1
  22. package/dist/list.min.js +1 -1
  23. package/dist/list.min.js.map +1 -1
  24. package/dist/src/all.d.ts +1 -0
  25. package/dist/src/all.d.ts.map +1 -1
  26. package/dist/src/badge/BadgeElement.d.ts.map +1 -1
  27. package/dist/src/core/shared/converters/index.d.ts +1 -0
  28. package/dist/src/core/shared/converters/index.d.ts.map +1 -1
  29. package/dist/src/core/shared/converters/timeConverter.d.ts +11 -0
  30. package/dist/src/core/shared/converters/timeConverter.d.ts.map +1 -0
  31. package/dist/src/list/ListItemElement.d.ts.map +1 -1
  32. package/dist/src/timepicker/TimepickerDialElement.d.ts +76 -0
  33. package/dist/src/timepicker/TimepickerDialElement.d.ts.map +1 -0
  34. package/dist/src/timepicker/TimepickerElement.d.ts +266 -0
  35. package/dist/src/timepicker/TimepickerElement.d.ts.map +1 -0
  36. package/dist/src/timepicker/TimepickerFormat.d.ts +3 -0
  37. package/dist/src/timepicker/TimepickerFormat.d.ts.map +1 -0
  38. package/dist/src/timepicker/TimepickerInputElement.d.ts +110 -0
  39. package/dist/src/timepicker/TimepickerInputElement.d.ts.map +1 -0
  40. package/dist/src/timepicker/TimepickerInputElementBase.d.ts +69 -0
  41. package/dist/src/timepicker/TimepickerInputElementBase.d.ts.map +1 -0
  42. package/dist/src/timepicker/TimepickerInputPeriodToggleElement.d.ts +18 -0
  43. package/dist/src/timepicker/TimepickerInputPeriodToggleElement.d.ts.map +1 -0
  44. package/dist/src/timepicker/TimepickerMode.d.ts +3 -0
  45. package/dist/src/timepicker/TimepickerMode.d.ts.map +1 -0
  46. package/dist/src/timepicker/TimepickerOrientation.d.ts +3 -0
  47. package/dist/src/timepicker/TimepickerOrientation.d.ts.map +1 -0
  48. package/dist/src/timepicker/TimepickerPeriod.d.ts +8 -0
  49. package/dist/src/timepicker/TimepickerPeriod.d.ts.map +1 -0
  50. package/dist/src/timepicker/TimepickerToggleElement.d.ts +21 -0
  51. package/dist/src/timepicker/TimepickerToggleElement.d.ts.map +1 -0
  52. package/dist/src/timepicker/TimepickerVariant.d.ts +3 -0
  53. package/dist/src/timepicker/TimepickerVariant.d.ts.map +1 -0
  54. package/dist/src/timepicker/TimepickerView.d.ts +3 -0
  55. package/dist/src/timepicker/TimepickerView.d.ts.map +1 -0
  56. package/dist/src/timepicker/index.d.ts +11 -0
  57. package/dist/src/timepicker/index.d.ts.map +1 -0
  58. package/dist/timepicker.js +1533 -0
  59. package/dist/timepicker.js.map +1 -0
  60. package/dist/timepicker.min.js +15 -0
  61. package/dist/timepicker.min.js.map +1 -0
  62. package/package.json +6 -1
package/dist/core.js CHANGED
@@ -3,171 +3,13 @@
3
3
  * Copyright (c) 2025–2026 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate } from 'tslib';
7
- import { isServer, nothing, noChange, unsafeCSS, html, css, LitElement } from 'lit';
8
- import { directive, Directive, PartType } from 'lit/directive.js';
9
- import { property, query } from 'lit/decorators.js';
6
+ import { hasKeys, isCheckedMixin, hasCustomState, deleteCustomState, addCustomState, isDisabledMixin, isAttachInternalsMixin, internals, DesignToken, isCheckedIndeterminateMixin, setCustomState } from './TextOverflowElement.js';
7
+ export { ActionElementBase, AnimationLoopController, AttachInternals, Checked, CheckedIndeterminate, ClickOutsideController, Disabled, FocusController, HoverController, HtmlFor, InertController, IntersectionController, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement, MutationController, PressedController, ResizeController, Role, ScrollController, ScrollLockController, VelocityTracker, customElement, debounce, forcedColorsActive, isHtmlForMixin, prefersReducedMotion, resolveElementById, safeStyleMap, timeConverter } from './TextOverflowElement.js';
8
+ import { __decorate, __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';
9
+ import { property } from 'lit/decorators.js';
10
+ import { isServer, nothing, html } from 'lit';
10
11
  import { ifDefined } from 'lit/directives/if-defined.js';
11
12
 
12
- var _AnimationLoopController_frameId, _AnimationLoopController_lastTime, _AnimationLoopController_running, _AnimationLoopController_callback, _AnimationLoopController_loop;
13
- /** A `ReactiveController` used to execute a function in an animation loop. */
14
- class AnimationLoopController {
15
- constructor(host, callback) {
16
- /** @private */_AnimationLoopController_frameId.set(this, null);
17
- /** @private */
18
- _AnimationLoopController_lastTime.set(this, 0);
19
- /** @private */
20
- _AnimationLoopController_running.set(this, false);
21
- /** @private */
22
- _AnimationLoopController_callback.set(this, void 0);
23
- /** @private */
24
- _AnimationLoopController_loop.set(this, () => {
25
- if (!__classPrivateFieldGet(this, _AnimationLoopController_running, "f")) return;
26
- const now = performance.now();
27
- __classPrivateFieldGet(this, _AnimationLoopController_callback, "f").call(this, (now - __classPrivateFieldGet(this, _AnimationLoopController_lastTime, "f")) / 1000, now / 1000);
28
- __classPrivateFieldSet(this, _AnimationLoopController_lastTime, now, "f");
29
- __classPrivateFieldSet(this, _AnimationLoopController_frameId, requestAnimationFrame(__classPrivateFieldGet(this, _AnimationLoopController_loop, "f")), "f");
30
- });
31
- __classPrivateFieldSet(this, _AnimationLoopController_callback, callback, "f");
32
- host.addController(this);
33
- }
34
- /** @inheritdoc */
35
- hostDisconnected() {
36
- this.stop();
37
- }
38
- /** Starts the animation loop. */
39
- start() {
40
- if (__classPrivateFieldGet(this, _AnimationLoopController_running, "f")) return;
41
- __classPrivateFieldSet(this, _AnimationLoopController_running, true, "f");
42
- __classPrivateFieldSet(this, _AnimationLoopController_lastTime, performance.now(), "f");
43
- __classPrivateFieldGet(this, _AnimationLoopController_loop, "f").call(this);
44
- }
45
- /** Stops the animation loop. */
46
- stop() {
47
- if (!__classPrivateFieldGet(this, _AnimationLoopController_running, "f")) return;
48
- __classPrivateFieldSet(this, _AnimationLoopController_running, false, "f");
49
- if (__classPrivateFieldGet(this, _AnimationLoopController_frameId, "f") !== null) {
50
- cancelAnimationFrame(__classPrivateFieldGet(this, _AnimationLoopController_frameId, "f"));
51
- __classPrivateFieldSet(this, _AnimationLoopController_frameId, null, "f");
52
- }
53
- }
54
- }
55
- _AnimationLoopController_frameId = new WeakMap(), _AnimationLoopController_lastTime = new WeakMap(), _AnimationLoopController_running = new WeakMap(), _AnimationLoopController_callback = new WeakMap(), _AnimationLoopController_loop = new WeakMap();
56
-
57
- var _MonitorControllerBase_host, _MonitorControllerBase_target, _MonitorControllerBase_targets;
58
- /**
59
- * A base implementation for a `ReactiveController` used to monitor the state of one
60
- * or more elements. This class must be inherited.
61
- */
62
- class MonitorControllerBase {
63
- /**
64
- * Initializes the `MonitorControllerBase` base class values when called by a derived class.
65
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
66
- * @param {MonitorControllerOptions} options Options used to configure this controller.
67
- */
68
- constructor(host, options) {
69
- /** @private */_MonitorControllerBase_host.set(this, void 0);
70
- /** @private */
71
- _MonitorControllerBase_target.set(this, void 0);
72
- /** @private */
73
- _MonitorControllerBase_targets.set(this, new Set());
74
- __classPrivateFieldSet(this, _MonitorControllerBase_host, host, "f");
75
- __classPrivateFieldSet(this, _MonitorControllerBase_target, options.target, "f");
76
- __classPrivateFieldGet(this, _MonitorControllerBase_host, "f").addController(this);
77
- }
78
- /** The targets being observed. */
79
- get targets() {
80
- return __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").values();
81
- }
82
- /** Whether one or more targets are being monitored. */
83
- get hasTargets() {
84
- return __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").size > 0;
85
- }
86
- /** @inheritdoc */
87
- hostConnected() {
88
- // Target defaults to host unless explicitly null.
89
- if (__classPrivateFieldGet(this, _MonitorControllerBase_target, "f") !== null) {
90
- this.observe(__classPrivateFieldGet(this, _MonitorControllerBase_target, "f") ?? __classPrivateFieldGet(this, _MonitorControllerBase_host, "f"));
91
- }
92
- }
93
- /** @inheritdoc */
94
- hostDisconnected() {
95
- this.unobserveAll();
96
- }
97
- /**
98
- * Starts observing the specified element.
99
- * @param {HTMLElement} target The element to start observing.
100
- */
101
- observe(target) {
102
- if (__classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").has(target)) return;
103
- __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").add(target);
104
- this._observe(target);
105
- }
106
- /**
107
- * Determines whether the specified element is being observed.
108
- * @param {HTMLElement} target The element to test.
109
- * @returns {boolean} Whether `target` is being observed.
110
- */
111
- isObserving(target) {
112
- return __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").has(target);
113
- }
114
- /**
115
- * Stops observing the specified element.
116
- * @param {HTMLElement} target The element to stop observing.
117
- */
118
- unobserve(target) {
119
- if (!__classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").delete(target)) return;
120
- this._unobserve(target);
121
- }
122
- /** Stops observing all targets. */
123
- unobserveAll() {
124
- __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").forEach(x => this.unobserve(x));
125
- __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").clear();
126
- }
127
- }
128
- _MonitorControllerBase_host = new WeakMap(), _MonitorControllerBase_target = new WeakMap(), _MonitorControllerBase_targets = new WeakMap();
129
-
130
- var _ClickOutsideController_instances, _ClickOutsideController_callback, _ClickOutsideController_documentClickHandler, _ClickOutsideController_listening, _ClickOutsideController_handleDocumentClick;
131
- /** A `ReactiveController` used to monitor whether the user clicks outside all observed elements. */
132
- class ClickOutsideController extends MonitorControllerBase {
133
- /**
134
- * Initializes a new instance of this class.
135
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
136
- * @param {FocusControllerOptions} options Options used to configure this controller.
137
- */
138
- constructor(host, options) {
139
- super(host, options);
140
- _ClickOutsideController_instances.add(this);
141
- /** @private */
142
- _ClickOutsideController_callback.set(this, void 0);
143
- /** @private */
144
- _ClickOutsideController_documentClickHandler.set(this, e => __classPrivateFieldGet(this, _ClickOutsideController_instances, "m", _ClickOutsideController_handleDocumentClick).call(this, e));
145
- /** @private */
146
- _ClickOutsideController_listening.set(this, false);
147
- __classPrivateFieldSet(this, _ClickOutsideController_callback, options.callback, "f");
148
- }
149
- /** @inheritdoc */
150
- _observe() {
151
- if (!__classPrivateFieldGet(this, _ClickOutsideController_listening, "f")) {
152
- document.addEventListener("click", __classPrivateFieldGet(this, _ClickOutsideController_documentClickHandler, "f"));
153
- __classPrivateFieldSet(this, _ClickOutsideController_listening, true, "f");
154
- }
155
- }
156
- /** @inheritdoc */
157
- _unobserve() {
158
- if (!this.hasTargets && __classPrivateFieldGet(this, _ClickOutsideController_listening, "f")) {
159
- document.removeEventListener("click", __classPrivateFieldGet(this, _ClickOutsideController_documentClickHandler, "f"));
160
- __classPrivateFieldSet(this, _ClickOutsideController_listening, false, "f");
161
- }
162
- }
163
- }
164
- _ClickOutsideController_callback = new WeakMap(), _ClickOutsideController_documentClickHandler = new WeakMap(), _ClickOutsideController_listening = new WeakMap(), _ClickOutsideController_instances = new WeakSet(), _ClickOutsideController_handleDocumentClick = function _ClickOutsideController_handleDocumentClick(e) {
165
- const composedPath = e.composedPath();
166
- if (!composedPath.some(x => x instanceof HTMLElement && this.isObserving(x))) {
167
- __classPrivateFieldGet(this, _ClickOutsideController_callback, "f").call(this, composedPath);
168
- }
169
- };
170
-
171
13
  /**
172
14
  * Computes a CSS size expression (var(), %, rem, calc(), etc.) relative to the given host element.
173
15
  * @param {HTMLElement} host - The element whose coordinate system and CSS variables should be used to resolve the expression.
@@ -223,14 +65,6 @@ async function focusWhenReady(element, timeout = 200) {
223
65
  return true;
224
66
  }
225
67
 
226
- /**
227
- * Determines whether forced colors are active.
228
- * @returns {boolean} Whether forced colors are active.
229
- */
230
- function forcedColorsActive() {
231
- return !isServer && matchMedia("(forced-colors: active)").matches;
232
- }
233
-
234
68
  function lerp(a, b, t) {
235
69
  return a + (b - a) * t;
236
70
  }
@@ -653,14 +487,6 @@ function interceptProperty(target, prop, options) {
653
487
  return () => Object.defineProperty(target, prop, descriptor);
654
488
  }
655
489
 
656
- /**
657
- * Determines whether reduced motion is preferred.
658
- * @returns {boolean} Whether reduced motion is preferred.
659
- */
660
- function prefersReducedMotion() {
661
- return isServer || matchMedia("(prefers-reduced-motion)").matches;
662
- }
663
-
664
490
  /**
665
491
  * Registers a constructable stylesheet in the document's `adoptedStyleSheets`.
666
492
  * @param css - A `CSSResult` (e.g., from `css```) whose text will be injected into a constructable stylesheet.
@@ -672,29 +498,6 @@ function registerStyleSheet(css) {
672
498
  document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
673
499
  }
674
500
 
675
- /**
676
- * Resolves an element by ID, waiting for document readiness if needed.
677
- * @param {string} id - The element ID to resolve.
678
- * @param {ParentNode} root - Optional root node to query from (defaults to document).
679
- * @returns {Promise<T | null>} A promise that resolves with the element or `null` if not found.
680
- */
681
- function resolveElementById(id, root = document) {
682
- return new Promise(resolve => {
683
- const element = root.querySelector(`#${id}`);
684
- if (element) {
685
- resolve(element);
686
- return;
687
- }
688
- if (document.readyState === "complete" || document.readyState === "interactive") {
689
- resolve(root.querySelector(`#${id}`));
690
- return;
691
- }
692
- document.addEventListener("DOMContentLoaded", () => resolve(root.querySelector(`#${id}`)), {
693
- once: true
694
- });
695
- });
696
- }
697
-
698
501
  /**
699
502
  * Resolves a URL fragment reference (`url(path#id)`) based on the current document location.
700
503
  *
@@ -735,52 +538,6 @@ function scrollIntoViewIfNeeded(element, scrollContainer, options) {
735
538
  }
736
539
  }
737
540
 
738
- var _VelocityTracker_samples, _VelocityTracker_windowMs;
739
- /** Utility for computing gesture velocity over a rolling time window. */
740
- class VelocityTracker {
741
- /**
742
- * @param {number} [windowMs = 100] The size of the rolling sampling window in milliseconds.
743
- */
744
- constructor(windowMs = 100) {
745
- /** @private */_VelocityTracker_samples.set(this, []);
746
- /** @private */
747
- _VelocityTracker_windowMs.set(this, void 0);
748
- __classPrivateFieldSet(this, _VelocityTracker_windowMs, windowMs, "f");
749
- }
750
- /**
751
- * Adds a new sample to the tracker.
752
- * @param {number} value The value in pixels.
753
- * @param {number} [timestamp=performance.now()] The timestamp when `value` changed.
754
- */
755
- add(value, timestamp = performance.now()) {
756
- __classPrivateFieldGet(this, _VelocityTracker_samples, "f").push({
757
- y: value,
758
- t: timestamp
759
- });
760
- const cutoff = timestamp - __classPrivateFieldGet(this, _VelocityTracker_windowMs, "f");
761
- while (__classPrivateFieldGet(this, _VelocityTracker_samples, "f").length > 1 && __classPrivateFieldGet(this, _VelocityTracker_samples, "f")[0].t < cutoff) {
762
- __classPrivateFieldGet(this, _VelocityTracker_samples, "f").shift();
763
- }
764
- }
765
- /**
766
- * Computes the current velocity in px/s.
767
- * @returns The vertical velocity in pixels per second.
768
- */
769
- getVelocity() {
770
- if (__classPrivateFieldGet(this, _VelocityTracker_samples, "f").length < 2) return 0;
771
- const first = __classPrivateFieldGet(this, _VelocityTracker_samples, "f")[0];
772
- const last = __classPrivateFieldGet(this, _VelocityTracker_samples, "f")[__classPrivateFieldGet(this, _VelocityTracker_samples, "f").length - 1];
773
- const dy = last.y - first.y;
774
- const dt = (last.t - first.t) / 1000;
775
- return dt > 0 ? dy / dt : 0;
776
- }
777
- /** Clears all stored samples. */
778
- reset() {
779
- __classPrivateFieldGet(this, _VelocityTracker_samples, "f").length = 0;
780
- }
781
- }
782
- _VelocityTracker_samples = new WeakMap(), _VelocityTracker_windowMs = new WeakMap();
783
-
784
541
  /**
785
542
  * Determines whether an element is a custom element and waits for it to be upgraded.
786
543
  * @param {Element} el The element for which to wait for upgrade.
@@ -802,2277 +559,556 @@ async function waitForUpgrade(el) {
802
559
  await Promise.resolve();
803
560
  }
804
561
 
805
- var _FocusController_instances, _a, _FocusController_touch, _FocusController_callback, _FocusController_filter, _FocusController_keyDownHandler, _FocusController_focusInHandler, _FocusController_focusOutHandler, _FocusController_touchStartHandler, _FocusController_touchEndHandler, _FocusController_hadKeydown, _FocusController_handleKeyDown, _FocusController_handleFocusIn, _FocusController_handleFocusOut;
806
- /** A `ReactiveController` used to monitor the focused state of one or more elements. */
807
- class FocusController extends MonitorControllerBase {
808
- /**
809
- * Initializes a new instance of this class.
810
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
811
- * @param {FocusControllerOptions} options Options used to configure this controller.
812
- */
813
- constructor(host, options) {
814
- super(host, options);
815
- _FocusController_instances.add(this);
816
- /** @private */
817
- _FocusController_touch.set(this, false);
818
- /** @private */
819
- _FocusController_callback.set(this, void 0);
820
- /** @private */
821
- _FocusController_filter.set(this, void 0);
822
- /** @private */
823
- _FocusController_keyDownHandler.set(this, e => __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleKeyDown).call(this, e));
824
- /** @private */
825
- _FocusController_focusInHandler.set(this, e => __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleFocusIn).call(this, e));
826
- /** @private */
827
- _FocusController_focusOutHandler.set(this, e => __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleFocusOut).call(this, e));
828
- /** @private */
829
- _FocusController_touchStartHandler.set(this, () => __classPrivateFieldSet(this, _FocusController_touch, true, "f"));
830
- /** @private */
831
- _FocusController_touchEndHandler.set(this, () => __classPrivateFieldSet(this, _FocusController_touch, false, "f"));
832
- __classPrivateFieldSet(this, _FocusController_callback, options.callback, "f");
833
- __classPrivateFieldSet(this, _FocusController_filter, options.filter, "f");
834
- }
835
- /** @inheritdoc */
836
- _observe(target) {
837
- target.addEventListener("keydown", __classPrivateFieldGet(this, _FocusController_keyDownHandler, "f"));
838
- target.addEventListener("focusin", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
839
- target.addEventListener("focusout", __classPrivateFieldGet(this, _FocusController_focusOutHandler, "f"));
840
- target.addEventListener("touchstart", __classPrivateFieldGet(this, _FocusController_touchStartHandler, "f"), {
841
- passive: true
842
- });
843
- target.addEventListener("touchend", __classPrivateFieldGet(this, _FocusController_touchEndHandler, "f"));
844
- target.addEventListener("touchcancel", __classPrivateFieldGet(this, _FocusController_touchEndHandler, "f"));
845
- }
846
- /** @inheritdoc */
847
- _unobserve(target) {
848
- target.removeEventListener("keydown", __classPrivateFieldGet(this, _FocusController_keyDownHandler, "f"));
849
- target.removeEventListener("focusin", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
850
- target.removeEventListener("focusout", __classPrivateFieldGet(this, _FocusController_focusOutHandler, "f"));
851
- target.removeEventListener("touchstart", __classPrivateFieldGet(this, _FocusController_touchStartHandler, "f"));
852
- target.removeEventListener("touchend", __classPrivateFieldGet(this, _FocusController_touchEndHandler, "f"));
853
- target.removeEventListener("touchcancel", __classPrivateFieldGet(this, _FocusController_touchEndHandler, "f"));
854
- }
855
- }
856
- _a = FocusController, _FocusController_touch = new WeakMap(), _FocusController_callback = new WeakMap(), _FocusController_filter = new WeakMap(), _FocusController_keyDownHandler = new WeakMap(), _FocusController_focusInHandler = new WeakMap(), _FocusController_focusOutHandler = new WeakMap(), _FocusController_touchStartHandler = new WeakMap(), _FocusController_touchEndHandler = new WeakMap(), _FocusController_instances = new WeakSet(), _FocusController_handleKeyDown = function _FocusController_handleKeyDown(e) {
857
- if (__classPrivateFieldGet(this, _FocusController_filter, "f")?.call(this, e)) return;
858
- const target = e.currentTarget;
859
- if (target.matches(":focus-within")) {
860
- __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleFocusIn).call(this, e);
861
- }
862
- }, _FocusController_handleFocusIn = function _FocusController_handleFocusIn(e) {
863
- if (__classPrivateFieldGet(this, _FocusController_filter, "f")?.call(this, e)) return;
864
- if (__classPrivateFieldGet(this, _FocusController_touch, "f")) return;
865
- const target = e.currentTarget;
866
- __classPrivateFieldGet(this, _FocusController_callback, "f").call(this, true, target.matches(":focus-visible") || __classPrivateFieldGet(_a, _a, "f", _FocusController_hadKeydown) || forcedColorsActive(), target);
867
- }, _FocusController_handleFocusOut = function _FocusController_handleFocusOut(e) {
868
- if (__classPrivateFieldGet(this, _FocusController_filter, "f")?.call(this, e)) return;
869
- if (__classPrivateFieldGet(this, _FocusController_touch, "f")) return;
870
- __classPrivateFieldGet(this, _FocusController_callback, "f").call(this, false, false, e.currentTarget);
871
- };
872
- (() => {
873
- if (typeof window !== "undefined") {
874
- window.addEventListener("keydown", () => __classPrivateFieldSet(_a, _a, true, "f", _FocusController_hadKeydown), {
875
- capture: true,
876
- passive: true
877
- });
878
- window.addEventListener("pointerdown", () => __classPrivateFieldSet(_a, _a, false, "f", _FocusController_hadKeydown), {
879
- capture: true
880
- });
562
+ /** Converts an ISO‑8601 date to and from a `Date` object. */
563
+ const dateConverter = {
564
+ fromAttribute(value) {
565
+ if (!value) return null;
566
+ // Matches all four formats:
567
+ // yyyy-MM-dd
568
+ // yyyy-MM-ddTHH:mm:ss
569
+ // yyyy-MM-ddTHH:mm:ssZ
570
+ // yyyy-MM-ddTHH:mm:ss±HH:mm
571
+ const isoRegex = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
572
+ const m = value.match(isoRegex);
573
+ if (!m) return null;
574
+ const year = Number(m[1]);
575
+ const month = Number(m[2]) - 1; // JS months are 0-based
576
+ const day = Number(m[3]);
577
+ const hasTime = m[4] !== undefined;
578
+ const hours = hasTime ? Number(m[4]) : 0;
579
+ const minutes = hasTime ? Number(m[5]) : 0;
580
+ const seconds = hasTime ? Number(m[6]) : 0;
581
+ const ms = hasTime && m[7] ? Number(m[7]) : 0;
582
+ const tz = m[8];
583
+ // CASE 1: yyyy-MM-dd → local date (no timezone math)
584
+ if (!hasTime && !tz) {
585
+ return new Date(year, month, day);
586
+ }
587
+ // CASE 2: yyyy-MM-ddTHH:mm:ss (no timezone) → local datetime
588
+ if (hasTime && !tz) {
589
+ return new Date(year, month, day, hours, minutes, seconds, ms);
590
+ }
591
+ // CASE 3: yyyy-MM-ddTHH:mm:ssZ → UTC
592
+ if (tz === "Z") {
593
+ return new Date(Date.UTC(year, month, day, hours, minutes, seconds, ms));
594
+ }
595
+ // CASE 4: yyyy-MM-ddTHH:mm:ss±HH:mm → offset
596
+ if (tz && /^[+-]\d{2}:\d{2}$/.test(tz)) {
597
+ const sign = tz.startsWith("-") ? -1 : 1;
598
+ const [tzH, tzM] = tz.slice(1).split(":").map(Number);
599
+ const offsetMinutes = sign * (tzH * 60 + tzM);
600
+ // Convert offset datetime → UTC → local
601
+ const utc = Date.UTC(year, month, day, hours, minutes, seconds, ms);
602
+ return new Date(utc - offsetMinutes * 60_000);
603
+ }
604
+ return null;
605
+ },
606
+ toAttribute(value) {
607
+ return value?.toISOString() ?? null;
881
608
  }
882
- })();
883
- /** @private */
884
- _FocusController_hadKeydown = {
885
- value: false
886
609
  };
887
610
 
888
- var _HoverController_instances, _HoverController_callback, _HoverController_startDelays, _HoverController_endDelays, _HoverController_pointerInHandler, _HoverController_pointerLeaveHandler, _HoverController_clearDelays, _HoverController_clearStartDelay, _HoverController_clearEndDelay, _HoverController_handlePointerEnter, _HoverController_handlePointerLeave;
889
- /** A `ReactiveController` used to monitor the hover state of one or more elements. */
890
- class HoverController extends MonitorControllerBase {
891
- /**
892
- * Initializes a new instance of this class.
893
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
894
- * @param {HoverControllerOptions} options Options used to configure this controller.
895
- */
896
- constructor(host, options) {
897
- super(host, options);
898
- _HoverController_instances.add(this);
899
- /** @private */
900
- _HoverController_callback.set(this, void 0);
901
- /** @private */
902
- _HoverController_startDelays.set(this, new Map());
903
- /** @private */
904
- _HoverController_endDelays.set(this, new Map());
905
- /** @private */
906
- _HoverController_pointerInHandler.set(this, e => __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_handlePointerEnter).call(this, e));
907
- /** @private */
908
- _HoverController_pointerLeaveHandler.set(this, e => __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_handlePointerLeave).call(this, e));
909
- __classPrivateFieldSet(this, _HoverController_callback, options.callback, "f");
910
- this.startDelay = options.startDelay ?? 0;
911
- this.endDelay = options.endDelay ?? 0;
912
- }
913
- /** Clears any hover delays for all targets. */
914
- clearDelays() {
915
- for (const target of this.targets) {
916
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearDelays).call(this, target);
917
- }
918
- }
919
- /** @inheritdoc */
920
- _observe(target) {
921
- target.addEventListener("pointerenter", __classPrivateFieldGet(this, _HoverController_pointerInHandler, "f"));
922
- target.addEventListener("pointerleave", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
923
- target.addEventListener("touchend", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
924
- }
925
- /** @inheritdoc */
926
- _unobserve(target) {
927
- target.removeEventListener("pointerenter", __classPrivateFieldGet(this, _HoverController_pointerInHandler, "f"));
928
- target.removeEventListener("pointerleave", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
929
- target.removeEventListener("touchend", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
930
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearDelays).call(this, target);
931
- }
932
- }
933
- _HoverController_callback = new WeakMap(), _HoverController_startDelays = new WeakMap(), _HoverController_endDelays = new WeakMap(), _HoverController_pointerInHandler = new WeakMap(), _HoverController_pointerLeaveHandler = new WeakMap(), _HoverController_instances = new WeakSet(), _HoverController_clearDelays = function _HoverController_clearDelays(target) {
934
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target);
935
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
936
- }, _HoverController_clearStartDelay = function _HoverController_clearStartDelay(target) {
937
- if (__classPrivateFieldGet(this, _HoverController_startDelays, "f").has(target)) {
938
- clearTimeout(__classPrivateFieldGet(this, _HoverController_startDelays, "f").get(target));
939
- return __classPrivateFieldGet(this, _HoverController_startDelays, "f").delete(target);
940
- }
941
- return false;
942
- }, _HoverController_clearEndDelay = function _HoverController_clearEndDelay(target) {
943
- if (__classPrivateFieldGet(this, _HoverController_endDelays, "f").has(target)) {
944
- clearTimeout(__classPrivateFieldGet(this, _HoverController_endDelays, "f").get(target));
945
- return __classPrivateFieldGet(this, _HoverController_endDelays, "f").delete(target);
946
- }
947
- return false;
948
- }, _HoverController_handlePointerEnter = function _HoverController_handlePointerEnter(e) {
949
- const target = e.target;
950
- // If there is a pending end delay, cancel it.
951
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
952
- // Otherwise, if there is a pending start delay, cancel it and start a new one.
953
- if (this.startDelay > 0) {
954
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target);
955
- __classPrivateFieldGet(this, _HoverController_startDelays, "f").set(target, setTimeout(() => {
956
- __classPrivateFieldGet(this, _HoverController_startDelays, "f").delete(target);
957
- __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, true, target);
958
- }, this.startDelay));
959
- } else {
960
- // Otherwise, report the start.
961
- __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, true, target);
962
- }
963
- }, _HoverController_handlePointerLeave = function _HoverController_handlePointerLeave(e) {
964
- const target = e.target;
965
- // If there is a pending start delay, cancel it and do not report the end.
966
- if (__classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target)) return;
967
- // Otherwise, if there is a pending end delay, cancel it and start a new one.
968
- if (this.endDelay > 0) {
969
- __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
970
- __classPrivateFieldGet(this, _HoverController_endDelays, "f").set(target, setTimeout(() => {
971
- __classPrivateFieldGet(this, _HoverController_endDelays, "f").delete(target);
972
- __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, false, target);
973
- }, this.endDelay));
974
- } else {
975
- // Otherwise, report the end.
976
- __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, false, target);
611
+ /** Converts a space-separated attribute in to an array of strings. */
612
+ const spaceSeparatedStringConverter = {
613
+ fromAttribute(value) {
614
+ if (!value) return [];
615
+ return value.split(/\s+/).map(d => d.trim()).filter(Boolean);
616
+ },
617
+ toAttribute(value) {
618
+ return value.join(" ");
977
619
  }
978
620
  };
979
621
 
980
- var _InertController_host, _InertController_inerts;
981
622
  /**
982
- * A `ReactiveController` that provides safe, predictable inerting of background
983
- * content for modal UI surfaces (dialogs, date pickers, fullscreen search views).
623
+ * Determines whether a value is a `SelectedMixin`.
624
+ * @param {unknown} value The value to test.
625
+ * @returns Whether `value` is a `SelectedMixin`.
984
626
  */
985
- class InertController {
986
- constructor(host) {
987
- /** @private */_InertController_host.set(this, void 0);
988
- /** @private */
989
- _InertController_inerts.set(this, new Array());
990
- __classPrivateFieldSet(this, _InertController_host, host, "f");
991
- host.addController(this);
992
- }
993
- /**
994
- * Locks background content by applying inertness to all non‑modal elements,
995
- * isolating the active surface from pointer and keyboard interaction.
996
- */
997
- lock() {
998
- this.unlock();
999
- for (let current = __classPrivateFieldGet(this, _InertController_host, "f"); current.parentNode && current.parentNode !== document.documentElement; current = current.parentNode) {
1000
- for (const sibling of current.parentNode.children) {
1001
- if (sibling instanceof HTMLElement && sibling !== current && !sibling.inert) {
1002
- sibling.inert = true;
1003
- __classPrivateFieldGet(this, _InertController_inerts, "f").push(sibling);
627
+ function isSelectedMixin(value) {
628
+ return hasKeys(value, "selected");
629
+ }
630
+ /**
631
+ * Mixin to augment an element with behavior that supports a selected state.
632
+ * @template T The type of the base class.
633
+ * @param {T} base The base class.
634
+ * @returns {Constructor<SelectedMixin> & T} A constructor that implements `SelectedMixin`.
635
+ */
636
+ function Selected(base) {
637
+ class _SelectedMixin extends base {
638
+ constructor() {
639
+ super(...arguments);
640
+ /**
641
+ * Whether the element is selected.
642
+ * @default false
643
+ */
644
+ this.selected = false;
645
+ }
646
+ /** @inheritdoc */
647
+ update(changedProperties) {
648
+ super.update(changedProperties);
649
+ if (changedProperties.has("selected")) {
650
+ if (this.role === "button") {
651
+ this.ariaPressed = `${this.selected}`;
652
+ this.ariaSelected = null;
653
+ this.ariaChecked = null;
654
+ } else if (this.role === "radio") {
655
+ this.ariaChecked = `${this.selected}`;
656
+ this.ariaSelected = null;
657
+ this.ariaPressed = null;
658
+ } else if (this.role && this.role !== "none" && this.role !== "presentation") {
659
+ this.ariaSelected = `${this.selected}`;
660
+ this.ariaPressed = null;
661
+ this.ariaChecked = null;
1004
662
  }
1005
663
  }
1006
664
  }
1007
665
  }
1008
- /** Restores background interactivity by removing inertness previously applied during `lock()`. */
1009
- unlock() {
1010
- __classPrivateFieldGet(this, _InertController_inerts, "f").forEach(x => x.inert = false);
1011
- __classPrivateFieldGet(this, _InertController_inerts, "f").length = 0;
1012
- }
1013
- /** @inheritdoc */
1014
- hostDisconnected() {
1015
- this.unlock();
1016
- }
666
+ __decorate([property({
667
+ type: Boolean,
668
+ reflect: true
669
+ })], _SelectedMixin.prototype, "selected", void 0);
670
+ return _SelectedMixin;
1017
671
  }
1018
- _InertController_host = new WeakMap(), _InertController_inerts = new WeakMap();
1019
672
 
1020
- var _IntersectionController_callback, _IntersectionController_skipInitial, _IntersectionController_observer, _IntersectionController_unobservedUpdate;
1021
- /** A `ReactiveController` used to monitor changes in the intersection of a target element with an ancestor element. */
1022
- class IntersectionController extends MonitorControllerBase {
1023
- /**
1024
- * Initializes a new instance of the `IntersectionController` class.
1025
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1026
- * @param {IntersectionControllerOptions} options Options used to configure this controller.
1027
- */
1028
- constructor(host, options) {
1029
- super(host, options);
1030
- /** @private */
1031
- _IntersectionController_callback.set(this, void 0);
1032
- /** @private */
1033
- _IntersectionController_skipInitial.set(this, false);
1034
- /** @private */
1035
- _IntersectionController_observer.set(this, void 0);
1036
- /** @private */
1037
- _IntersectionController_unobservedUpdate.set(this, true);
1038
- __classPrivateFieldSet(this, _IntersectionController_callback, options.callback, "f");
1039
- __classPrivateFieldSet(this, _IntersectionController_skipInitial, options.skipInitial ?? false, "f");
1040
- if (isServer) return;
1041
- if (!window.IntersectionObserver) {
1042
- console.warn("IntersectionController error: the browser does not support IntersectionObserver.");
1043
- return;
1044
- }
1045
- __classPrivateFieldSet(this, _IntersectionController_observer, new IntersectionObserver((entries, observer) => {
1046
- __classPrivateFieldGet(this, _IntersectionController_callback, "f").call(this, entries, observer);
1047
- }, options.init), "f");
1048
- }
1049
- /** @inheritdoc */
1050
- async hostUpdated() {
1051
- if (__classPrivateFieldGet(this, _IntersectionController_observer, "f") && !__classPrivateFieldGet(this, _IntersectionController_skipInitial, "f") && __classPrivateFieldGet(this, _IntersectionController_unobservedUpdate, "f")) {
1052
- __classPrivateFieldGet(this, _IntersectionController_callback, "f").call(this, [], __classPrivateFieldGet(this, _IntersectionController_observer, "f"));
1053
- }
1054
- __classPrivateFieldSet(this, _IntersectionController_unobservedUpdate, false, "f");
1055
- }
1056
- /** @inheritdoc */
1057
- _observe(target) {
1058
- __classPrivateFieldGet(this, _IntersectionController_observer, "f")?.observe(target);
1059
- __classPrivateFieldSet(this, _IntersectionController_unobservedUpdate, true, "f");
1060
- }
1061
- /** @inheritdoc */
1062
- _unobserve(target) {
1063
- __classPrivateFieldGet(this, _IntersectionController_observer, "f")?.unobserve(target);
1064
- }
673
+ /**
674
+ * Determines whether a value is a `CheckedOrSelectedMixin`.
675
+ * @param {unknown} value The value to test.
676
+ * @returns Whether `value` is a `CheckedOrSelectedMixin`.
677
+ */
678
+ function isCheckedOrSelectedMixin(value) {
679
+ return isCheckedMixin(value) || isSelectedMixin(value);
1065
680
  }
1066
- _IntersectionController_callback = new WeakMap(), _IntersectionController_skipInitial = new WeakMap(), _IntersectionController_observer = new WeakMap(), _IntersectionController_unobservedUpdate = new WeakMap();
1067
-
1068
- var _LongPressController_instances, _LongPressController_callback, _LongPressController_threshold, _LongPressController_pressedTargets, _LongPressController_pressedTimeouts, _LongPressController_touchStartHandler, _LongPressController_touchEndOrCancelHandler, _LongPressController_handleTouchStart, _LongPressController_handleTouchEndOrCancel;
1069
- /** A `ReactiveController` used to detect a long press gesture. */
1070
- class LongPressController extends MonitorControllerBase {
1071
- /**
1072
- * Initializes a new instance of this class.
1073
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1074
- * @param {LongPressControllerOptions} options Options used to configure this controller.
1075
- */
1076
- constructor(host, options) {
1077
- super(host, options);
1078
- _LongPressController_instances.add(this);
1079
- /** @private */
1080
- _LongPressController_callback.set(this, void 0);
1081
- /** @private */
1082
- _LongPressController_threshold.set(this, void 0);
1083
- /** @private */
1084
- _LongPressController_pressedTargets.set(this, new Set());
1085
- /** @private */
1086
- _LongPressController_pressedTimeouts.set(this, new Map());
1087
- /** @private */
1088
- _LongPressController_touchStartHandler.set(this, e => __classPrivateFieldGet(this, _LongPressController_instances, "m", _LongPressController_handleTouchStart).call(this, e));
1089
- /** @private */
1090
- _LongPressController_touchEndOrCancelHandler.set(this, e => __classPrivateFieldGet(this, _LongPressController_instances, "m", _LongPressController_handleTouchEndOrCancel).call(this, e));
1091
- __classPrivateFieldSet(this, _LongPressController_callback, options.callback, "f");
1092
- __classPrivateFieldSet(this, _LongPressController_threshold, options.threshold ?? 500, "f");
1093
- }
1094
- /** @inheritdoc */
1095
- _observe(target) {
1096
- target.addEventListener("touchstart", __classPrivateFieldGet(this, _LongPressController_touchStartHandler, "f"), {
1097
- passive: true
1098
- });
1099
- target.addEventListener("touchend", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
1100
- target.addEventListener("touchcancel", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
1101
- }
1102
- /** @inheritdoc */
1103
- _unobserve(target) {
1104
- target.removeEventListener("touchstart", __classPrivateFieldGet(this, _LongPressController_touchStartHandler, "f"));
1105
- target.removeEventListener("touchend", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
1106
- target.removeEventListener("touchcancel", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
1107
- }
681
+ /**
682
+ * Determines whether the state of an element is checked or selected.
683
+ * @param {CheckedOrSelectedMixin} element The element to test.
684
+ * @return {boolean} Whether `element` is checked or selected.
685
+ */
686
+ function isCheckedOrSelected(element) {
687
+ return isCheckedMixin(element) && element.checked || isSelectedMixin(element) && element.selected;
1108
688
  }
1109
- _LongPressController_callback = new WeakMap(), _LongPressController_threshold = new WeakMap(), _LongPressController_pressedTargets = new WeakMap(), _LongPressController_pressedTimeouts = new WeakMap(), _LongPressController_touchStartHandler = new WeakMap(), _LongPressController_touchEndOrCancelHandler = new WeakMap(), _LongPressController_instances = new WeakSet(), _LongPressController_handleTouchStart = function _LongPressController_handleTouchStart(e) {
1110
- if (e.currentTarget instanceof HTMLElement && this.isObserving(e.currentTarget)) {
1111
- const target = e.currentTarget;
1112
- __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").set(target, setTimeout(() => {
1113
- __classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").add(target);
1114
- __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").delete(target);
1115
- __classPrivateFieldGet(this, _LongPressController_callback, "f").call(this, true, target);
1116
- }, __classPrivateFieldGet(this, _LongPressController_threshold, "f")));
1117
- }
1118
- }, _LongPressController_handleTouchEndOrCancel = function _LongPressController_handleTouchEndOrCancel(e) {
1119
- if (e.currentTarget instanceof HTMLElement && this.isObserving(e.currentTarget)) {
1120
- const target = e.currentTarget;
1121
- if (__classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").has(target)) {
1122
- __classPrivateFieldGet(this, _LongPressController_callback, "f").call(this, false, target);
1123
- __classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").delete(target);
1124
- }
1125
- if (__classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").has(target)) {
1126
- clearTimeout(__classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").get(target));
1127
- __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").delete(target);
1128
- }
689
+ /**
690
+ * Sets the checked or selected state of an element.
691
+ * @param {CheckedOrSelectedMixin} element The element for which to set the checked or selected state.
692
+ * @param {boolean} checkedOrSelected The checked or selected state.
693
+ */
694
+ function checkOrSelect(element, checkedOrSelected) {
695
+ if (isCheckedMixin(element)) {
696
+ element.checked = checkedOrSelected;
697
+ } else {
698
+ element.selected = checkedOrSelected;
1129
699
  }
1130
- };
700
+ }
1131
701
 
1132
- var _MutationController_callback, _MutationController_skipInitial, _MutationController_config, _MutationController_observer, _MutationController_unobservedUpdate;
1133
702
  /**
1134
- * A `ReactiveController` that integrates a `MutationObserver` with an element's reactive update lifecycle
1135
- * to detect arbitrary changes to DOM, including nodes being added or removed and attributes changing.
703
+ * Determines whether a value is a `DirtyMixin`.
704
+ * @param {unknown} value The value to test.
705
+ * @returns A value indicating whether `value` is a `DirtyMixin`.
1136
706
  */
1137
- class MutationController extends MonitorControllerBase {
1138
- /**
1139
- * Initializes a new instance of the `MutationController` class.
1140
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1141
- * @param {MutationControllerOptions} options Options used to configure this controller.
1142
- */
1143
- constructor(host, options) {
1144
- super(host, options);
1145
- /** @private */
1146
- _MutationController_callback.set(this, void 0);
1147
- /** @private */
1148
- _MutationController_skipInitial.set(this, false);
1149
- /** @private */
1150
- _MutationController_config.set(this, void 0);
1151
- /** @private */
1152
- _MutationController_observer.set(this, void 0);
1153
- /** @private */
1154
- _MutationController_unobservedUpdate.set(this, true);
1155
- __classPrivateFieldSet(this, _MutationController_callback, options.callback, "f");
1156
- __classPrivateFieldSet(this, _MutationController_skipInitial, options.skipInitial ?? false, "f");
1157
- __classPrivateFieldSet(this, _MutationController_config, options.config, "f");
1158
- if (isServer) return;
1159
- if (!window.MutationObserver) {
1160
- console.warn("MutationController error: the browser does not support MutationObserver.");
1161
- return;
1162
- }
1163
- __classPrivateFieldSet(this, _MutationController_observer, new MutationObserver((records, observer) => __classPrivateFieldGet(this, _MutationController_callback, "f").call(this, records, observer)), "f");
1164
- }
1165
- /** @inheritdoc */
1166
- async hostUpdated() {
1167
- if (__classPrivateFieldGet(this, _MutationController_observer, "f") && !__classPrivateFieldGet(this, _MutationController_skipInitial, "f") && __classPrivateFieldGet(this, _MutationController_unobservedUpdate, "f")) {
1168
- const records = __classPrivateFieldGet(this, _MutationController_observer, "f").takeRecords();
1169
- if (records.length > 0) {
1170
- __classPrivateFieldGet(this, _MutationController_callback, "f").call(this, records, __classPrivateFieldGet(this, _MutationController_observer, "f"));
1171
- }
1172
- }
1173
- __classPrivateFieldSet(this, _MutationController_unobservedUpdate, false, "f");
1174
- }
1175
- /** @inheritdoc */
1176
- hostDisconnected() {
1177
- super.hostDisconnected();
1178
- __classPrivateFieldGet(this, _MutationController_observer, "f")?.disconnect();
1179
- }
1180
- /** @inheritdoc */
1181
- _observe(target) {
1182
- __classPrivateFieldGet(this, _MutationController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _MutationController_config, "f"));
1183
- __classPrivateFieldSet(this, _MutationController_unobservedUpdate, true, "f");
1184
- }
1185
- /** @inheritdoc */
1186
- _unobserve() {
1187
- __classPrivateFieldGet(this, _MutationController_observer, "f")?.disconnect();
1188
- for (const target of this.targets) {
1189
- __classPrivateFieldGet(this, _MutationController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _MutationController_config, "f"));
1190
- }
1191
- }
1192
- }
1193
- _MutationController_callback = new WeakMap(), _MutationController_skipInitial = new WeakMap(), _MutationController_config = new WeakMap(), _MutationController_observer = new WeakMap(), _MutationController_unobservedUpdate = new WeakMap();
1194
-
1195
- var _PressedController_instances, _PressedController_capture, _PressedController_callback, _PressedController_filter, _PressedController_isPressedKey, _PressedController_pressedTargets, _PressedController_minPressedDuration, _PressedController_pointerDownHandler, _PressedController_pointerUpHandler, _PressedController_touchEndHandler, _PressedController_keyDownHandler, _PressedController_keyUpHandler, _PressedController_handlePointerDown, _PressedController_handlePointerUp, _PressedController_handleTouchEnd, _PressedController_handleKeyDown, _PressedController_handleKeyUp, _PressedController_clearPressedTargets;
1196
- /** A `ReactiveController` used to monitor the pressed state of one or more elements. */
1197
- class PressedController extends MonitorControllerBase {
1198
- /**
1199
- * Initializes a new instance of this class.
1200
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1201
- * @param {PressedControllerOptions} options Options used to configure this controller.
1202
- */
1203
- constructor(host, options) {
1204
- super(host, options);
1205
- _PressedController_instances.add(this);
1206
- /** @private */
1207
- _PressedController_capture.set(this, void 0);
1208
- /** @private */
1209
- _PressedController_callback.set(this, void 0);
1210
- /** @private */
1211
- _PressedController_filter.set(this, void 0);
1212
- /** @private */
1213
- _PressedController_isPressedKey.set(this, void 0);
1214
- /** @private */
1215
- _PressedController_pressedTargets.set(this, new Map());
1216
- /** @private */
1217
- _PressedController_minPressedDuration.set(this, void 0);
1218
- /** @private */
1219
- _PressedController_pointerDownHandler.set(this, e => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handlePointerDown).call(this, e));
1220
- /** @private */
1221
- _PressedController_pointerUpHandler.set(this, e => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handlePointerUp).call(this, e));
1222
- /** @private */
1223
- _PressedController_touchEndHandler.set(this, e => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handleTouchEnd).call(this, e));
1224
- /** @private */
1225
- _PressedController_keyDownHandler.set(this, e => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handleKeyDown).call(this, e));
1226
- /** @private */
1227
- _PressedController_keyUpHandler.set(this, e => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handleKeyUp).call(this, e));
1228
- __classPrivateFieldSet(this, _PressedController_capture, options.capture, "f");
1229
- __classPrivateFieldSet(this, _PressedController_callback, options.callback, "f");
1230
- __classPrivateFieldSet(this, _PressedController_filter, options.filter, "f");
1231
- __classPrivateFieldSet(this, _PressedController_isPressedKey, options.isPressedKey, "f");
1232
- __classPrivateFieldSet(this, _PressedController_minPressedDuration, options.minPressedDuration ?? 0, "f");
1233
- }
1234
- /** @inheritdoc */
1235
- hostConnected() {
1236
- document.addEventListener("pointerup", __classPrivateFieldGet(this, _PressedController_pointerUpHandler, "f"), {
1237
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1238
- });
1239
- document.addEventListener("touchend", __classPrivateFieldGet(this, _PressedController_touchEndHandler, "f"), {
1240
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1241
- });
1242
- document.addEventListener("touchcancel", __classPrivateFieldGet(this, _PressedController_touchEndHandler, "f"), {
1243
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1244
- });
1245
- super.hostConnected();
1246
- }
1247
- /** @inheritdoc */
1248
- hostDisconnected() {
1249
- document.removeEventListener("pointerup", __classPrivateFieldGet(this, _PressedController_pointerUpHandler, "f"), {
1250
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1251
- });
1252
- document.removeEventListener("touchend", __classPrivateFieldGet(this, _PressedController_touchEndHandler, "f"), {
1253
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1254
- });
1255
- document.removeEventListener("touchcancel", __classPrivateFieldGet(this, _PressedController_touchEndHandler, "f"), {
1256
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1257
- });
1258
- super.hostDisconnected();
1259
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").clear();
1260
- }
1261
- /** @inheritdoc */
1262
- _observe(target) {
1263
- target.addEventListener("pointerdown", __classPrivateFieldGet(this, _PressedController_pointerDownHandler, "f"), {
1264
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1265
- });
1266
- if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")) {
1267
- target.addEventListener("keydown", __classPrivateFieldGet(this, _PressedController_keyDownHandler, "f"), {
1268
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1269
- });
1270
- target.addEventListener("keyup", __classPrivateFieldGet(this, _PressedController_keyUpHandler, "f"), {
1271
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1272
- });
1273
- }
1274
- }
1275
- /** @inheritdoc */
1276
- _unobserve(target) {
1277
- target.removeEventListener("pointerdown", __classPrivateFieldGet(this, _PressedController_pointerDownHandler, "f"), {
1278
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1279
- });
1280
- if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")) {
1281
- target.removeEventListener("keydown", __classPrivateFieldGet(this, _PressedController_keyDownHandler, "f"), {
1282
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1283
- });
1284
- target.removeEventListener("keyup", __classPrivateFieldGet(this, _PressedController_keyUpHandler, "f"), {
1285
- capture: __classPrivateFieldGet(this, _PressedController_capture, "f")
1286
- });
1287
- }
1288
- }
707
+ function isDirtyMixin(value) {
708
+ return hasKeys(value, "dirty", "pristine", "markAsDirty", "markAsPristine");
1289
709
  }
1290
- _PressedController_capture = new WeakMap(), _PressedController_callback = new WeakMap(), _PressedController_filter = new WeakMap(), _PressedController_isPressedKey = new WeakMap(), _PressedController_pressedTargets = new WeakMap(), _PressedController_minPressedDuration = new WeakMap(), _PressedController_pointerDownHandler = new WeakMap(), _PressedController_pointerUpHandler = new WeakMap(), _PressedController_touchEndHandler = new WeakMap(), _PressedController_keyDownHandler = new WeakMap(), _PressedController_keyUpHandler = new WeakMap(), _PressedController_instances = new WeakSet(), _PressedController_handlePointerDown = function _PressedController_handlePointerDown(e) {
1291
- if (__classPrivateFieldGet(this, _PressedController_filter, "f")?.call(this, e)) return;
1292
- if (e.pointerType === "mouse" && e.button > 1) return;
1293
- for (const target of e.composedPath()) {
1294
- if (target instanceof HTMLElement && this.isObserving(target)) {
1295
- if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target)) {
1296
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").set(target, performance.now());
1297
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, {
1298
- x: e.x,
1299
- y: e.y
1300
- }, target);
1301
- }
1302
- break;
710
+ const _eventHandler$2 = Symbol("_eventHandler");
711
+ /**
712
+ * Mixin to augment an element with functionality used to mark it as dirty.
713
+ * @template T The type of the base class.
714
+ * @param {T} base The base class.
715
+ * @returns {Constructor<DirtyMixin> & T} A constructor that implements `DirtyMixin`.
716
+ */
717
+ function Dirty(base) {
718
+ var _a;
719
+ class _Dirty extends base {
720
+ constructor() {
721
+ super(...arguments);
722
+ /** @private */
723
+ this[_a] = () => this.markAsDirty();
1303
724
  }
1304
- }
1305
- }, _PressedController_handlePointerUp = function _PressedController_handlePointerUp(e) {
1306
- if (e.pointerType === "mouse" && e.button > 1) return;
1307
- __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_clearPressedTargets).call(this, e.x, e.y);
1308
- }, _PressedController_handleTouchEnd = function _PressedController_handleTouchEnd(e) {
1309
- __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_clearPressedTargets).call(this, e.changedTouches[0]?.clientX ?? 0, e.changedTouches[0]?.clientY ?? 0);
1310
- }, _PressedController_handleKeyDown = function _PressedController_handleKeyDown(e) {
1311
- if (__classPrivateFieldGet(this, _PressedController_filter, "f")?.call(this, e)) return;
1312
- if (e.target !== e.currentTarget) return;
1313
- const target = e.currentTarget;
1314
- if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
1315
- if (e.key === " ") {
1316
- e.preventDefault();
725
+ /** Whether the user has modified the value of the element. */
726
+ get dirty() {
727
+ return hasCustomState(this, "--dirty");
1317
728
  }
1318
- if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target)) {
1319
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").set(target, performance.now());
1320
- const bounds = target.getBoundingClientRect();
1321
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, {
1322
- x: bounds.x + bounds.width / 2,
1323
- y: bounds.y + bounds.height / 2
1324
- }, target);
729
+ /** Whether the user has not modified the value of the element. */
730
+ get pristine() {
731
+ return !this.dirty;
1325
732
  }
1326
- }
1327
- }, _PressedController_handleKeyUp = function _PressedController_handleKeyUp(e) {
1328
- const target = e.target;
1329
- if (__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target) && __classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
1330
- const remainingTime = __classPrivateFieldGet(this, _PressedController_minPressedDuration, "f") - (performance.now() - __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").get(target));
1331
- const bounds = target.getBoundingClientRect();
1332
- if (remainingTime > 0) {
1333
- setTimeout(() => {
1334
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").delete(target);
1335
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, {
1336
- x: bounds.x + bounds.width / 2,
1337
- y: bounds.y + bounds.height / 2
1338
- }, target);
1339
- }, remainingTime);
1340
- } else {
1341
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").delete(target);
1342
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, {
1343
- x: bounds.x + bounds.width / 2,
1344
- y: bounds.y + bounds.height / 2
1345
- }, target);
733
+ /** @inheritdoc */
734
+ connectedCallback() {
735
+ this.markAsPristine();
736
+ super.connectedCallback();
737
+ this.addEventListener("change", this[_eventHandler$2]);
1346
738
  }
1347
- }
1348
- }, _PressedController_clearPressedTargets = function _PressedController_clearPressedTargets(x, y) {
1349
- for (const target of __classPrivateFieldGet(this, _PressedController_pressedTargets, "f")) {
1350
- const remainingTime = __classPrivateFieldGet(this, _PressedController_minPressedDuration, "f") - (performance.now() - target[1]);
1351
- if (remainingTime > 0) {
1352
- setTimeout(() => {
1353
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").delete(target[0]);
1354
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, {
1355
- x,
1356
- y
1357
- }, target[0]);
1358
- }, remainingTime);
1359
- } else {
1360
- __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").delete(target[0]);
1361
- __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, {
1362
- x,
1363
- y
1364
- }, target[0]);
739
+ /** @inheritdoc */
740
+ disconnectedCallback() {
741
+ super.disconnectedCallback();
742
+ this.removeEventListener("change", this[_eventHandler$2]);
1365
743
  }
1366
- }
1367
- };
1368
-
1369
- var _ResizeController_callback, _ResizeController_skipInitial, _ResizeController_config, _ResizeController_observer, _ResizeController_unobservedUpdate;
1370
- /** A `ReactiveController` used to monitor when an element is resized. */
1371
- class ResizeController extends MonitorControllerBase {
1372
- /**
1373
- * Initializes a new instance of the `ResizeController` class.
1374
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1375
- * @param {ResizeControllerOptions} options Options used to configure this controller.
1376
- */
1377
- constructor(host, options) {
1378
- super(host, options);
1379
- /** @private */
1380
- _ResizeController_callback.set(this, void 0);
1381
- /** @private */
1382
- _ResizeController_skipInitial.set(this, void 0);
1383
- /** @private */
1384
- _ResizeController_config.set(this, void 0);
1385
- /** @private */
1386
- _ResizeController_observer.set(this, void 0);
1387
- /** @private */
1388
- _ResizeController_unobservedUpdate.set(this, true);
1389
- __classPrivateFieldSet(this, _ResizeController_callback, options.callback, "f");
1390
- __classPrivateFieldSet(this, _ResizeController_skipInitial, options.skipInitial ?? false, "f");
1391
- __classPrivateFieldSet(this, _ResizeController_config, options.config, "f");
1392
- if (isServer) return;
1393
- if (!window.ResizeObserver) {
1394
- console.warn("ResizeController error: the browser does not support ResizeObserver.");
1395
- return;
744
+ /** Marks the element as pristine. */
745
+ markAsPristine() {
746
+ deleteCustomState(this, "--dirty");
1396
747
  }
1397
- __classPrivateFieldSet(this, _ResizeController_observer, new ResizeObserver((entries, observer) => __classPrivateFieldGet(this, _ResizeController_callback, "f").call(this, entries, observer)), "f");
1398
- }
1399
- /** @inheritdoc */
1400
- async hostUpdated() {
1401
- if (__classPrivateFieldGet(this, _ResizeController_observer, "f") && !__classPrivateFieldGet(this, _ResizeController_skipInitial, "f") && __classPrivateFieldGet(this, _ResizeController_unobservedUpdate, "f")) {
1402
- __classPrivateFieldGet(this, _ResizeController_callback, "f").call(this, [], __classPrivateFieldGet(this, _ResizeController_observer, "f"));
748
+ /** Marks the element as dirty. */
749
+ markAsDirty() {
750
+ addCustomState(this, "--dirty");
1403
751
  }
1404
- __classPrivateFieldSet(this, _ResizeController_unobservedUpdate, false, "f");
1405
- }
1406
- /** @inheritdoc */
1407
- _observe(target) {
1408
- __classPrivateFieldGet(this, _ResizeController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _ResizeController_config, "f"));
1409
- __classPrivateFieldSet(this, _ResizeController_unobservedUpdate, true, "f");
1410
- }
1411
- /** @inheritdoc */
1412
- _unobserve(target) {
1413
- __classPrivateFieldGet(this, _ResizeController_observer, "f")?.unobserve(target);
1414
752
  }
753
+ _a = _eventHandler$2;
754
+ return _Dirty;
1415
755
  }
1416
- _ResizeController_callback = new WeakMap(), _ResizeController_skipInitial = new WeakMap(), _ResizeController_config = new WeakMap(), _ResizeController_observer = new WeakMap(), _ResizeController_unobservedUpdate = new WeakMap();
1417
-
1418
- /**
1419
- * Class decorator factory that defines the decorated class as a custom element.
1420
- *
1421
- * ```js
1422
- * @customElement('my-element')
1423
- * class MyElement extends LitElement {
1424
- * render() {
1425
- * return html``;
1426
- * }
1427
- * }
1428
- * ```
1429
- * @param {string} tagName The tag name of the custom element to define.
1430
- */
1431
- const customElement = tagName => (classOrTarget, context) => {
1432
- const define = () => {
1433
- if (typeof window !== "undefined" && !customElements.get(tagName)) {
1434
- customElements.define(tagName, classOrTarget);
1435
- }
1436
- };
1437
- if (context) {
1438
- context.addInitializer(define);
1439
- } else {
1440
- define();
1441
- }
1442
- };
1443
756
 
1444
- /* eslint-disable @typescript-eslint/no-explicit-any */
1445
757
  /**
1446
- * A decorator that runs a function once after a given "cooldown" period.
1447
- * @param {number} timeout The timeout, in milliseconds, after which the function is invoked.
1448
- * @returns {MethodDecorator} The decorator that runs a function once after a given "cooldown" period.
758
+ * Determines whether a value is a `TouchedMixin`.
759
+ * @param {unknown} value The value to test.
760
+ * @returns A value indicating whether `value` is a `TouchedMixin`.
1449
761
  */
1450
- function debounce(timeout) {
1451
- const _id = Symbol("_id");
1452
- return (_, __, descriptor) => {
1453
- const orig = descriptor.value;
1454
- descriptor.value = function (...args) {
1455
- // eslint-disable-next-line @typescript-eslint/no-this-alias
1456
- const self = this;
1457
- clearTimeout(self[_id]);
1458
- self[_id] = setTimeout(() => orig.apply(this, args), timeout);
1459
- };
1460
- return descriptor;
1461
- };
1462
- }
1463
-
1464
- var _ScrollController_instances, _ScrollController_debounce, _ScrollController_callback, _ScrollController_scrollHandler, _ScrollController_scrollContainers, _ScrollController_getShadowScrollContainer, _ScrollController_isScrollable, _ScrollController_getScrollContainers, _ScrollController_handleScroll;
1465
- /** A `ReactiveController` used to monitor when a scroll event is emitted from a scrollable ancestor. */
1466
- class ScrollController extends MonitorControllerBase {
1467
- /**
1468
- * Initializes a new instance of the `ScrollController` class.
1469
- * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
1470
- * @param {ScrollControllerOptions} options Options used to configure this controller.
1471
- */
1472
- constructor(host, options) {
1473
- super(host, options);
1474
- _ScrollController_instances.add(this);
1475
- /** @private */
1476
- _ScrollController_debounce.set(this, void 0);
1477
- /** @private */
1478
- _ScrollController_callback.set(this, void 0);
1479
- /** @private */
1480
- _ScrollController_scrollHandler.set(this, e => __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_handleScroll).call(this, e));
1481
- /** @private */
1482
- _ScrollController_scrollContainers.set(this, new Map());
1483
- __classPrivateFieldSet(this, _ScrollController_debounce, options.debounce === true, "f");
1484
- __classPrivateFieldSet(this, _ScrollController_callback, options.callback, "f");
1485
- }
1486
- /**
1487
- * Returns the scrollable ancestors for a target element currently being observed by this controller.
1488
- * @param target The element whose scroll containers are currently being observed.
1489
- * @returns {Element[] | undefined} The scrollable ancestors, or `undefined` if `target` is not being observed.
1490
- */
1491
- getScrollContainers(target) {
1492
- return __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").get(target);
1493
- }
1494
- /** @inheritdoc */
1495
- _observe(target) {
1496
- const scrollableAncestors = __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_getScrollContainers).call(this, target);
1497
- if (scrollableAncestors.length > 0) {
1498
- __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").set(target, scrollableAncestors);
1499
- for (const ancestor of scrollableAncestors) {
1500
- (ancestor === document.documentElement ? document : ancestor).addEventListener("scroll", __classPrivateFieldGet(this, _ScrollController_scrollHandler, "f"), {
1501
- passive: true
1502
- });
1503
- }
1504
- }
1505
- }
1506
- /** @inheritdoc */
1507
- _unobserve(target) {
1508
- if (__classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").has(target)) {
1509
- for (const ancestor of __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").get(target)) {
1510
- (ancestor === document.documentElement ? document : ancestor).removeEventListener("scroll", __classPrivateFieldGet(this, _ScrollController_scrollHandler, "f"));
1511
- }
1512
- __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").delete(target);
1513
- }
1514
- }
1515
- /** @private */
1516
- _debounceCallback(target) {
1517
- __classPrivateFieldGet(this, _ScrollController_callback, "f").call(this, target);
1518
- }
762
+ function isTouchedMixin(value) {
763
+ return hasKeys(value, "touched", "untouched", "markAsTouched", "markAsUntouched");
1519
764
  }
1520
- _ScrollController_debounce = new WeakMap(), _ScrollController_callback = new WeakMap(), _ScrollController_scrollHandler = new WeakMap(), _ScrollController_scrollContainers = new WeakMap(), _ScrollController_instances = new WeakSet(), _ScrollController_getShadowScrollContainer = function _ScrollController_getShadowScrollContainer(element) {
1521
- const root = element.shadowRoot;
1522
- if (!root) return null;
1523
- const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
1524
- let node = walker.currentNode;
1525
- while (node) {
1526
- if (node instanceof Element && __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_isScrollable).call(this, node)) return node;
1527
- node = walker.nextNode();
1528
- }
1529
- return null;
1530
- }, _ScrollController_isScrollable = function _ScrollController_isScrollable(element) {
1531
- const style = getComputedStyle(element);
1532
- return /(auto|scroll)/.test(style.overflow + style.overflowY + style.overflowX);
1533
- }, _ScrollController_getScrollContainers = function _ScrollController_getScrollContainers(element) {
1534
- const ancestors = new Array();
1535
- const shadowScrollContainer = __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_getShadowScrollContainer).call(this, element);
1536
- if (shadowScrollContainer) {
1537
- ancestors.push(shadowScrollContainer);
1538
- }
1539
- let ancestor = element;
1540
- while (ancestor) {
1541
- if (__classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_isScrollable).call(this, ancestor)) {
1542
- ancestors.push(ancestor);
1543
- }
1544
- ancestor = ancestor.parentElement;
1545
- }
1546
- return ancestors;
1547
- }, _ScrollController_handleScroll = function _ScrollController_handleScroll(e) {
1548
- const target = e.target === document ? document.documentElement : e.target;
1549
- if (__classPrivateFieldGet(this, _ScrollController_debounce, "f")) {
1550
- this._debounceCallback(target);
1551
- } else {
1552
- __classPrivateFieldGet(this, _ScrollController_callback, "f").call(this, target);
1553
- }
1554
- };
1555
- __decorate([debounce(40)], ScrollController.prototype, "_debounceCallback", null);
1556
-
1557
- var _ScrollLockController_instances, _ScrollLockController_locked, _ScrollLockController_scrollTop, _ScrollLockController_scrollLeft, _ScrollLockController_previousOverflow, _ScrollLockController_previousScrollbarGutter, _ScrollLockController_isVerticallyScrollable;
765
+ const _eventHandler$1 = Symbol("_eventHandler");
1558
766
  /**
1559
- * A `ReactiveController` that provides safe, predictable scroll locking for modal UI
1560
- * surfaces (dialogs, bottom sheets, overlays).
767
+ * Mixin to augment an element with functionality used to mark it as touched.
768
+ * @template T The type of the base class.
769
+ * @param {T} base The base class.
770
+ * @returns {Constructor<TouchedMixin> & T} A constructor that implements `TouchedMixin`.
1561
771
  */
1562
- class ScrollLockController {
1563
- constructor(host) {
1564
- _ScrollLockController_instances.add(this);
1565
- /** @private */
1566
- _ScrollLockController_locked.set(this, false);
1567
- /** @private */
1568
- _ScrollLockController_scrollTop.set(this, 0);
1569
- /** @private */
1570
- _ScrollLockController_scrollLeft.set(this, 0);
1571
- /** @private */
1572
- _ScrollLockController_previousOverflow.set(this, "");
1573
- /** @private */
1574
- _ScrollLockController_previousScrollbarGutter.set(this, "");
1575
- host.addController(this);
1576
- }
1577
- /** Locks document scrolling only if scroll actually exists. */
1578
- lock() {
1579
- if (__classPrivateFieldGet(this, _ScrollLockController_locked, "f")) return;
1580
- __classPrivateFieldSet(this, _ScrollLockController_locked, true, "f");
1581
- // Save scroll position
1582
- __classPrivateFieldSet(this, _ScrollLockController_scrollTop, window.scrollY, "f");
1583
- __classPrivateFieldSet(this, _ScrollLockController_scrollLeft, window.scrollX, "f");
1584
- // Save existing inline styles
1585
- __classPrivateFieldSet(this, _ScrollLockController_previousOverflow, document.documentElement.style.overflow, "f");
1586
- __classPrivateFieldSet(this, _ScrollLockController_previousScrollbarGutter, document.documentElement.style.scrollbarGutter, "f");
1587
- // Only apply gutter if vertical scroll exists
1588
- if (__classPrivateFieldGet(this, _ScrollLockController_instances, "m", _ScrollLockController_isVerticallyScrollable).call(this)) {
1589
- document.documentElement.style.scrollbarGutter = "stable";
1590
- }
1591
- // Lock scroll
1592
- document.documentElement.style.overflow = "hidden";
1593
- // Freeze scroll position
1594
- window.scrollTo(__classPrivateFieldGet(this, _ScrollLockController_scrollLeft, "f"), __classPrivateFieldGet(this, _ScrollLockController_scrollTop, "f"));
1595
- }
1596
- /** Unlocks document scrolling and restores the previous state. */
1597
- unlock() {
1598
- if (!__classPrivateFieldGet(this, _ScrollLockController_locked, "f")) return;
1599
- __classPrivateFieldSet(this, _ScrollLockController_locked, false, "f");
1600
- // Restore previous inline styles
1601
- document.documentElement.style.overflow = __classPrivateFieldGet(this, _ScrollLockController_previousOverflow, "f");
1602
- document.documentElement.style.scrollbarGutter = __classPrivateFieldGet(this, _ScrollLockController_previousScrollbarGutter, "f");
1603
- // Restore scroll position
1604
- window.scrollTo(__classPrivateFieldGet(this, _ScrollLockController_scrollLeft, "f"), __classPrivateFieldGet(this, _ScrollLockController_scrollTop, "f"));
1605
- }
1606
- /** @inheritdoc */
1607
- hostDisconnected() {
1608
- this.unlock();
1609
- }
1610
- }
1611
- _ScrollLockController_locked = new WeakMap(), _ScrollLockController_scrollTop = new WeakMap(), _ScrollLockController_scrollLeft = new WeakMap(), _ScrollLockController_previousOverflow = new WeakMap(), _ScrollLockController_previousScrollbarGutter = new WeakMap(), _ScrollLockController_instances = new WeakSet(), _ScrollLockController_isVerticallyScrollable = function _ScrollLockController_isVerticallyScrollable() {
1612
- return document.documentElement.scrollHeight > document.documentElement.clientHeight;
1613
- };
1614
-
1615
- /** Converts an ISO‑8601 date to and from a `Date` object. */
1616
- const dateConverter = {
1617
- fromAttribute(value) {
1618
- if (!value) return null;
1619
- // Matches all four formats:
1620
- // yyyy-MM-dd
1621
- // yyyy-MM-ddTHH:mm:ss
1622
- // yyyy-MM-ddTHH:mm:ssZ
1623
- // yyyy-MM-ddTHH:mm:ss±HH:mm
1624
- const isoRegex = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
1625
- const m = value.match(isoRegex);
1626
- if (!m) return null;
1627
- const year = Number(m[1]);
1628
- const month = Number(m[2]) - 1; // JS months are 0-based
1629
- const day = Number(m[3]);
1630
- const hasTime = m[4] !== undefined;
1631
- const hours = hasTime ? Number(m[4]) : 0;
1632
- const minutes = hasTime ? Number(m[5]) : 0;
1633
- const seconds = hasTime ? Number(m[6]) : 0;
1634
- const ms = hasTime && m[7] ? Number(m[7]) : 0;
1635
- const tz = m[8];
1636
- // CASE 1: yyyy-MM-dd → local date (no timezone math)
1637
- if (!hasTime && !tz) {
1638
- return new Date(year, month, day);
1639
- }
1640
- // CASE 2: yyyy-MM-ddTHH:mm:ss (no timezone) → local datetime
1641
- if (hasTime && !tz) {
1642
- return new Date(year, month, day, hours, minutes, seconds, ms);
772
+ function Touched(base) {
773
+ var _a;
774
+ class _Touched extends base {
775
+ constructor() {
776
+ super(...arguments);
777
+ /** @private */
778
+ this[_a] = () => this.markAsTouched();
1643
779
  }
1644
- // CASE 3: yyyy-MM-ddTHH:mm:ssZ UTC
1645
- if (tz === "Z") {
1646
- return new Date(Date.UTC(year, month, day, hours, minutes, seconds, ms));
780
+ /** Whether the user has interacted when the element. */
781
+ get touched() {
782
+ return hasCustomState(this, "--touched");
1647
783
  }
1648
- // CASE 4: yyyy-MM-ddTHH:mm:ss±HH:mm offset
1649
- if (tz && /^[+-]\d{2}:\d{2}$/.test(tz)) {
1650
- const sign = tz.startsWith("-") ? -1 : 1;
1651
- const [tzH, tzM] = tz.slice(1).split(":").map(Number);
1652
- const offsetMinutes = sign * (tzH * 60 + tzM);
1653
- // Convert offset datetime → UTC → local
1654
- const utc = Date.UTC(year, month, day, hours, minutes, seconds, ms);
1655
- return new Date(utc - offsetMinutes * 60_000);
784
+ /** Whether the user has not interacted when the element. */
785
+ get untouched() {
786
+ return !this.touched;
1656
787
  }
1657
- return null;
1658
- },
1659
- toAttribute(value) {
1660
- return value?.toISOString() ?? null;
1661
- }
1662
- };
1663
-
1664
- /** Converts a space-separated attribute in to an array of strings. */
1665
- const spaceSeparatedStringConverter = {
1666
- fromAttribute(value) {
1667
- if (!value) return [];
1668
- return value.split(/\s+/).map(d => d.trim()).filter(Boolean);
1669
- },
1670
- toAttribute(value) {
1671
- return value.join(" ");
1672
- }
1673
- };
1674
-
1675
- const important = "important";
1676
- // The leading space is important
1677
- const importantFlag = " !" + important;
1678
- // How many characters to remove from a value, as a negative number
1679
- const flagTrim = 0 - importantFlag.length;
1680
- class SafeStyleMapDirective extends Directive {
1681
- constructor(partInfo) {
1682
- super(partInfo);
1683
- if (partInfo.type !== PartType.ATTRIBUTE || partInfo.name !== "style" || partInfo.strings?.length > 2) {
1684
- throw new Error("The `styleMap` directive must be used in the `style` attribute " + "and must be the only part in the attribute.");
788
+ /** @inheritdoc */
789
+ connectedCallback() {
790
+ this.markAsUntouched();
791
+ super.connectedCallback();
792
+ this.addEventListener("focusout", this[_eventHandler$1], {
793
+ capture: true
794
+ });
1685
795
  }
1686
- }
1687
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1688
- render(_) {
1689
- return nothing;
1690
- }
1691
- update(part, [styleInfo]) {
1692
- const {
1693
- style
1694
- } = part.element;
1695
- if (this._previousStyleProperties === undefined) {
1696
- this._previousStyleProperties = new Set(Object.keys(styleInfo));
796
+ /** @inheritdoc */
797
+ disconnectedCallback() {
798
+ super.disconnectedCallback();
799
+ this.removeEventListener("focusout", this[_eventHandler$1], {
800
+ capture: true
801
+ });
1697
802
  }
1698
- // Remove old properties that no longer exist in styleInfo
1699
- for (const name of this._previousStyleProperties) {
1700
- // If the name isn't in styleInfo or it's null/undefined
1701
- if (styleInfo[name] == null) {
1702
- this._previousStyleProperties.delete(name);
1703
- if (name.includes("-")) {
1704
- style.removeProperty(name);
1705
- } else {
1706
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1707
- style[name] = null;
1708
- }
1709
- }
803
+ /** Marks the element as touched. */
804
+ markAsTouched() {
805
+ addCustomState(this, "--touched");
1710
806
  }
1711
- // Add or update properties
1712
- for (const name in styleInfo) {
1713
- const value = styleInfo[name];
1714
- if (value != null) {
1715
- this._previousStyleProperties.add(name);
1716
- const isImportant = typeof value === "string" && value.endsWith(importantFlag);
1717
- if (name.includes("-") || isImportant) {
1718
- style.setProperty(name, isImportant ? value.slice(0, flagTrim) : value, isImportant ? important : "");
1719
- } else {
1720
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1721
- style[name] = value;
1722
- }
1723
- }
807
+ /** Marks the element as untouched. */
808
+ markAsUntouched() {
809
+ deleteCustomState(this, "--touched");
1724
810
  }
1725
- return noChange;
1726
811
  }
812
+ _a = _eventHandler$1;
813
+ return _Touched;
1727
814
  }
1728
- /**
1729
- * A directive that applies CSS properties to an element.
1730
- *
1731
- * `safeStyleMap` can only be used in the `style` attribute and must be the only
1732
- * expression in the attribute. It takes the property names in the
1733
- * {@link StyleInfo styleInfo} object and adds the properties to the inline
1734
- * style of the element.
1735
- *
1736
- * Property names with dashes (`-`) are assumed to be valid CSS
1737
- * property names and set on the element's style object using `setProperty()`.
1738
- * Names without dashes are assumed to be camelCased JavaScript property names
1739
- * and set on the element's style object using property assignment, allowing the
1740
- * style object to translate JavaScript-style names to CSS property names.
1741
- *
1742
- * For example `safeStyleMap({backgroundColor: 'red', 'border-top': '5px', '--size':
1743
- * '0'})` sets the `background-color`, `border-top` and `--size` properties.
1744
- *
1745
- * @param styleInfo
1746
- * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}
1747
- */
1748
- const safeStyleMap = directive(SafeStyleMapDirective);
1749
815
 
1750
816
  /**
1751
- * Determines whether an object has keys for a given type.
1752
- * @template T The type to test.
817
+ * Determines whether a value is a `DisabledInteractiveMixin`.
1753
818
  * @param {unknown} value The value to test.
1754
- * @param {...keys: Array<keyof T>} keys The keys of `T` to test.
1755
- * @returns {boolean} Whether `value` has all `keys`.
819
+ * @returns {value is DisabledInteractiveMixin} Whether `value` is a `DisabledInteractiveMixin`.
1756
820
  */
1757
- function hasKeys(value, ...keys) {
1758
- return typeof value === "object" && value !== null && keys.every(x => x in value);
821
+ function isDisabledInteractiveMixin(value) {
822
+ return hasKeys(value, "disabledInteractive") && isDisabledMixin(value);
1759
823
  }
1760
-
1761
- /** A symbol through which to access the `ElementInternals` attached to an element. */
1762
- const internals = Symbol("internals");
1763
- /**
1764
- * Determines whether a value is an `AttachInternalsMixin`.
1765
- * @param {unknown} value The value to test.
1766
- * @returns Whether `value` is an `AttachInternalsMixin`.
1767
- */
1768
- function isAttachInternalsMixin(value) {
1769
- return hasKeys(value, internals);
1770
- }
1771
- const _internals = Symbol("_internals");
1772
- // Since flushing custom state doesn't flush in Safari (affecting all iOS browsers),
1773
- // a copy of custom state is retained locally so components can correctly read after write.
1774
- const _customState = Symbol("_customState");
824
+ const SUPPRESSED_EVENTS = ["click", "dblclick", "auxclick", "keydown", "keyup"];
825
+ const INTERACTIVE_KEYS = ["Tab", "ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Left", "Up", "Right", "Down"];
826
+ const _suppressedEventHandler = Symbol("_suppressedEventHandler");
1775
827
  /**
1776
- * Mixin to augment an element with behavior that attaches to `ElementInternals`.
828
+ * Mixin to augment an element with behavior that supports an interactive disabled state.
1777
829
  * @template T The type of the base class.
1778
830
  * @param {T} base The base class.
1779
- * @param {boolean | undefined} formAssociated Whether the element is "Form Associated".
1780
- * @returns {Constructor<AttachInternalsMixin> & T} A constructor that implements `AttachInternalsMixin`.
831
+ * @returns {Constructor<DisabledInteractiveMixin>} A constructor that implements `DisabledInteractiveMixin`.
1781
832
  */
1782
- function AttachInternals(base, formAssociated) {
833
+ function DisabledInteractive(base) {
1783
834
  var _a;
1784
- class _AttachInternals extends base {
835
+ class _DisabledInteractiveMixin extends base {
1785
836
  constructor() {
1786
837
  super(...arguments);
1787
- // Since flushing custom state doesn't flush in Safari (affecting all iOS browsers),
1788
- // a copy of custom state is retained locally so components can correctly read after write.
1789
838
  /** @private */
1790
- this[_a] = new Set();
1791
- }
1792
- /** @internal */
1793
- get [(_a = _customState, internals)]() {
1794
- return this[_internals] ?? (this[_internals] = this.attachInternals());
1795
- }
1796
- }
1797
- /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
1798
- _AttachInternals.formAssociated = formAssociated;
1799
- return _AttachInternals;
1800
- }
1801
- /**
1802
- * Convenience function used to test whether an element has a given custom state.
1803
- * @param {AttachInternalsMixin} element The element to test.
1804
- * @param {string} state The custom state to test.
1805
- * @returns {boolean} Whether `element` has `state`.
1806
- */
1807
- function hasCustomState(element, state) {
1808
- // Since flushing custom state doesn't flush in Safari (affecting all iOS browsers),
1809
- // a copy of custom state is retained locally so components can correctly read after write.
1810
- if (_customState in element) {
1811
- return element[_customState].has(state);
1812
- }
1813
- // This should never get called due to needing a local copy of custom state
1814
- // since reading after write to flush doesn't work in Safari (affecting all iOS browsers).
1815
- return element[internals].states.has(state);
1816
- }
1817
- /**
1818
- * Convenience function used to add custom state to an element.
1819
- * @param {AttachInternalsMixin} element The element to which to add custom state.
1820
- * @param {string} state The custom state to add.
1821
- */
1822
- function addCustomState(element, state) {
1823
- // Avoid style recalculation when element already has state.
1824
- if (hasCustomState(element, state)) return;
1825
- // Since flushing custom state doesn't flush in Safari (affecting all iOS browsers),
1826
- // a copy of custom state is retained locally so components can correctly read after write.
1827
- if (_customState in element) {
1828
- element[_customState].add(state);
1829
- }
1830
- element[internals]?.states.add(state);
1831
- element[internals]?.states.has(state); // flush (even though this doesn't work in Safari)
1832
- }
1833
- /**
1834
- * Convenience function used to delete custom state from an element.
1835
- * @param {AttachInternalsMixin} element The element from which to delete custom state.
1836
- * @param {string} state The custom state to delete.
1837
- * @returns {boolean} Whether `state` was removed from `element`.
1838
- */
1839
- function deleteCustomState(element, state) {
1840
- // Since flushing custom state doesn't flush in Safari (affecting all iOS browsers),
1841
- // a copy of custom state is retained locally so components can correctly read after write.
1842
- if (_customState in element) {
1843
- element[_customState].delete(state);
1844
- }
1845
- if (element[internals]?.states.delete(state)) {
1846
- element[internals]?.states.has(state); // flush (even though this doesn't work in Safari)
1847
- return true;
1848
- }
1849
- return false;
1850
- }
1851
- /**
1852
- * Convenience function used to add or delete custom state for an element.
1853
- * @param {AttachInternalsMixin} element The element for which to add or delete custom state.
1854
- * @param {string} state The custom state to add or delete.
1855
- * @param {boolean} value Whether to add or delete `state` from `element`.
1856
- */
1857
- function setCustomState(element, state, value) {
1858
- if (value) {
1859
- addCustomState(element, state);
1860
- } else {
1861
- deleteCustomState(element, state);
1862
- }
1863
- }
1864
-
1865
- /**
1866
- * Determines whether a value is a `CheckedMixin`.
1867
- * @param {unknown} value The value to test.
1868
- * @returns Whether `value` is a `CheckedMixin`.
1869
- */
1870
- function isCheckedMixin(value) {
1871
- return hasKeys(value, "checked");
1872
- }
1873
- /**
1874
- * Mixin to augment an element with behavior that supports a checked state.
1875
- * @template T The type of the base class.
1876
- * @param {T} base The base class.
1877
- * @returns {Constructor<CheckedMixin> & T} A constructor that implements `CheckedMixin`.
1878
- */
1879
- function Checked(base) {
1880
- class _CheckedMixin extends base {
1881
- constructor() {
1882
- super(...arguments);
839
+ this[_a] = e => {
840
+ if (this.disabledInteractive) {
841
+ // Only allow specific keys when disabled and interactive.
842
+ if (e instanceof KeyboardEvent && INTERACTIVE_KEYS.includes(e.key)) {
843
+ return;
844
+ }
845
+ e.stopImmediatePropagation();
846
+ e.preventDefault();
847
+ }
848
+ };
1883
849
  /**
1884
- * Whether the element is checked.
850
+ * Whether the element is disabled and interactive.
1885
851
  * @default false
1886
852
  */
1887
- this.checked = false;
853
+ this.disabledInteractive = false;
1888
854
  }
1889
855
  /** @inheritdoc */
1890
- update(changedProperties) {
1891
- super.update(changedProperties);
1892
- if (changedProperties.has("checked")) {
1893
- if (this.role === "button") {
1894
- this.ariaPressed = `${this.checked}`;
1895
- this.ariaChecked = null;
1896
- } else if (this.role && this.role !== "none" && this.role !== "presentation") {
1897
- this.ariaChecked = `${this.checked}`;
1898
- this.ariaPressed = null;
1899
- }
1900
- }
856
+ connectedCallback() {
857
+ SUPPRESSED_EVENTS.forEach(x => this.addEventListener(x, this[_suppressedEventHandler], true));
858
+ super.connectedCallback();
1901
859
  }
1902
- }
1903
- __decorate([property({
1904
- type: Boolean,
1905
- reflect: true
1906
- })], _CheckedMixin.prototype, "checked", void 0);
1907
- return _CheckedMixin;
1908
- }
1909
-
1910
- /**
1911
- * Determines whether a value is a `CheckedIndeterminateMixin`.
1912
- * @param {unknown} value The value to test.
1913
- * @returns Whether `value` is a `CheckedIndeterminateMixin`.
1914
- */
1915
- function isCheckedIndeterminateMixin(value) {
1916
- return hasKeys(value, "indeterminate") && isCheckedMixin(value);
1917
- }
1918
- /**
1919
- * Mixin to augment an element with behavior that supports a mixed checked state.
1920
- * @template T The type of the base class.
1921
- * @param {T} base The base class.
1922
- * @returns {Constructor<CheckedIndeterminateMixin> & T} A constructor that implements `CheckedIndeterminateMixin`.
1923
- */
1924
- function CheckedIndeterminate(base) {
1925
- class _CheckedIndeterminateMixin extends Checked(base) {
1926
- constructor() {
1927
- super(...arguments);
1928
- /**
1929
- * Whether the element's checked state is indeterminate.
1930
- * @default false
1931
- */
1932
- this.indeterminate = false;
860
+ /** @inheritdoc */
861
+ disconnectedCallback() {
862
+ SUPPRESSED_EVENTS.forEach(x => this.removeEventListener(x, this[_suppressedEventHandler], true));
863
+ super.disconnectedCallback();
1933
864
  }
1934
865
  /** @inheritdoc */
1935
866
  update(changedProperties) {
1936
867
  super.update(changedProperties);
1937
- if (changedProperties.has("indeterminate") && this.role && this.role !== "none" && this.role !== "presentation") {
1938
- this.ariaChecked = !this.checked && this.indeterminate ? "mixed" : `${this.checked}`;
868
+ if ((changedProperties.has("disabled") || changedProperties.has("disabledInteractive")) && this.role && this.role !== "none" && this.role !== "presentation" && this.role !== "none") {
869
+ this.ariaDisabled = this.disabled || this.disabledInteractive ? "true" : null;
1939
870
  }
1940
871
  }
1941
872
  }
873
+ _a = _suppressedEventHandler;
1942
874
  __decorate([property({
875
+ attribute: "disabled-interactive",
1943
876
  type: Boolean,
1944
877
  reflect: true
1945
- })], _CheckedIndeterminateMixin.prototype, "indeterminate", void 0);
1946
- return _CheckedIndeterminateMixin;
878
+ })], _DisabledInteractiveMixin.prototype, "disabledInteractive", void 0);
879
+ return _DisabledInteractiveMixin;
1947
880
  }
1948
881
 
882
+ /** A symbol through which to update labels to reflect a control's current state. */
883
+ const updateLabels = Symbol("updateLabels");
1949
884
  /**
1950
- * Determines whether a value is a `SelectedMixin`.
885
+ * Determines whether a value is a `LabelledMixin`.
1951
886
  * @param {unknown} value The value to test.
1952
- * @returns Whether `value` is a `SelectedMixin`.
887
+ * @returns A value indicating whether `value` is a `LabelledMixin`.
1953
888
  */
1954
- function isSelectedMixin(value) {
1955
- return hasKeys(value, "selected");
889
+ function isLabelledMixin(value) {
890
+ return hasKeys(value, "labels") && isAttachInternalsMixin(value);
1956
891
  }
892
+ const _eventHandler = Symbol("_eventHandler");
1957
893
  /**
1958
- * Mixin to augment an element with behavior that supports a selected state.
894
+ * Mixin to augment an element with support for labelling.
1959
895
  * @template T The type of the base class.
1960
896
  * @param {T} base The base class.
1961
- * @returns {Constructor<SelectedMixin> & T} A constructor that implements `SelectedMixin`.
897
+ * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
1962
898
  */
1963
- function Selected(base) {
1964
- class _SelectedMixin extends base {
899
+ function Labelled(base) {
900
+ var _a;
901
+ class _Labelled extends base {
1965
902
  constructor() {
1966
903
  super(...arguments);
1967
- /**
1968
- * Whether the element is selected.
1969
- * @default false
1970
- */
1971
- this.selected = false;
904
+ /** @private */
905
+ this[_a] = e => {
906
+ if (!e.defaultPrevented) {
907
+ this[updateLabels]();
908
+ }
909
+ };
910
+ }
911
+ /** The label elements that the element is associated with. */
912
+ get labels() {
913
+ return this[internals].labels;
914
+ }
915
+ /** @inheritdoc */
916
+ connectedCallback() {
917
+ super.connectedCallback();
918
+ this.addEventListener("focusout", this[_eventHandler]);
919
+ this.addEventListener("change", this[_eventHandler]);
920
+ }
921
+ /** @inheritdoc */
922
+ disconnectedCallback() {
923
+ super.disconnectedCallback();
924
+ this.removeEventListener("focusout", this[_eventHandler]);
925
+ this.removeEventListener("change", this[_eventHandler]);
1972
926
  }
1973
927
  /** @inheritdoc */
1974
928
  update(changedProperties) {
1975
929
  super.update(changedProperties);
1976
- if (changedProperties.has("selected")) {
1977
- if (this.role === "button") {
1978
- this.ariaPressed = `${this.selected}`;
1979
- this.ariaSelected = null;
1980
- this.ariaChecked = null;
1981
- } else if (this.role === "radio") {
1982
- this.ariaChecked = `${this.selected}`;
1983
- this.ariaSelected = null;
1984
- this.ariaPressed = null;
1985
- } else if (this.role && this.role !== "none" && this.role !== "presentation") {
1986
- this.ariaSelected = `${this.selected}`;
1987
- this.ariaPressed = null;
1988
- this.ariaChecked = null;
930
+ this[updateLabels]();
931
+ }
932
+ /** @internal */
933
+ [(_a = _eventHandler, updateLabels)]() {
934
+ const focusable = this.hasAttribute("tabindex");
935
+ const disabled = isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive;
936
+ const invalid = isTouchedMixin(this) && this.touched && (this.ariaInvalid || hasCustomState(this, "--invalid"));
937
+ for (const label of this.labels ?? []) {
938
+ label.style.userSelect = focusable ? "none" : "";
939
+ label.style.cursor = !disabled && focusable ? "pointer" : "";
940
+ if (!disabled && focusable) {
941
+ label.style.setProperty("-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)");
942
+ } else {
943
+ label.style.removeProperty("-webkit-tap-highlight-color");
1989
944
  }
945
+ label.style.color = disabled ? `color-mix(in srgb, ${DesignToken.color.onSurface} 38%, transparent)` : invalid ? `${DesignToken.color.error}` : "";
1990
946
  }
1991
947
  }
1992
948
  }
1993
- __decorate([property({
1994
- type: Boolean,
1995
- reflect: true
1996
- })], _SelectedMixin.prototype, "selected", void 0);
1997
- return _SelectedMixin;
1998
- }
1999
-
2000
- /**
2001
- * Determines whether a value is a `CheckedOrSelectedMixin`.
2002
- * @param {unknown} value The value to test.
2003
- * @returns Whether `value` is a `CheckedOrSelectedMixin`.
2004
- */
2005
- function isCheckedOrSelectedMixin(value) {
2006
- return isCheckedMixin(value) || isSelectedMixin(value);
2007
- }
2008
- /**
2009
- * Determines whether the state of an element is checked or selected.
2010
- * @param {CheckedOrSelectedMixin} element The element to test.
2011
- * @return {boolean} Whether `element` is checked or selected.
2012
- */
2013
- function isCheckedOrSelected(element) {
2014
- return isCheckedMixin(element) && element.checked || isSelectedMixin(element) && element.selected;
2015
- }
2016
- /**
2017
- * Sets the checked or selected state of an element.
2018
- * @param {CheckedOrSelectedMixin} element The element for which to set the checked or selected state.
2019
- * @param {boolean} checkedOrSelected The checked or selected state.
2020
- */
2021
- function checkOrSelect(element, checkedOrSelected) {
2022
- if (isCheckedMixin(element)) {
2023
- element.checked = checkedOrSelected;
2024
- } else {
2025
- element.selected = checkedOrSelected;
2026
- }
949
+ /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
950
+ _Labelled.formAssociated = true;
951
+ return _Labelled;
2027
952
  }
2028
953
 
954
+ /** A symbol through which a "Form Associated" custom element provides a value for a form. */
955
+ const formValue = Symbol("formValue");
956
+ /** A symbol through which a "Form Associated" custom element provides a default value for resetting a form. */
957
+ const defaultValue = Symbol("defaultValue");
2029
958
  /**
2030
- * Determines whether a value is a `DirtyMixin`.
959
+ * Determines whether a value is a `FormAssociatedMixin`.
2031
960
  * @param {unknown} value The value to test.
2032
- * @returns A value indicating whether `value` is a `DirtyMixin`.
961
+ * @returns A value indicating whether `value` is a `FormAssociatedMixin`.
2033
962
  */
2034
- function isDirtyMixin(value) {
2035
- return hasKeys(value, "dirty", "pristine", "markAsDirty", "markAsPristine");
963
+ function isFormAssociatedMixin(value) {
964
+ return hasKeys(value, "disabled", "form", "name") && isLabelledMixin(value) && isAttachInternalsMixin(value);
2036
965
  }
2037
- const _eventHandler$2 = Symbol("_eventHandler");
966
+ const _defaultValue = Symbol("_defaultValue");
967
+ const _defaultIndeterminate = Symbol("_defaultIndeterminate");
968
+ const _formDisabled = Symbol("_formDisabled");
2038
969
  /**
2039
- * Mixin to augment an element with functionality used to mark it as dirty.
970
+ * Mixin to augment an element with "Form Associated" behavior.
2040
971
  * @template T The type of the base class.
2041
972
  * @param {T} base The base class.
2042
- * @returns {Constructor<DirtyMixin> & T} A constructor that implements `DirtyMixin`.
973
+ * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
2043
974
  */
2044
- function Dirty(base) {
2045
- var _a;
2046
- class _Dirty extends base {
975
+ function FormAssociated(base) {
976
+ var _a, _b;
977
+ class _FormAssociatedMixin extends base {
2047
978
  constructor() {
2048
979
  super(...arguments);
2049
980
  /** @private */
2050
- this[_a] = () => this.markAsDirty();
2051
- }
2052
- /** Whether the user has modified the value of the element. */
2053
- get dirty() {
2054
- return hasCustomState(this, "--dirty");
981
+ this[_a] = false;
982
+ /** @private */
983
+ this[_b] = false;
2055
984
  }
2056
- /** Whether the user has not modified the value of the element. */
2057
- get pristine() {
2058
- return !this.dirty;
985
+ /** The `HTMLFormElement` associated with this element. */
986
+ get form() {
987
+ return this[internals].form;
2059
988
  }
2060
989
  /** @inheritdoc */
2061
- connectedCallback() {
2062
- this.markAsPristine();
2063
- super.connectedCallback();
2064
- this.addEventListener("change", this[_eventHandler$2]);
2065
- }
2066
- /** @inheritdoc */
2067
- disconnectedCallback() {
2068
- super.disconnectedCallback();
2069
- this.removeEventListener("change", this[_eventHandler$2]);
990
+ get labels() {
991
+ return this[internals].labels;
2070
992
  }
2071
- /** Marks the element as pristine. */
2072
- markAsPristine() {
2073
- deleteCustomState(this, "--dirty");
993
+ /** @internal */
994
+ get [(_a = _defaultIndeterminate, _b = _formDisabled, formValue)]() {
995
+ return null;
2074
996
  }
2075
- /** Marks the element as dirty. */
2076
- markAsDirty() {
2077
- addCustomState(this, "--dirty");
997
+ /** @internal */
998
+ get [defaultValue]() {
999
+ return this[_defaultValue];
2078
1000
  }
2079
- }
2080
- _a = _eventHandler$2;
2081
- return _Dirty;
2082
- }
2083
-
2084
- /**
2085
- * Determines whether a value is a `TouchedMixin`.
2086
- * @param {unknown} value The value to test.
2087
- * @returns A value indicating whether `value` is a `TouchedMixin`.
2088
- */
2089
- function isTouchedMixin(value) {
2090
- return hasKeys(value, "touched", "untouched", "markAsTouched", "markAsUntouched");
2091
- }
2092
- const _eventHandler$1 = Symbol("_eventHandler");
2093
- /**
2094
- * Mixin to augment an element with functionality used to mark it as touched.
2095
- * @template T The type of the base class.
2096
- * @param {T} base The base class.
2097
- * @returns {Constructor<TouchedMixin> & T} A constructor that implements `TouchedMixin`.
2098
- */
2099
- function Touched(base) {
2100
- var _a;
2101
- class _Touched extends base {
2102
- constructor() {
2103
- super(...arguments);
2104
- /** @private */
2105
- this[_a] = () => this.markAsTouched();
1001
+ /** The name that identifies the element when submitting the associated form. */
1002
+ get name() {
1003
+ return this.getAttribute("name") ?? "";
2106
1004
  }
2107
- /** Whether the user has interacted when the element. */
2108
- get touched() {
2109
- return hasCustomState(this, "--touched");
1005
+ set name(value) {
1006
+ if (value) {
1007
+ this.setAttribute("name", value);
1008
+ } else {
1009
+ this.removeAttribute("name");
1010
+ }
2110
1011
  }
2111
- /** Whether the user has not interacted when the element. */
2112
- get untouched() {
2113
- return !this.touched;
1012
+ // Disabled attributes should not be reflected for form associated elements due to
1013
+ // how the formDisabledCallback overrides an element's disabled state.
1014
+ // See https://github.com/whatwg/html/issues/8365
1015
+ /**
1016
+ * Whether the element is disabled.
1017
+ * @default false
1018
+ */
1019
+ get disabled() {
1020
+ return super.disabled || this[_formDisabled];
1021
+ }
1022
+ set disabled(value) {
1023
+ super.disabled = value;
2114
1024
  }
2115
1025
  /** @inheritdoc */
2116
1026
  connectedCallback() {
2117
- this.markAsUntouched();
2118
1027
  super.connectedCallback();
2119
- this.addEventListener("focusout", this[_eventHandler$1], {
2120
- capture: true
2121
- });
1028
+ if (isCheckedMixin(this)) {
1029
+ this[_defaultValue] = this.checked;
1030
+ if (isCheckedIndeterminateMixin(this)) {
1031
+ this[_defaultIndeterminate] = this.indeterminate;
1032
+ }
1033
+ } else if ("value" in this) {
1034
+ this[_defaultValue] = this.value;
1035
+ }
2122
1036
  }
2123
1037
  /** @inheritdoc */
2124
- disconnectedCallback() {
2125
- super.disconnectedCallback();
2126
- this.removeEventListener("focusout", this[_eventHandler$1], {
2127
- capture: true
2128
- });
2129
- }
2130
- /** Marks the element as touched. */
2131
- markAsTouched() {
2132
- addCustomState(this, "--touched");
2133
- }
2134
- /** Marks the element as untouched. */
2135
- markAsUntouched() {
2136
- deleteCustomState(this, "--touched");
1038
+ requestUpdate(name, oldValue, options) {
1039
+ super.requestUpdate(name, oldValue, options);
1040
+ this[internals].setFormValue(this[formValue]);
2137
1041
  }
2138
- }
2139
- _a = _eventHandler$1;
2140
- return _Touched;
2141
- }
2142
-
2143
- /** Design tokens that control color. */
2144
- const ColorToken = {
2145
- /** High-emphasis fills, texts, and icons against surface. */
2146
- primary: unsafeCSS("var(--md-sys-color-primary, #6750A4)"),
2147
- /** Text and icons against primary. */
2148
- onPrimary: unsafeCSS("var(--md-sys-color-on-primary, #FFFFFF)"),
2149
- /** Standout fill color against surface, for key components. */
2150
- primaryContainer: unsafeCSS("var(--md-sys-color-primary-container, #EADDFF)"),
2151
- /** Text and icons against primary container. */
2152
- onPrimaryContainer: unsafeCSS("var(--md-sys-color-on-primary-container, #4F378B)"),
2153
- /** High-emphasis fills, texts, and icons that maintain the same tone in light and dark themes. */
2154
- primaryFixed: unsafeCSS("var(--md-sys-color-primary-fixed, #EADDFF)"),
2155
- /** High-emphasis fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
2156
- primaryFixedDim: unsafeCSS("var(--md-sys-color-primary-fixed-dim, #D0BCFF)"),
2157
- /** Text and icons against fixed primary. */
2158
- onPrimaryFixed: unsafeCSS("var(--md-sys-color-on-primary-fixed, #21005D)"),
2159
- /** Lower-emphasis text and icons against fixed primary. */
2160
- onPrimaryFixedVariant: unsafeCSS("var(--md-sys-color-on-primary-fixed-variant, #4F378B)"),
2161
- /** Less prominent fills, text, and icons against surface. */
2162
- secondary: unsafeCSS("var(--md-sys-color-secondary, #625B71)"),
2163
- /** Text and icons against secondary. */
2164
- onSecondary: unsafeCSS("var(--md-sys-color-on-secondary, #FFFFFF)"),
2165
- /** Less prominent fill color against surface, for recessive components. */
2166
- secondaryContainer: unsafeCSS("var(--md-sys-color-secondary-container, #E8DEF8)"),
2167
- /** Text and icons against secondary container. */
2168
- onSecondaryContainer: unsafeCSS("var(--md-sys-color-on-secondary-container, #4A4458)"),
2169
- /** Less prominent fills, texts, and icons that maintain the same tone in light and dark themes. */
2170
- secondaryFixed: unsafeCSS("var(--md-sys-color-secondary-fixed, #E8DEF8)"),
2171
- /** Less prominent fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
2172
- secondaryFixedDim: unsafeCSS("var(--md-sys-color-secondary-fixed-dim, #CCC2DC)"),
2173
- /** Text and icons against fixed secondary. */
2174
- onSecondaryFixed: unsafeCSS("var(--md-sys-color-on-secondary-fixed, #1D192B)"),
2175
- /** Lower-emphasis text and icons against fixed secondary. */
2176
- onSecondaryFixedVariant: unsafeCSS("var(--md-sys-color-on-secondary-fixed-variant, #4A4458)"),
2177
- /** Complementary fills, text, and icons against surface. */
2178
- tertiary: unsafeCSS("var(--md-sys-color-tertiary, #7D5260)"),
2179
- /** Text and icons against tertiary. */
2180
- onTertiary: unsafeCSS("var(--md-sys-color-on-tertiary, #FFFFFF)"),
2181
- /** Complementary container color against surface. */
2182
- tertiaryContainer: unsafeCSS("var(--md-sys-color-tertiary-container, #FFD8E4)"),
2183
- /** Text and icons against tertiary container. */
2184
- onTertiaryContainer: unsafeCSS("var(--md-sys-color-on-tertiary-container, #633B48)"),
2185
- /** Complementary fills, texts, and icons that maintain the same tone in light and dark themes. */
2186
- tertiaryFixed: unsafeCSS("var(--md-sys-color-tertiary-fixed, #FFD8E4)"),
2187
- /** Complementary fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
2188
- tertiaryFixedDim: unsafeCSS("var(--md-sys-color-tertiary-fixed-dim, #EFB8C8)"),
2189
- /** Text and icons against fixed tertiary. */
2190
- onTertiaryFixed: unsafeCSS("var(--md-sys-color-on-tertiary-fixed, #31111D)"),
2191
- /** Lower-emphasis text and icons against fixed tertiary. */
2192
- onTertiaryFixedVariant: unsafeCSS("var(--md-sys-color-on-tertiary-fixed-variant, #633B48)"),
2193
- /** Attention-grabbing color against surface for fills, icons, and text, indicating urgency. */
2194
- error: unsafeCSS("var(--md-sys-color-error, #B3261E)"),
2195
- /** Text and icons against error. */
2196
- onError: unsafeCSS("var(--md-sys-color-on-error, #FFFFFF)"),
2197
- /** Attention-grabbing fill color against surface. */
2198
- errorContainer: unsafeCSS("var(--md-sys-color-error-container, #F9DEDC)"),
2199
- /** Text and icons against error container. */
2200
- onErrorContainer: unsafeCSS("var(--md-sys-color-on-error-container, #8C1D18)"),
2201
- /** Default color for backgrounds. */
2202
- surface: unsafeCSS("var(--md-sys-color-surface, #FEF7FF)"),
2203
- /** Text and icons against any surface color. */
2204
- onSurface: unsafeCSS("var(--md-sys-color-on-surface, #1D1B20)"),
2205
- /** Lower-emphasis color for text and icons against any surface color. */
2206
- onSurfaceVariant: unsafeCSS("var(--md-sys-color-on-surface-variant, #49454F)"),
2207
- /** Lowest-emphasis container color. */
2208
- surfaceContainerLowest: unsafeCSS("var(--md-sys-color-surface-container-lowest, #FFFFFF)"),
2209
- /** Low-emphasis container color. */
2210
- surfaceContainerLow: unsafeCSS("var(--md-sys-color-surface-container-low, #F7F2FA)"),
2211
- /** Default container color. */
2212
- surfaceContainer: unsafeCSS("var(--md-sys-color-surface-container, #F3EDF7)"),
2213
- /** High-emphasis container color. */
2214
- surfaceContainerHigh: unsafeCSS("var(--md-sys-color-surface-container-high, #ECE6F0)"),
2215
- /** Highest-emphasis container color. */
2216
- surfaceContainerHighest: unsafeCSS("var(--md-sys-color-surface-container-highest, #E6E0E9)"),
2217
- /** Dimmest surface color in light and dark themes. */
2218
- surfaceDim: unsafeCSS("var(--md-sys-color-surface-dim, #DED8E1)"),
2219
- /** Brightest surface color in light and dark themes. */
2220
- surfaceBright: unsafeCSS("var(--md-sys-color-surface-bright, #FEF7FF)"),
2221
- /** Alternate surface color, can be used for active states. */
2222
- surfaceVariant: unsafeCSS("var(--md-sys-color-surface-variant, #E7E0EC)"),
2223
- /** Background fills for elements which contrast against surface. */
2224
- inverseSurface: unsafeCSS("var(--md-sys-color-inverse-surface, #322F35)"),
2225
- /** Text and icons against inverse surface. */
2226
- inverseOnSurface: unsafeCSS("var(--md-sys-color-inverse-on-surface, #F5EFF7)"),
2227
- /** Primary text and icons against inverse surface. */
2228
- inversePrimary: unsafeCSS("var(--md-sys-color-inverse-primary, #D0BCFF)"),
2229
- /** Important boundaries, such as a text field outline. */
2230
- outline: unsafeCSS("var(--md-sys-color-outline, #79747E)"),
2231
- /** Decorative elements, such as dividers. */
2232
- outlineVariant: unsafeCSS("var(--md-sys-color-outline-variant, #CAC4D0)"),
2233
- /** Elevation shadow color. */
2234
- shadow: unsafeCSS("var(--md-sys-color-shadow, #000000)"),
2235
- /** Backdrop which obscures underlying content. */
2236
- scrim: unsafeCSS("var(--md-sys-color-scrim, #000000)")
2237
- };
2238
-
2239
- const _DensityToken = {
2240
- /** Base density multiplier. */
2241
- scale: unsafeCSS("var(--md-sys-density-scale, 0)"),
2242
- /** Spatial unit used to scale component dimensions based on density. */
2243
- size: unsafeCSS("var(--md-sys-density-size, 0.25rem)")
2244
- };
2245
- /** Design tokens that control density. */
2246
- const DensityToken = {
2247
- ..._DensityToken,
2248
- /**
2249
- * Creates a CSS `calc` that calculates a dimension based on density.
2250
- * @param {number} minScale The minimum supported scale.
2251
- * @returns {CSSResult} A CSS `calc` used to calculate a dimension based on density.
2252
- */
2253
- calc(minScale) {
2254
- return unsafeCSS(`calc(max(${minScale}, ${_DensityToken.scale}) * ${_DensityToken.size})`);
2255
- }
2256
- };
2257
-
2258
- const UMBRA_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 20%, transparent)`;
2259
- const UMBRA = ["0px 0px 0px 0px", "0px 2px 1px -1px", "0px 3px 1px -2px", "0px 3px 3px -2px", "0px 2px 4px -1px", "0px 3px 5px -1px", "0px 3px 5px -1px", "0px 4px 5px -2px", "0px 5px 5px -3px", "0px 5px 6px -3px", "0px 6px 6px -3px", "0px 6px 7px -4px", "0px 7px 8px -4px", "0px 7px 8px -4px", "0px 7px 9px -4px", "0px 8px 9px -5px", "0px 8px 10px -5px", "0px 8px 11px -5px", "0px 9px 11px -5px", "0px 9px 12px -6px", "0px 10px 13px -6px", "0px 10px 13px -6px", "0px 10px 14px -6px", "0px 11px 14px -7px", "0px 11px 15px -7px"];
2260
- const PENUMBRA_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 14%, transparent)`;
2261
- const PENUMBRA = ["0px 0px 0px 0px", "0px 1px 1px 0px", "0px 2px 2px 0px", "0px 3px 4px 0px", "0px 4px 5px 0px", "0px 5px 8px 0px", "0px 6px 10px 0px", "0px 7px 10px 1px", "0px 8px 10px 1px", "0px 9px 12px 1px", "0px 10px 14px 1px", "0px 11px 15px 1px", "0px 12px 17px 2px", "0px 13px 19px 2px", "0px 14px 21px 2px", "0px 15px 22px 2px", "0px 16px 24px 2px", "0px 17px 26px 2px", "0px 18px 28px 2px", "0px 19px 29px 2px", "0px 20px 31px 3px", "0px 21px 33px 3px", "0px 22px 35px 3px", "0px 23px 36px 3px", "0px 24px 38px 3px"];
2262
- const AMBIENT_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 12%, transparent)`;
2263
- const AMBIENT = ["0px 0px 0px 0px", "0px 1px 3px 0px", "0px 1px 5px 0px", "0px 1px 8px 0px", "0px 1px 10px 0px", "0px 1px 14px 0px", "0px 1px 18px 0px", "0px 2px 16px 1px", "0px 3px 14px 2px", "0px 3px 16px 2px", "0px 4px 18px 3px", "0px 4px 20px 3px", "0px 5px 22px 4px", "0px 5px 24px 4px", "0px 5px 26px 4px", "0px 6px 28px 5px", "0px 6px 30px 5px", "0px 6px 32px 5px", "0px 7px 34px 6px", "0px 7px 36px 6px", "0px 8px 38px 7px", "0px 8px 40px 7px", "0px 8px 42px 7px", "0px 9px 44px 8px", "0px 9px 46px 8px"];
2264
- function elevation(z) {
2265
- return `${UMBRA_COLOR} ${UMBRA[z]},${PENUMBRA_COLOR} ${PENUMBRA[z]},${AMBIENT_COLOR} ${AMBIENT[z]}`;
2266
- }
2267
- /** Design tokens that control elevation. */
2268
- const ElevationToken$1 = {
2269
- /** Level 0 elevation. */
2270
- level0: unsafeCSS(`var(--md-sys-elevation-level0, ${elevation(0)})`),
2271
- /** Level 1 elevation. */
2272
- level1: unsafeCSS(`var(--md-sys-elevation-level1, ${elevation(1)})`),
2273
- /** Level 2 elevation. */
2274
- level2: unsafeCSS(`var(--md-sys-elevation-level2, ${elevation(3)})`),
2275
- /** Level 3 elevation. */
2276
- level3: unsafeCSS(`var(--md-sys-elevation-level3, ${elevation(6)})`),
2277
- /** Level 4 elevation. */
2278
- level4: unsafeCSS(`var(--md-sys-elevation-level4, ${elevation(8)})`),
2279
- /** Level 5 elevation. */
2280
- level5: unsafeCSS(`var(--md-sys-elevation-level5, ${elevation(12)})`)
2281
- };
2282
-
2283
- function space(unit) {
2284
- return unsafeCSS(`var(--md-sys-measurement-space${unit}, ${0.5 * (unit / 100)}rem)`);
2285
- }
2286
- /** Design tokens that control measurements. */
2287
- const MeasurementToken = {
2288
- /** Zero spacing. */
2289
- space0: space(0),
2290
- /** 2dp spacing. */
2291
- space25: space(25),
2292
- /** 4dp spacing. */
2293
- space50: space(50),
2294
- /** 6dp spacing. */
2295
- space75: space(75),
2296
- /** 8dp spacing. */
2297
- space100: space(100),
2298
- /** 10dp spacing. */
2299
- space125: space(125),
2300
- /** 12dp spacing. */
2301
- space150: space(150),
2302
- /** 14dp spacing. */
2303
- space175: space(175),
2304
- /** 16dp spacing. */
2305
- space200: space(200),
2306
- /** 20dp spacing. */
2307
- space250: space(250),
2308
- /** 24dp spacing. */
2309
- space300: space(300),
2310
- /** 32dp spacing. */
2311
- space400: space(400),
2312
- /** 36dp spacing. */
2313
- space450: space(450),
2314
- /** 40dp spacing. */
2315
- space500: space(500),
2316
- /** 48dp spacing. */
2317
- space600: space(600),
2318
- /** 56dp spacing. */
2319
- space700: space(700),
2320
- /** 64dp spacing. */
2321
- space800: space(800),
2322
- /** 72dp spacing. */
2323
- space900: space(900)
2324
- };
2325
-
2326
- const EasingToken = {
2327
- /** Emphasized transition. */
2328
- emphasized: unsafeCSS("var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0.0, 0, 1.0))"),
2329
- /** Decelerated emphasized transition. */
2330
- emphasizedDecelerate: unsafeCSS("var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1.0))"),
2331
- /** Accelerated emphasized transition. */
2332
- emphasizedAccelerate: unsafeCSS("var(--md-sys-motion-easing-emphasized-accelerate, cubic-bezier(0.3, 0.0, 0.8, 0.15))"),
2333
- /** Simple, small, or utility-focused transition. */
2334
- standard: unsafeCSS("var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0))"),
2335
- /** Decelerated standard transition. */
2336
- standardDecelerate: unsafeCSS("var(--md-sys-motion-easing-standard-decelerate, cubic-bezier(0, 0, 0, 1))"),
2337
- /** Accelerated standard transition. */
2338
- standardAccelerate: unsafeCSS("var(--md-sys-motion-easing-standard-accelerate, cubic-bezier(0.3, 0, 1, 1))")
2339
- };
2340
- const SpringToken = {
2341
- /** Fast spatial spring. */
2342
- fastSpatial: unsafeCSS("var(--md-sys-motion-spring-fast-spatial, 350ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
2343
- /** Default spatial spring. */
2344
- defaultSpatial: unsafeCSS("var(--md-sys-motion-spring-default-spatial, 500ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
2345
- /** Slow spatial spring. */
2346
- slowSpatial: unsafeCSS("var(--md-sys-motion-spring-slow-spatial, 750ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
2347
- /** Fast effects spring. */
2348
- fastEffects: unsafeCSS("var(--md-sys-motion-spring-fast-effects, 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00))"),
2349
- /** Default effects spring. */
2350
- defaultEffects: unsafeCSS("var(--md-sys-motion-spring-default-effects, 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00))"),
2351
- /** Slow effects spring. */
2352
- slowEffects: unsafeCSS("var(--md-sys-motion-spring-slow-effects, 200ms cubic-bezier(0.34, 0.88, 0.34, 1.00))")
2353
- };
2354
- const DurationToken = {
2355
- /** Small utility-focused transition duration. */
2356
- short1: unsafeCSS("var(--md-sys-motion-duration-short-1, 50ms)"),
2357
- /** Small utility-focused transition duration. */
2358
- short2: unsafeCSS("var(--md-sys-motion-duration-short-2, 100ms)"),
2359
- /** Small utility-focused transition duration. */
2360
- short3: unsafeCSS("var(--md-sys-motion-duration-short-3, 150ms)"),
2361
- /** Small utility-focused transition duration. */
2362
- short4: unsafeCSS("var(--md-sys-motion-duration-short-4, 200ms)"),
2363
- /** Duration for transitions that traverse a medium area of the screen. */
2364
- medium1: unsafeCSS("var(--md-sys-motion-duration-medium-1, 250ms)"),
2365
- /** Duration for transitions that traverse a medium area of the screen. */
2366
- medium2: unsafeCSS("var(--md-sys-motion-duration-medium-2, 300ms)"),
2367
- /** Duration for transitions that traverse a medium area of the screen. */
2368
- medium3: unsafeCSS("var(--md-sys-motion-duration-medium-3, 350ms)"),
2369
- /** Duration for transitions that traverse a medium area of the screen. */
2370
- medium4: unsafeCSS("var(--md-sys-motion-duration-medium-4, 400ms)"),
2371
- /** Duration for large expressive transitions. */
2372
- long1: unsafeCSS("var(--md-sys-motion-duration-long-1, 450ms)"),
2373
- /** Duration for large expressive transitions. */
2374
- long2: unsafeCSS("var(--md-sys-motion-duration-long-2, 500ms)"),
2375
- /** Duration for large expressive transitions. */
2376
- long3: unsafeCSS("var(--md-sys-motion-duration-long-3, 550ms)"),
2377
- /** Duration for large expressive transitions. */
2378
- long4: unsafeCSS("var(--md-sys-motion-duration-long-4, 600ms)"),
2379
- /** Extra long duration for ambient transitions. */
2380
- extraLong1: unsafeCSS("var(--md-sys-motion-duration-extra-long-1, 700ms)"),
2381
- /** Extra long duration for ambient transitions. */
2382
- extraLong2: unsafeCSS("var(--md-sys-motion-duration-extra-long-2, 800ms)"),
2383
- /** Extra long duration for ambient transitions. */
2384
- extraLong3: unsafeCSS("var(--md-sys-motion-duration-extra-long-3, 900ms)"),
2385
- /** Extra long duration for ambient transitions. */
2386
- extraLong4: unsafeCSS("var(--md-sys-motion-duration-extra-long-4, 1000ms)")
2387
- };
2388
- /** Design tokens that control motion. */
2389
- const MotionToken = {
2390
- /** Design tokens that control transition effects. */
2391
- easing: EasingToken,
2392
- /** Design tokens that control transition duration. */
2393
- duration: DurationToken,
2394
- /** Design tokens that control spring effects. */
2395
- spring: SpringToken
2396
- };
2397
-
2398
- /** Design tokens that control scrollbars. */
2399
- const ScrollbarToken = {
2400
- /** Width of a standard scrollbar. */
2401
- width: unsafeCSS(`var(--m3e-scrollbar-width, auto)`),
2402
- /** Width of a thin scrollbar. */
2403
- thinWidth: unsafeCSS(`var(--m3e-scrollbar-thin-width, thin)`),
2404
- /** Color of a scrollbar. */
2405
- color: unsafeCSS(`var(--m3e-scrollbar-thumb-color, #938f94) var(--m3e-scrollbar-track-color, transparent)`)
2406
- };
2407
-
2408
- const CornerValue = {
2409
- /** No rounding. */
2410
- none: unsafeCSS("var(--md-sys-shape-corner-value-none, 0)"),
2411
- /** Extra small rounded corner. */
2412
- extraSmall: unsafeCSS("var(--md-sys-shape-corner-value-extra-small, 0.25rem)"),
2413
- /** Small rounded corner. */
2414
- small: unsafeCSS("var(--md-sys-shape-corner-value-small, 0.5rem)"),
2415
- /** Medium rounded corner. */
2416
- medium: unsafeCSS("var(--md-sys-shape-corner-value-medium, 0.75rem)"),
2417
- /** Large rounded corner. */
2418
- large: unsafeCSS("var(--md-sys-shape-corner-value-large, 1rem)"),
2419
- /** Increased large rounded corner. */
2420
- largeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-large-increased, 1.25rem)"),
2421
- /** Extra large rounded corner. */
2422
- extraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-large, 1.75rem)"),
2423
- /** Increased extra large rounded corner. */
2424
- extraLargeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-extra-large-increased, 2rem)"),
2425
- /** Extra extra large rounded corner. */
2426
- extraExtraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-extra-large, 3rem)")
2427
- };
2428
- /** Design tokens that control shape. */
2429
- const ShapeToken = {
2430
- corner: {
2431
- /** Fully rounded symmetric shape. */
2432
- full: unsafeCSS("var(--md-sys-shape-corner-full, 624.9375rem)"),
2433
- /** Extra large rounded asymmetric shape directed towards the top. */
2434
- extraLargeTop: unsafeCSS(`var(--md-sys-shape-corner-extra-large-top, ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none})`),
2435
- /** Extra large rounded symmetric shape. */
2436
- extraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-large, ${CornerValue.extraLarge})`),
2437
- /** Extra large rounded asymmetric shape directed towards the end. */
2438
- extraLargeEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none}`),
2439
- /** Extra large rounded asymmetric shape directed towards the start. */
2440
- extraLargeStart: unsafeCSS(`${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraLarge}`),
2441
- /** Large rounded asymmetric shape directed towards the top. */
2442
- largeTop: unsafeCSS(`var(--md-sys-shape-corner-large-top, ${CornerValue.large} ${CornerValue.large} ${CornerValue.none} ${CornerValue.none})`),
2443
- /** Large rounded asymmetric shape directed towards the end. */
2444
- largeEnd: unsafeCSS(`var(--md-sys-shape-corner-large-end, ${CornerValue.none} ${CornerValue.large} ${CornerValue.large} ${CornerValue.none})`),
2445
- /** Large rounded asymmetric shape directed towards the start. */
2446
- largeStart: unsafeCSS(`var(--md-sys-shape-corner-large-start, ${CornerValue.large} ${CornerValue.none} ${CornerValue.none} ${CornerValue.large})`),
2447
- /** Large rounded symmetric shape. */
2448
- large: unsafeCSS(`var(--md-sys-shape-corner-large, ${CornerValue.large})`),
2449
- /** Medium rounded symmetric shape. */
2450
- medium: unsafeCSS(`var(--md-sys-shape-corner-medium, ${CornerValue.medium})`),
2451
- /** Medium rounded asymmetric shape directed towards the top. */
2452
- mediumTop: unsafeCSS(`${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none} ${CornerValue.none}`),
2453
- /** Medium rounded asymmetric shape directed towards the end. */
2454
- mediumEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none}`),
2455
- /** Medium rounded asymmetric shape directed towards the start. */
2456
- mediumStart: unsafeCSS(`${CornerValue.medium} ${CornerValue.none} ${CornerValue.none} ${CornerValue.medium}`),
2457
- /** Small rounded symmetric shape. */
2458
- small: unsafeCSS(`var(--md-sys-shape-corner-small, ${CornerValue.small})`),
2459
- /** Small rounded asymmetric shape directed towards the top. */
2460
- smallTop: unsafeCSS(`${CornerValue.small} ${CornerValue.small} ${CornerValue.none} ${CornerValue.none}`),
2461
- /** Small rounded asymmetric shape directed towards the end. */
2462
- smallEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.small} ${CornerValue.small} ${CornerValue.none}`),
2463
- /** Small rounded asymmetric shape directed towards the start. */
2464
- smallStart: unsafeCSS(`${CornerValue.small} ${CornerValue.none} ${CornerValue.none} ${CornerValue.small}`),
2465
- /** Extra small rounded asymmetric shape directed towards the top. */
2466
- extraSmallTop: unsafeCSS(`var(--md-sys-shape-corner-extra-small-top, ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none})`),
2467
- /** Extra small rounded symmetric shape. */
2468
- extraSmall: unsafeCSS(`var(--md-sys-shape-corner-extra-small, ${CornerValue.extraSmall})`),
2469
- /** Extra small rounded asymmetric shape directed towards the end. */
2470
- extraSmallEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none}`),
2471
- /** Extra small rounded asymmetric shape directed towards the start. */
2472
- extraSmallStart: unsafeCSS(`${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall}`),
2473
- /** Extra small rounded asymmetric shape directed towards the bottom. */
2474
- extraSmallBottom: unsafeCSS(`${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall}`),
2475
- /** No rounding. */
2476
- none: unsafeCSS(`var(--md-sys-shape-corner-none, ${CornerValue.none})`),
2477
- /** Increased large rounded symmetric shape. */
2478
- largeIncreased: unsafeCSS(`var(--md-sys-shape-corner-large-increased, ${CornerValue.largeIncreased})`),
2479
- /** Increased extra large rounded symmetric shape. */
2480
- extraLargeIncreased: unsafeCSS(`var(--md-sys-shape-corner-extra-large-increased, ${CornerValue.extraLargeIncreased})`),
2481
- /** Extra extra large rounded symmetric shape. */
2482
- extraExtraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-extra-large, ${CornerValue.extraExtraLarge})`),
2483
- /** Design tokens that control specific corners. */
2484
- value: CornerValue
2485
- }
2486
- };
2487
-
2488
- /** Design tokens that control state layer. */
2489
- const StateToken = {
2490
- /** Opacity of the state layer on focus. */
2491
- focusStateLayerOpacity: unsafeCSS("var(--md-sys-state-focus-state-layer-opacity, 10%)"),
2492
- /** Opacity of the state layer on hover. */
2493
- hoverStateLayerOpacity: unsafeCSS("var(--md-sys-state-hover-state-layer-opacity, 8%)"),
2494
- /** Opacity of the state layer on pressed. */
2495
- pressedStateLayerOpacity: unsafeCSS("var(--md-sys-state-pressed-state-layer-opacity, 10%)")
2496
- };
2497
-
2498
- /** Design tokens that control typescale. */
2499
- const TypescaleToken = {
2500
- /** Standard typescale variant. */
2501
- standard: {
2502
- /** Short, important text or numerals. */
2503
- display: {
2504
- large: {
2505
- fontSize: unsafeCSS("var(--md-sys-typescale-display-large-font-size, 3.5625rem)"),
2506
- fontWeight: unsafeCSS("var(--md-sys-typescale-display-large-font-weight, 400)"),
2507
- lineHeight: unsafeCSS("var(--md-sys-typescale-display-large-line-height, 4rem)"),
2508
- tracking: unsafeCSS("var(--md-sys-typescale-display-large-tracking, 0.015625rem)")
2509
- },
2510
- medium: {
2511
- fontSize: unsafeCSS("var(--md-sys-typescale-display-medium-font-size, 2.8125rem)"),
2512
- fontWeight: unsafeCSS("var(--md-sys-typescale-display-medium-font-weight, 400)"),
2513
- lineHeight: unsafeCSS("var(--md-sys-typescale-display-medium-line-height, 3.25rem)"),
2514
- tracking: unsafeCSS("var(--md-sys-typescale-display-medium-tracking, 0)")
2515
- },
2516
- small: {
2517
- fontSize: unsafeCSS("var(--md-sys-typescale-display-small-font-size, 2.25rem)"),
2518
- fontWeight: unsafeCSS("var(--md-sys-typescale-display-small-font-weight, 400)"),
2519
- lineHeight: unsafeCSS("var(--md-sys-typescale-display-small-line-height, 2.75rem)"),
2520
- tracking: unsafeCSS("var(--md-sys-typescale-display-small-tracking, 0)")
2521
- }
2522
- },
2523
- /** Short, high-emphasis text on smaller screens. */
2524
- headline: {
2525
- large: {
2526
- fontSize: unsafeCSS("var(--md-sys-typescale-headline-large-font-size, 2rem)"),
2527
- fontWeight: unsafeCSS("var(--md-sys-typescale-headline-large-font-weight, 400)"),
2528
- lineHeight: unsafeCSS("var(--md-sys-typescale-headline-large-line-height, 2.5rem)"),
2529
- tracking: unsafeCSS("var(--md-sys-typescale-headline-large-tracking, 0)")
2530
- },
2531
- medium: {
2532
- fontSize: unsafeCSS("var(--md-sys-typescale-headline-medium-font-size, 1.75rem)"),
2533
- fontWeight: unsafeCSS("var(--md-sys-typescale-headline-medium-font-weight, 400)"),
2534
- lineHeight: unsafeCSS("var(--md-sys-typescale-headline-medium-line-height, 2.25rem)"),
2535
- tracking: unsafeCSS("var(--md-sys-typescale-headline-medium-tracking, 0)")
2536
- },
2537
- small: {
2538
- fontSize: unsafeCSS("var(--md-sys-typescale-headline-small-font-size, 1.5rem)"),
2539
- fontWeight: unsafeCSS("var(--md-sys-typescale-headline-small-font-weight, 400)"),
2540
- lineHeight: unsafeCSS("var(--md-sys-typescale-headline-small-line-height, 2rem)"),
2541
- tracking: unsafeCSS("var(--md-sys-typescale-headline-small-tracking, 0)")
2542
- }
2543
- },
2544
- /** Medium-emphasis text that remains relatively short. */
2545
- title: {
2546
- large: {
2547
- fontSize: unsafeCSS("var(--md-sys-typescale-title-large-font-size, 1.375rem)"),
2548
- fontWeight: unsafeCSS("var(--md-sys-typescale-title-large-font-weight, 400)"),
2549
- lineHeight: unsafeCSS("var(--md-sys-typescale-title-large-line-height, 1.75rem)"),
2550
- tracking: unsafeCSS("var(--md-sys-typescale-title-large-tracking, 0)")
2551
- },
2552
- medium: {
2553
- fontSize: unsafeCSS("var(--md-sys-typescale-title-medium-font-size, 1rem)"),
2554
- fontWeight: unsafeCSS("var(--md-sys-typescale-title-medium-font-weight, 500)"),
2555
- lineHeight: unsafeCSS("var(--md-sys-typescale-title-medium-line-height, 1.5rem)"),
2556
- tracking: unsafeCSS("var(--md-sys-typescale-title-medium-tracking, 0.009375rem)")
2557
- },
2558
- small: {
2559
- fontSize: unsafeCSS("var(--md-sys-typescale-title-small-font-size, 0.875rem)"),
2560
- fontWeight: unsafeCSS("var(--md-sys-typescale-title-small-font-weight, 500)"),
2561
- lineHeight: unsafeCSS("var(--md-sys-typescale-title-small-line-height, 1.25rem)"),
2562
- tracking: unsafeCSS("var(--md-sys-typescale-title-small-tracking, 0.00625rem)")
2563
- }
2564
- },
2565
- /** Longer passages of text. */
2566
- body: {
2567
- large: {
2568
- fontSize: unsafeCSS("var(--md-sys-typescale-body-large-font-size, 1rem)"),
2569
- fontWeight: unsafeCSS("var(--md-sys-typescale-body-large-font-weight, 400)"),
2570
- lineHeight: unsafeCSS("var(--md-sys-typescale-body-large-line-height, 1.5rem)"),
2571
- tracking: unsafeCSS("var(--md-sys-typescale-body-large-tracking, 0.03125rem)")
2572
- },
2573
- medium: {
2574
- fontSize: unsafeCSS("var(--md-sys-typescale-body-medium-font-size, 0.875rem)"),
2575
- fontWeight: unsafeCSS("var(--md-sys-typescale-body-medium-font-weight, 400)"),
2576
- lineHeight: unsafeCSS("var(--md-sys-typescale-body-medium-line-height, 1.25rem)"),
2577
- tracking: unsafeCSS("var(--md-sys-typescale-body-medium-tracking, 0.015625rem)")
2578
- },
2579
- small: {
2580
- fontSize: unsafeCSS("var(--md-sys-typescale-body-small-font-size, 0.75rem)"),
2581
- fontWeight: unsafeCSS("var(--md-sys-typescale-body-small-font-weight, 400)"),
2582
- lineHeight: unsafeCSS("var(--md-sys-typescale-body-small-line-height, 1rem)"),
2583
- tracking: unsafeCSS("var(--md-sys-typescale-body-small-tracking, 0.025rem)")
2584
- }
2585
- },
2586
- /** Smaller, utilitarian text. */
2587
- label: {
2588
- large: {
2589
- fontSize: unsafeCSS("var(--md-sys-typescale-label-large-font-size, 0.875rem)"),
2590
- fontWeight: unsafeCSS("var(--md-sys-typescale-label-large-font-weight, 500)"),
2591
- lineHeight: unsafeCSS("var(--md-sys-typescale-label-large-line-height, 1.25rem)"),
2592
- tracking: unsafeCSS("var(--md-sys-typescale-label-large-tracking, 0.00625rem)")
2593
- },
2594
- medium: {
2595
- fontSize: unsafeCSS("var(--md-sys-typescale-label-medium-font-size, 0.75rem)"),
2596
- fontWeight: unsafeCSS("var(--md-sys-typescale-label-medium-font-weight, 500)"),
2597
- lineHeight: unsafeCSS("var(--md-sys-typescale-label-medium-line-height, 1rem)"),
2598
- tracking: unsafeCSS("var(--md-sys-typescale-label-medium-tracking, 0.03125rem)")
2599
- },
2600
- small: {
2601
- fontSize: unsafeCSS("var(--md-sys-typescale-label-small-font-size, 0.6875rem)"),
2602
- fontWeight: unsafeCSS("var(--md-sys-typescale-label-small-font-weight, 500)"),
2603
- lineHeight: unsafeCSS("var(--md-sys-typescale-label-small-line-height, 1rem)"),
2604
- tracking: unsafeCSS("var(--md-sys-typescale-label-small-tracking, 0.03125rem)")
1042
+ /** Called when the element is disabled or enabled via its form association. */
1043
+ formDisabledCallback(disabled) {
1044
+ const wasDisabled = this.disabled;
1045
+ this[_formDisabled] = disabled;
1046
+ if (this.disabled != wasDisabled) {
1047
+ this.requestUpdate("disabled", wasDisabled);
2605
1048
  }
2606
1049
  }
2607
- },
2608
- /** Emphasized typescale variant. */
2609
- emphasized: {
2610
- /** Short, important text or numerals. */
2611
- display: {
2612
- large: {
2613
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-size, 3.5625rem)"),
2614
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-weight, 500)"),
2615
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-line-height, 4rem)"),
2616
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-tracking, 0.015625rem)")
2617
- },
2618
- medium: {
2619
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-size, 2.8125rem)"),
2620
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-weight, 500)"),
2621
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-line-height, 3.25rem)"),
2622
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-tracking, 0)")
2623
- },
2624
- small: {
2625
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-size, 2.25rem)"),
2626
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-weight, 500)"),
2627
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-line-height, 2.75rem)"),
2628
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-tracking, 0)")
2629
- }
2630
- },
2631
- /** Short, high-emphasis text on smaller screens. */
2632
- headline: {
2633
- large: {
2634
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-size, 2rem)"),
2635
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-weight, 500)"),
2636
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-line-height, 2.5rem)"),
2637
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-tracking, 0)")
2638
- },
2639
- medium: {
2640
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-size, 1.75rem)"),
2641
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-weight, 500)"),
2642
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-line-height, 2.25rem)"),
2643
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-tracking, 0)")
2644
- },
2645
- small: {
2646
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-size, 1.5rem)"),
2647
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-weight, 500)"),
2648
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-line-height, 2rem)"),
2649
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-tracking, 0)")
2650
- }
2651
- },
2652
- /** Medium-emphasis text that remains relatively short. */
2653
- title: {
2654
- large: {
2655
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-size, 1.375rem)"),
2656
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-weight, 500)"),
2657
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-line-height, 1.75rem)"),
2658
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-tracking, 0)")
2659
- },
2660
- medium: {
2661
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-size, 1rem)"),
2662
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-weight, 700)"),
2663
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-line-height, 3.5rem)"),
2664
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-tracking, 0.009375rem)")
2665
- },
2666
- small: {
2667
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-size, 0.875rem)"),
2668
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-weight, 700)"),
2669
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-line-height, 1.25rem)"),
2670
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-tracking, 0.00625rem)")
2671
- }
2672
- },
2673
- /** Longer passages of text. */
2674
- body: {
2675
- large: {
2676
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-size, 1rem)"),
2677
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-weight, 500)"),
2678
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-line-height, 1.5rem)"),
2679
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-tracking, 0.03125rem)")
2680
- },
2681
- medium: {
2682
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-size, 0.875rem)"),
2683
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-weight, 500)"),
2684
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-line-height, 1.25rem)"),
2685
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-tracking, 0.015625rem)")
2686
- },
2687
- small: {
2688
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-size, 0.75rem)"),
2689
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-weight, 500)"),
2690
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-line-height, 1rem)"),
2691
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-tracking, 0.025rem)")
1050
+ /** Called when the associated form is reset. */
1051
+ formResetCallback() {
1052
+ if (isCheckedMixin(this)) {
1053
+ this.checked = this[_defaultValue] === true;
1054
+ if (isCheckedIndeterminateMixin(this)) {
1055
+ this.indeterminate = this[_defaultIndeterminate];
1056
+ }
1057
+ } else if ("value" in this) {
1058
+ this.value = this[defaultValue];
2692
1059
  }
2693
- },
2694
- /** Smaller, utilitarian text. */
2695
- label: {
2696
- large: {
2697
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-size, 0.875rem)"),
2698
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-weight, 700)"),
2699
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-line-height, 1.25rem)"),
2700
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-tracking, 0.00625rem)")
2701
- },
2702
- medium: {
2703
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-size, 0.75rem)"),
2704
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-weight, 700)"),
2705
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-line-height, 1rem)"),
2706
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-tracking, 0.03125rem)")
2707
- },
2708
- small: {
2709
- fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-size, 0.6875rem)"),
2710
- fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-weight, 700)"),
2711
- lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-line-height, 1rem)"),
2712
- tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-tracking, 0.03125rem)")
1060
+ if (isDirtyMixin(this)) {
1061
+ this.markAsPristine();
2713
1062
  }
2714
- }
2715
- }
2716
- };
2717
-
2718
- /** Design tokens used to style components. */
2719
- const DesignToken = {
2720
- /** Design tokens that control color. */
2721
- color: ColorToken,
2722
- /** Design tokens that control elevation. */
2723
- elevation: ElevationToken$1,
2724
- /** Design tokens that control motion. */
2725
- motion: MotionToken,
2726
- /** Design tokens that control shape. */
2727
- shape: ShapeToken,
2728
- /** Design tokens that control state layer. */
2729
- state: StateToken,
2730
- /** Design tokens that control typescale. */
2731
- typescale: TypescaleToken,
2732
- /** Design tokens that control scrollbars. */
2733
- scrollbar: ScrollbarToken,
2734
- /** Design tokens that control density. */
2735
- density: DensityToken,
2736
- /** Design tokens that control measurement. */
2737
- measurement: MeasurementToken
2738
- };
2739
-
2740
- /**
2741
- * Determines whether a value is a `DisabledMixin`.
2742
- * @param {unknown} value The value to test.
2743
- * @returns {value is DisabledMixin} Whether `value` is a `DisabledMixin`.
2744
- */
2745
- function isDisabledMixin(value) {
2746
- return hasKeys(value, "disabled");
2747
- }
2748
- /**
2749
- * Mixin to augment an element with behavior that supports a disabled state.
2750
- * @template T The type of the base class.
2751
- * @param {T} base The base class.
2752
- * @param {boolean} [reflect=true] Whether the disabled property is reflected as an attribute.
2753
- * @returns {Constructor<DisabledMixin> & T} A constructor that implements `DisabledMixin`.
2754
- */
2755
- function Disabled(base, reflect = true) {
2756
- class _DisabledMixin extends base {
2757
- constructor() {
2758
- super(...arguments);
2759
- /**
2760
- * Whether the element is disabled.
2761
- * @default false
2762
- */
2763
- this.disabled = false;
2764
- }
2765
- /** @inheritdoc */
2766
- update(changedProperties) {
2767
- super.update(changedProperties);
2768
- if (changedProperties.has("disabled") && this.role && this.role !== "none" && this.role !== "presentation") {
2769
- this.ariaDisabled = this.disabled ? "true" : null;
1063
+ if (isTouchedMixin(this)) {
1064
+ this.markAsUntouched();
2770
1065
  }
2771
1066
  }
2772
1067
  }
1068
+ /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
1069
+ _FormAssociatedMixin.formAssociated = true;
2773
1070
  __decorate([property({
2774
- type: Boolean,
2775
- reflect: reflect
2776
- })], _DisabledMixin.prototype, "disabled", void 0);
2777
- return _DisabledMixin;
1071
+ noAccessor: true
1072
+ })], _FormAssociatedMixin.prototype, "name", null);
1073
+ __decorate([property({
1074
+ type: Boolean
1075
+ })], _FormAssociatedMixin.prototype, "disabled", null);
1076
+ return _FormAssociatedMixin;
2778
1077
  }
2779
1078
 
1079
+ /** A symbol through which a "Form Associated" custom element validates its current state. */
1080
+ const validate = Symbol("validate");
2780
1081
  /**
2781
- * Determines whether a value is a `DisabledInteractiveMixin`.
1082
+ * Determines whether a value is a `ConstraintValidationMixin`.
2782
1083
  * @param {unknown} value The value to test.
2783
- * @returns {value is DisabledInteractiveMixin} Whether `value` is a `DisabledInteractiveMixin`.
1084
+ * @returns Whether `value` is a `ConstraintValidationMixin`.
2784
1085
  */
2785
- function isDisabledInteractiveMixin(value) {
2786
- return hasKeys(value, "disabledInteractive") && isDisabledMixin(value);
1086
+ function isConstraintValidationMixin(value) {
1087
+ return hasKeys(value, "willValidate", "validity", "validationMessage", "reportValidity", "checkValidity", "setCustomValidity") && isFormAssociatedMixin(value);
2787
1088
  }
2788
- const SUPPRESSED_EVENTS = ["click", "dblclick", "auxclick", "keydown", "keyup"];
2789
- const INTERACTIVE_KEYS = ["Tab", "ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Left", "Up", "Right", "Down"];
2790
- const _suppressedEventHandler = Symbol("_suppressedEventHandler");
1089
+ const _updateValidity = Symbol("_updateValidity");
1090
+ const _validityMessage = Symbol("_validityMessage");
2791
1091
  /**
2792
- * Mixin to augment an element with behavior that supports an interactive disabled state.
1092
+ * Mixin to augment an element with "Form Associated" behavior that supports constraint validation.
2793
1093
  * @template T The type of the base class.
2794
1094
  * @param {T} base The base class.
2795
- * @returns {Constructor<DisabledInteractiveMixin>} A constructor that implements `DisabledInteractiveMixin`.
1095
+ * @returns {Constructor<ConstraintValidationMixin> & T} A constructor that implements `ConstraintValidationMixin`.
2796
1096
  */
2797
- function DisabledInteractive(base) {
2798
- var _a;
2799
- class _DisabledInteractiveMixin extends base {
1097
+ function ConstraintValidation(base) {
1098
+ var __ConstraintValidation_instances, __ConstraintValidation_getNativeMessage;
1099
+ class _ConstraintValidation extends base {
2800
1100
  constructor() {
2801
1101
  super(...arguments);
2802
- /** @private */
2803
- this[_a] = e => {
2804
- if (this.disabledInteractive) {
2805
- // Only allow specific keys when disabled and interactive.
2806
- if (e instanceof KeyboardEvent && INTERACTIVE_KEYS.includes(e.key)) {
2807
- return;
2808
- }
2809
- e.stopImmediatePropagation();
2810
- e.preventDefault();
2811
- }
2812
- };
2813
- /**
2814
- * Whether the element is disabled and interactive.
2815
- * @default false
2816
- */
2817
- this.disabledInteractive = false;
1102
+ __ConstraintValidation_instances.add(this);
2818
1103
  }
2819
- /** @inheritdoc */
2820
- connectedCallback() {
2821
- SUPPRESSED_EVENTS.forEach(x => this.addEventListener(x, this[_suppressedEventHandler], true));
2822
- super.connectedCallback();
1104
+ /** Whether the element is a submittable element that is a candidate for constraint validation. */
1105
+ get willValidate() {
1106
+ return this[internals].willValidate;
2823
1107
  }
2824
- /** @inheritdoc */
2825
- disconnectedCallback() {
2826
- SUPPRESSED_EVENTS.forEach(x => this.removeEventListener(x, this[_suppressedEventHandler], true));
2827
- super.disconnectedCallback();
2828
- }
2829
- /** @inheritdoc */
2830
- update(changedProperties) {
2831
- super.update(changedProperties);
2832
- if ((changedProperties.has("disabled") || changedProperties.has("disabledInteractive")) && this.role && this.role !== "none" && this.role !== "presentation" && this.role !== "none") {
2833
- this.ariaDisabled = this.disabled || this.disabledInteractive ? "true" : null;
2834
- }
2835
- }
2836
- }
2837
- _a = _suppressedEventHandler;
2838
- __decorate([property({
2839
- attribute: "disabled-interactive",
2840
- type: Boolean,
2841
- reflect: true
2842
- })], _DisabledInteractiveMixin.prototype, "disabledInteractive", void 0);
2843
- return _DisabledInteractiveMixin;
2844
- }
2845
-
2846
- /** A symbol through which to update labels to reflect a control's current state. */
2847
- const updateLabels = Symbol("updateLabels");
2848
- /**
2849
- * Determines whether a value is a `LabelledMixin`.
2850
- * @param {unknown} value The value to test.
2851
- * @returns A value indicating whether `value` is a `LabelledMixin`.
2852
- */
2853
- function isLabelledMixin(value) {
2854
- return hasKeys(value, "labels") && isAttachInternalsMixin(value);
2855
- }
2856
- const _eventHandler = Symbol("_eventHandler");
2857
- /**
2858
- * Mixin to augment an element with support for labelling.
2859
- * @template T The type of the base class.
2860
- * @param {T} base The base class.
2861
- * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
2862
- */
2863
- function Labelled(base) {
2864
- var _a;
2865
- class _Labelled extends base {
2866
- constructor() {
2867
- super(...arguments);
2868
- /** @private */
2869
- this[_a] = e => {
2870
- if (!e.defaultPrevented) {
2871
- this[updateLabels]();
2872
- }
2873
- };
2874
- }
2875
- /** The label elements that the element is associated with. */
2876
- get labels() {
2877
- return this[internals].labels;
2878
- }
2879
- /** @inheritdoc */
2880
- connectedCallback() {
2881
- super.connectedCallback();
2882
- this.addEventListener("focusout", this[_eventHandler]);
2883
- this.addEventListener("change", this[_eventHandler]);
2884
- }
2885
- /** @inheritdoc */
2886
- disconnectedCallback() {
2887
- super.disconnectedCallback();
2888
- this.removeEventListener("focusout", this[_eventHandler]);
2889
- this.removeEventListener("change", this[_eventHandler]);
2890
- }
2891
- /** @inheritdoc */
2892
- update(changedProperties) {
2893
- super.update(changedProperties);
2894
- this[updateLabels]();
2895
- }
2896
- /** @internal */
2897
- [(_a = _eventHandler, updateLabels)]() {
2898
- const focusable = this.hasAttribute("tabindex");
2899
- const disabled = isDisabledMixin(this) && this.disabled || isDisabledInteractiveMixin(this) && this.disabledInteractive;
2900
- const invalid = isTouchedMixin(this) && this.touched && (this.ariaInvalid || hasCustomState(this, "--invalid"));
2901
- for (const label of this.labels ?? []) {
2902
- label.style.userSelect = focusable ? "none" : "";
2903
- label.style.cursor = !disabled && focusable ? "pointer" : "";
2904
- if (!disabled && focusable) {
2905
- label.style.setProperty("-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)");
2906
- } else {
2907
- label.style.removeProperty("-webkit-tap-highlight-color");
2908
- }
2909
- label.style.color = disabled ? `color-mix(in srgb, ${DesignToken.color.onSurface} 38%, transparent)` : invalid ? `${DesignToken.color.error}` : "";
2910
- }
2911
- }
2912
- }
2913
- /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
2914
- _Labelled.formAssociated = true;
2915
- return _Labelled;
2916
- }
2917
-
2918
- /** A symbol through which a "Form Associated" custom element provides a value for a form. */
2919
- const formValue = Symbol("formValue");
2920
- /** A symbol through which a "Form Associated" custom element provides a default value for resetting a form. */
2921
- const defaultValue = Symbol("defaultValue");
2922
- /**
2923
- * Determines whether a value is a `FormAssociatedMixin`.
2924
- * @param {unknown} value The value to test.
2925
- * @returns A value indicating whether `value` is a `FormAssociatedMixin`.
2926
- */
2927
- function isFormAssociatedMixin(value) {
2928
- return hasKeys(value, "disabled", "form", "name") && isLabelledMixin(value) && isAttachInternalsMixin(value);
2929
- }
2930
- const _defaultValue = Symbol("_defaultValue");
2931
- const _defaultIndeterminate = Symbol("_defaultIndeterminate");
2932
- const _formDisabled = Symbol("_formDisabled");
2933
- /**
2934
- * Mixin to augment an element with "Form Associated" behavior.
2935
- * @template T The type of the base class.
2936
- * @param {T} base The base class.
2937
- * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
2938
- */
2939
- function FormAssociated(base) {
2940
- var _a, _b;
2941
- class _FormAssociatedMixin extends base {
2942
- constructor() {
2943
- super(...arguments);
2944
- /** @private */
2945
- this[_a] = false;
2946
- /** @private */
2947
- this[_b] = false;
2948
- }
2949
- /** The `HTMLFormElement` associated with this element. */
2950
- get form() {
2951
- return this[internals].form;
2952
- }
2953
- /** @inheritdoc */
2954
- get labels() {
2955
- return this[internals].labels;
2956
- }
2957
- /** @internal */
2958
- get [(_a = _defaultIndeterminate, _b = _formDisabled, formValue)]() {
2959
- return null;
2960
- }
2961
- /** @internal */
2962
- get [defaultValue]() {
2963
- return this[_defaultValue];
2964
- }
2965
- /** The name that identifies the element when submitting the associated form. */
2966
- get name() {
2967
- return this.getAttribute("name") ?? "";
2968
- }
2969
- set name(value) {
2970
- if (value) {
2971
- this.setAttribute("name", value);
2972
- } else {
2973
- this.removeAttribute("name");
2974
- }
2975
- }
2976
- // Disabled attributes should not be reflected for form associated elements due to
2977
- // how the formDisabledCallback overrides an element's disabled state.
2978
- // See https://github.com/whatwg/html/issues/8365
2979
- /**
2980
- * Whether the element is disabled.
2981
- * @default false
2982
- */
2983
- get disabled() {
2984
- return super.disabled || this[_formDisabled];
2985
- }
2986
- set disabled(value) {
2987
- super.disabled = value;
2988
- }
2989
- /** @inheritdoc */
2990
- connectedCallback() {
2991
- super.connectedCallback();
2992
- if (isCheckedMixin(this)) {
2993
- this[_defaultValue] = this.checked;
2994
- if (isCheckedIndeterminateMixin(this)) {
2995
- this[_defaultIndeterminate] = this.indeterminate;
2996
- }
2997
- } else if ("value" in this) {
2998
- this[_defaultValue] = this.value;
2999
- }
3000
- }
3001
- /** @inheritdoc */
3002
- requestUpdate(name, oldValue, options) {
3003
- super.requestUpdate(name, oldValue, options);
3004
- this[internals].setFormValue(this[formValue]);
3005
- }
3006
- /** Called when the element is disabled or enabled via its form association. */
3007
- formDisabledCallback(disabled) {
3008
- const wasDisabled = this.disabled;
3009
- this[_formDisabled] = disabled;
3010
- if (this.disabled != wasDisabled) {
3011
- this.requestUpdate("disabled", wasDisabled);
3012
- }
3013
- }
3014
- /** Called when the associated form is reset. */
3015
- formResetCallback() {
3016
- if (isCheckedMixin(this)) {
3017
- this.checked = this[_defaultValue] === true;
3018
- if (isCheckedIndeterminateMixin(this)) {
3019
- this.indeterminate = this[_defaultIndeterminate];
3020
- }
3021
- } else if ("value" in this) {
3022
- this.value = this[defaultValue];
3023
- }
3024
- if (isDirtyMixin(this)) {
3025
- this.markAsPristine();
3026
- }
3027
- if (isTouchedMixin(this)) {
3028
- this.markAsUntouched();
3029
- }
3030
- }
3031
- }
3032
- /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
3033
- _FormAssociatedMixin.formAssociated = true;
3034
- __decorate([property({
3035
- noAccessor: true
3036
- })], _FormAssociatedMixin.prototype, "name", null);
3037
- __decorate([property({
3038
- type: Boolean
3039
- })], _FormAssociatedMixin.prototype, "disabled", null);
3040
- return _FormAssociatedMixin;
3041
- }
3042
-
3043
- /** A symbol through which a "Form Associated" custom element validates its current state. */
3044
- const validate = Symbol("validate");
3045
- /**
3046
- * Determines whether a value is a `ConstraintValidationMixin`.
3047
- * @param {unknown} value The value to test.
3048
- * @returns Whether `value` is a `ConstraintValidationMixin`.
3049
- */
3050
- function isConstraintValidationMixin(value) {
3051
- return hasKeys(value, "willValidate", "validity", "validationMessage", "reportValidity", "checkValidity", "setCustomValidity") && isFormAssociatedMixin(value);
3052
- }
3053
- const _updateValidity = Symbol("_updateValidity");
3054
- const _validityMessage = Symbol("_validityMessage");
3055
- /**
3056
- * Mixin to augment an element with "Form Associated" behavior that supports constraint validation.
3057
- * @template T The type of the base class.
3058
- * @param {T} base The base class.
3059
- * @returns {Constructor<ConstraintValidationMixin> & T} A constructor that implements `ConstraintValidationMixin`.
3060
- */
3061
- function ConstraintValidation(base) {
3062
- var __ConstraintValidation_instances, __ConstraintValidation_getNativeMessage;
3063
- class _ConstraintValidation extends base {
3064
- constructor() {
3065
- super(...arguments);
3066
- __ConstraintValidation_instances.add(this);
3067
- }
3068
- /** Whether the element is a submittable element that is a candidate for constraint validation. */
3069
- get willValidate() {
3070
- return this[internals].willValidate;
3071
- }
3072
- /** The validity state of the element. */
3073
- get validity() {
3074
- this[_updateValidity]();
3075
- return this[internals].validity;
1108
+ /** The validity state of the element. */
1109
+ get validity() {
1110
+ this[_updateValidity]();
1111
+ return this[internals].validity;
3076
1112
  }
3077
1113
  /** The error message that would be displayed if the user submits the form, or an empty string if no error message. */
3078
1114
  get validationMessage() {
@@ -3346,105 +1382,11 @@ function FormSubmitter(base) {
3346
1382
  }
3347
1383
 
3348
1384
  /**
3349
- * Determines whether a value is a `HtmlForMixin`.
3350
- * @param {unknown} value The value to test.
3351
- * @returns {value is HtmlForMixin} Whether `value` is a `HtmlForMixin`.
3352
- */
3353
- function isHtmlForMixin(value) {
3354
- return hasKeys(value, "htmlFor", "control", "attach", "detach");
3355
- }
3356
- const _control = Symbol("_control");
3357
- const _firstUpdated = Symbol("_firstUpdated");
3358
- /**
3359
- * Mixin that creates an attached element associated with an interactive control.
1385
+ * Mixin to augment an element with behavior emits a click event on keyboard events.
3360
1386
  * @template T The type of the base class.
3361
1387
  * @param {T} base The base class.
3362
- * @returns {Constructor<HtmlForMixin> & T} A constructor extends `base` and implements `HtmlForMixin`.
3363
- */
3364
- function HtmlFor(base) {
3365
- var _a;
3366
- class _HtmlForMixin extends base {
3367
- constructor() {
3368
- super(...arguments);
3369
- /** @private */
3370
- this[_a] = false;
3371
- /** The identifier of the interactive control to which this element is attached. */
3372
- this.htmlFor = null;
3373
- }
3374
- /** The interactive element to which this element is attached. */
3375
- get control() {
3376
- return this[_control]?.deref() ?? null;
3377
- }
3378
- /** @inheritdoc */
3379
- connectedCallback() {
3380
- super.connectedCallback();
3381
- const control = this[_control]?.deref();
3382
- if (control) {
3383
- this.attach(control);
3384
- }
3385
- }
3386
- /** @inheritdoc */
3387
- disconnectedCallback() {
3388
- super.disconnectedCallback();
3389
- const control = this[_control];
3390
- if (control) {
3391
- this.detach();
3392
- this[_control] = control;
3393
- }
3394
- }
3395
- /** @inheritdoc */
3396
- firstUpdated(_changedProperties) {
3397
- super.firstUpdated(_changedProperties);
3398
- this[_firstUpdated] = true;
3399
- }
3400
- /** @inheritdoc */
3401
- update(changedProperties) {
3402
- super.update(changedProperties);
3403
- if (changedProperties.has("htmlFor")) {
3404
- if (this.htmlFor) {
3405
- const root = this.getRootNode();
3406
- if (root) {
3407
- resolveElementById(this.htmlFor, root).then(control => {
3408
- if (control !== this.control) {
3409
- if (this.control) {
3410
- this.detach();
3411
- }
3412
- if (control instanceof HTMLElement) {
3413
- this.attach(control);
3414
- }
3415
- }
3416
- });
3417
- }
3418
- } else if (this.control && this[_firstUpdated]) {
3419
- this.detach();
3420
- }
3421
- }
3422
- }
3423
- /**
3424
- * Attaches the element to an interactive control.
3425
- * @param {HTMLElement} control The element that controls the attachable element.
3426
- */
3427
- attach(control) {
3428
- this[_control] = new WeakRef(control);
3429
- }
3430
- /** Detaches the element from its current interactive control. */
3431
- detach() {
3432
- this[_control] = undefined;
3433
- }
3434
- }
3435
- _a = _firstUpdated;
3436
- __decorate([property({
3437
- attribute: "for"
3438
- })], _HtmlForMixin.prototype, "htmlFor", void 0);
3439
- return _HtmlForMixin;
3440
- }
3441
-
3442
- /**
3443
- * Mixin to augment an element with behavior emits a click event on keyboard events.
3444
- * @template T The type of the base class.
3445
- * @param {T} base The base class.
3446
- * @param {boolean} [allowEnter=true] Whether the `ENTER` key emits a click event.
3447
- * @returns {T} A class that extends `base` with keyboard click behavior.
1388
+ * @param {boolean} [allowEnter=true] Whether the `ENTER` key emits a click event.
1389
+ * @returns {T} A class that extends `base` with keyboard click behavior.
3448
1390
  */
3449
1391
  function KeyboardClick(base, allowEnter = true) {
3450
1392
  var __KeyboardClickMixin_instances, __KeyboardClickMixin_keyPressed, __KeyboardClickMixin_keyDownHandler, __KeyboardClickMixin_keyUpHandler, __KeyboardClickMixin_focusOutHandler, __KeyboardClickMixin_handleKeyDown, __KeyboardClickMixin_handleKeyUp;
@@ -3786,24 +1728,6 @@ function RequiredConstraintValidation(base) {
3786
1728
  return _RequiredConstraintValidation;
3787
1729
  }
3788
1730
 
3789
- /**
3790
- * Mixin to augment an element with an ARIA role.
3791
- * @template T The type of the base class.
3792
- * @param {T} base The base class.
3793
- * @param {ARIARole} role The ARIA role.
3794
- * @returns {Constructor & T} A constructor that implements focusable behavior.
3795
- */
3796
- function Role(base, role) {
3797
- class _RoleMixin extends base {
3798
- /** @inheritdoc */
3799
- connectedCallback() {
3800
- this.role = this.role || role;
3801
- super.connectedCallback();
3802
- }
3803
- }
3804
- return _RoleMixin;
3805
- }
3806
-
3807
1731
  /** A symbol used to define the function called to resume animation. */
3808
1732
  const resumeAnimation = Symbol("resumeAnimation");
3809
1733
  /**
@@ -3866,1482 +1790,5 @@ function Vertical(base) {
3866
1790
  return _VerticalMixin;
3867
1791
  }
3868
1792
 
3869
- var _ActionElementBase_clickHandler;
3870
- /**
3871
- * A base implementation for an element, nested within a clickable element, used to
3872
- * perform an action. This class must be inherited.
3873
- */
3874
- class ActionElementBase extends LitElement {
3875
- constructor() {
3876
- super(...arguments);
3877
- /** @private */
3878
- _ActionElementBase_clickHandler.set(this, e => {
3879
- if (!e.defaultPrevented) {
3880
- this._onClick(e);
3881
- }
3882
- });
3883
- }
3884
- /** @inheritdoc */
3885
- connectedCallback() {
3886
- super.connectedCallback();
3887
- this.parentElement?.addEventListener("click", __classPrivateFieldGet(this, _ActionElementBase_clickHandler, "f"));
3888
- }
3889
- /** @inheritdoc */
3890
- disconnectedCallback() {
3891
- super.disconnectedCallback();
3892
- this.parentElement?.removeEventListener("click", __classPrivateFieldGet(this, _ActionElementBase_clickHandler, "f"));
3893
- }
3894
- /** @inheritdoc */
3895
- render() {
3896
- return html`<slot></slot>`;
3897
- }
3898
- }
3899
- _ActionElementBase_clickHandler = new WeakMap();
3900
- /** The styles of the element. */
3901
- ActionElementBase.styles = css`:host { display: contents; } ::slotted(.material-icons) { font-size: inherit !important; }`;
3902
-
3903
- /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
3904
- var _M3eCollapsibleElement_instances, _M3eCollapsibleElement_slotChanged, _M3eCollapsibleElement_hasOpened, _M3eCollapsibleElement_handleSlotChange, _M3eCollapsibleElement_autoSize, _M3eCollapsibleElement_clearSize, _M3eCollapsibleElement_actualSize;
3905
- /**
3906
- * A container used to expand and collapse content.
3907
- *
3908
- * @example
3909
- * ```html
3910
- * <m3e-collapsible>
3911
- * <!-- Collapsible content -->
3912
- * </m3e-collapsible>
3913
- * ```
3914
- *
3915
- * @tag m3e-collapsible
3916
- *
3917
- * @slot - Renders the collapsible content.
3918
- *
3919
- * @attr open - Whether content is visible.
3920
- * @attr orientation - Orientation of collapsible content.
3921
- * @attr no-animate - Whether to disable animation.
3922
- *
3923
- * @fires opening - Dispatched when the collapsible begins to open.
3924
- * @fires opened - Dispatched when the collapsible has opened.
3925
- * @fires closing - Dispatched when the collapsible begins to close.
3926
- * @fires closed - Dispatched when the collapsible has closed.
3927
- *
3928
- * @cssprop --m3e-collapsible-animation-duration - The duration of the expand / collapse animation.
3929
- */
3930
- let M3eCollapsibleElement = class M3eCollapsibleElement extends AttachInternals(LitElement) {
3931
- constructor() {
3932
- super(...arguments);
3933
- _M3eCollapsibleElement_instances.add(this);
3934
- /** @private */
3935
- _M3eCollapsibleElement_slotChanged.set(this, false);
3936
- /** @private */
3937
- _M3eCollapsibleElement_hasOpened.set(this, false);
3938
- /**
3939
- * Whether content is visible.
3940
- * @default false
3941
- */
3942
- this.open = false;
3943
- /**
3944
- * Orientation of collapsible content.
3945
- * @default "vertical"
3946
- */
3947
- this.orientation = "vertical";
3948
- /**
3949
- * Whether to disable animation.
3950
- * @default false
3951
- */
3952
- this.noAnimate = false;
3953
- }
3954
- /** @inheritdoc */
3955
- update(changedProperties) {
3956
- super.update(changedProperties);
3957
- const noAnimate = this.noAnimate || changedProperties.has("orientation") && !changedProperties.has("open");
3958
- addCustomState(this, "--no-animate");
3959
- if (!__classPrivateFieldGet(this, _M3eCollapsibleElement_slotChanged, "f")) {
3960
- if (this.open) {
3961
- __classPrivateFieldSet(this, _M3eCollapsibleElement_hasOpened, true, "f");
3962
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
3963
- }
3964
- __classPrivateFieldSet(this, _M3eCollapsibleElement_slotChanged, true, "f");
3965
- return;
3966
- }
3967
- this.toggleAttribute("inert", !this.open);
3968
- if (this.open) {
3969
- __classPrivateFieldSet(this, _M3eCollapsibleElement_hasOpened, true, "f");
3970
- if (!(noAnimate || prefersReducedMotion())) {
3971
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
3972
- setCustomState(this, "--overflows", this.orientation === "vertical" ? this.clientHeight < this.scrollHeight : this.orientation === "horizontal" ? this.clientWidth < this.scrollWidth : this.clientHeight < this.scrollHeight || this.clientWidth < this.scrollWidth);
3973
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
3974
- }
3975
- deleteCustomState(this, "--closing");
3976
- addCustomState(this, "--opening");
3977
- this.dispatchEvent(new Event("opening"));
3978
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
3979
- deleteCustomState(this, "--no-animate");
3980
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_actualSize).call(this);
3981
- if (noAnimate || prefersReducedMotion()) {
3982
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
3983
- deleteCustomState(this, "--opening");
3984
- this.dispatchEvent(new Event("opened"));
3985
- } else {
3986
- this.addEventListener("transitionend", () => {
3987
- if (this.open) {
3988
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
3989
- deleteCustomState(this, "--opening");
3990
- this.dispatchEvent(new Event("opened"));
3991
- }
3992
- }, {
3993
- once: true
3994
- });
3995
- }
3996
- } else {
3997
- deleteCustomState(this, "--opening");
3998
- addCustomState(this, "--closing");
3999
- this.dispatchEvent(new Event("closing"));
4000
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_actualSize).call(this);
4001
- if (__classPrivateFieldGet(this, _M3eCollapsibleElement_hasOpened, "f")) {
4002
- deleteCustomState(this, "--no-animate");
4003
- }
4004
- if (noAnimate || prefersReducedMotion()) {
4005
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
4006
- deleteCustomState(this, "--closing");
4007
- this.dispatchEvent(new Event("closed"));
4008
- } else {
4009
- requestAnimationFrame(() => {
4010
- __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
4011
- this.addEventListener("transitionend", () => {
4012
- if (!this.open) {
4013
- deleteCustomState(this, "--closing");
4014
- this.dispatchEvent(new Event("closed"));
4015
- }
4016
- }, {
4017
- once: true
4018
- });
4019
- });
4020
- }
4021
- }
4022
- }
4023
- /** @inheritdoc */
4024
- render() {
4025
- return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_handleSlotChange)}"></slot>`;
4026
- }
4027
- };
4028
- _M3eCollapsibleElement_slotChanged = new WeakMap();
4029
- _M3eCollapsibleElement_hasOpened = new WeakMap();
4030
- _M3eCollapsibleElement_instances = new WeakSet();
4031
- _M3eCollapsibleElement_handleSlotChange = function _M3eCollapsibleElement_handleSlotChange() {
4032
- __classPrivateFieldSet(this, _M3eCollapsibleElement_slotChanged, true, "f");
4033
- };
4034
- _M3eCollapsibleElement_autoSize = function _M3eCollapsibleElement_autoSize() {
4035
- switch (this.orientation) {
4036
- case "vertical":
4037
- this.style.height = "auto";
4038
- break;
4039
- case "horizontal":
4040
- this.style.width = "auto";
4041
- break;
4042
- case "both":
4043
- this.style.height = this.style.width = "auto";
4044
- break;
4045
- }
4046
- };
4047
- _M3eCollapsibleElement_clearSize = function _M3eCollapsibleElement_clearSize() {
4048
- switch (this.orientation) {
4049
- case "vertical":
4050
- this.style.height = "";
4051
- break;
4052
- case "horizontal":
4053
- this.style.width = "";
4054
- break;
4055
- case "both":
4056
- this.style.height = this.style.width = "";
4057
- break;
4058
- }
4059
- };
4060
- _M3eCollapsibleElement_actualSize = function _M3eCollapsibleElement_actualSize() {
4061
- switch (this.orientation) {
4062
- case "vertical":
4063
- this.style.height = `${this.scrollHeight}px`;
4064
- break;
4065
- case "horizontal":
4066
- this.style.width = `${this.scrollWidth}px`;
4067
- break;
4068
- case "both":
4069
- this.style.height = `${this.scrollHeight}px`;
4070
- this.style.width = `${this.scrollWidth}px`;
4071
- break;
4072
- }
4073
- };
4074
- /** The styles of the element. */
4075
- M3eCollapsibleElement.styles = css`:host { display: block; overflow: hidden; } :host([orientation="vertical"]) { height: 0px; transition: ${unsafeCSS(`visibility var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4076
- ${DesignToken.motion.easing.standard},
4077
- height var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4078
- ${DesignToken.motion.easing.standard},
4079
- padding-top var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4080
- ${DesignToken.motion.easing.standard},
4081
- padding-bottom var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4082
- ${DesignToken.motion.easing.standard}`)}; } :host([orientation="horizontal"]) { width: 0px; transition: ${unsafeCSS(`visibility var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4083
- ${DesignToken.motion.easing.standard},
4084
- width var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4085
- ${DesignToken.motion.easing.standard},
4086
- padding-left var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4087
- ${DesignToken.motion.easing.standard},
4088
- padding-right var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4089
- ${DesignToken.motion.easing.standard}`)}; } :host([orientation="both"]) { height: 0px; width: 0px; transition: ${unsafeCSS(`visibility var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4090
- ${DesignToken.motion.easing.standard},
4091
- width var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4092
- ${DesignToken.motion.easing.standard},
4093
- height var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4094
- ${DesignToken.motion.easing.standard},
4095
- padding var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
4096
- ${DesignToken.motion.easing.standard}`)}; } :host(:not(:is(:state(--closing), :--closing)):not([open])) { visibility: hidden; } :host([orientation="vertical"]:not([open])) { min-height: unset !important; padding-top: 0px !important; padding-bottom: 0px !important; } :host([orientation="horizontal"]:not([open])) { min-width: unset !important; padding-left: 0px !important; padding-right: 0px !important; } :host([orientation="both"]:not([open])) { min-height: unset !important; min-width: unset !important; padding: 0px !important; } :host([no-animate]), :host(:is(:state(--no-animate), :--no-animate)) { transition-duration: 0ms; } :host([orientation="vertical"]:is(:state(--opening), :--opening)), :host([orientation="vertical"]:is(:state(--closing), :--closing)) { overflow-y: hidden !important; } :host([orientation="horizontal"]:is(:state(--opening), :--opening)), :host([orientation="horizontal"]:is(:state(--closing), :--closing)) { overflow-x: hidden !important; } :host([orientation="both"]:is(:state(--opening), :--opening)), :host([orientation="both"]:is(:state(--closing), :--closing)) { overflow-y: hidden !important; overflow-x: hidden !important; } :host(:is(:state(--overflows), :--overflows)) { scrollbar-gutter: stable; } ::slotted(*) { --m3e-collapsible-animation-duration: initial; } @media (prefers-reduced-motion) { :host { transition: none; } }`;
4097
- __decorate([property({
4098
- type: Boolean,
4099
- reflect: true
4100
- })], M3eCollapsibleElement.prototype, "open", void 0);
4101
- __decorate([property({
4102
- reflect: true
4103
- })], M3eCollapsibleElement.prototype, "orientation", void 0);
4104
- __decorate([property({
4105
- attribute: "no-animate",
4106
- type: Boolean,
4107
- reflect: true
4108
- })], M3eCollapsibleElement.prototype, "noAnimate", void 0);
4109
- M3eCollapsibleElement = __decorate([customElement("m3e-collapsible")], M3eCollapsibleElement);
4110
-
4111
- /**
4112
- * Component design tokens that control the `M3eElevationElement`.
4113
- * @internal
4114
- */
4115
- const ElevationToken = {
4116
- liftDuration: unsafeCSS(`var(--m3e-elevation-lift-duration, ${DesignToken.motion.duration.short4})`),
4117
- liftEasing: unsafeCSS(`var(--m3e-elevation-lift-easing, ${DesignToken.motion.easing.standard})`),
4118
- settleDuration: unsafeCSS(`var(--m3e-elevation-settle-duration, ${DesignToken.motion.duration.short3})`),
4119
- settleEasing: unsafeCSS(`var(--m3e-elevation-settle-easing, ${DesignToken.motion.easing.standardAccelerate})`),
4120
- level: unsafeCSS(`var(--m3e-elevation-level, ${DesignToken.elevation.level0})`),
4121
- hoverLevel: unsafeCSS(`var(--m3e-elevation-hover-level, ${DesignToken.elevation.level0})`),
4122
- focusLevel: unsafeCSS(`var(--m3e-elevation-focus-level, ${DesignToken.elevation.level0})`),
4123
- pressedLevel: unsafeCSS(`var(--m3e-elevation-pressed-level, ${DesignToken.elevation.level0})`)
4124
- };
4125
-
4126
- var _M3eElevationElement_instances, _M3eElevationElement_hoverController, _M3eElevationElement_focusController, _M3eElevationElement_pressedController, _M3eElevationElement_handleHoverChange, _M3eElevationElement_handleFocusChange, _M3eElevationElement_handlePressedChange;
4127
- /**
4128
- * Visually depicts elevation using a shadow.
4129
- *
4130
- * @description
4131
- * The `m3e-elevation` component is an absolute positioned element used to depict elevation using a shadow.
4132
- * The parenting element must be a relative positioned element and allow for overflow. Use the `level` attribute
4133
- * to specify the elevation level.
4134
- *
4135
- * The component can also be attached to another element using the `for` attribute. When attached, elevation will
4136
- * be lifted by 1 level on hover. This can be disabled using the `disabled` attribute.
4137
- *
4138
- * Alternatively, use the `attach` and `detach` methods to programmatically attach and detach this element to another.
4139
- *
4140
- * @example
4141
- * The following example illustrates basic markup. Note how the parenting element's position is `relative`. A parenting
4142
- * element's position must be `relative` and overflow must be visible.
4143
- *
4144
- * ```html
4145
- * <div style="position: relative;">
4146
- * <m3e-elevation level="1"></m3e-elevation>
4147
- * <div>
4148
- * ```
4149
- * @example
4150
- * The following example illustrates attaching elevation to an interactive element. In this example, the parenting div
4151
- * is given an `id` referenced by `m3e-elevation` using the `for` attribute. Note that `#myDiv` is not used when
4152
- * specifying the attached element's identifier. The `#` is inferred.
4153
- *
4154
- * ```html
4155
- * <div id="myDiv" style="position: relative;">
4156
- * <m3e-elevation for="myDiv" level="1"></m3e-elevation>
4157
- * <div>
4158
- * ```
4159
- *
4160
- * @tag m3e-elevation
4161
- *
4162
- * @attr disabled - Whether hover and press events will not trigger changes in elevation, when attached to an interactive element.
4163
- * @attr for - The identifier of the interactive control to which this element is attached.
4164
- * @attr level - The level at which to visually depict elevation.
4165
- *
4166
- * @cssprop --m3e-elevation-color - Color used to depict elevation.
4167
- * @cssprop --m3e-elevation-lift-duration - Duration when lifting.
4168
- * @cssprop --m3e-elevation-lift-easing - Easing curve when lifting.
4169
- * @cssprop --m3e-elevation-settle-duration - Duration when settling.
4170
- * @cssprop --m3e-elevation-settle-easing - Easing curve when settling.
4171
- * @cssprop --m3e-elevation-level - Elevation when resting (box-shadow).
4172
- * @cssprop --m3e-elevation-hover-level - Elevation on hover (box-shadow).
4173
- * @cssprop --m3e-elevation-focus-level - Elevation on focus (box-shadow).
4174
- * @cssprop --m3e-elevation-pressed-level - Elevation on pressed (box-shadow).
4175
- */
4176
- let M3eElevationElement = class M3eElevationElement extends HtmlFor(Role(LitElement, "none")) {
4177
- constructor() {
4178
- super(...arguments);
4179
- _M3eElevationElement_instances.add(this);
4180
- /** @private */
4181
- _M3eElevationElement_hoverController.set(this, new HoverController(this, {
4182
- target: null,
4183
- callback: hovering => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handleHoverChange).call(this, hovering)
4184
- }));
4185
- /** @private */
4186
- _M3eElevationElement_focusController.set(this, new FocusController(this, {
4187
- target: null,
4188
- callback: focused => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handleFocusChange).call(this, focused)
4189
- }));
4190
- /** @private */
4191
- _M3eElevationElement_pressedController.set(this, new PressedController(this, {
4192
- target: null,
4193
- callback: pressed => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handlePressedChange).call(this, pressed)
4194
- }));
4195
- /**
4196
- * Whether hover and press events will not trigger changes in elevation, when attached to an interactive element.
4197
- * @default false
4198
- */
4199
- this.disabled = false;
4200
- /**
4201
- * The level at which to visually depict elevation.
4202
- * @default null
4203
- */
4204
- this.level = null;
4205
- }
4206
- /** @inheritdoc */
4207
- attach(control) {
4208
- super.attach(control);
4209
- __classPrivateFieldGet(this, _M3eElevationElement_hoverController, "f").observe(control);
4210
- __classPrivateFieldGet(this, _M3eElevationElement_focusController, "f").observe(control);
4211
- __classPrivateFieldGet(this, _M3eElevationElement_pressedController, "f").observe(control);
4212
- }
4213
- /** @inheritdoc */
4214
- detach() {
4215
- if (this.control) {
4216
- __classPrivateFieldGet(this, _M3eElevationElement_hoverController, "f").unobserve(this.control);
4217
- __classPrivateFieldGet(this, _M3eElevationElement_focusController, "f").unobserve(this.control);
4218
- __classPrivateFieldGet(this, _M3eElevationElement_pressedController, "f").unobserve(this.control);
4219
- }
4220
- super.detach();
4221
- }
4222
- /** @inheritdoc */
4223
- connectedCallback() {
4224
- this.ariaHidden = "true";
4225
- super.connectedCallback();
4226
- }
4227
- /** @inheritdoc */
4228
- disconnectedCallback() {
4229
- super.disconnectedCallback();
4230
- this._shadow?.classList.toggle("hover", false);
4231
- this._shadow?.classList.toggle("focus", false);
4232
- this._shadow?.classList.toggle("pressed", false);
4233
- this._shadow?.classList.toggle("resting", false);
4234
- }
4235
- /** @inheritdoc */
4236
- updated(_changedProperties) {
4237
- super.updated(_changedProperties);
4238
- if (_changedProperties.has("disabled") && this.disabled) {
4239
- this._shadow?.classList.toggle("hover", false);
4240
- this._shadow?.classList.toggle("focus", false);
4241
- this._shadow?.classList.toggle("pressed", false);
4242
- this._shadow?.classList.toggle("resting", true);
4243
- }
4244
- }
4245
- /** @inheritdoc */
4246
- render() {
4247
- return html`<div class="shadow"></div>`;
4248
- }
4249
- };
4250
- _M3eElevationElement_hoverController = new WeakMap();
4251
- _M3eElevationElement_focusController = new WeakMap();
4252
- _M3eElevationElement_pressedController = new WeakMap();
4253
- _M3eElevationElement_instances = new WeakSet();
4254
- _M3eElevationElement_handleHoverChange = function _M3eElevationElement_handleHoverChange(hovering) {
4255
- if (!this.disabled) {
4256
- this._shadow?.classList.toggle("hover", hovering);
4257
- this._shadow?.classList.toggle("resting", !hovering);
4258
- }
4259
- };
4260
- _M3eElevationElement_handleFocusChange = function _M3eElevationElement_handleFocusChange(focused) {
4261
- if (!this.disabled) {
4262
- this._shadow?.classList.toggle("focus", focused);
4263
- }
4264
- };
4265
- _M3eElevationElement_handlePressedChange = function _M3eElevationElement_handlePressedChange(pressed) {
4266
- if (!this.disabled) {
4267
- this._shadow?.classList.toggle("pressed", pressed);
4268
- }
4269
- };
4270
- /** The styles of the element. */
4271
- M3eElevationElement.styles = css`:host { display: block; } :host, .shadow { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; border-radius: inherit; } .shadow.resting, .shadow.focus, .shadow.pressed { will-change: box-shadow; transition: ${unsafeCSS(`box-shadow ${ElevationToken.settleDuration} ${ElevationToken.settleEasing};`)}; } .shadow.hover { will-change: box-shadow; transition: ${unsafeCSS(`box-shadow ${ElevationToken.liftDuration} ${ElevationToken.liftEasing};`)}; } .shadow { box-shadow: ${ElevationToken.level}; } .shadow.focus { box-shadow: ${ElevationToken.focusLevel}; } .shadow.hover { box-shadow: ${ElevationToken.hoverLevel}; } .shadow.pressed { box-shadow: ${ElevationToken.pressedLevel}; } :host([level="0"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level0}; --m3e-elevation-hover-level: ${DesignToken.elevation.level1}; } :host([level="1"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level1}; --m3e-elevation-hover-level: ${DesignToken.elevation.level2}; } :host([level="2"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level2}; --m3e-elevation-hover-level: ${DesignToken.elevation.level3}; } :host([level="3"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level3}; --m3e-elevation-hover-level: ${DesignToken.elevation.level4}; } :host([level="4"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level4}; --m3e-elevation-hover-level: ${DesignToken.elevation.level5}; } :host([level="5"]) .shadow { --m3e-elevation-level: ${DesignToken.elevation.level5}; --m3e-elevation-hover-level: ${ElevationToken.level}; } :host([level]) .shadow { --m3e-elevation-focus-level: ${ElevationToken.level}; --m3e-elevation-pressed-level: ${ElevationToken.level}; } @media (prefers-reduced-motion) { .shadow.resting, .shadow.pressed, .shadow.focus, .shadow.hover { transition: none; } } @media (forced-colors: active) { .shadow { display: none; } }`;
4272
- __decorate([query(".shadow")], M3eElevationElement.prototype, "_shadow", void 0);
4273
- __decorate([property({
4274
- type: Boolean,
4275
- reflect: true
4276
- })], M3eElevationElement.prototype, "disabled", void 0);
4277
- __decorate([property({
4278
- type: Number,
4279
- reflect: true
4280
- })], M3eElevationElement.prototype, "level", void 0);
4281
- M3eElevationElement = __decorate([customElement("m3e-elevation")], M3eElevationElement);
4282
-
4283
- /**
4284
- * Component design tokens that control the `M3eFocusRingElement`.
4285
- * @internal
4286
- */
4287
- const FocusRingToken = {
4288
- /** The color of the focus ring. */
4289
- color: unsafeCSS(`var(--m3e-focus-ring-color, ${DesignToken.color.secondary})`),
4290
- /** The duration of the focus ring animation. */
4291
- duration: unsafeCSS(`var(--m3e-focus-ring-duration, ${DesignToken.motion.duration.long2})`),
4292
- /** The thickness of the focus ring. */
4293
- thickness: unsafeCSS("var(--m3e-focus-ring-thickness, 3px)"),
4294
- /** Offset of an outward focus ring. */
4295
- outwardOffset: unsafeCSS("var(--m3e-focus-ring-outward-offset, 2px)"),
4296
- /** Offset of an inward focus ring. */
4297
- inwardOffset: unsafeCSS("var(--m3e-focus-ring-inward-offset, 0px)"),
4298
- /** The visibility of the focus ring. */
4299
- visibility: unsafeCSS("var(--m3e-focus-ring-visibility, visible)"),
4300
- /** The factor by which the focus ring grows. */
4301
- growthFactor: unsafeCSS("var(--m3e-focus-ring-growth-factor, 2)")
4302
- };
4303
-
4304
- var _M3eFocusRingElement_instances, _M3eFocusRingElement_focusController, _M3eFocusRingElement_handleFocusChange;
4305
- /**
4306
- * A focus ring used to depict a strong focus indicator.
4307
- *
4308
- * @description
4309
- * The `m3e-focus-ring` component is an absolute positioned element used to provide a strong focus indicator.
4310
- * The parenting element must be a relative positioned focusable element and allow for overflow.
4311
- *
4312
- * The component can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
4313
- * The focus ring is displayed when the interactive element receives visible focus and hidden when focus is lost.
4314
- * This can be disabled using the `disabled` attribute.
4315
- *
4316
- * Alternatively, you can use the `show` and `hide` methods to programmatically control the focus ring.
4317
- *
4318
- * @example
4319
- * The following example illustrates attaching a focus ring to an interactive element. In this example, the parenting div
4320
- * has relative positioning and is given an `id` referenced by `m3e-focus-ring` using the `for` attribute. Note that `#myDiv`
4321
- * is not used when specifying the attached element's identifier. The `#` is inferred.
4322
- *
4323
- * ```html
4324
- * <div id="myDiv" tabindex="0" style="position: relative;">
4325
- * <m3e-focus-ring for="myDiv"></m3e-focus-ring>
4326
- * <div>
4327
- * ```
4328
- *
4329
- * @tag m3e-focus-ring
4330
- *
4331
- * @attr disabled - Whether the focus events will not trigger the focus ring. Focus rings can be still controlled manually by using the `show` and `hide` methods.
4332
- * @attr inward - Whether the focus ring animates inward instead of outward.
4333
- *
4334
- * @cssprop --m3e-focus-ring-color - The color of the focus ring.
4335
- * @cssprop --m3e-focus-ring-duration - The duration of the focus ring animation.
4336
- * @cssprop --m3e-focus-ring-growth-factor - The factor by which the focus ring grows.
4337
- * @cssprop --m3e-focus-ring-thickness - The thickness of the focus ring.
4338
- * @cssprop --m3e-focus-ring-visibility - The visibility of the focus ring.
4339
- * @cssprop --m3e-focus-ring-outward-offset - Offset of an outward focus ring.
4340
- * @cssprop --m3e-focus-ring-inward-offset - Offset of an inward focus ring.
4341
- */
4342
- let M3eFocusRingElement = class M3eFocusRingElement extends HtmlFor(Role(LitElement, "none")) {
4343
- constructor() {
4344
- super(...arguments);
4345
- _M3eFocusRingElement_instances.add(this);
4346
- /** @private */
4347
- _M3eFocusRingElement_focusController.set(this, new FocusController(this, {
4348
- target: null,
4349
- callback: (_, focusVisible) => __classPrivateFieldGet(this, _M3eFocusRingElement_instances, "m", _M3eFocusRingElement_handleFocusChange).call(this, focusVisible)
4350
- }));
4351
- /**
4352
- * Whether the focus ring animates inward instead of outward.
4353
- * @default false
4354
- */
4355
- this.inward = false;
4356
- /**
4357
- * Whether the focus events will not trigger the focus ring.
4358
- * Focus rings can be still controlled manually by using the `show` and `hide` methods.
4359
- * @default false
4360
- */
4361
- this.disabled = false;
4362
- }
4363
- /** Launches a manual focus ring. */
4364
- show() {
4365
- this._outline?.classList.toggle("visible", true);
4366
- }
4367
- /** Hides the focus ring. */
4368
- hide() {
4369
- this._outline?.classList.toggle("visible", false);
4370
- }
4371
- /** @inheritdoc */
4372
- attach(control) {
4373
- super.attach(control);
4374
- __classPrivateFieldGet(this, _M3eFocusRingElement_focusController, "f").observe(control);
4375
- }
4376
- /** @inheritdoc */
4377
- detach() {
4378
- if (this.control) {
4379
- __classPrivateFieldGet(this, _M3eFocusRingElement_focusController, "f").unobserve(this.control);
4380
- }
4381
- super.detach();
4382
- }
4383
- /** @inheritdoc */
4384
- connectedCallback() {
4385
- this.ariaHidden = "true";
4386
- super.connectedCallback();
4387
- }
4388
- /** @inheritdoc */
4389
- disconnectedCallback() {
4390
- super.disconnectedCallback();
4391
- this.hide();
4392
- }
4393
- /** @inheritdoc */
4394
- render() {
4395
- return html`<div class="outline"></div>`;
4396
- }
4397
- /** @inheritdoc */
4398
- updated(_changedProperties) {
4399
- super.updated(_changedProperties);
4400
- if (_changedProperties.has("disabled") && this.disabled) {
4401
- this.hide();
4402
- }
4403
- }
4404
- };
4405
- _M3eFocusRingElement_focusController = new WeakMap();
4406
- _M3eFocusRingElement_instances = new WeakSet();
4407
- _M3eFocusRingElement_handleFocusChange = function _M3eFocusRingElement_handleFocusChange(focusVisible) {
4408
- if (!this.disabled) {
4409
- if (focusVisible) {
4410
- this.show();
4411
- } else {
4412
- this.hide();
4413
- }
4414
- }
4415
- };
4416
- /** The styles of the element. */
4417
- M3eFocusRingElement.styles = css`:host { display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; border-radius: inherit; outline: none; } .outline { contain: layout style; position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; border-radius: inherit; z-index: 1; outline-color: ${FocusRingToken.color}; outline-width: ${FocusRingToken.thickness}; visibility: ${FocusRingToken.visibility}; } .outline.visible { outline-style: solid; } :host(:not([inward])) .outline { outline-offset: ${FocusRingToken.outwardOffset}; } :host([inward]) .outline { outline-offset: calc(${FocusRingToken.inwardOffset} - ${FocusRingToken.thickness}); } :host(:not([inward])) .outline.visible { animation: grow-shrink ${FocusRingToken.duration}; } :host([inward]) .outline.visible { animation: shrink-grow ${FocusRingToken.duration}; } @keyframes grow-shrink { 50% { outline-width: calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor}); } } @keyframes shrink-grow { 50% { outline-offset: calc( ${FocusRingToken.inwardOffset} - calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor}) ); outline-width: calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor}); } } @media (prefers-reduced-motion) { :host(:not([inward])) .outline.visible, :host([inward]) .outline.visible { animation: none; } } @media (forced-colors: active) { .outline { outline-color: Highlight; } }`;
4418
- __decorate([query(".outline")], M3eFocusRingElement.prototype, "_outline", void 0);
4419
- __decorate([property({
4420
- type: Boolean,
4421
- reflect: true
4422
- })], M3eFocusRingElement.prototype, "inward", void 0);
4423
- __decorate([property({
4424
- type: Boolean,
4425
- reflect: true
4426
- })], M3eFocusRingElement.prototype, "disabled", void 0);
4427
- M3eFocusRingElement = __decorate([customElement("m3e-focus-ring")], M3eFocusRingElement);
4428
-
4429
- /**
4430
- * An element which looks like a checkbox.
4431
- *
4432
- * @description
4433
- * The `m3e-pseudo-checkbox` component is a pseudo-checkbox supporting checked, indeterminate, and disabled
4434
- * states. It is customizable via CSS properties for expressive, accessible UI design.
4435
- *
4436
- * @example
4437
- * The following example illustrates how to render a checked pseudo-checkbox.
4438
- * ```html
4439
- * <m3e-pseudo-checkbox checked></m3e-pseudo-checkbox>
4440
- * ```
4441
- *
4442
- * @tag m3e-pseudo-checkbox
4443
- *
4444
- * @attr checked - A value indicating whether the element is checked.
4445
- * @attr disabled - A value indicating whether the element is disabled.
4446
- * @attr indeterminate - A value indicating whether the element's checked state is indeterminate.
4447
- *
4448
- * @cssprop --m3e-checkbox-icon-size - Size of the checkbox icon.
4449
- * @cssprop --m3e-checkbox-container-shape - Border radius of the checkbox container.
4450
- * @cssprop --m3e-checkbox-unselected-outline-thickness - Outline thickness for unselected state.
4451
- * @cssprop --m3e-checkbox-unselected-outline-color - Outline color for unselected state.
4452
- * @cssprop --m3e-checkbox-selected-container-color - Background color for selected state.
4453
- * @cssprop --m3e-checkbox-selected-icon-color - Icon color for selected state.
4454
- * @cssprop --m3e-checkbox-unselected-disabled-outline-color - Outline color for unselected disabled state.
4455
- * @cssprop --m3e-checkbox-unselected-disabled-outline-opacity - Outline opacity for unselected disabled state.
4456
- * @cssprop --m3e-checkbox-selected-disabled-container-color - Background color for selected disabled state.
4457
- * @cssprop --m3e-checkbox-selected-disabled-container-opacity - Background opacity for selected disabled state.
4458
- * @cssprop --m3e-checkbox-selected-disabled-icon-color - Icon color for selected disabled state.
4459
- * @cssprop --m3e-checkbox-selected-disabled-icon-opacity - Icon opacity for selected disabled state.
4460
- */
4461
- let M3ePseudoCheckboxElement = class M3ePseudoCheckboxElement extends CheckedIndeterminate(Disabled(Role(LitElement, "none"))) {
4462
- /** @inheritdoc */
4463
- connectedCallback() {
4464
- super.connectedCallback();
4465
- this.ariaHidden = "true";
4466
- }
4467
- /** @inheritdoc */
4468
- render() {
4469
- if (this.indeterminate) {
4470
- return html`<svg viewBox="0 -960 960 960" fill="currentColor"><path Required d="M240-440v-80h480v80H240Z"/></svg>`;
4471
- }
4472
- if (this.checked) {
4473
- return html`<svg viewBox="0 -960 960 960" fill="currentColor"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>`;
4474
- }
4475
- return nothing;
4476
- }
4477
- };
4478
- /** The styles of the element. */
4479
- M3ePseudoCheckboxElement.styles = css`:host { display: inline-block; vertical-align: middle; width: var(--m3e-checkbox-icon-size, 1.125rem); height: var(--m3e-checkbox-icon-size, 1.125rem); border-radius: var(--m3e-checkbox-container-shape, 2px); box-sizing: border-box; flex: none; contain: layout style paint; } :host(:not([checked]):not([indeterminate])) { border-width: var(--m3e-checkbox-unselected-outline-thickness, 2px); border-style: solid; } :host(:not([disabled])[checked]), :host(:not([disabled])[indeterminate]) { background-color: var(--m3e-checkbox-selected-container-color, ${DesignToken.color.primary}); color: var(--m3e-checkbox-selected-icon-color, ${DesignToken.color.onPrimary}); } :host(:not([disabled]):not([checked]):not([indeterminate])) { border-color: var(--m3e-checkbox-unselected-outline-color, ${DesignToken.color.onSurfaceVariant}); } :host([disabled]:not([checked]):not([indeterminate])) { border-color: color-mix( in srgb, var(--m3e-checkbox-unselected-disabled-outline-color, ${DesignToken.color.onSurface}) var(--m3e-checkbox-unselected-disabled-outline-opacity, 38%), transparent ); } :host([disabled][checked]), :host([disabled][indeterminate]) { background-color: color-mix( in srgb, var(--m3e-checkbox-selected-disabled-container-color, ${DesignToken.color.onSurface}) var(--m3e-checkbox-selected-disabled-container-opacity, 38%), transparent ); color: color-mix( in srgb, var(--m3e-checkbox-selected-disabled-icon-color, ${DesignToken.color.surface}) var(--m3e-checkbox-selected-disabled-icon-opacity, 100%), transparent ); } svg { pointer-events: none; } @media (forced-colors: active) { :host(:not([disabled])[checked]), :host(:not([disabled])[indeterminate]) { border-color: Highlight; background-color: Highlight; color: HighlightText; } :host(:not([disabled]):not([checked]):not([indeterminate])) { border-color: CanvasText; background: Canvas; } :host([disabled]:not([checked]):not([indeterminate])) { border-color: GrayText; background-color: Canvas; } :host([disabled][checked]), :host([disabled][indeterminate]) { background-color: GrayText; color: Canvas; } }`;
4480
- M3ePseudoCheckboxElement = __decorate([customElement("m3e-pseudo-checkbox")], M3ePseudoCheckboxElement);
4481
-
4482
- /**
4483
- * An element which looks like a radio button.
4484
- *
4485
- * @description
4486
- * The `m3e-pseudo-radio` component is a pseudo-radio supporting checked and disabled
4487
- * states. It is customizable via CSS properties for expressive, accessible UI design.
4488
- *
4489
- * @example
4490
- * The following example illustrates how to render a checked pseudo-radio.
4491
- * ```html
4492
- * <m3e-pseudo-radio checked></m3e-pseudo-radio>
4493
- * ```
4494
- *
4495
- * @tag m3e-pseudo-radio
4496
- *
4497
- * @attr checked - A value indicating whether the element is checked.
4498
- * @attr disabled - A value indicating whether the element is disabled.
4499
- *
4500
- * @cssprop --m3e-radio-icon-size - Size of the radio icon.
4501
- * @cssprop --m3e-radio-unselected-icon-color - Color of the unselected radio icon.
4502
- * @cssprop --m3e-radio-selected-icon-color - Color of the selected radio icon.
4503
- * @cssprop --m3e-radio-disabled-icon-color - Color of the disabled radio icon.
4504
- */
4505
- let M3ePseudoRadioElement = class M3ePseudoRadioElement extends Checked(Disabled(Role(LitElement, "none"))) {
4506
- /** @inheritdoc */
4507
- connectedCallback() {
4508
- super.connectedCallback();
4509
- this.ariaHidden = "true";
4510
- }
4511
- /** @inheritdoc */
4512
- render() {
4513
- return html`<svg class="icon" viewBox="0 0 20 20"><mask id="cutout2"><rect width="100%" height="100%" fill="white"></rect><circle cx="10" cy="10" r="8" fill="black"></circle></mask><circle class="outer circle" cx="10" cy="10" r="10" mask="url(#cutout2)"></circle><circle class="inner circle" cx="10" cy="10" r="5"></circle></svg>`;
4514
- }
4515
- };
4516
- /** The styles of the element. */
4517
- M3ePseudoRadioElement.styles = css`:host { display: inline-block; vertical-align: middle; box-sizing: border-box; width: var(--m3e-radio-icon-size, 1.25rem); height: var(--m3e-radio-icon-size, 1.25rem); flex: none; contain: layout style paint; } .circle { fill: currentColor; } :host(:not([checked])) .circle.inner { opacity: 0; } :host(:not([checked])) { color: var(--m3e-radio-unselected-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host([checked]) { color: var(--m3e-radio-selected-icon-color, ${DesignToken.color.primary}); } :host([disabled]) { color: color-mix(in srgb, var(--m3e-radio-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent); } @media (forced-colors: active) { :host { border-radius: 50%; } :host(:not([checked])) { color: CanvasText; background-color: Canvas; } :host([checked]) { color: HighlightText; background-color: Highlight; } :host([disabled]) { color: GrayText; background-color: Canvas; } }`;
4518
- M3ePseudoRadioElement = __decorate([customElement("m3e-pseudo-radio")], M3ePseudoRadioElement);
4519
-
4520
- /**
4521
- * Component design tokens that control the `M3eRippleElement`.
4522
- * @internal
4523
- */
4524
- const RippleToken = {
4525
- color: unsafeCSS(`var(--m3e-ripple-color, ${DesignToken.color.onSurface})`),
4526
- opacity: unsafeCSS(`var(--m3e-ripple-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
4527
- enterDuration: unsafeCSS(`var(--m3e-ripple-enter-duration, ${DesignToken.motion.duration.long4})`),
4528
- exitDuration: unsafeCSS(`var(--m3e-ripple-exit-duration, ${DesignToken.motion.duration.short2})`),
4529
- scaleFactor: unsafeCSS(`var(--m3e-ripple-scale-factor, 2.5)`)
4530
- };
4531
-
4532
- var _M3eRippleElement_instances, _M3eRippleElement_ripple, _M3eRippleElement_pressedController, _M3eRippleElement_destroyRipple, _M3eRippleElement_handleAnimationEnd, _M3eRippleElement_handlePressedChange;
4533
- /**
4534
- * Connects user input to screen reactions using ripples.
4535
- *
4536
- * @description
4537
- * The `m3e-ripple` component is an absolute positioned element used to depict a ripple.
4538
- * The parenting element must be a relative positioned element.
4539
- *
4540
- * The component can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
4541
- * The ripple is displayed when the interactive element is pressed and hidden when released. This can be disabled using the `disabled` attribute.
4542
- *
4543
- * The pressed state actives either using both pointer and keyboard events. For keyboard events, `SPACE` activate a ripple.
4544
- *
4545
- * Alternatively, you can use the `show` and `hide` methods to programmatically control the ripple.
4546
- *
4547
- * @example
4548
- * The following example illustrates attaching a ripple to an interactive element. In this example, the parenting div
4549
- * has relative positioning and is given an `id` referenced by `m3e-ripple` using the `for` attribute. Note that `#myDiv`
4550
- * is not used when specifying the attached element's identifier. The `#` is inferred.
4551
- *
4552
- * ```html
4553
- * <div id="myDiv" tabindex="0" style="position: relative;">
4554
- * <m3e-ripple for="myDiv"></m3e-ripple>
4555
- * <div>
4556
- * ```
4557
- *
4558
- * @tag m3e-ripple
4559
- *
4560
- * @attr centered - Whether the ripple always originates from the center of the element's bounds, rather than originating from the location of the click event.
4561
- * @attr disabled - Whether click events will not trigger the ripple. Ripples can be still controlled manually by using the `show` and 'hide' methods.
4562
- * @attr for - The identifier of the interactive control to which this element is attached.
4563
- * @attr radius - The radius, in pixels, of the ripple.
4564
- * @attr unbounded - Whether the ripple is visible outside the element's bounds.
4565
- *
4566
- * @cssprop --m3e-ripple-color - The color of the ripple.
4567
- * @cssprop --m3e-ripple-enter-duration - The duration for the enter animation (expansion from point of contact).
4568
- * @cssprop --m3e-ripple-exit-duration - The duration for the exit animation (fade-out).
4569
- * @cssprop --m3e-ripple-opacity - The opacity of the ripple.
4570
- * @cssprop --m3e-ripple-scale-factor - The factor by which to scale the ripple.
4571
- * @cssprop --m3e-ripple-shape - The shape of the ripple.
4572
- */
4573
- let M3eRippleElement = class M3eRippleElement extends HtmlFor(Role(LitElement, "none")) {
4574
- constructor() {
4575
- super(...arguments);
4576
- _M3eRippleElement_instances.add(this);
4577
- /** @private */
4578
- _M3eRippleElement_ripple.set(this, null);
4579
- /** @private */
4580
- _M3eRippleElement_pressedController.set(this, new PressedController(this, {
4581
- target: null,
4582
- minPressedDuration: 150,
4583
- isPressedKey: key => key === " ",
4584
- callback: (pressed, {
4585
- x,
4586
- y
4587
- }) => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_handlePressedChange).call(this, pressed, x, y)
4588
- }));
4589
- /**
4590
- * Whether click events will not trigger the ripple.
4591
- * Ripples can be still controlled manually by using the `show` and 'hide' methods.
4592
- * @default false
4593
- */
4594
- this.disabled = false;
4595
- /**
4596
- * Whether the ripple always originates from the center of the element's bounds, rather
4597
- * than originating from the location of the click event.
4598
- * @default false
4599
- */
4600
- this.centered = false;
4601
- /**
4602
- * Whether the ripple is visible outside the element's bounds.
4603
- * @default false
4604
- */
4605
- this.unbounded = false;
4606
- /**
4607
- * The radius, in pixels, of the ripple.
4608
- * @default null
4609
- */
4610
- this.radius = null;
4611
- }
4612
- /** Whether the ripple is currently visible to the user. */
4613
- get visible() {
4614
- return __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f") !== null;
4615
- }
4616
- /**
4617
- * Launches a manual ripple.
4618
- * @param {number} x The x-coordinate, relative to the viewport, at which to present the ripple.
4619
- * @param {number} y The y-coordinate, relative to the viewport, at which to present the ripple.
4620
- * @param {boolean} [persistent=false] Whether the ripple will persist until hidden.
4621
- */
4622
- show(x, y, persistent = false) {
4623
- __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this);
4624
- const bounds = this.getBoundingClientRect();
4625
- if (this.centered) {
4626
- x = bounds.left + bounds.width / 2;
4627
- y = bounds.top + bounds.height / 2;
4628
- }
4629
- let radius = this.radius;
4630
- if (!radius || isNaN(radius)) {
4631
- const distX = Math.max(Math.abs(x - bounds.left), Math.abs(x - bounds.right));
4632
- const distY = Math.max(Math.abs(y - bounds.top), Math.abs(y - bounds.bottom));
4633
- radius = Math.sqrt(distX * distX + distY * distY);
4634
- }
4635
- const offsetX = x - bounds.left;
4636
- const offsetY = y - bounds.top;
4637
- __classPrivateFieldSet(this, _M3eRippleElement_ripple, document.createElement("div"), "f");
4638
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").classList.add("ripple");
4639
- if (persistent) {
4640
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").classList.add("persistent");
4641
- }
4642
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.left = `${offsetX - radius}px`;
4643
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.top = `${offsetY - radius}px`;
4644
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.width = `${radius * 2}px`;
4645
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.height = `${radius * 2}px`;
4646
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").addEventListener("animationend", () => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_handleAnimationEnd).call(this, persistent), {
4647
- once: true
4648
- });
4649
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").addEventListener("transitionend", () => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this), {
4650
- once: true
4651
- });
4652
- this.shadowRoot?.appendChild(__classPrivateFieldGet(this, _M3eRippleElement_ripple, "f"));
4653
- }
4654
- /** Manually hides the ripple. */
4655
- hide() {
4656
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.classList.add("exit");
4657
- }
4658
- /** @inheritdoc */
4659
- attach(control) {
4660
- super.attach(control);
4661
- __classPrivateFieldGet(this, _M3eRippleElement_pressedController, "f").observe(control);
4662
- }
4663
- /** @inheritdoc */
4664
- detach() {
4665
- if (this.control) {
4666
- __classPrivateFieldGet(this, _M3eRippleElement_pressedController, "f").unobserve(this.control);
4667
- }
4668
- super.detach();
4669
- }
4670
- /** @inheritdoc */
4671
- connectedCallback() {
4672
- this.ariaHidden = "true";
4673
- super.connectedCallback();
4674
- }
4675
- /** @inheritdoc */
4676
- disconnectedCallback() {
4677
- super.disconnectedCallback();
4678
- __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this);
4679
- }
4680
- /** @inheritdoc */
4681
- updated(_changedProperties) {
4682
- super.updated(_changedProperties);
4683
- if (_changedProperties.has("disabled") && this.disabled) {
4684
- this.hide();
4685
- }
4686
- }
4687
- };
4688
- _M3eRippleElement_ripple = new WeakMap();
4689
- _M3eRippleElement_pressedController = new WeakMap();
4690
- _M3eRippleElement_instances = new WeakSet();
4691
- _M3eRippleElement_destroyRipple = function _M3eRippleElement_destroyRipple() {
4692
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.remove();
4693
- __classPrivateFieldSet(this, _M3eRippleElement_ripple, null, "f");
4694
- };
4695
- _M3eRippleElement_handleAnimationEnd = function _M3eRippleElement_handleAnimationEnd(persistent) {
4696
- if (persistent) {
4697
- __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.classList.add("pressed");
4698
- } else {
4699
- this.hide();
4700
- }
4701
- };
4702
- _M3eRippleElement_handlePressedChange = function _M3eRippleElement_handlePressedChange(pressed, x, y) {
4703
- if (!this.disabled) {
4704
- if (pressed) {
4705
- this.show(x, y, true);
4706
- } else {
4707
- this.hide();
4708
- }
4709
- }
4710
- };
4711
- /** The styles of the element. */
4712
- M3eRippleElement.styles = css`:host { display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; border-radius: inherit; } :host(:not([unbounded])) { overflow: hidden; } :host(:not([unbounded])) .ripple { contain: layout style paint; } :host([unbounded]) .ripple { contain: layout style; } .ripple { display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; transform: scale(0); border-radius: ${DesignToken.shape.corner.full}; background-color: color-mix(in srgb, ${RippleToken.color} ${RippleToken.opacity}, transparent); will-change: background-color, opacity; animation: ripple ${RippleToken.enterDuration} linear; } .ripple.persistent.pressed { transform: scale(${RippleToken.scaleFactor}); } .ripple.exit { transition: opacity ${RippleToken.exitDuration} cubic-bezier(0, 0, 0.2, 0.1); opacity: 0; } @keyframes ripple { to { transform: scale(${RippleToken.scaleFactor}); } } @media (prefers-reduced-motion) { .ripple { transform: scale(${RippleToken.scaleFactor}); animation-duration: 90ms; } .ripple.exit { transition-duration: 10ms; } } @media (forced-colors: active) { .ripple { display: none; } }`;
4713
- __decorate([property({
4714
- type: Boolean,
4715
- reflect: true
4716
- })], M3eRippleElement.prototype, "disabled", void 0);
4717
- __decorate([property({
4718
- type: Boolean,
4719
- reflect: true
4720
- })], M3eRippleElement.prototype, "centered", void 0);
4721
- __decorate([property({
4722
- type: Boolean,
4723
- reflect: true
4724
- })], M3eRippleElement.prototype, "unbounded", void 0);
4725
- __decorate([property({
4726
- type: Number
4727
- })], M3eRippleElement.prototype, "radius", void 0);
4728
- M3eRippleElement = __decorate([customElement("m3e-ripple")], M3eRippleElement);
4729
-
4730
- var _M3eScrollContainerElement_scrollHandler;
4731
- /**
4732
- * A vertically oriented content container which presents dividers above and below content when scrolled.
4733
- *
4734
- * @description
4735
- * The `m3e-scroll-container` component provides a vertically oriented scrollable container with dynamic
4736
- * dividers above and below content. Designed according to Material 3 principles, it supports custom scrollbar
4737
- * thickness, divider styling, and focus ring theming via CSS custom properties.
4738
- *
4739
- * @example
4740
- * This example shows a scrollable container with dividers above and below the content, and thin scrollbars enabled.
4741
- * ```html
4742
- * <m3e-scroll-container dividers="above-below" thin>
4743
- * <div>Scrollable content goes here</div>
4744
- * </m3e-scroll-container>
4745
- * ```
4746
- *
4747
- * @tag m3e-scroll-container
4748
- *
4749
- * @slot - Renders the scrollable content.
4750
- *
4751
- * @attr dividers - The dividers used to separate scrollable content.
4752
- * @attr thin - Whether to present thin scrollbars.
4753
- *
4754
- * @cssprop --m3e-divider-thickness - Thickness of the divider lines above and below content.
4755
- * @cssprop --m3e-divider-color - Color of the divider lines when visible.
4756
- * @cssprop --m3e-focus-ring-color - Color of the focus ring outline.
4757
- * @cssprop --m3e-focus-ring-thickness - Thickness of the focus ring outline.
4758
- * @cssprop --m3e-focus-ring-factor - Animation factor for focus ring thickness.
4759
- * @cssprop --m3e-focus-ring-duration - Duration of the focus ring animation.
4760
- */
4761
- let M3eScrollContainerElement = class M3eScrollContainerElement extends AttachInternals(LitElement) {
4762
- constructor() {
4763
- super(...arguments);
4764
- /** @private */
4765
- _M3eScrollContainerElement_scrollHandler.set(this, () => this._updateScroll());
4766
- /**
4767
- * The dividers used to separate scrollable content.
4768
- * @default "above-below"
4769
- */
4770
- this.dividers = "above-below";
4771
- /**
4772
- * Whether to present thin scrollbars.
4773
- * @default false
4774
- */
4775
- this.thin = false;
4776
- }
4777
- /** @inheritdoc */
4778
- disconnectedCallback() {
4779
- super.disconnectedCallback();
4780
- this.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"));
4781
- }
4782
- /** @inheritdoc */
4783
- update(changedProperties) {
4784
- super.update(changedProperties);
4785
- if (changedProperties.has("dividers")) {
4786
- this.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"));
4787
- if (this.dividers !== "none") {
4788
- this.addEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"), {
4789
- passive: true
4790
- });
4791
- }
4792
- }
4793
- }
4794
- /** @inheritdoc */
4795
- render() {
4796
- return html`<slot @slotchange="${this._updateScroll}"></slot>`;
4797
- }
4798
- /** @private */
4799
- _updateScroll() {
4800
- const before = (this.dividers === "above" || this.dividers === "above-below") && this.scrollTop > 0;
4801
- const after = (this.dividers === "below" || this.dividers === "above-below") && this.scrollHeight - this.scrollTop - this.clientHeight > 1;
4802
- setCustomState(this, "--above", before);
4803
- setCustomState(this, "--below", after);
4804
- }
4805
- };
4806
- _M3eScrollContainerElement_scrollHandler = new WeakMap();
4807
- /** The styles of the element. */
4808
- M3eScrollContainerElement.styles = css`:host { display: block; overflow-y: auto; position: relative; box-sizing: border-box; scrollbar-color: ${DesignToken.scrollbar.color}; border-top: var(--m3e-divider-thickness, 1px) solid transparent; border-bottom: var(--m3e-divider-thickness, 1px) solid transparent; outline-color: ${FocusRingToken.color}; outline-width: ${FocusRingToken.thickness}; outline-offset: ${FocusRingToken.outwardOffset}; } :host([thin]) { scrollbar-width: ${DesignToken.scrollbar.thinWidth}; } :host(:not([thin])) { scrollbar-width: ${DesignToken.scrollbar.width}; } :host(:not(:focus-visible):is(:state(--above), :--above)) { border-top-color: var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host(:not(:focus-visible):is(:state(--below), :--below)) { border-bottom-color: var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host(:focus-visible) { outline-style: solid; animation: grow-shrink ${FocusRingToken.duration}; } @keyframes grow-shrink { 50% { outline-width: calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor}); } } @media (forced-colors: active) { :host { border-top: var(--m3e-divider-thickness, 1px) solid Canvas; border-bottom: var(--m3e-divider-thickness, 1px) solid Canvas; } :host(:not(:focus-visible):is(:state(--above), :--above)) { border-top-color: GrayText; } :host(:not(:focus-visible):is(:state(--below), :--below)) { border-bottom-color: GrayText; } } @media (prefers-reduced-motion) { :host(:focus-visible) { animation: none; } }`;
4809
- __decorate([property()], M3eScrollContainerElement.prototype, "dividers", void 0);
4810
- __decorate([property({
4811
- type: Boolean,
4812
- reflect: true
4813
- })], M3eScrollContainerElement.prototype, "thin", void 0);
4814
- __decorate([debounce(40)], M3eScrollContainerElement.prototype, "_updateScroll", null);
4815
- M3eScrollContainerElement = __decorate([customElement("m3e-scroll-container")], M3eScrollContainerElement);
4816
-
4817
- var _M3eSlideElement_instances, _M3eSlideElement_items, _M3eSlideElement_handleSlotChange, _M3eSlideElement_updateItems;
4818
- /**
4819
- * A carousel-like container used to horizontally cycle through slotted items.
4820
- *
4821
- * @example
4822
- * The following example illustrates the use of `m3e-slide` to cycle through content.
4823
- * In this example, `selected-index` is set to `1` so that "Content at index 1" is presented
4824
- * by the component.
4825
- * ```html
4826
- * <m3e-slide selected-index="1">
4827
- * <div>Content at index 0</div>
4828
- * <div>Content at index 1</div>
4829
- * <div>Content at index 2</div>
4830
- * <div>Content at index 3</div>
4831
- * </m3e-slide>
4832
- * ```
4833
- *
4834
- * @tag m3e-slide
4835
- *
4836
- * @slot - Renders the items through which to cycle.
4837
- *
4838
- * @attr selected-index - The zero-based index of the visible item.
4839
- *
4840
- * @cssprop --m3e-slide-animation-duration - The duration of transitions between slotted items.
4841
- */
4842
- let M3eSlideElement = class M3eSlideElement extends AttachInternals(LitElement) {
4843
- constructor() {
4844
- super(...arguments);
4845
- _M3eSlideElement_instances.add(this);
4846
- /** @private */
4847
- _M3eSlideElement_items.set(this, new Array());
4848
- /**
4849
- * The zero-based index of the visible item.
4850
- * @default null
4851
- */
4852
- this.selectedIndex = null;
4853
- }
4854
- /** @inheritdoc */
4855
- connectedCallback() {
4856
- super.connectedCallback();
4857
- addCustomState(this, "--no-animate");
4858
- }
4859
- /** @inheritdoc */
4860
- update(changedProperties) {
4861
- super.update(changedProperties);
4862
- if (changedProperties.has("selectedIndex")) {
4863
- if (this.selectedIndex === null) {
4864
- addCustomState(this, "--no-animate");
4865
- }
4866
- __classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_updateItems).call(this);
4867
- if (this.selectedIndex !== null && hasCustomState(this, "--no-animate")) {
4868
- requestAnimationFrame(() => {
4869
- if (this.selectedIndex !== null) {
4870
- deleteCustomState(this, "--no-animate");
4871
- }
4872
- });
4873
- }
4874
- }
4875
- }
4876
- /** @inheritdoc */
4877
- render() {
4878
- return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_handleSlotChange)}"></slot>`;
4879
- }
4880
- };
4881
- _M3eSlideElement_items = new WeakMap();
4882
- _M3eSlideElement_instances = new WeakSet();
4883
- _M3eSlideElement_handleSlotChange = function _M3eSlideElement_handleSlotChange(e) {
4884
- const items = [...e.target.assignedElements({
4885
- flatten: true
4886
- })];
4887
- for (const removed of __classPrivateFieldGet(this, _M3eSlideElement_items, "f").filter(x => !items.includes(x))) {
4888
- removed.classList.remove("-before");
4889
- removed.classList.remove("-after");
4890
- removed.removeAttribute("inert");
4891
- }
4892
- __classPrivateFieldSet(this, _M3eSlideElement_items, items, "f");
4893
- __classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_updateItems).call(this);
4894
- };
4895
- _M3eSlideElement_updateItems = function _M3eSlideElement_updateItems() {
4896
- const selectedIndex = this.selectedIndex ?? __classPrivateFieldGet(this, _M3eSlideElement_items, "f").length;
4897
- for (let i = 0; i < __classPrivateFieldGet(this, _M3eSlideElement_items, "f").length; i++) {
4898
- const item = __classPrivateFieldGet(this, _M3eSlideElement_items, "f")[i];
4899
- item.classList.toggle("-before", i < selectedIndex);
4900
- item.classList.toggle("-after", i > selectedIndex);
4901
- item.toggleAttribute("inert", i !== selectedIndex);
4902
- }
4903
- };
4904
- /** The styles of the element. */
4905
- M3eSlideElement.styles = css`:host { display: flex; position: relative; overflow: hidden; } ::slotted(*) { width: 100%; top: 0; transition: ${unsafeCSS(`inset-inline-start var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard},
4906
- visibility var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard} allow-discrete`)}; } ::slotted(.-before), ::slotted(.-after) { visibility: hidden; position: absolute; } ::slotted(.-before) { inset-inline-start: -100%; } ::slotted(.-after) { inset-inline-start: 100%; } ::slotted(:not(.-before):not(.-after)) { position: relative; inset-inline-start: 0; } :host(:is(:state(--no-animate), :--no-animate)) ::slotted(*) { transition: none; } @media (prefers-reduced-motion) { ::slotted(*) { transition: none; } }`;
4907
- __decorate([property({
4908
- attribute: "selected-index",
4909
- type: Number,
4910
- reflect: true
4911
- })], M3eSlideElement.prototype, "selectedIndex", void 0);
4912
- M3eSlideElement = __decorate([customElement("m3e-slide")], M3eSlideElement);
4913
-
4914
- /**
4915
- * Component design tokens that control the `M3eStateLayerElement`.
4916
- * @internal
4917
- */
4918
- const StateLayerToken = {
4919
- hoverColor: unsafeCSS(`var(--m3e-state-layer-hover-color, ${DesignToken.color.onSurface})`),
4920
- hoverOpacity: unsafeCSS(`var(--m3e-state-layer-hover-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
4921
- focusColor: unsafeCSS(`var(--m3e-state-layer-focus-color, ${DesignToken.color.onSurface})`),
4922
- focusOpacity: unsafeCSS(`var(--m3e-state-layer-focus-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
4923
- duration: unsafeCSS(`var(--m3e-state-layer-duration, ${DesignToken.motion.duration.medium1})`),
4924
- easing: unsafeCSS(`var(--m3e-state-layer-easing, ${DesignToken.motion.easing.standard})`)
4925
- };
4926
-
4927
- var _M3eStateLayerElement_instances, _M3eStateLayerElement_hoverController, _M3eStateLayerElement_focusController, _M3eStateLayerElement_handleHoverChange, _M3eStateLayerElement_handleFocusChange;
4928
- /**
4929
- * Provides focus and hover state layer treatment for an interactive element.
4930
- *
4931
- * @description
4932
- * The `m3e-state-layer` component is an absolute positioned element used to depict hover and focus overlays.
4933
- * The parenting element must be a relative positioned element.
4934
- *
4935
- * This element can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
4936
- * The state layer is displayed when the interactive element is either hovered or focused. This can be disabled using
4937
- * the `disabled` attribute.
4938
- *
4939
- * @example
4940
- * The following example illustrates attaching a state layer to an interactive element. In this example, the parenting div
4941
- * has relative positioning and is given an `id` referenced by `m3e-state-layer` using the `for` attribute. Note that `#myDiv`
4942
- * is not used when specifying the attached element's identifier. The `#` is inferred.
4943
- *
4944
- * ```html
4945
- * <div id="myDiv" tabindex="0" style="position: relative;">
4946
- * <m3e-state-layer for="myDiv"></m3e-state-layer>
4947
- * <div>
4948
- * ```
4949
- *
4950
- * @tag m3e-state-layer
4951
- *
4952
- * @attr disabled - Whether hover and focus events will not trigger the state layer. State layers can still be controlled manually using the `show` and `hide` methods.
4953
- * @attr disable-hover - Whether hover events will not trigger the state layer. State layers can still be controlled manually using the `show` and `hide` methods.
4954
- *
4955
- * @cssprop --m3e-state-layer-duration - Duration of state layer changes.
4956
- * @cssprop --m3e-state-layer-easing - Easing curve of state layer changes.
4957
- * @cssprop --m3e-state-layer-focus-color - Color on hover.
4958
- * @cssprop --m3e-state-layer-focus-opacity - Opacity on focus.
4959
- * @cssprop --m3e-state-layer-hover-color - Color on hover.
4960
- * @cssprop --m3e-state-layer-hover-opacity - Opacity on hover.
4961
- */
4962
- let M3eStateLayerElement = class M3eStateLayerElement extends HtmlFor(Role(LitElement, "none")) {
4963
- constructor() {
4964
- super(...arguments);
4965
- _M3eStateLayerElement_instances.add(this);
4966
- /** @private */
4967
- _M3eStateLayerElement_hoverController.set(this, new HoverController(this, {
4968
- target: null,
4969
- callback: hovering => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleHoverChange).call(this, hovering)
4970
- }));
4971
- /** @private */
4972
- _M3eStateLayerElement_focusController.set(this, new FocusController(this, {
4973
- target: null,
4974
- callback: (_, focusVisible) => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleFocusChange).call(this, focusVisible)
4975
- }));
4976
- /**
4977
- * Whether hover and focus events will not trigger the state layer. State layers can still
4978
- * be controlled manually using the `show` and `hide` methods.
4979
- * @default false
4980
- */
4981
- this.disabled = false;
4982
- /**
4983
- * Whether hover events will not trigger the state layer. State layers can still
4984
- * be controlled manually using the `show` and `hide` methods.
4985
- * @default false
4986
- */
4987
- this.disableHover = false;
4988
- }
4989
- /**
4990
- * Launches a manual state layer.
4991
- * @param {"hover" | "focused"} state The state of the layer to show.
4992
- */
4993
- show(state) {
4994
- this._layer?.classList.toggle(state, true);
4995
- }
4996
- /**
4997
- * Hides the state layer.
4998
- * @param {"hover" | "focused"} state The state of the layer to hide.
4999
- */
5000
- hide(state) {
5001
- this._layer?.classList.toggle(state, false);
5002
- }
5003
- /** @inheritdoc */
5004
- attach(control) {
5005
- super.attach(control);
5006
- __classPrivateFieldGet(this, _M3eStateLayerElement_hoverController, "f").observe(control);
5007
- __classPrivateFieldGet(this, _M3eStateLayerElement_focusController, "f").observe(control);
5008
- }
5009
- /** @inheritdoc */
5010
- detach() {
5011
- if (this.control) {
5012
- __classPrivateFieldGet(this, _M3eStateLayerElement_hoverController, "f").unobserve(this.control);
5013
- __classPrivateFieldGet(this, _M3eStateLayerElement_focusController, "f").unobserve(this.control);
5014
- }
5015
- super.detach();
5016
- }
5017
- /** @inheritdoc */
5018
- connectedCallback() {
5019
- this.ariaHidden = "true";
5020
- super.connectedCallback();
5021
- }
5022
- /** @inheritdoc */
5023
- disconnectedCallback() {
5024
- super.disconnectedCallback();
5025
- this.hide("hover");
5026
- this.hide("focused");
5027
- }
5028
- /** @inheritdoc */
5029
- updated(_changedProperties) {
5030
- super.updated(_changedProperties);
5031
- if (_changedProperties.has("disabled") && this.disabled) {
5032
- this.hide("hover");
5033
- this.hide("focused");
5034
- }
5035
- if (_changedProperties.has("disableHover") && this.disableHover) {
5036
- this.hide("hover");
5037
- }
5038
- }
5039
- /** @inheritdoc */
5040
- render() {
5041
- return html`<div class="layer"></div>`;
5042
- }
5043
- };
5044
- _M3eStateLayerElement_hoverController = new WeakMap();
5045
- _M3eStateLayerElement_focusController = new WeakMap();
5046
- _M3eStateLayerElement_instances = new WeakSet();
5047
- _M3eStateLayerElement_handleHoverChange = function _M3eStateLayerElement_handleHoverChange(hovering) {
5048
- if (!this.disabled && !this.disableHover) {
5049
- if (hovering) {
5050
- this.show("hover");
5051
- } else {
5052
- this.hide("hover");
5053
- }
5054
- }
5055
- };
5056
- _M3eStateLayerElement_handleFocusChange = function _M3eStateLayerElement_handleFocusChange(focusVisible) {
5057
- if (!this.disabled) {
5058
- if (focusVisible) {
5059
- this.show("focused");
5060
- } else {
5061
- this.hide("focused");
5062
- }
5063
- }
5064
- };
5065
- /** The styles of the element. */
5066
- M3eStateLayerElement.styles = css`:host { display: block; } :host, .layer { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; border-radius: inherit; } .layer { contain: layout style paint; will-change: background-color; transition: ${unsafeCSS(`background-color ${StateLayerToken.duration} ${StateLayerToken.easing}`)}; } .layer.focused { background-color: color-mix(in srgb, ${StateLayerToken.focusColor} ${StateLayerToken.focusOpacity}, transparent); } .layer.hover { background-color: color-mix(in srgb, ${StateLayerToken.hoverColor} ${StateLayerToken.hoverOpacity}, transparent); } @media (prefers-reduced-motion) { .layer { transition: none; } } @media (forced-colors: active) { .layer { display: none; } }`;
5067
- __decorate([query(".layer")], M3eStateLayerElement.prototype, "_layer", void 0);
5068
- __decorate([property({
5069
- type: Boolean,
5070
- reflect: true
5071
- })], M3eStateLayerElement.prototype, "disabled", void 0);
5072
- __decorate([property({
5073
- attribute: "disable-hover",
5074
- type: Boolean,
5075
- reflect: true
5076
- })], M3eStateLayerElement.prototype, "disableHover", void 0);
5077
- M3eStateLayerElement = __decorate([customElement("m3e-state-layer")], M3eStateLayerElement);
5078
-
5079
- var _M3eTextHighlightElement_instances, _M3eTextHighlightElement_id, _M3eTextHighlightElement_ranges, _M3eTextHighlightElement_styles, _M3eTextHighlightElement_isTextNode, _M3eTextHighlightElement_findTextNodes, _M3eTextHighlightElement_highlight;
5080
- var M3eTextHighlightElement_1;
5081
- /**
5082
- * Highlights text which matches a given search term.
5083
- *
5084
- * @description
5085
- * Highlights all text ranges in slotted content that match a given search term using the CSS Custom Highlight API.
5086
- *
5087
- * @example
5088
- * The following example illustrates highlighting "Lor".
5089
- * ```html
5090
- * <m3e-text-highlight term="Lor">
5091
- * <p>
5092
- * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
5093
- * ut labore et dolore magna aliqua.
5094
- * </p>
5095
- * </m3e-text-highlight>
5096
- * ```
5097
- *
5098
- * @tag m3e-text-highlight
5099
- *
5100
- * @slot - Renders the content to highlight.
5101
- *
5102
- * @attr case-sensitive - Whether matching is case sensitive.
5103
- * @attr disabled - A value indicating whether text highlighting is disabled.
5104
- * @attr mode - The mode in which to highlight text.
5105
- * @attr term - The term to highlight.
5106
- *
5107
- * @fires highlight - Dispatched when content is highlighted.
5108
- *
5109
- * @cssprop --m3e-text-highlight-container-color - Background color applied to highlighted text ranges.
5110
- * @cssprop --m3e-text-highlight-color - Foreground color of highlighted text content.
5111
- * @cssprop --m3e-text-highlight-decoration - Optional text decoration (e.g., underline, line-through) for highlighted text.
5112
- * @cssprop --m3e-text-highlight-shadow - Optional text shadow for emphasis or contrast.
5113
- */
5114
- let M3eTextHighlightElement = M3eTextHighlightElement_1 = class M3eTextHighlightElement extends LitElement {
5115
- constructor() {
5116
- super();
5117
- _M3eTextHighlightElement_instances.add(this);
5118
- /** @private */
5119
- _M3eTextHighlightElement_id.set(this, `m3e-text-highlight-${M3eTextHighlightElement_1.__nextId++}`);
5120
- /** @private */
5121
- _M3eTextHighlightElement_ranges.set(this, new Array());
5122
- /** @private */
5123
- _M3eTextHighlightElement_styles.set(this, null);
5124
- /**
5125
- * A value indicating whether text highlighting is disabled.
5126
- * @default false
5127
- */
5128
- this.disabled = false;
5129
- /**
5130
- * The term to highlight.
5131
- * @default ""
5132
- */
5133
- this.term = "";
5134
- /**
5135
- * Whether matching is case sensitive.
5136
- * @default false
5137
- */
5138
- this.caseSensitive = false;
5139
- /**
5140
- * The mode in which to highlight text.
5141
- * @default "contains"
5142
- */
5143
- this.mode = "contains";
5144
- if (this.isSupported) {
5145
- __classPrivateFieldSet(this, _M3eTextHighlightElement_styles, new CSSStyleSheet(), "f");
5146
- __classPrivateFieldGet(this, _M3eTextHighlightElement_styles, "f").replaceSync(css`::highlight(${unsafeCSS(__classPrivateFieldGet(this, _M3eTextHighlightElement_id, "f"))}) { background-color: var(--m3e-text-highlight-container-color, ${DesignToken.color.secondaryContainer}); color: var(--m3e-text-highlight-color, ${DesignToken.color.onSecondaryContainer}); text-decoration: var(--m3e-text-highlight-decoration); text-shadow: var(--m3e-text-highlight-shadow); }`.toString());
5147
- }
5148
- }
5149
- /** A value indicating whether text highlighting is supported by the browser. */
5150
- get isSupported() {
5151
- return !isServer && CSS.highlights ? true : false;
5152
- }
5153
- /** The ranges that match the current term. */
5154
- get ranges() {
5155
- return __classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f");
5156
- }
5157
- /** @inheritdoc */
5158
- firstUpdated(_changedProperties) {
5159
- super.firstUpdated(_changedProperties);
5160
- if (this.shadowRoot && __classPrivateFieldGet(this, _M3eTextHighlightElement_styles, "f") && !this.shadowRoot.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eTextHighlightElement_styles, "f"))) {
5161
- this.shadowRoot.adoptedStyleSheets.push(__classPrivateFieldGet(this, _M3eTextHighlightElement_styles, "f"));
5162
- }
5163
- }
5164
- /** @inheritdoc */
5165
- updated(_changedProperties) {
5166
- super.updated(_changedProperties);
5167
- if (_changedProperties.has("term") || _changedProperties.has("caseSensitive") || _changedProperties.has("disabled")) {
5168
- __classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_highlight).call(this);
5169
- }
5170
- }
5171
- /** @inheritdoc */
5172
- render() {
5173
- return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_highlight)}"></slot>`;
5174
- }
5175
- };
5176
- _M3eTextHighlightElement_id = new WeakMap();
5177
- _M3eTextHighlightElement_ranges = new WeakMap();
5178
- _M3eTextHighlightElement_styles = new WeakMap();
5179
- _M3eTextHighlightElement_instances = new WeakSet();
5180
- _M3eTextHighlightElement_isTextNode = function _M3eTextHighlightElement_isTextNode(node) {
5181
- return !/^\s*$/.test(node.data);
5182
- };
5183
- _M3eTextHighlightElement_findTextNodes = function _M3eTextHighlightElement_findTextNodes(parent, nodes) {
5184
- if (parent instanceof HTMLSlotElement) {
5185
- parent.assignedNodes({
5186
- flatten: true
5187
- }).forEach(x => {
5188
- switch (x.nodeType) {
5189
- case Node.TEXT_NODE:
5190
- if (__classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_isTextNode).call(this, x)) {
5191
- nodes.push(x);
5192
- }
5193
- break;
5194
- case Node.ELEMENT_NODE:
5195
- __classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_findTextNodes).call(this, x, nodes);
5196
- break;
5197
- }
5198
- });
5199
- } else {
5200
- parent.childNodes.forEach(x => {
5201
- switch (x.nodeType) {
5202
- case Node.TEXT_NODE:
5203
- if (__classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_isTextNode).call(this, x)) {
5204
- nodes.push(x);
5205
- }
5206
- break;
5207
- case Node.ELEMENT_NODE:
5208
- __classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_findTextNodes).call(this, x, nodes);
5209
- break;
5210
- }
5211
- });
5212
- }
5213
- };
5214
- _M3eTextHighlightElement_highlight = function _M3eTextHighlightElement_highlight() {
5215
- if (!this.isSupported || !this.isConnected) return;
5216
- CSS.highlights.delete(__classPrivateFieldGet(this, _M3eTextHighlightElement_id, "f"));
5217
- __classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f").length = 0;
5218
- if (this.disabled) return;
5219
- if (!this.term) {
5220
- this.dispatchEvent(new CustomEvent("highlight", {
5221
- detail: [...__classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f")],
5222
- bubbles: false,
5223
- composed: false
5224
- }));
5225
- return;
5226
- }
5227
- const texts = new Array();
5228
- __classPrivateFieldGet(this, _M3eTextHighlightElement_instances, "m", _M3eTextHighlightElement_findTextNodes).call(this, this, texts);
5229
- if (texts.length > 0) {
5230
- const term = !this.caseSensitive ? this.term.toLowerCase() : this.term;
5231
- switch (this.mode) {
5232
- case "starts-with":
5233
- {
5234
- const first = texts[0];
5235
- const text = (this.caseSensitive ? first.textContent : first.textContent?.toLowerCase()) ?? "";
5236
- if (text.startsWith(term)) {
5237
- const range = new Range();
5238
- range.setStart(first, 0);
5239
- range.setEnd(first, term.length);
5240
- __classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f").push(range);
5241
- }
5242
- }
5243
- break;
5244
- case "ends-with":
5245
- {
5246
- const last = texts[texts.length - 1];
5247
- const text = (this.caseSensitive ? last.textContent : last.textContent?.toLowerCase()) ?? "";
5248
- if (text.endsWith(term)) {
5249
- const start = text.length - term.length;
5250
- const end = start + term.length;
5251
- const range = new Range();
5252
- range.setStart(last, start);
5253
- range.setEnd(last, end);
5254
- __classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f").push(range);
5255
- }
5256
- }
5257
- break;
5258
- case "contains":
5259
- __classPrivateFieldSet(this, _M3eTextHighlightElement_ranges, texts.map(x => {
5260
- return {
5261
- el: x,
5262
- text: (!this.caseSensitive ? x.textContent?.toLowerCase() : x.textContent) ?? ""
5263
- };
5264
- }).map(({
5265
- el,
5266
- text
5267
- }) => {
5268
- const indices = new Array();
5269
- let startPos = 0;
5270
- while (startPos < text.length) {
5271
- const index = text.indexOf(term, startPos);
5272
- if (index === -1) break;
5273
- indices.push(index);
5274
- startPos = index + term.length;
5275
- }
5276
- return indices.map(index => {
5277
- const range = new Range();
5278
- range.setStart(el, index);
5279
- range.setEnd(el, index + term.length);
5280
- return range;
5281
- });
5282
- }).flat(), "f");
5283
- break;
5284
- }
5285
- if (__classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f").length > 0) {
5286
- CSS.highlights.set(__classPrivateFieldGet(this, _M3eTextHighlightElement_id, "f"), new Highlight(...__classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f")));
5287
- }
5288
- }
5289
- this.dispatchEvent(new CustomEvent("highlight", {
5290
- detail: [...__classPrivateFieldGet(this, _M3eTextHighlightElement_ranges, "f")],
5291
- bubbles: false,
5292
- composed: false
5293
- }));
5294
- };
5295
- /** The styles of the element. */
5296
- M3eTextHighlightElement.styles = css`:host { display: contents; }`;
5297
- /** @private */
5298
- M3eTextHighlightElement.__nextId = 0;
5299
- __decorate([property({
5300
- type: Boolean,
5301
- reflect: true
5302
- })], M3eTextHighlightElement.prototype, "disabled", void 0);
5303
- __decorate([property()], M3eTextHighlightElement.prototype, "term", void 0);
5304
- __decorate([property({
5305
- attribute: "case-sensitive",
5306
- type: Boolean
5307
- })], M3eTextHighlightElement.prototype, "caseSensitive", void 0);
5308
- __decorate([property()], M3eTextHighlightElement.prototype, "mode", void 0);
5309
- M3eTextHighlightElement = M3eTextHighlightElement_1 = __decorate([customElement("m3e-text-highlight")], M3eTextHighlightElement);
5310
-
5311
- /**
5312
- * An inline container which presents an ellipsis when content overflows.
5313
- *
5314
- * @description
5315
- * The `m3e-text-overflow` component truncates inline content with an ellipsis when it
5316
- * exceeds the available width. It's intended for use inside flex or otherwise
5317
- * constrained containers to preserve layout while providing predictable, single-line
5318
- * truncation behavior for long text.
5319
- *
5320
- * @example
5321
- * A typical usage inside a flex container where the heading and trailing actions are
5322
- * constrained, allowing the center text to truncate with an ellipsis.
5323
- *
5324
- * ```html
5325
- * <div style="display:flex;align-items:center;gap:12px;">
5326
- * <m3e-icon name="menu"></m3e-icon>
5327
- * <m3e-text-overflow>Very long title or breadcrumb that should truncate gracefully</m3e-text-overflow>
5328
- * <m3e-icon name="more_vert"></m3e-icon>
5329
- * </div>
5330
- * ```
5331
- *
5332
- * @tag m3e-text-overflow
5333
- *
5334
- * @slot - Renders the content to truncate with an ellipsis.
5335
- */
5336
- let M3eTextOverflowElement = class M3eTextOverflowElement extends LitElement {
5337
- /** @inheritdoc */
5338
- render() {
5339
- return html`<span class="base"><slot></slot></span>`;
5340
- }
5341
- };
5342
- /** The styles of the element. */
5343
- M3eTextOverflowElement.styles = css`:host { flex: 1 1 auto; display: inline-flex; align-items: center; flex-wrap: nowrap; min-width: 0; } .base { flex: 1 1 auto; display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
5344
- M3eTextOverflowElement = __decorate([customElement("m3e-text-overflow")], M3eTextOverflowElement);
5345
-
5346
- export { ActionElementBase, AnimationLoopController, AttachInternals, Checked, CheckedIndeterminate, ClickOutsideController, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, InertController, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement, MutationController, PressedController, ReadOnly, ReconnectedCallback, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, ScrollLockController, Selected, SuppressInitialAnimation, Touched, VelocityTracker, Vertical, addCustomState, checkOrSelect, computeCssSize, computeLineCount, customElement, dateConverter, debounce, defaultValue, deleteCustomState, focusWhenReady, forcedColorsActive, formValue, generateClipPaths, getScrollbarWidth, getTextContent, guid, hasAssignedNodes, hasCustomState, hasKeys, interceptProperty, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, registerStyleSheet, renderPseudoLink, resolveElementById, resolveFragmentUrl, resumeAnimation, safeStyleMap, scrollIntoViewIfNeeded, setCustomState, spaceSeparatedStringConverter, updateLabels, validate, waitForUpgrade };
1793
+ export { ConstraintValidation, DesignToken, Dirty, DisabledInteractive, Focusable, FormAssociated, FormSubmitter, KeyboardClick, Labelled, LinkButton, ReadOnly, ReconnectedCallback, Required, RequiredConstraintValidation, Selected, SuppressInitialAnimation, Touched, Vertical, addCustomState, checkOrSelect, computeCssSize, computeLineCount, dateConverter, defaultValue, deleteCustomState, focusWhenReady, formValue, generateClipPaths, getScrollbarWidth, getTextContent, guid, hasAssignedNodes, hasCustomState, hasKeys, interceptProperty, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, registerStyleSheet, renderPseudoLink, resolveFragmentUrl, resumeAnimation, scrollIntoViewIfNeeded, setCustomState, spaceSeparatedStringConverter, updateLabels, validate, waitForUpgrade };
5347
1794
  //# sourceMappingURL=core.js.map