mood-ui 0.5.0 → 0.5.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/README.md +135 -46
- package/dist/mood-ui.cjs +3 -3
- package/dist/mood-ui.cjs.map +1 -1
- package/dist/mood-ui.css +1 -1
- package/dist/mood-ui.mjs +146 -65
- package/dist/mood-ui.mjs.map +1 -1
- package/package.json +1 -1
package/dist/mood-ui.mjs
CHANGED
|
@@ -3692,13 +3692,18 @@ var Rr = [
|
|
|
3692
3692
|
setup(e, { emit: r }) {
|
|
3693
3693
|
let l = e, u = r, f = O(null);
|
|
3694
3694
|
U(f, (e) => u("update:panelRef", e));
|
|
3695
|
-
let p = Nt(() => l.radius), m = Ft(), h = jt(), g = i(() => Dt(m.value)), _ = i(() =>
|
|
3696
|
-
|
|
3695
|
+
let p = Nt(() => l.radius), m = Ft(), h = jt(), g = i(() => Dt(m.value)), _ = i(() => {
|
|
3696
|
+
let e = h?.value.palettes ? {
|
|
3697
3697
|
...Xe(h.value.palettes),
|
|
3698
3698
|
...Ze(h.value.palettes, dt, vt)
|
|
3699
|
-
} : {},
|
|
3700
|
-
|
|
3701
|
-
|
|
3699
|
+
} : {}, t = h?.value.surfaces ? ot(h.value.surfaces) : {}, n = g.value === "dark" && h?.value.darkSurfaces ? ot(h.value.darkSurfaces) : {};
|
|
3700
|
+
return {
|
|
3701
|
+
...e,
|
|
3702
|
+
...t,
|
|
3703
|
+
...n,
|
|
3704
|
+
...l.style ?? {}
|
|
3705
|
+
};
|
|
3706
|
+
}), y = i(() => {
|
|
3702
3707
|
switch (p.value) {
|
|
3703
3708
|
case "none": return "rounded-none";
|
|
3704
3709
|
case "small": return "rounded-sm";
|
|
@@ -3729,7 +3734,7 @@ var Rr = [
|
|
|
3729
3734
|
_: 3
|
|
3730
3735
|
})]));
|
|
3731
3736
|
}
|
|
3732
|
-
}), [["__scopeId", "data-v-
|
|
3737
|
+
}), [["__scopeId", "data-v-428c90d7"]]), Br = ["for"], Vr = {
|
|
3733
3738
|
key: 0,
|
|
3734
3739
|
"aria-hidden": "true",
|
|
3735
3740
|
class: "text-destructive ml-0.5"
|
|
@@ -9098,7 +9103,7 @@ var Rr = [
|
|
|
9098
9103
|
"tabindex",
|
|
9099
9104
|
"onClick",
|
|
9100
9105
|
"onKeydown"
|
|
9101
|
-
], Wo = { key: 1 }, Go = /* @__PURE__ */ f({
|
|
9106
|
+
], Wo = { key: 1 }, Go = /* @__PURE__ */ dn(/* @__PURE__ */ f({
|
|
9102
9107
|
__name: "Segmented",
|
|
9103
9108
|
props: {
|
|
9104
9109
|
items: {},
|
|
@@ -9118,60 +9123,107 @@ var Rr = [
|
|
|
9118
9123
|
},
|
|
9119
9124
|
emits: ["update:modelValue", "change"],
|
|
9120
9125
|
setup(t, { emit: n }) {
|
|
9121
|
-
let r = t,
|
|
9122
|
-
function
|
|
9126
|
+
let r = t, l = n, u = Pt(() => r.size), d = Nt(() => r.radius), f = Mt(() => r.color), p = O(null), m = O(null), h = O([]);
|
|
9127
|
+
function g(e, t) {
|
|
9128
|
+
h.value[t] = e;
|
|
9129
|
+
}
|
|
9130
|
+
let y = O({
|
|
9131
|
+
transform: "translate3d(0,0,0)",
|
|
9132
|
+
width: "0px",
|
|
9133
|
+
height: "0px",
|
|
9134
|
+
opacity: "0"
|
|
9135
|
+
}), C = !1;
|
|
9136
|
+
function w(e = !0) {
|
|
9137
|
+
let t = r.items.findIndex((e) => e.value === r.modelValue), n = h.value[t];
|
|
9138
|
+
if (!n) return;
|
|
9139
|
+
let i = n.offsetWidth, a = n.offsetHeight;
|
|
9140
|
+
if (i === 0 && a === 0) return;
|
|
9141
|
+
let o = m.value;
|
|
9142
|
+
!e && o && (o.classList.add("segmented-indicator--no-anim"), requestAnimationFrame(() => {
|
|
9143
|
+
requestAnimationFrame(() => o.classList.remove("segmented-indicator--no-anim"));
|
|
9144
|
+
})), y.value = {
|
|
9145
|
+
transform: `translate3d(${n.offsetLeft}px, ${n.offsetTop}px, 0)`,
|
|
9146
|
+
width: `${i}px`,
|
|
9147
|
+
height: `${a}px`,
|
|
9148
|
+
top: "0",
|
|
9149
|
+
opacity: "1"
|
|
9150
|
+
}, C = !0;
|
|
9151
|
+
}
|
|
9152
|
+
let E = null;
|
|
9153
|
+
S(() => {
|
|
9154
|
+
requestAnimationFrame(() => {
|
|
9155
|
+
requestAnimationFrame(() => w(!1));
|
|
9156
|
+
}), typeof ResizeObserver < "u" && p.value && (E = new ResizeObserver(() => w(C)), E.observe(p.value)), typeof window < "u" && window.addEventListener("resize", D);
|
|
9157
|
+
}), x(() => {
|
|
9158
|
+
E?.disconnect(), E = null, typeof window < "u" && window.removeEventListener("resize", D);
|
|
9159
|
+
});
|
|
9160
|
+
function D() {
|
|
9161
|
+
w(!1);
|
|
9162
|
+
}
|
|
9163
|
+
U(() => [
|
|
9164
|
+
r.modelValue,
|
|
9165
|
+
u.value,
|
|
9166
|
+
d.value,
|
|
9167
|
+
f.value,
|
|
9168
|
+
r.fullWidth,
|
|
9169
|
+
r.items.length
|
|
9170
|
+
], () => _(() => w(C)));
|
|
9171
|
+
function A(e) {
|
|
9123
9172
|
return r.modelValue === e.value;
|
|
9124
9173
|
}
|
|
9125
|
-
function
|
|
9126
|
-
e.disabled || r.disabled ||
|
|
9174
|
+
function j(e) {
|
|
9175
|
+
e.disabled || r.disabled || A(e) || (l("update:modelValue", e.value), l("change", e.value));
|
|
9127
9176
|
}
|
|
9128
|
-
function
|
|
9129
|
-
r.disabled || (e.key === "ArrowRight" || e.key === "ArrowDown" ? (e.preventDefault(),
|
|
9177
|
+
function N(e, t) {
|
|
9178
|
+
r.disabled || (e.key === "ArrowRight" || e.key === "ArrowDown" ? (e.preventDefault(), F(t, 1)) : e.key === "ArrowLeft" || e.key === "ArrowUp" ? (e.preventDefault(), F(t, -1)) : (e.key === " " || e.key === "Enter") && (e.preventDefault(), j(t)));
|
|
9130
9179
|
}
|
|
9131
|
-
function
|
|
9180
|
+
function F(e, t) {
|
|
9132
9181
|
let n = r.items.filter((e) => !e.disabled);
|
|
9133
9182
|
if (n.length === 0) return;
|
|
9134
9183
|
let i = n[(n.findIndex((t) => t.value === e.value) + t + n.length) % n.length];
|
|
9135
|
-
i &&
|
|
9184
|
+
i && (j(i), _(() => {
|
|
9185
|
+
let e = r.items.findIndex((e) => e.value === i.value);
|
|
9186
|
+
h.value[e]?.focus();
|
|
9187
|
+
}));
|
|
9136
9188
|
}
|
|
9137
|
-
let
|
|
9138
|
-
switch (
|
|
9189
|
+
let I = i(() => {
|
|
9190
|
+
switch (u.value) {
|
|
9139
9191
|
case "small": return "h-7 px-2.5 text-xs";
|
|
9140
9192
|
case "large": return "h-10 px-4 text-base";
|
|
9141
9193
|
default: return "h-8 px-3 text-sm";
|
|
9142
9194
|
}
|
|
9143
|
-
}),
|
|
9144
|
-
switch (
|
|
9195
|
+
}), L = i(() => {
|
|
9196
|
+
switch (u.value) {
|
|
9145
9197
|
case "small": return "w-3.5 h-3.5";
|
|
9146
9198
|
case "large": return "w-5 h-5";
|
|
9147
9199
|
default: return "w-4 h-4";
|
|
9148
9200
|
}
|
|
9149
|
-
}),
|
|
9150
|
-
switch (
|
|
9201
|
+
}), R = i(() => {
|
|
9202
|
+
switch (d.value) {
|
|
9151
9203
|
case "none": return "rounded-none";
|
|
9152
9204
|
case "small": return "rounded";
|
|
9153
9205
|
case "large": return "rounded-xl";
|
|
9154
9206
|
case "full": return "rounded-full";
|
|
9155
9207
|
default: return "rounded-lg";
|
|
9156
9208
|
}
|
|
9157
|
-
}),
|
|
9158
|
-
switch (
|
|
9209
|
+
}), z = i(() => {
|
|
9210
|
+
switch (d.value) {
|
|
9159
9211
|
case "none": return "rounded-none";
|
|
9160
9212
|
case "small": return "rounded-[3px]";
|
|
9161
9213
|
case "large": return "rounded-lg";
|
|
9162
9214
|
case "full": return "rounded-full";
|
|
9163
9215
|
default: return "rounded-md";
|
|
9164
9216
|
}
|
|
9165
|
-
}),
|
|
9166
|
-
switch (
|
|
9167
|
-
case "primary": return "
|
|
9168
|
-
case "danger": return "
|
|
9169
|
-
case "success": return "
|
|
9170
|
-
case "warning": return "
|
|
9171
|
-
default: return "
|
|
9217
|
+
}), B = i(() => {
|
|
9218
|
+
switch (f.value) {
|
|
9219
|
+
case "primary": return "text-primary font-medium";
|
|
9220
|
+
case "danger": return "text-destructive font-medium";
|
|
9221
|
+
case "success": return "text-success font-medium";
|
|
9222
|
+
case "warning": return "text-warning font-medium";
|
|
9223
|
+
default: return "text-foreground font-medium";
|
|
9172
9224
|
}
|
|
9173
|
-
}),
|
|
9174
|
-
switch (
|
|
9225
|
+
}), V = i(() => {
|
|
9226
|
+
switch (f.value) {
|
|
9175
9227
|
case "primary": return "focus-visible:ring-primary";
|
|
9176
9228
|
case "danger": return "focus-visible:ring-destructive";
|
|
9177
9229
|
case "success": return "focus-visible:ring-success";
|
|
@@ -9180,44 +9232,54 @@ var Rr = [
|
|
|
9180
9232
|
}
|
|
9181
9233
|
});
|
|
9182
9234
|
return (n, r) => (T(), s("div", {
|
|
9235
|
+
ref_key: "trackEl",
|
|
9236
|
+
ref: p,
|
|
9183
9237
|
role: "radiogroup",
|
|
9184
9238
|
"aria-label": t.ariaLabel,
|
|
9185
9239
|
"aria-disabled": t.disabled || void 0,
|
|
9186
9240
|
class: v([
|
|
9187
9241
|
"relative inline-flex items-center p-1 bg-muted gap-0.5",
|
|
9188
|
-
|
|
9242
|
+
R.value,
|
|
9189
9243
|
t.fullWidth ? "w-full" : "",
|
|
9190
9244
|
t.disabled ? "opacity-60 pointer-events-none" : ""
|
|
9191
9245
|
])
|
|
9192
|
-
}, [(
|
|
9246
|
+
}, [c("span", {
|
|
9247
|
+
ref_key: "indicatorEl",
|
|
9248
|
+
ref: m,
|
|
9249
|
+
class: v(["segmented-indicator absolute pointer-events-none", [z.value, "bg-card shadow-sm"]]),
|
|
9250
|
+
style: b(y.value),
|
|
9251
|
+
"aria-hidden": "true"
|
|
9252
|
+
}, null, 6), (T(!0), s(e, null, k(t.items, (e, n) => (T(), s("button", {
|
|
9193
9253
|
key: e.value,
|
|
9254
|
+
ref_for: !0,
|
|
9255
|
+
ref: (e) => g(e, n),
|
|
9194
9256
|
type: "button",
|
|
9195
9257
|
role: "radio",
|
|
9196
|
-
"aria-checked":
|
|
9258
|
+
"aria-checked": A(e) ? "true" : "false",
|
|
9197
9259
|
"aria-label": e.ariaLabel ?? e.label,
|
|
9198
9260
|
"aria-disabled": e.disabled || void 0,
|
|
9199
9261
|
disabled: e.disabled || t.disabled,
|
|
9200
|
-
tabindex:
|
|
9262
|
+
tabindex: A(e) ? 0 : -1,
|
|
9201
9263
|
class: v([
|
|
9202
|
-
"relative inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap",
|
|
9264
|
+
"relative z-10 inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap",
|
|
9203
9265
|
"transition-colors duration-150 ease-out",
|
|
9204
9266
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-muted",
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9267
|
+
V.value,
|
|
9268
|
+
I.value,
|
|
9269
|
+
z.value,
|
|
9208
9270
|
t.fullWidth ? "flex-1" : "",
|
|
9209
9271
|
e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
9210
|
-
|
|
9272
|
+
A(e) ? B.value : "text-muted-foreground hover:text-foreground"
|
|
9211
9273
|
]),
|
|
9212
|
-
onClick: (t) =>
|
|
9213
|
-
onKeydown: (t) =>
|
|
9274
|
+
onClick: (t) => j(e),
|
|
9275
|
+
onKeydown: (t) => N(t, e)
|
|
9214
9276
|
}, [e.icon ? (T(), a(M(e.icon), {
|
|
9215
9277
|
key: 0,
|
|
9216
|
-
class: v(
|
|
9278
|
+
class: v(L.value),
|
|
9217
9279
|
"aria-hidden": "true"
|
|
9218
9280
|
}, null, 8, ["class"])) : o("", !0), e.label ? (T(), s("span", Wo, P(e.label), 1)) : o("", !0)], 42, Uo))), 128))], 10, Ho));
|
|
9219
9281
|
}
|
|
9220
|
-
}), Ko = [
|
|
9282
|
+
}), [["__scopeId", "data-v-e2a0f99a"]]), Ko = [
|
|
9221
9283
|
"role",
|
|
9222
9284
|
"aria-label",
|
|
9223
9285
|
"aria-valuenow",
|
|
@@ -10151,10 +10213,17 @@ var Rr = [
|
|
|
10151
10213
|
"afterLeave"
|
|
10152
10214
|
],
|
|
10153
10215
|
setup(e, { emit: r }) {
|
|
10154
|
-
let l = e, f = r, p = z(), m = i(() => `modo-drawer-${p}-title`), h = i(() => `modo-drawer-${p}-desc`), g = O(null), y = O(null), S = O(null), C = Mt(() => l.color), w = Nt(() => l.radius), E = jt(), D = Ft(), k = i(() => Dt(D.value)), j = i(() =>
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10216
|
+
let l = e, f = r, p = z(), m = i(() => `modo-drawer-${p}-title`), h = i(() => `modo-drawer-${p}-desc`), g = O(null), y = O(null), S = O(null), C = Mt(() => l.color), w = Nt(() => l.radius), E = jt(), D = Ft(), k = i(() => Dt(D.value)), j = i(() => {
|
|
10217
|
+
let e = E?.value.palettes ? {
|
|
10218
|
+
...Xe(E.value.palettes),
|
|
10219
|
+
...Ze(E.value.palettes, dt, vt)
|
|
10220
|
+
} : {}, t = E?.value.surfaces ? ot(E.value.surfaces) : {}, n = k.value === "dark" && E?.value.darkSurfaces ? ot(E.value.darkSurfaces) : {};
|
|
10221
|
+
return {
|
|
10222
|
+
...e,
|
|
10223
|
+
...t,
|
|
10224
|
+
...n
|
|
10225
|
+
};
|
|
10226
|
+
});
|
|
10158
10227
|
function M() {
|
|
10159
10228
|
l.modelValue && (f("update:modelValue", !1), f("close"));
|
|
10160
10229
|
}
|
|
@@ -10557,10 +10626,17 @@ var Rr = [
|
|
|
10557
10626
|
"afterLeave"
|
|
10558
10627
|
],
|
|
10559
10628
|
setup(e, { emit: r }) {
|
|
10560
|
-
let l = e, f = r, p = z(), m = i(() => `modo-modal-${p}-title`), h = i(() => `modo-modal-${p}-desc`), g = O(null), y = O(null), S = O(null), C = Mt(() => l.color), w = Nt(() => l.radius), E = jt(), D = Ft(), k = i(() => Dt(D.value)), j = i(() =>
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10629
|
+
let l = e, f = r, p = z(), m = i(() => `modo-modal-${p}-title`), h = i(() => `modo-modal-${p}-desc`), g = O(null), y = O(null), S = O(null), C = Mt(() => l.color), w = Nt(() => l.radius), E = jt(), D = Ft(), k = i(() => Dt(D.value)), j = i(() => {
|
|
10630
|
+
let e = E?.value.palettes ? {
|
|
10631
|
+
...Xe(E.value.palettes),
|
|
10632
|
+
...Ze(E.value.palettes, dt, vt)
|
|
10633
|
+
} : {}, t = E?.value.surfaces ? ot(E.value.surfaces) : {}, n = k.value === "dark" && E?.value.darkSurfaces ? ot(E.value.darkSurfaces) : {};
|
|
10634
|
+
return {
|
|
10635
|
+
...e,
|
|
10636
|
+
...t,
|
|
10637
|
+
...n
|
|
10638
|
+
};
|
|
10639
|
+
});
|
|
10564
10640
|
function M() {
|
|
10565
10641
|
l.modelValue && (f("update:modelValue", !1), f("close"));
|
|
10566
10642
|
}
|
|
@@ -10949,17 +11025,22 @@ var Rr = [
|
|
|
10949
11025
|
arrowCross: h
|
|
10950
11026
|
};
|
|
10951
11027
|
}
|
|
10952
|
-
let ie = i(() =>
|
|
10953
|
-
|
|
11028
|
+
let ie = i(() => {
|
|
11029
|
+
let e = y?.value.palettes ? {
|
|
10954
11030
|
...Xe(y.value.palettes),
|
|
10955
11031
|
...Ze(y.value.palettes, dt, vt)
|
|
10956
|
-
} : {},
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
11032
|
+
} : {}, t = y?.value.surfaces ? ot(y.value.surfaces) : {}, n = C.value === "dark" && y?.value.darkSurfaces ? ot(y.value.darkSurfaces) : {};
|
|
11033
|
+
return {
|
|
11034
|
+
...e,
|
|
11035
|
+
...t,
|
|
11036
|
+
...n,
|
|
11037
|
+
top: `${ne.value.top}px`,
|
|
11038
|
+
left: `${ne.value.left}px`,
|
|
11039
|
+
maxWidth: `${f.maxWidth}px`,
|
|
11040
|
+
zIndex: "1400",
|
|
11041
|
+
transformOrigin: ae(ne.value.placement)
|
|
11042
|
+
};
|
|
11043
|
+
});
|
|
10963
11044
|
function ae(e) {
|
|
10964
11045
|
let t = e.split("-")[0], n = e.split("-")[1] ?? "center";
|
|
10965
11046
|
switch (t) {
|
|
@@ -12627,7 +12708,7 @@ var Rr = [
|
|
|
12627
12708
|
]))), 128))])])], 12, Rc)) : o("", !0)]);
|
|
12628
12709
|
};
|
|
12629
12710
|
}
|
|
12630
|
-
}), [["__scopeId", "data-v-
|
|
12711
|
+
}), [["__scopeId", "data-v-301ec066"]]), Hc = ["aria-labelledby"], Uc = ["id"], Wc = {
|
|
12631
12712
|
key: 1,
|
|
12632
12713
|
"aria-hidden": "true",
|
|
12633
12714
|
class: "mx-2 my-1 h-px bg-border"
|
|
@@ -15546,7 +15627,7 @@ var mu = (e) => ({
|
|
|
15546
15627
|
}, 8, ["state", "style"])
|
|
15547
15628
|
], 34));
|
|
15548
15629
|
}
|
|
15549
|
-
}), [["__scopeId", "data-v-
|
|
15630
|
+
}), [["__scopeId", "data-v-9efb8568"]]);
|
|
15550
15631
|
//#endregion
|
|
15551
15632
|
//#region src/composables/useAutoScroll.ts
|
|
15552
15633
|
function Bu({ scrollRef: e, enabled: t, zone: n = 40, maxSpeed: r = 12 }) {
|
|
@@ -21350,7 +21431,7 @@ var Ef = ["aria-label"], Df = {
|
|
|
21350
21431
|
c("div", Lp, P(Et.value), 1)
|
|
21351
21432
|
], 38));
|
|
21352
21433
|
}
|
|
21353
|
-
}), [["__scopeId", "data-v-
|
|
21434
|
+
}), [["__scopeId", "data-v-a5b3a28f"]]), Vp = /* @__PURE__ */ f({
|
|
21354
21435
|
name: "TableColumn",
|
|
21355
21436
|
__isTableColumn: !0,
|
|
21356
21437
|
__name: "TableColumn",
|