morya-ui 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # morya-ui
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### 新功能
6
+
7
+ - add tooltip support for collapsed menu items
8
+
9
+ ### 变更
10
+
11
+ - improve submenu arrow icon and expand behavior
12
+ - update dataset keys from 'mu' to 'm' for consistency
13
+
3
14
  ## 0.2.1
4
15
 
5
16
  ### 破坏性变更
@@ -0,0 +1,27 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ label?: string;
4
+ /** When false, render slot only (expanded menu). */
5
+ active?: boolean;
6
+ /** Suppress while a flyout submenu is open. */
7
+ suspended?: boolean;
8
+ };
9
+ declare var __VLS_8: {}, __VLS_10: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_8) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_10) => any;
14
+ };
15
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ active: boolean;
17
+ suspended: boolean;
18
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
27
+ //# sourceMappingURL=MenuCollapsedTooltip.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuCollapsedTooltip.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuCollapsedTooltip.vue"],"names":[],"mappings":";AAyCA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC;AA4DJ,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAW,CAAE;AAC5C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;YAvEH,OAAO;eAEJ,OAAO;6EAwErB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuNodes.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuNodes.vue"],"names":[],"mappings":";AAmOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAUvC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAsbF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MenuNodes.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuNodes.vue"],"names":[],"mappings":";AAwPA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAWvC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAgeF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,6 +2,8 @@
2
2
  .m-menu {
3
3
  --m-menu-indent: var(--m-space-3);
4
4
  --m-menu-root-indent: var(--m-space-4);
5
+ --m-menu-submenu-gap: var(--m-space-2);
6
+ --m-menu-submenu-inset: var(--m-space-2);
5
7
  --m-menu-item-radius: var(--m-radius-md);
6
8
  --m-menu-color: transparent;
7
9
  --m-menu-item-color-hover: color-mix(
@@ -210,6 +212,12 @@
210
212
  margin-top: 0.25rem;
211
213
  }
212
214
 
215
+ .m-menu--collapsed .m-menu__item .m-tooltip,
216
+ .m-menu--collapsed .m-menu__collapsed-popover .m-tooltip {
217
+ display: flex;
218
+ width: 100%;
219
+ }
220
+
213
221
  .m-menu--collapsed .m-menu__item-content {
214
222
  align-items: center;
215
223
  display: flex;
@@ -368,9 +376,14 @@
368
376
  height: 1rem;
369
377
  justify-content: center;
370
378
  margin-inline-start: 0.25rem;
379
+ transition: transform var(--m-motion-fast) var(--m-motion-ease);
371
380
  width: 1rem;
372
381
  }
373
382
 
383
+ .m-menu__arrow--expanded {
384
+ transform: rotate(90deg);
385
+ }
386
+
374
387
  .m-menu__separator {
375
388
  background: var(--m-color-border);
376
389
  height: 1px;
@@ -378,25 +391,34 @@
378
391
  }
379
392
 
380
393
  .m-menu__submenu {
394
+ display: grid;
395
+ grid-template-rows: 1fr;
396
+ }
397
+
398
+ .m-menu__submenu-inner {
399
+ min-height: 0;
381
400
  overflow: hidden;
401
+ padding-block-start: var(--m-menu-submenu-gap);
402
+ padding-inline-start: var(--m-menu-submenu-inset);
382
403
  }
383
404
 
384
405
  .m-menu-expand-enter-active,
385
406
  .m-menu-expand-leave-active {
407
+ overflow: hidden;
386
408
  transition:
387
- max-height var(--m-motion-normal) var(--m-motion-ease),
409
+ grid-template-rows var(--m-motion-normal) var(--m-motion-ease),
388
410
  opacity var(--m-motion-normal) var(--m-motion-ease);
389
411
  }
390
412
 
391
413
  .m-menu-expand-enter-from,
392
414
  .m-menu-expand-leave-to {
393
- max-height: 0;
415
+ grid-template-rows: 0fr;
394
416
  opacity: 0;
395
417
  }
396
418
 
397
419
  .m-menu-expand-enter-to,
398
420
  .m-menu-expand-leave-from {
399
- max-height: 30rem;
421
+ grid-template-rows: 1fr;
400
422
  opacity: 1;
401
423
  }
402
424
 
@@ -27,7 +27,7 @@ var y = "morya-ui-density", b = ["wex-design-density"], x = [
27
27
  ], S = d(w());
28
28
  function C(e, t) {
29
29
  let n = t ?? (typeof document < "u" ? document.documentElement : void 0);
30
- n && (n.dataset.muDensity = e);
30
+ n && (n.dataset.mDensity = e);
31
31
  }
32
32
  function w() {
33
33
  let e = _(y, b);
@@ -45,11 +45,11 @@ var T = "morya-ui-motion", E = ["wex-design-motion"], D = [
45
45
  ], O = d(M());
46
46
  function k(e, t) {
47
47
  let n = t ?? (typeof document < "u" ? document.documentElement : void 0);
48
- n && (n.dataset.muMotion = e);
48
+ n && (n.dataset.mMotion = e);
49
49
  }
50
50
  function A(e, t) {
51
51
  let n = t ?? (typeof document < "u" ? document.documentElement : void 0);
52
- n && (e === !1 ? n.dataset.muIgnoreReducedMotion = "true" : delete n.dataset.muIgnoreReducedMotion);
52
+ n && (e === !1 ? n.dataset.mIgnoreReducedMotion = "true" : delete n.dataset.mIgnoreReducedMotion);
53
53
  }
54
54
  function j() {
55
55
  return "full";
@@ -114,12 +114,12 @@ var F = ["data-m-density"], I = /* @__PURE__ */ o({
114
114
  x.value.theme === "system" && P(N());
115
115
  }
116
116
  function I() {
117
- typeof document > "u" || (k = document.documentElement.dataset.muIgnoreReducedMotion, A(x.value.respectReducedMotion));
117
+ typeof document > "u" || (k = document.documentElement.dataset.mIgnoreReducedMotion, A(x.value.respectReducedMotion));
118
118
  }
119
119
  function L() {
120
120
  if (!w.value || typeof document > "u") return;
121
121
  let { density: e, zIndex: t, theme: n } = x.value;
122
- e && (E = document.documentElement.dataset.muDensity, C(e)), t != null && (D = document.documentElement.style.getPropertyValue("--m-z-base"), document.documentElement.style.setProperty("--m-z-base", String(t))), n !== void 0 && (O = document.documentElement.dataset.theme, P(n === "system" ? N() : n)), n === "system" && typeof window < "u" && (j?.removeEventListener("change", M), j = window.matchMedia("(prefers-color-scheme: dark)"), j.addEventListener("change", M));
122
+ e && (E = document.documentElement.dataset.mDensity, C(e)), t != null && (D = document.documentElement.style.getPropertyValue("--m-z-base"), document.documentElement.style.setProperty("--m-z-base", String(t))), n !== void 0 && (O = document.documentElement.dataset.theme, P(n === "system" ? N() : n)), n === "system" && typeof window < "u" && (j?.removeEventListener("change", M), j = window.matchMedia("(prefers-color-scheme: dark)"), j.addEventListener("change", M));
123
123
  }
124
124
  return g(() => x.value.respectReducedMotion, I, { immediate: !0 }), g(() => [
125
125
  w.value,
@@ -127,7 +127,7 @@ var F = ["data-m-density"], I = /* @__PURE__ */ o({
127
127
  x.value.zIndex,
128
128
  x.value.theme
129
129
  ], L, { immediate: !0 }), l(() => {
130
- typeof document > "u" || (k !== void 0 && (k ? document.documentElement.dataset.muIgnoreReducedMotion = k : delete document.documentElement.dataset.muIgnoreReducedMotion), w.value && (E !== void 0 && (E ? document.documentElement.dataset.muDensity = E : delete document.documentElement.dataset.muDensity), D !== void 0 && (D ? document.documentElement.style.setProperty("--m-z-base", D) : document.documentElement.style.removeProperty("--m-z-base")), O !== void 0 && (O ? document.documentElement.dataset.theme = O : delete document.documentElement.dataset.theme), j?.removeEventListener("change", M), j = null));
130
+ typeof document > "u" || (k !== void 0 && (k ? document.documentElement.dataset.mIgnoreReducedMotion = k : delete document.documentElement.dataset.mIgnoreReducedMotion), w.value && (E !== void 0 && (E ? document.documentElement.dataset.mDensity = E : delete document.documentElement.dataset.mDensity), D !== void 0 && (D ? document.documentElement.style.setProperty("--m-z-base", D) : document.documentElement.style.removeProperty("--m-z-base")), O !== void 0 && (O ? document.documentElement.dataset.theme = O : delete document.documentElement.dataset.theme), j?.removeEventListener("change", M), j = null));
131
131
  }), (e, t) => (u(), a("div", c(m(v), {
132
132
  class: "m-config-provider",
133
133
  "data-m-density": S.value,