@m3e/menu 1.0.0-rc.3 → 1.0.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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ Alternately, you can explicitly reference the `html-custom-data.json` and `css-c
27
27
  }
28
28
  ```
29
29
 
30
- ## 🚀 Browser Usage
30
+ ## 🚀 Native Module Support
31
31
 
32
32
  This package uses [JavaScript Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#module_specifiers). To use it directly in a browser without a bundler, use a module script similar to the following.
33
33
 
@@ -3973,6 +3973,11 @@
3973
3973
  "kind": "javascript-module",
3974
3974
  "path": "../core/src/shared/mixins/Labelled.ts",
3975
3975
  "declarations": [
3976
+ {
3977
+ "kind": "variable",
3978
+ "name": "updateLabels",
3979
+ "description": "A symbol through which to update labels to reflect a control's current state."
3980
+ },
3976
3981
  {
3977
3982
  "kind": "function",
3978
3983
  "name": "isLabelledMixin",
@@ -4022,16 +4027,6 @@
4022
4027
  },
4023
4028
  "description": "The label elements that the element is associated with.",
4024
4029
  "readonly": true
4025
- },
4026
- {
4027
- "kind": "method",
4028
- "name": "[_updateLabels]",
4029
- "privacy": "private",
4030
- "return": {
4031
- "type": {
4032
- "text": "void"
4033
- }
4034
- }
4035
4030
  }
4036
4031
  ],
4037
4032
  "parameters": [
@@ -4046,6 +4041,14 @@
4046
4041
  }
4047
4042
  ],
4048
4043
  "exports": [
4044
+ {
4045
+ "kind": "js",
4046
+ "name": "updateLabels",
4047
+ "declaration": {
4048
+ "name": "updateLabels",
4049
+ "module": "../core/src/shared/mixins/Labelled.ts"
4050
+ }
4051
+ },
4049
4052
  {
4050
4053
  "kind": "js",
4051
4054
  "name": "isLabelledMixin",
package/dist/index.js CHANGED
@@ -688,6 +688,7 @@ let M3eMenuElement = M3eMenuElement_1 = class M3eMenuElement extends Role(LitEle
688
688
  connectedCallback() {
689
689
  super.connectedCallback();
690
690
  this.tabIndex = -1;
691
+ this.classList.add("-no-animate");
691
692
  this.setAttribute("popover", "manual");
692
693
  this.addEventListener("keydown", __classPrivateFieldGet(this, _M3eMenuElement_keyDownHandler, "f"));
693
694
  this.addEventListener("toggle", __classPrivateFieldGet(this, _M3eMenuElement_toggleHandler, "f"));
@@ -798,6 +799,11 @@ let M3eMenuElement = M3eMenuElement_1 = class M3eMenuElement extends Role(LitEle
798
799
  render() {
799
800
  return html `<slot @slotchange="${__classPrivateFieldGet(this, _M3eMenuElement_instances, "m", _M3eMenuElement_handleSlotChange)}"></slot>`;
800
801
  }
802
+ /** @inheritdoc */
803
+ firstUpdated(_changedProperties) {
804
+ super.firstUpdated(_changedProperties);
805
+ requestAnimationFrame(() => this.classList.remove("-no-animate"));
806
+ }
801
807
  };
802
808
  _M3eMenuElement_trigger = new WeakMap();
803
809
  _M3eMenuElement_anchorCleanup = new WeakMap();
@@ -868,6 +874,8 @@ M3eMenuElement.styles = css `
868
874
  box-shadow: var(--m3e-menu-container-elevation, ${DesignToken.elevation.level3});
869
875
  opacity: 0;
870
876
  display: none;
877
+ }
878
+ :host(:not(.-no-animate)) {
871
879
  transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard},
872
880
  transform ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard},
873
881
  overlay ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard} allow-discrete,
@@ -910,7 +918,7 @@ M3eMenuElement.styles = css `
910
918
  }
911
919
  }
912
920
  @media (prefers-reduced-motion) {
913
- :host {
921
+ :host(:not(.-no-animate)) {
914
922
  transition: none;
915
923
  }
916
924
  }