@gradient-ui/core 0.2.1 → 0.4.1
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 +58 -2
- package/dist/GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs +1 -0
- package/dist/GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js +466 -0
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs +1 -0
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js +7015 -0
- package/dist/{default-585QCoXx.js → camelToKebabCase-6qY6WHvl.js} +987 -1194
- package/dist/camelToKebabCase-BQDotaQm.cjs +316 -0
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +55 -51
- package/dist/default-BhuY-A3o.cjs +4 -0
- package/dist/default-OTmCd0Aq.js +131 -0
- package/dist/directives.cjs +1 -1
- package/dist/directives.mjs +6 -5
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +184 -110
- package/dist/mask-BbofdFd4.cjs +1 -0
- package/dist/mask-CZX-I_iy.js +936 -0
- package/dist/material-Ca7ZZAiO.cjs +194 -0
- package/dist/material-okvXHenb.js +1162 -0
- package/dist/materialSurface-BBrP9ltj.js +591 -0
- package/dist/materialSurface-CK8LN_dU.cjs +1 -0
- package/dist/services.cjs +1 -1
- package/dist/services.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/surface-8z3gR7vF.cjs +1 -0
- package/dist/surface-BKu4KfkY.js +288 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +55 -9
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +1 -1
- package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +675 -9
- package/dist/types/components/ui/GAlert/types.d.ts +352 -4
- package/dist/types/components/ui/GAside/GAside.vue.d.ts +7 -5
- package/dist/types/components/ui/GAside/types.d.ts +17 -6
- package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +679 -13
- package/dist/types/components/ui/GBadge/types.d.ts +350 -3
- package/dist/types/components/ui/GButton/GButton.vue.d.ts +357 -27
- package/dist/types/components/ui/GButton/types.d.ts +230 -49
- package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +24 -24
- package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +24 -24
- package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +24 -24
- package/dist/types/components/ui/GChip/GChip.vue.d.ts +295 -25
- package/dist/types/components/ui/GChip/types.d.ts +188 -43
- package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +1 -1
- package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +47 -13
- package/dist/types/components/ui/GExpansion/types.d.ts +284 -22
- package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +220 -7
- package/dist/types/components/ui/GFAB/types.d.ts +122 -3
- package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +15 -15
- package/dist/types/components/ui/GFieldBase/props.d.ts +10 -10
- package/dist/types/components/ui/GForm/GForm.vue.d.ts +156 -0
- package/dist/types/components/ui/GForm/index.d.ts +2 -0
- package/dist/types/components/ui/GForm/types.d.ts +107 -0
- package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +165 -66
- package/dist/types/components/ui/GGradient/GGradientBorderLayer.vue.d.ts +11 -0
- package/dist/types/components/ui/GGradient/index.d.ts +1 -0
- package/dist/types/components/ui/GGradient/types.d.ts +10 -1
- package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +257 -0
- package/dist/types/components/ui/GGradientMaterial/index.d.ts +2 -0
- package/dist/types/components/ui/GGradientMaterial/types.d.ts +140 -0
- package/dist/types/components/ui/GInput/GInput.vue.d.ts +15 -15
- package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +5 -5
- package/dist/types/components/ui/GLoading/types.d.ts +3 -2
- package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +14 -14
- package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +11 -11
- package/dist/types/components/ui/GMenuItem/types.d.ts +4 -4
- package/dist/types/components/ui/GModal/GModal.vue.d.ts +1 -1
- package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +7 -5
- package/dist/types/components/ui/GNavList/types.d.ts +17 -6
- package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +4 -4
- package/dist/types/components/ui/GNavbar/GNavbarItem.vue.d.ts +3 -3
- package/dist/types/components/ui/GNavbar/GNavbarMenu.vue.d.ts +3 -3
- package/dist/types/components/ui/GNavbar/types.d.ts +6 -6
- package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +41 -20
- package/dist/types/components/ui/GProgress/types.d.ts +23 -10
- package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +1 -1
- package/dist/types/components/ui/GSelectItem.vue.d.ts +5 -3
- package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +681 -15
- package/dist/types/components/ui/GSnackbar/types.d.ts +350 -3
- package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +2 -2
- package/dist/types/components/ui/GSquircle/types.d.ts +8 -2
- package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +24 -24
- package/dist/types/components/ui/GTable/GTable.vue.d.ts +191 -0
- package/dist/types/components/ui/GTable/GTableBody.vue.d.ts +69 -0
- package/dist/types/components/ui/GTable/GTableCell.vue.d.ts +35 -0
- package/dist/types/components/ui/GTable/GTableExpandedRow.vue.d.ts +25 -0
- package/dist/types/components/ui/GTable/GTableHead.vue.d.ts +30 -0
- package/dist/types/components/ui/GTable/GTableRow.vue.d.ts +40 -0
- package/dist/types/components/ui/GTable/context.d.ts +25 -0
- package/dist/types/components/ui/GTable/index.d.ts +3 -0
- package/dist/types/components/ui/GTable/types.d.ts +666 -0
- package/dist/types/components/ui/GTable/useTable.d.ts +22 -0
- package/dist/types/components/ui/GTable/useTableExpansion.d.ts +17 -0
- package/dist/types/components/ui/GTable/useTableSpans.d.ts +12 -0
- package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +4 -4
- package/dist/types/components/ui/GTabs/types.d.ts +6 -6
- package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +15 -15
- package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +490 -16
- package/dist/types/components/ui/GToggleButton/types.d.ts +284 -32
- package/dist/types/directives/index.d.ts +2 -0
- package/dist/types/directives/ripple.d.ts +1 -1
- package/dist/types/directives/specular.d.ts +34 -0
- package/dist/types/theme/color.d.ts +11 -0
- package/dist/types/theme/colorSeeds.d.ts +21 -20
- package/dist/types/theme/colorSystem.d.ts +12 -0
- package/dist/types/theme/cssTokens.d.ts +7 -0
- package/dist/types/theme/default.d.ts +26 -80
- package/dist/types/theme/gradient/animation/css.d.ts +12 -0
- package/dist/types/theme/gradient/animation/index.d.ts +1 -0
- package/dist/types/theme/gradient/colorMath.d.ts +3 -0
- package/dist/types/theme/gradient/constants.d.ts +3 -0
- package/dist/types/theme/gradient/core.d.ts +1 -0
- package/dist/types/theme/gradient/effects/index.d.ts +1 -0
- package/dist/types/theme/gradient/effects/morph.d.ts +5 -0
- package/dist/types/theme/gradient/effects/shadow.d.ts +3 -0
- package/dist/types/theme/gradient/formatters/canvas.d.ts +2 -0
- package/dist/types/theme/gradient/formatters/css.d.ts +3 -0
- package/dist/types/theme/gradient/formatters/index.d.ts +1 -0
- package/dist/types/theme/gradient/formatters/svg.d.ts +5 -0
- package/dist/types/theme/gradient/index.d.ts +1 -0
- package/dist/types/theme/gradient/material.d.ts +1 -0
- package/dist/types/theme/gradient/model.d.ts +5 -0
- package/dist/types/theme/gradient/presets.d.ts +158 -0
- package/dist/types/theme/gradient/recipes.d.ts +14 -0
- package/dist/types/theme/gradient/tokens.d.ts +72 -0
- package/dist/types/theme/gradient/types.d.ts +117 -0
- package/dist/types/theme/gradient/utils.d.ts +10 -0
- package/dist/types/theme/gradient.d.ts +1 -0
- package/dist/types/theme/index.d.ts +12 -1
- package/dist/types/theme/palette.d.ts +13 -0
- package/dist/types/theme/scheme.d.ts +2 -0
- package/dist/types/theme/types.d.ts +11 -0
- package/dist/types/use/actionSurface.d.ts +1742 -20
- package/dist/types/use/check/booleanControl.d.ts +9 -9
- package/dist/types/use/check/optionGroup.d.ts +9 -7
- package/dist/types/use/check/types.d.ts +26 -26
- package/dist/types/use/color.d.ts +2 -2
- package/dist/types/use/colorResolver.d.ts +15 -5
- package/dist/types/use/form/context.d.ts +8 -0
- package/dist/types/use/form/control.d.ts +4 -0
- package/dist/types/use/form/props.d.ts +4 -4
- package/dist/types/use/form/textFieldControl.d.ts +1 -1
- package/dist/types/use/glass.d.ts +24 -0
- package/dist/types/use/gradient.d.ts +1759 -43
- package/dist/types/use/gradientGlow.d.ts +4 -4
- package/dist/types/use/gradientMaterial.d.ts +21 -0
- package/dist/types/use/gradientRuntime.d.ts +11 -0
- package/dist/types/use/gradientRuntimeRegistry.d.ts +8 -0
- package/dist/types/use/gradientSurface.d.ts +31 -4
- package/dist/types/use/index.d.ts +9 -0
- package/dist/types/use/input/props.d.ts +11 -11
- package/dist/types/use/material.d.ts +112 -0
- package/dist/types/use/materialSurface.d.ts +376 -0
- package/dist/types/use/surface.d.ts +67 -19
- package/dist/types/use/surfaceColor.d.ts +1 -1
- package/dist/types/use/tagName.d.ts +47 -0
- package/dist/types/use/textarea/props.d.ts +11 -11
- package/dist/types/use/variant.d.ts +1 -1
- package/dist/use.cjs +1 -1
- package/dist/use.mjs +42 -19
- package/dist/useSnackbar-BHQshEZ8.cjs +1 -0
- package/dist/useSnackbar-DeNHZH8v.js +908 -0
- package/package.json +11 -4
- package/dist/GLoading.vue_vue_type_style_index_0_lang-CqbeZChH.cjs +0 -1
- package/dist/GLoading.vue_vue_type_style_index_0_lang-DDqJEYGf.js +0 -691
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-DVKJZfcV.cjs +0 -4
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-hL_S3ZHD.js +0 -5633
- package/dist/camelToKebabCase-BAESShJ1.cjs +0 -1
- package/dist/camelToKebabCase-KgkZ7-1F.js +0 -28
- package/dist/default-BcPApP1Q.cjs +0 -318
- package/dist/icon-0-mbYGMr.cjs +0 -1
- package/dist/icon-BrFRYYf3.js +0 -66
- package/dist/mask-BgaDaVWU.js +0 -816
- package/dist/mask-pzGv8apS.cjs +0 -1
- package/dist/types/theme/changeTone.d.ts +0 -1
- package/dist/types/theme/colorPallete.d.ts +0 -2
- package/dist/types/theme/generateColors.d.ts +0 -1
- package/dist/types/theme/generateGradient.d.ts +0 -9
- package/dist/types/theme/getComplementaryColor.d.ts +0 -1
- package/dist/types/utils/color.d.ts +0 -3
- package/dist/types/utils/colors/normaliseColor.d.ts +0 -5
- package/dist/useSnackbar-CFrWSpt4.cjs +0 -1
- package/dist/useSnackbar-lGrTDbl-.js +0 -763
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
import { defineComponent as U, openBlock as Y, createBlock as q, resolveDynamicComponent as z, normalizeClass as X, computed as i, inject as J, provide as Q, toRef as M, toValue as d, watch as Z, onBeforeUnmount as ee } from "vue";
|
|
2
|
+
import { p as h, g as te, l as P, n as T, o as ae, j as $, c as A, r as D, b as ne, q as re, e as oe, h as ie, s as se, i as le, d as de, k as ce, a as ue } from "./surface-BKu4KfkY.js";
|
|
3
|
+
import "@mdi/js";
|
|
4
|
+
import { p as C, f as w, b as me, h as ge, C as fe } from "./camelToKebabCase-6qY6WHvl.js";
|
|
5
|
+
import { u as he, D as ve } from "./default-OTmCd0Aq.js";
|
|
6
|
+
import { createGradientMaterial as Se } from "@gradient-ui/gradient-engine";
|
|
7
|
+
const we = /* @__PURE__ */ U({
|
|
8
|
+
__name: "MdiIconSet",
|
|
9
|
+
props: {
|
|
10
|
+
icon: {},
|
|
11
|
+
tag: {}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
return (t, a) => (Y(), q(z(e.tag), {
|
|
15
|
+
class: X(["mdi", `mdi-${e.icon}`]),
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, null, 8, ["class"]));
|
|
18
|
+
}
|
|
19
|
+
}), R = Symbol("gradient-icons"), p = {
|
|
20
|
+
defaultSet: "mdi",
|
|
21
|
+
aliases: {},
|
|
22
|
+
sets: {
|
|
23
|
+
mdi: {
|
|
24
|
+
component: we
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function L(e = {}) {
|
|
29
|
+
return {
|
|
30
|
+
defaultSet: e.defaultSet ?? p.defaultSet,
|
|
31
|
+
aliases: {
|
|
32
|
+
...p.aliases,
|
|
33
|
+
...e.aliases ?? {}
|
|
34
|
+
},
|
|
35
|
+
sets: {
|
|
36
|
+
...p.sets,
|
|
37
|
+
...e.sets ?? {}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function ot(e = {}) {
|
|
42
|
+
Q(R, L(e));
|
|
43
|
+
}
|
|
44
|
+
function it(e, t = {}) {
|
|
45
|
+
e.provide(R, L(t));
|
|
46
|
+
}
|
|
47
|
+
function pe() {
|
|
48
|
+
return J(R, p);
|
|
49
|
+
}
|
|
50
|
+
function st(e) {
|
|
51
|
+
const t = pe();
|
|
52
|
+
return i(() => {
|
|
53
|
+
let a = e() ?? "";
|
|
54
|
+
if (a.startsWith("$")) {
|
|
55
|
+
const s = a.slice(1);
|
|
56
|
+
a = t.aliases[s] ?? a;
|
|
57
|
+
}
|
|
58
|
+
const [r, n] = a.includes(":") ? a.split(":", 2) : [t.defaultSet, a], o = t.sets[r] ?? t.sets[t.defaultSet];
|
|
59
|
+
return {
|
|
60
|
+
icon: n ?? a,
|
|
61
|
+
component: o.component
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const ye = h({
|
|
66
|
+
placement: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "bottom"
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
function _e(e, t) {
|
|
72
|
+
return i(() => `${t}_${e.placement}`);
|
|
73
|
+
}
|
|
74
|
+
const be = h({
|
|
75
|
+
active: Boolean,
|
|
76
|
+
...P(),
|
|
77
|
+
glow: [Boolean, Number, String],
|
|
78
|
+
animateGlow: Boolean,
|
|
79
|
+
shadow: Boolean,
|
|
80
|
+
...te()
|
|
81
|
+
});
|
|
82
|
+
function lt(e, t = "g-gradient") {
|
|
83
|
+
const a = T(e, t), r = ae(e, t);
|
|
84
|
+
return {
|
|
85
|
+
glowClasses: i(() => ({
|
|
86
|
+
[a.value]: !0,
|
|
87
|
+
[r.value]: !0,
|
|
88
|
+
[`${t}_active`]: e.active,
|
|
89
|
+
[`${t}_glow`]: e.glow,
|
|
90
|
+
[`${t}_animate-glow`]: e.animateGlow,
|
|
91
|
+
[`${t}_shadow`]: e.shadow
|
|
92
|
+
}))
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const Me = h({
|
|
96
|
+
rootTag: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: "div"
|
|
99
|
+
},
|
|
100
|
+
interactive: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: !0
|
|
103
|
+
},
|
|
104
|
+
borderRadius: {
|
|
105
|
+
type: [Number, String],
|
|
106
|
+
default: 4
|
|
107
|
+
},
|
|
108
|
+
inheritWidth: Boolean,
|
|
109
|
+
surfaceFill: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: "transparent"
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
function dt(e) {
|
|
115
|
+
const t = $(M(e, "borderRadius")), a = i(
|
|
116
|
+
() => `g-gradient_surface-${e.surfaceFill}`
|
|
117
|
+
);
|
|
118
|
+
return {
|
|
119
|
+
interactionClass: i(
|
|
120
|
+
() => e.interactive ? "g-gradient_interactive" : ""
|
|
121
|
+
),
|
|
122
|
+
surfaceBorderRadius: t,
|
|
123
|
+
surfaceFillClass: a
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const $e = {
|
|
127
|
+
action: "materialAction",
|
|
128
|
+
surface: "materialSurface"
|
|
129
|
+
}, Ce = "var(--g-token-elevation-2)", x = "none", y = "none", I = "none", Re = "#ffffff", Be = "#0d0d12", _ = Object.fromEntries(
|
|
130
|
+
Object.entries(w).map(([e, t]) => [
|
|
131
|
+
ge(e),
|
|
132
|
+
t
|
|
133
|
+
])
|
|
134
|
+
), Ge = new Set(fe), k = {
|
|
135
|
+
error: w.red,
|
|
136
|
+
success: w.green,
|
|
137
|
+
warning: w.orange
|
|
138
|
+
}, ke = (e) => {
|
|
139
|
+
if (e in _) return _[e];
|
|
140
|
+
const t = e.match(/^(.+)-(\d+)$/);
|
|
141
|
+
if (!t) return null;
|
|
142
|
+
const [, a, r] = t, n = _[a], o = Number(r);
|
|
143
|
+
return !n || !Ge.has(o) ? null : me(n)[o];
|
|
144
|
+
}, Ee = (e, t) => e ? C(e) ? e : e === "primary" || e === "main" ? t : e in k ? k[e] : ke(e) : t, b = (e) => {
|
|
145
|
+
const t = e / 255;
|
|
146
|
+
return t <= 0.04045 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
|
|
147
|
+
}, E = (e) => 0.2126 * b(e.r) + 0.7152 * b(e.g) + 0.0722 * b(e.b), Oe = (e, t) => {
|
|
148
|
+
const a = E(e), r = E(t), n = Math.max(a, r), o = Math.min(a, r);
|
|
149
|
+
return (n + 0.05) / (o + 0.05);
|
|
150
|
+
}, Pe = (e) => {
|
|
151
|
+
var u, c, f;
|
|
152
|
+
const t = (u = e.gradient.stops) == null ? void 0 : u.map((m) => {
|
|
153
|
+
const g = C(m.color);
|
|
154
|
+
return g ? { color: g, position: m.position } : null;
|
|
155
|
+
}).filter((m) => m !== null).sort((m, g) => m.position - g.position);
|
|
156
|
+
if (!(t != null && t.length)) return null;
|
|
157
|
+
const a = 50, r = t.findIndex(
|
|
158
|
+
(m) => m.position >= a
|
|
159
|
+
);
|
|
160
|
+
if (r === -1) return ((c = t.at(-1)) == null ? void 0 : c.color) ?? null;
|
|
161
|
+
if (r === 0) return ((f = t[0]) == null ? void 0 : f.color) ?? null;
|
|
162
|
+
const n = t[r - 1], o = t[r], s = o.position - n.position, l = s ? (a - n.position) / s : 0;
|
|
163
|
+
return {
|
|
164
|
+
r: n.color.r + (o.color.r - n.color.r) * l,
|
|
165
|
+
g: n.color.g + (o.color.g - n.color.g) * l,
|
|
166
|
+
b: n.color.b + (o.color.b - n.color.b) * l
|
|
167
|
+
};
|
|
168
|
+
}, Te = (e, t) => {
|
|
169
|
+
const a = Pe(e);
|
|
170
|
+
if (!a) return t;
|
|
171
|
+
const n = [Re, Be].map((o) => {
|
|
172
|
+
const s = C(o);
|
|
173
|
+
return s ? {
|
|
174
|
+
color: o,
|
|
175
|
+
contrast: Oe(s, a)
|
|
176
|
+
} : null;
|
|
177
|
+
}).filter(
|
|
178
|
+
(o) => !!o
|
|
179
|
+
).sort(
|
|
180
|
+
(o, s) => s.contrast - o.contrast
|
|
181
|
+
)[0];
|
|
182
|
+
return (n == null ? void 0 : n.color) ?? t;
|
|
183
|
+
}, Ae = (e, t, a) => ({
|
|
184
|
+
"--g-gradient-material-background": ne(e),
|
|
185
|
+
"--g-gradient-material-color": D(e),
|
|
186
|
+
"--g-gradient-material-foreground": A(e),
|
|
187
|
+
"--g-gradient-material-shadow": t ? Ce : x,
|
|
188
|
+
"--g-gradient-material-drop-shadow": y,
|
|
189
|
+
"--g-gradient-material-filter": y,
|
|
190
|
+
"--g-gradient-material-animation": a ? "var(--g-gradient-animation, none)" : I,
|
|
191
|
+
"--g-gradient-current": "var(--g-gradient-material-background)",
|
|
192
|
+
"--g-gradient-current-shadow": "var(--g-gradient-material-shadow)",
|
|
193
|
+
"--g-gradient-current-filter": "var(--g-gradient-material-filter)",
|
|
194
|
+
"--g-gradient-current-animation": "var(--g-gradient-material-animation)"
|
|
195
|
+
}), De = (e, t, a, r) => {
|
|
196
|
+
var u, c, f, m, g, S, v;
|
|
197
|
+
const n = (c = (u = e.effects) == null ? void 0 : u.boxShadow) == null ? void 0 : c.cssVar, o = (m = (f = e.effects) == null ? void 0 : f.dropShadow) == null ? void 0 : m.cssVar, s = (S = (g = e.effects) == null ? void 0 : g.morph) == null ? void 0 : S.cssVar, l = (v = e.animation) == null ? void 0 : v.cssVar;
|
|
198
|
+
return {
|
|
199
|
+
...e.cssVars,
|
|
200
|
+
"--g-gradient-material-background": `var(${e.gradient.cssVar})`,
|
|
201
|
+
"--g-gradient-material-color": D(r),
|
|
202
|
+
"--g-gradient-material-foreground": Te(
|
|
203
|
+
e,
|
|
204
|
+
A(r)
|
|
205
|
+
),
|
|
206
|
+
"--g-gradient-material-shadow": t && n ? `var(${n})` : x,
|
|
207
|
+
"--g-gradient-material-drop-shadow": t && o ? `var(${o})` : y,
|
|
208
|
+
"--g-gradient-material-filter": t && s ? `var(${s})` : t && o ? `var(${o})` : y,
|
|
209
|
+
"--g-gradient-material-animation": a && l ? `var(${l})` : I,
|
|
210
|
+
"--g-gradient-current": "var(--g-gradient-material-background)",
|
|
211
|
+
"--g-gradient-current-shadow": "var(--g-gradient-material-shadow)",
|
|
212
|
+
"--g-gradient-current-filter": "var(--g-gradient-material-filter)",
|
|
213
|
+
"--g-gradient-current-animation": "var(--g-gradient-material-animation)"
|
|
214
|
+
};
|
|
215
|
+
}, N = (e = {}) => {
|
|
216
|
+
const t = he(), a = i(() => d(e.kind) ?? "surface"), r = i(() => !!d(e.effects)), n = i(() => !!d(e.animations)), o = i(() => d(e.color)), s = i(
|
|
217
|
+
() => Ee(
|
|
218
|
+
o.value,
|
|
219
|
+
(t == null ? void 0 : t.seed.value) ?? ve
|
|
220
|
+
)
|
|
221
|
+
), l = i(() => {
|
|
222
|
+
const c = s.value;
|
|
223
|
+
return c ? Se(c, {
|
|
224
|
+
...d(e.options),
|
|
225
|
+
animation: d(e.animation),
|
|
226
|
+
animations: n.value,
|
|
227
|
+
dropShadow: d(e.dropShadow),
|
|
228
|
+
effects: r.value,
|
|
229
|
+
morph: d(e.morph),
|
|
230
|
+
recipe: d(e.recipe) ?? $e[a.value],
|
|
231
|
+
shadow: d(e.shadow)
|
|
232
|
+
}) : null;
|
|
233
|
+
}), u = i(() => {
|
|
234
|
+
const c = l.value;
|
|
235
|
+
return c ? De(
|
|
236
|
+
c,
|
|
237
|
+
r.value,
|
|
238
|
+
n.value,
|
|
239
|
+
o.value
|
|
240
|
+
) : Ae(
|
|
241
|
+
o.value,
|
|
242
|
+
r.value,
|
|
243
|
+
n.value
|
|
244
|
+
);
|
|
245
|
+
});
|
|
246
|
+
return {
|
|
247
|
+
gradientMaterial: l,
|
|
248
|
+
gradientMaterialStyles: u
|
|
249
|
+
};
|
|
250
|
+
}, Le = h({
|
|
251
|
+
...P(),
|
|
252
|
+
...se(),
|
|
253
|
+
...ie(),
|
|
254
|
+
...ye({
|
|
255
|
+
placement: "center"
|
|
256
|
+
}),
|
|
257
|
+
borderRadius: {
|
|
258
|
+
type: [Number, String],
|
|
259
|
+
default: 4
|
|
260
|
+
},
|
|
261
|
+
borderWidth: {
|
|
262
|
+
type: [Number, String],
|
|
263
|
+
default: 1
|
|
264
|
+
},
|
|
265
|
+
color: String,
|
|
266
|
+
state: String,
|
|
267
|
+
materialKind: {
|
|
268
|
+
type: String,
|
|
269
|
+
default: "action"
|
|
270
|
+
},
|
|
271
|
+
gradientRecipe: String
|
|
272
|
+
}), xe = h({
|
|
273
|
+
...Le(),
|
|
274
|
+
...be(),
|
|
275
|
+
...Me()
|
|
276
|
+
});
|
|
277
|
+
function ct(e) {
|
|
278
|
+
const t = $(M(e, "borderWidth")), a = $(M(e, "borderRadius")), r = i(() => t.value ? `calc(${a.value} + ${t.value})` : a.value), n = T(e, "g-gradient"), o = _e(e, "g-gradient"), s = re(e, "g-gradient"), l = oe(
|
|
279
|
+
() => e.color ?? e.state
|
|
280
|
+
), u = i(() => Number(e.borderWidth) > 0), { gradientMaterial: c, gradientMaterialStyles: f } = N({
|
|
281
|
+
color: () => e.color ?? e.state,
|
|
282
|
+
kind: () => e.materialKind,
|
|
283
|
+
recipe: () => e.gradientRecipe
|
|
284
|
+
}), m = i(() => ({
|
|
285
|
+
[n.value]: !0,
|
|
286
|
+
[o.value]: !0,
|
|
287
|
+
[s.value]: !0,
|
|
288
|
+
"g-gradient_inherit-width": e.inheritWidth,
|
|
289
|
+
[`g-gradient_${e.state}`]: e.state
|
|
290
|
+
})), g = i(() => ({
|
|
291
|
+
...u.value ? f.value : { "--g-gradient-current": l.value },
|
|
292
|
+
"--g-border-radius": a.value,
|
|
293
|
+
"--g-border-width": t.value
|
|
294
|
+
}));
|
|
295
|
+
return {
|
|
296
|
+
borderWidthPx: t,
|
|
297
|
+
borderRadiusPx: a,
|
|
298
|
+
containerBorderRadius: r,
|
|
299
|
+
gradientMaterial: c,
|
|
300
|
+
resolvedGradient: l,
|
|
301
|
+
gradientClasses: m,
|
|
302
|
+
gradientStyles: g
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const Ie = "data-gradient-engine-style", Ne = "data-gradient-engine-svg", Ve = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map(), B = () => typeof document < "u", V = (e, t, a) => {
|
|
306
|
+
const r = e.get(t);
|
|
307
|
+
if (r)
|
|
308
|
+
return r.count += 1, () => {
|
|
309
|
+
r.count -= 1, r.count <= 0 && (r.element.remove(), e.delete(t));
|
|
310
|
+
};
|
|
311
|
+
const n = a();
|
|
312
|
+
return document.head.append(n), e.set(t, {
|
|
313
|
+
count: 1,
|
|
314
|
+
element: n
|
|
315
|
+
}), () => {
|
|
316
|
+
const o = e.get(t);
|
|
317
|
+
o && (o.count -= 1, o.count <= 0 && (o.element.remove(), e.delete(t)));
|
|
318
|
+
};
|
|
319
|
+
}, We = (e, t) => !B() || !t.trim() ? () => {
|
|
320
|
+
} : V(Ve, e, () => {
|
|
321
|
+
const a = document.createElement("style");
|
|
322
|
+
return a.setAttribute(Ie, e), a.textContent = t, a;
|
|
323
|
+
}), je = (e, t) => !B() || !t.trim() ? () => {
|
|
324
|
+
} : V(Fe, e, () => {
|
|
325
|
+
const a = document.createElement("div");
|
|
326
|
+
return a.setAttribute(Ne, e), a.style.position = "absolute", a.style.width = "0", a.style.height = "0", a.style.overflow = "hidden", a.innerHTML = t, a;
|
|
327
|
+
}), He = (e) => {
|
|
328
|
+
var r, n;
|
|
329
|
+
if (!B())
|
|
330
|
+
return {
|
|
331
|
+
dispose: () => {
|
|
332
|
+
},
|
|
333
|
+
id: e.id
|
|
334
|
+
};
|
|
335
|
+
const t = We(e.id, e.cssText), a = (n = (r = e.effects) == null ? void 0 : r.morph) != null && n.svg ? je(`${e.id}-morph`, e.effects.morph.svg) : () => {
|
|
336
|
+
};
|
|
337
|
+
return {
|
|
338
|
+
dispose: () => {
|
|
339
|
+
a(), t();
|
|
340
|
+
},
|
|
341
|
+
id: e.id
|
|
342
|
+
};
|
|
343
|
+
}, Ke = (e = {}) => {
|
|
344
|
+
let t = null;
|
|
345
|
+
const a = i(() => !!d(e.enabled)), r = i(() => d(e.material) ?? null), n = i(
|
|
346
|
+
() => {
|
|
347
|
+
var l, u;
|
|
348
|
+
return !!d(e.morph) && !!((u = (l = r.value) == null ? void 0 : l.morphBlobs) != null && u.length);
|
|
349
|
+
}
|
|
350
|
+
), o = i(
|
|
351
|
+
() => {
|
|
352
|
+
var l;
|
|
353
|
+
return n.value ? ((l = r.value) == null ? void 0 : l.morphBlobs) ?? [] : [];
|
|
354
|
+
}
|
|
355
|
+
), s = () => {
|
|
356
|
+
t == null || t.dispose(), t = null;
|
|
357
|
+
};
|
|
358
|
+
return Z(
|
|
359
|
+
() => {
|
|
360
|
+
var l;
|
|
361
|
+
return [a.value, (l = r.value) == null ? void 0 : l.id];
|
|
362
|
+
},
|
|
363
|
+
() => {
|
|
364
|
+
s(), a.value && r.value && (t = He(r.value));
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
immediate: !0
|
|
368
|
+
}
|
|
369
|
+
), ee(s), {
|
|
370
|
+
morphBlobs: o,
|
|
371
|
+
morphEnabled: n
|
|
372
|
+
};
|
|
373
|
+
}, Ue = (e = "g-material") => {
|
|
374
|
+
const t = i(() => [`${e}__material-glow`]), a = i(() => [
|
|
375
|
+
`${e}__material-glow-base`
|
|
376
|
+
]), r = i(() => [
|
|
377
|
+
`${e}__material-glow-morph`
|
|
378
|
+
]), n = i(() => [
|
|
379
|
+
`${e}__material-glow-morph-blob`
|
|
380
|
+
]), o = i(() => [
|
|
381
|
+
`${e}__material-morph`
|
|
382
|
+
]), s = i(() => [
|
|
383
|
+
`${e}__material-morph-blob`
|
|
384
|
+
]);
|
|
385
|
+
return {
|
|
386
|
+
materialContentClasses: i(() => [
|
|
387
|
+
`${e}__material-content`
|
|
388
|
+
]),
|
|
389
|
+
materialGlowBaseClasses: a,
|
|
390
|
+
materialGlowClasses: t,
|
|
391
|
+
materialGlowMorphBlobClasses: n,
|
|
392
|
+
materialGlowMorphClasses: r,
|
|
393
|
+
materialMorphBlobClasses: s,
|
|
394
|
+
materialMorphClasses: o
|
|
395
|
+
};
|
|
396
|
+
}, Ye = h({
|
|
397
|
+
materialKind: {
|
|
398
|
+
type: String,
|
|
399
|
+
default: "surface"
|
|
400
|
+
},
|
|
401
|
+
gradientRecipe: String,
|
|
402
|
+
borderRadius: {
|
|
403
|
+
type: [Number, String],
|
|
404
|
+
default: 8
|
|
405
|
+
},
|
|
406
|
+
padding: {
|
|
407
|
+
type: [Number, String],
|
|
408
|
+
default: 0
|
|
409
|
+
},
|
|
410
|
+
shadow: Boolean,
|
|
411
|
+
dropShadow: Boolean,
|
|
412
|
+
morph: Boolean,
|
|
413
|
+
animationOptions: Object,
|
|
414
|
+
shadowOptions: Object,
|
|
415
|
+
dropShadowOptions: Object,
|
|
416
|
+
morphOptions: Object
|
|
417
|
+
}), qe = (e) => typeof e == "number" ? `${e}ms` : e, ze = (e) => ({
|
|
418
|
+
"--g-gradient-morph-blob-color": e.color,
|
|
419
|
+
"--g-gradient-morph-x": `${e.dx}%`,
|
|
420
|
+
"--g-gradient-morph-x2": `${e.dx2}%`,
|
|
421
|
+
"--g-gradient-morph-y": `${e.dy}%`,
|
|
422
|
+
"--g-gradient-morph-y2": `${e.dy2}%`,
|
|
423
|
+
"--g-gradient-morph-origin-x": e.originX,
|
|
424
|
+
"--g-gradient-morph-origin-y": e.originY,
|
|
425
|
+
"--g-gradient-morph-animation": e.animationName,
|
|
426
|
+
"--g-gradient-morph-blur": `${e.blur}px`,
|
|
427
|
+
"--g-gradient-morph-opacity": e.opacity,
|
|
428
|
+
"--g-gradient-morph-rotate-mid": `${e.rotateMid}deg`,
|
|
429
|
+
"--g-gradient-morph-rotate-to": `${e.rotateTo}deg`,
|
|
430
|
+
"--g-gradient-morph-scale-mid": e.scaleMid,
|
|
431
|
+
"--g-gradient-morph-scale": e.scaleTo,
|
|
432
|
+
animationDelay: `${e.delay}ms`,
|
|
433
|
+
animationDuration: qe(e.duration),
|
|
434
|
+
left: `${e.x}%`,
|
|
435
|
+
top: `${e.y}%`,
|
|
436
|
+
width: `${e.size}%`
|
|
437
|
+
}), Xe = (e) => typeof e == "object" ? e : e ? {} : void 0, O = (e) => e == null ? "" : typeof e == "number" ? `${e}px` : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e, Je = (e = {}) => {
|
|
438
|
+
const t = i(() => e.baseClass ?? "g-material"), {
|
|
439
|
+
materialContentClasses: a,
|
|
440
|
+
materialGlowBaseClasses: r,
|
|
441
|
+
materialGlowClasses: n,
|
|
442
|
+
materialGlowMorphBlobClasses: o,
|
|
443
|
+
materialGlowMorphClasses: s,
|
|
444
|
+
materialMorphBlobClasses: l,
|
|
445
|
+
materialMorphClasses: u
|
|
446
|
+
} = Ue(t.value), c = i(() => O(d(e.borderRadius))), f = i(() => O(d(e.padding))), m = i(
|
|
447
|
+
() => Xe(d(e.morph))
|
|
448
|
+
), g = i(() => !!m.value), S = i(
|
|
449
|
+
() => !!(d(e.effects) || d(e.shadow) || d(e.dropShadow) || g.value)
|
|
450
|
+
), v = i(() => !!d(e.animations)), { gradientMaterial: G, gradientMaterialStyles: F } = N({
|
|
451
|
+
color: () => d(e.color) ?? d(e.state),
|
|
452
|
+
kind: () => d(e.kind),
|
|
453
|
+
recipe: () => d(e.recipe),
|
|
454
|
+
effects: S,
|
|
455
|
+
animations: v,
|
|
456
|
+
shadow: () => d(e.shadow),
|
|
457
|
+
dropShadow: () => d(e.dropShadow),
|
|
458
|
+
animation: () => d(e.animation),
|
|
459
|
+
morph: m
|
|
460
|
+
}), { morphBlobs: W, morphEnabled: j } = Ke({
|
|
461
|
+
enabled: () => !!(v.value || g.value),
|
|
462
|
+
material: G,
|
|
463
|
+
morph: g
|
|
464
|
+
}), H = i(() => [`${t.value}_surface`]), K = i(() => ({
|
|
465
|
+
...F.value,
|
|
466
|
+
"--g-gradient-material-radius": c.value,
|
|
467
|
+
"--g-gradient-material-padding": f.value
|
|
468
|
+
}));
|
|
469
|
+
return {
|
|
470
|
+
getMorphBlobStyle: ze,
|
|
471
|
+
gradientMaterial: G,
|
|
472
|
+
materialClasses: H,
|
|
473
|
+
materialContentClasses: a,
|
|
474
|
+
materialGlowBaseClasses: r,
|
|
475
|
+
materialGlowClasses: n,
|
|
476
|
+
materialGlowMorphBlobClasses: o,
|
|
477
|
+
materialGlowMorphClasses: s,
|
|
478
|
+
materialMorphBlobClasses: l,
|
|
479
|
+
materialMorphClasses: u,
|
|
480
|
+
materialStyles: K,
|
|
481
|
+
morphBlobs: W,
|
|
482
|
+
morphEnabled: j
|
|
483
|
+
};
|
|
484
|
+
}, ut = h({
|
|
485
|
+
tag: String,
|
|
486
|
+
href: String,
|
|
487
|
+
target: String,
|
|
488
|
+
rel: String
|
|
489
|
+
});
|
|
490
|
+
function Qe(e) {
|
|
491
|
+
const t = i(() => !!e.href && !e.disabled), a = i(
|
|
492
|
+
() => t.value ? {
|
|
493
|
+
href: e.href,
|
|
494
|
+
target: e.target,
|
|
495
|
+
rel: e.rel ?? (e.target === "_blank" ? "noopener noreferrer" : void 0)
|
|
496
|
+
} : {}
|
|
497
|
+
);
|
|
498
|
+
return {
|
|
499
|
+
isLink: t,
|
|
500
|
+
linkAttrs: a
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
function mt(e, t) {
|
|
504
|
+
const { isLink: a, linkAttrs: r } = Qe(e), n = i(
|
|
505
|
+
() => e.tag ?? (a.value ? "a" : t)
|
|
506
|
+
), o = i(() => n.value === "a" && a.value), s = i(
|
|
507
|
+
() => o.value ? r.value : {
|
|
508
|
+
type: n.value === "button" ? "button" : void 0,
|
|
509
|
+
disabled: n.value === "button" ? e.disabled : void 0
|
|
510
|
+
}
|
|
511
|
+
);
|
|
512
|
+
return {
|
|
513
|
+
tagName: n,
|
|
514
|
+
tagAttrs: s
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
const gt = h({
|
|
518
|
+
...Ye(),
|
|
519
|
+
...ue(),
|
|
520
|
+
...xe({
|
|
521
|
+
borderWidth: void 0,
|
|
522
|
+
borderRadius: void 0,
|
|
523
|
+
interactive: !1
|
|
524
|
+
})
|
|
525
|
+
}), ft = (e, t, a = {}) => {
|
|
526
|
+
const { colorStyles: r, resolvedColor: n, resolvedState: o } = le(e), { glassStyles: s } = de(e), l = Je({
|
|
527
|
+
baseClass: t,
|
|
528
|
+
color: n,
|
|
529
|
+
state: o,
|
|
530
|
+
kind: a.kind ?? "surface",
|
|
531
|
+
recipe: () => e.gradientRecipe,
|
|
532
|
+
effects: () => !!(e.variant === "gradient" || e.shadow || e.dropShadow || e.shadowOptions || e.dropShadowOptions || e.morph || e.morphOptions),
|
|
533
|
+
animations: () => !!e.animationOptions,
|
|
534
|
+
shadow: () => e.shadowOptions,
|
|
535
|
+
dropShadow: () => e.dropShadowOptions,
|
|
536
|
+
animation: () => e.animationOptions,
|
|
537
|
+
morph: () => e.morphOptions ?? e.morph
|
|
538
|
+
}), u = i(() => ({
|
|
539
|
+
...r.value,
|
|
540
|
+
...l.materialStyles.value,
|
|
541
|
+
...s.value
|
|
542
|
+
})), c = i(() => ({
|
|
543
|
+
animateGlow: e.animateGlow,
|
|
544
|
+
borderRadius: e.borderRadius,
|
|
545
|
+
borderWidth: e.borderWidth ?? (e.glow || e.animateGlow || e.variant === "outlined" || e.variant === "glass" ? 1 : 0),
|
|
546
|
+
color: n.value,
|
|
547
|
+
glow: e.glow,
|
|
548
|
+
gradientRecipe: e.gradientRecipe,
|
|
549
|
+
inheritWidth: !0,
|
|
550
|
+
interactive: !1,
|
|
551
|
+
placement: e.placement,
|
|
552
|
+
rounded: !1,
|
|
553
|
+
// The material owns elevation; the frame only owns the real border/glow.
|
|
554
|
+
shadow: !1,
|
|
555
|
+
state: o.value,
|
|
556
|
+
surfaceFill: "transparent"
|
|
557
|
+
}));
|
|
558
|
+
return {
|
|
559
|
+
...l,
|
|
560
|
+
...ce(t),
|
|
561
|
+
resolvedColor: n,
|
|
562
|
+
resolvedState: o,
|
|
563
|
+
materialFrameProps: c,
|
|
564
|
+
surfaceStyles: u
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
export {
|
|
568
|
+
gt as a,
|
|
569
|
+
ut as b,
|
|
570
|
+
L as c,
|
|
571
|
+
We as d,
|
|
572
|
+
He as e,
|
|
573
|
+
je as f,
|
|
574
|
+
N as g,
|
|
575
|
+
Ke as h,
|
|
576
|
+
it as i,
|
|
577
|
+
st as j,
|
|
578
|
+
pe as k,
|
|
579
|
+
Je as l,
|
|
580
|
+
Ye as m,
|
|
581
|
+
Ue as n,
|
|
582
|
+
ft as o,
|
|
583
|
+
ot as p,
|
|
584
|
+
mt as q,
|
|
585
|
+
ct as r,
|
|
586
|
+
lt as s,
|
|
587
|
+
dt as t,
|
|
588
|
+
Qe as u,
|
|
589
|
+
xe as v,
|
|
590
|
+
be as w
|
|
591
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),s=require("./surface-8z3gR7vF.cjs");require("@mdi/js");const f=require("./camelToKebabCase-BQDotaQm.cjs"),V=require("./default-BhuY-A3o.cjs"),X=require("@gradient-ui/gradient-engine"),J=a.defineComponent({__name:"MdiIconSet",props:{icon:{},tag:{}},setup(e){return(t,r)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.tag),{class:a.normalizeClass(["mdi",`mdi-${e.icon}`]),"aria-hidden":"true"},null,8,["class"]))}}),G=Symbol("gradient-icons"),S={defaultSet:"mdi",aliases:{},sets:{mdi:{component:J}}};function C(e={}){return{defaultSet:e.defaultSet??S.defaultSet,aliases:{...S.aliases,...e.aliases??{}},sets:{...S.sets,...e.sets??{}}}}function Q(e={}){a.provide(G,C(e))}function Z(e,t={}){e.provide(G,C(t))}function B(){return a.inject(G,S)}function ee(e){const t=B();return a.computed(()=>{let r=e()??"";if(r.startsWith("$")){const l=r.slice(1);r=t.aliases[l]??r}const[o,n]=r.includes(":")?r.split(":",2):[t.defaultSet,r],i=t.sets[o]??t.sets[t.defaultSet];return{icon:n??r,component:i.component}})}const te=s.propsFactory({placement:{type:String,default:"bottom"}});function ae(e,t){return a.computed(()=>`${t}_${e.placement}`)}const O=s.propsFactory({active:Boolean,...s.makeDisabledProps(),glow:[Boolean,Number,String],animateGlow:Boolean,shadow:Boolean,...s.makeStateProps()});function re(e,t="g-gradient"){const r=s.useDisabled(e,t),o=s.useState(e,t);return{glowClasses:a.computed(()=>({[r.value]:!0,[o.value]:!0,[`${t}_active`]:e.active,[`${t}_glow`]:e.glow,[`${t}_animate-glow`]:e.animateGlow,[`${t}_shadow`]:e.shadow}))}}const ne=s.propsFactory({rootTag:{type:String,default:"div"},interactive:{type:Boolean,default:!0},borderRadius:{type:[Number,String],default:4},inheritWidth:Boolean,surfaceFill:{type:String,default:"transparent"}});function oe(e){const t=s.usePx(a.toRef(e,"borderRadius")),r=a.computed(()=>`g-gradient_surface-${e.surfaceFill}`);return{interactionClass:a.computed(()=>e.interactive?"g-gradient_interactive":""),surfaceBorderRadius:t,surfaceFillClass:r}}const ie={action:"materialAction",surface:"materialSurface"},se="var(--g-token-elevation-2)",P="none",w="none",T="none",le="#ffffff",de="#0d0d12",y=Object.fromEntries(Object.entries(f.COLOR_SEEDS).map(([e,t])=>[f.camelToKebabCase(e),t])),ce=new Set(f.COLOR_SHADES),k={error:f.COLOR_SEEDS.red,success:f.COLOR_SEEDS.green,warning:f.COLOR_SEEDS.orange},ue=e=>{if(e in y)return y[e];const t=e.match(/^(.+)-(\d+)$/);if(!t)return null;const[,r,o]=t,n=y[r],i=Number(o);return!n||!ce.has(i)?null:f.createPalette(n)[i]},me=(e,t)=>e?f.parseColor(e)?e:e==="primary"||e==="main"?t:e in k?k[e]:ue(e):t,_=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},$=e=>.2126*_(e.r)+.7152*_(e.g)+.0722*_(e.b),ge=(e,t)=>{const r=$(e),o=$(t),n=Math.max(r,o),i=Math.min(r,o);return(n+.05)/(i+.05)},fe=e=>{var u,c,h;const t=(u=e.gradient.stops)==null?void 0:u.map(m=>{const g=f.parseColor(m.color);return g?{color:g,position:m.position}:null}).filter(m=>m!==null).sort((m,g)=>m.position-g.position);if(!(t!=null&&t.length))return null;const r=50,o=t.findIndex(m=>m.position>=r);if(o===-1)return((c=t.at(-1))==null?void 0:c.color)??null;if(o===0)return((h=t[0])==null?void 0:h.color)??null;const n=t[o-1],i=t[o],l=i.position-n.position,d=l?(r-n.position)/l:0;return{r:n.color.r+(i.color.r-n.color.r)*d,g:n.color.g+(i.color.g-n.color.g)*d,b:n.color.b+(i.color.b-n.color.b)*d}},he=(e,t)=>{const r=fe(e);if(!r)return t;const n=[le,de].map(i=>{const l=f.parseColor(i);return l?{color:i,contrast:ge(l,r)}:null}).filter(i=>!!i).sort((i,l)=>l.contrast-i.contrast)[0];return(n==null?void 0:n.color)??t},ve=(e,t,r)=>({"--g-gradient-material-background":s.resolveGradientValue(e),"--g-gradient-material-color":s.resolveColorValue(e),"--g-gradient-material-foreground":s.resolveOnColorValue(e),"--g-gradient-material-shadow":t?se:P,"--g-gradient-material-drop-shadow":w,"--g-gradient-material-filter":w,"--g-gradient-material-animation":r?"var(--g-gradient-animation, none)":T,"--g-gradient-current":"var(--g-gradient-material-background)","--g-gradient-current-shadow":"var(--g-gradient-material-shadow)","--g-gradient-current-filter":"var(--g-gradient-material-filter)","--g-gradient-current-animation":"var(--g-gradient-material-animation)"}),pe=(e,t,r,o)=>{var u,c,h,m,g,p,v;const n=(c=(u=e.effects)==null?void 0:u.boxShadow)==null?void 0:c.cssVar,i=(m=(h=e.effects)==null?void 0:h.dropShadow)==null?void 0:m.cssVar,l=(p=(g=e.effects)==null?void 0:g.morph)==null?void 0:p.cssVar,d=(v=e.animation)==null?void 0:v.cssVar;return{...e.cssVars,"--g-gradient-material-background":`var(${e.gradient.cssVar})`,"--g-gradient-material-color":s.resolveColorValue(o),"--g-gradient-material-foreground":he(e,s.resolveOnColorValue(o)),"--g-gradient-material-shadow":t&&n?`var(${n})`:P,"--g-gradient-material-drop-shadow":t&&i?`var(${i})`:w,"--g-gradient-material-filter":t&&l?`var(${l})`:t&&i?`var(${i})`:w,"--g-gradient-material-animation":r&&d?`var(${d})`:T,"--g-gradient-current":"var(--g-gradient-material-background)","--g-gradient-current-shadow":"var(--g-gradient-material-shadow)","--g-gradient-current-filter":"var(--g-gradient-material-filter)","--g-gradient-current-animation":"var(--g-gradient-material-animation)"}},M=(e={})=>{const t=V.useTheme(),r=a.computed(()=>a.toValue(e.kind)??"surface"),o=a.computed(()=>!!a.toValue(e.effects)),n=a.computed(()=>!!a.toValue(e.animations)),i=a.computed(()=>a.toValue(e.color)),l=a.computed(()=>me(i.value,(t==null?void 0:t.seed.value)??V.DEFAULT_SEED)),d=a.computed(()=>{const c=l.value;return c?X.createGradientMaterial(c,{...a.toValue(e.options),animation:a.toValue(e.animation),animations:n.value,dropShadow:a.toValue(e.dropShadow),effects:o.value,morph:a.toValue(e.morph),recipe:a.toValue(e.recipe)??ie[r.value],shadow:a.toValue(e.shadow)}):null}),u=a.computed(()=>{const c=d.value;return c?pe(c,o.value,n.value,i.value):ve(i.value,o.value,n.value)});return{gradientMaterial:d,gradientMaterialStyles:u}},Se=s.propsFactory({...s.makeDisabledProps(),...s.makeVariantProps(),...s.makeRoundedProps(),...te({placement:"center"}),borderRadius:{type:[Number,String],default:4},borderWidth:{type:[Number,String],default:1},color:String,state:String,materialKind:{type:String,default:"action"},gradientRecipe:String}),L=s.propsFactory({...Se(),...O(),...ne()});function we(e){const t=s.usePx(a.toRef(e,"borderWidth")),r=s.usePx(a.toRef(e,"borderRadius")),o=a.computed(()=>t.value?`calc(${r.value} + ${t.value})`:r.value),n=s.useDisabled(e,"g-gradient"),i=ae(e,"g-gradient"),l=s.useRounded(e,"g-gradient"),d=s.useResolveGradientValue(()=>e.color??e.state),u=a.computed(()=>Number(e.borderWidth)>0),{gradientMaterial:c,gradientMaterialStyles:h}=M({color:()=>e.color??e.state,kind:()=>e.materialKind,recipe:()=>e.gradientRecipe}),m=a.computed(()=>({[n.value]:!0,[i.value]:!0,[l.value]:!0,"g-gradient_inherit-width":e.inheritWidth,[`g-gradient_${e.state}`]:e.state})),g=a.computed(()=>({...u.value?h.value:{"--g-gradient-current":d.value},"--g-border-radius":r.value,"--g-border-width":t.value}));return{borderWidthPx:t,borderRadiusPx:r,containerBorderRadius:o,gradientMaterial:c,resolvedGradient:d,gradientClasses:m,gradientStyles:g}}const ye="data-gradient-engine-style",_e="data-gradient-engine-svg",Ge=new Map,Ce=new Map,R=()=>typeof document<"u",A=(e,t,r)=>{const o=e.get(t);if(o)return o.count+=1,()=>{o.count-=1,o.count<=0&&(o.element.remove(),e.delete(t))};const n=r();return document.head.append(n),e.set(t,{count:1,element:n}),()=>{const i=e.get(t);i&&(i.count-=1,i.count<=0&&(i.element.remove(),e.delete(t)))}},D=(e,t)=>!R()||!t.trim()?()=>{}:A(Ge,e,()=>{const r=document.createElement("style");return r.setAttribute(ye,e),r.textContent=t,r}),I=(e,t)=>!R()||!t.trim()?()=>{}:A(Ce,e,()=>{const r=document.createElement("div");return r.setAttribute(_e,e),r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.overflow="hidden",r.innerHTML=t,r}),x=e=>{var o,n;if(!R())return{dispose:()=>{},id:e.id};const t=D(e.id,e.cssText),r=(n=(o=e.effects)==null?void 0:o.morph)!=null&&n.svg?I(`${e.id}-morph`,e.effects.morph.svg):()=>{};return{dispose:()=>{r(),t()},id:e.id}},N=(e={})=>{let t=null;const r=a.computed(()=>!!a.toValue(e.enabled)),o=a.computed(()=>a.toValue(e.material)??null),n=a.computed(()=>{var d,u;return!!a.toValue(e.morph)&&!!((u=(d=o.value)==null?void 0:d.morphBlobs)!=null&&u.length)}),i=a.computed(()=>{var d;return n.value?((d=o.value)==null?void 0:d.morphBlobs)??[]:[]}),l=()=>{t==null||t.dispose(),t=null};return a.watch(()=>{var d;return[r.value,(d=o.value)==null?void 0:d.id]},()=>{l(),r.value&&o.value&&(t=x(o.value))},{immediate:!0}),a.onBeforeUnmount(l),{morphBlobs:i,morphEnabled:n}},F=(e="g-material")=>{const t=a.computed(()=>[`${e}__material-glow`]),r=a.computed(()=>[`${e}__material-glow-base`]),o=a.computed(()=>[`${e}__material-glow-morph`]),n=a.computed(()=>[`${e}__material-glow-morph-blob`]),i=a.computed(()=>[`${e}__material-morph`]),l=a.computed(()=>[`${e}__material-morph-blob`]);return{materialContentClasses:a.computed(()=>[`${e}__material-content`]),materialGlowBaseClasses:r,materialGlowClasses:t,materialGlowMorphBlobClasses:n,materialGlowMorphClasses:o,materialMorphBlobClasses:l,materialMorphClasses:i}},W=s.propsFactory({materialKind:{type:String,default:"surface"},gradientRecipe:String,borderRadius:{type:[Number,String],default:8},padding:{type:[Number,String],default:0},shadow:Boolean,dropShadow:Boolean,morph:Boolean,animationOptions:Object,shadowOptions:Object,dropShadowOptions:Object,morphOptions:Object}),Me=e=>typeof e=="number"?`${e}ms`:e,Re=e=>({"--g-gradient-morph-blob-color":e.color,"--g-gradient-morph-x":`${e.dx}%`,"--g-gradient-morph-x2":`${e.dx2}%`,"--g-gradient-morph-y":`${e.dy}%`,"--g-gradient-morph-y2":`${e.dy2}%`,"--g-gradient-morph-origin-x":e.originX,"--g-gradient-morph-origin-y":e.originY,"--g-gradient-morph-animation":e.animationName,"--g-gradient-morph-blur":`${e.blur}px`,"--g-gradient-morph-opacity":e.opacity,"--g-gradient-morph-rotate-mid":`${e.rotateMid}deg`,"--g-gradient-morph-rotate-to":`${e.rotateTo}deg`,"--g-gradient-morph-scale-mid":e.scaleMid,"--g-gradient-morph-scale":e.scaleTo,animationDelay:`${e.delay}ms`,animationDuration:Me(e.duration),left:`${e.x}%`,top:`${e.y}%`,width:`${e.size}%`}),be=e=>typeof e=="object"?e:e?{}:void 0,E=e=>e==null?"":typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,j=(e={})=>{const t=a.computed(()=>e.baseClass??"g-material"),{materialContentClasses:r,materialGlowBaseClasses:o,materialGlowClasses:n,materialGlowMorphBlobClasses:i,materialGlowMorphClasses:l,materialMorphBlobClasses:d,materialMorphClasses:u}=F(t.value),c=a.computed(()=>E(a.toValue(e.borderRadius))),h=a.computed(()=>E(a.toValue(e.padding))),m=a.computed(()=>be(a.toValue(e.morph))),g=a.computed(()=>!!m.value),p=a.computed(()=>!!(a.toValue(e.effects)||a.toValue(e.shadow)||a.toValue(e.dropShadow)||g.value)),v=a.computed(()=>!!a.toValue(e.animations)),{gradientMaterial:b,gradientMaterialStyles:q}=M({color:()=>a.toValue(e.color)??a.toValue(e.state),kind:()=>a.toValue(e.kind),recipe:()=>a.toValue(e.recipe),effects:p,animations:v,shadow:()=>a.toValue(e.shadow),dropShadow:()=>a.toValue(e.dropShadow),animation:()=>a.toValue(e.animation),morph:m}),{morphBlobs:H,morphEnabled:U}=N({enabled:()=>!!(v.value||g.value),material:b,morph:g}),Y=a.computed(()=>[`${t.value}_surface`]),z=a.computed(()=>({...q.value,"--g-gradient-material-radius":c.value,"--g-gradient-material-padding":h.value}));return{getMorphBlobStyle:Re,gradientMaterial:b,materialClasses:Y,materialContentClasses:r,materialGlowBaseClasses:o,materialGlowClasses:n,materialGlowMorphBlobClasses:i,materialGlowMorphClasses:l,materialMorphBlobClasses:d,materialMorphClasses:u,materialStyles:z,morphBlobs:H,morphEnabled:U}},Ve=s.propsFactory({tag:String,href:String,target:String,rel:String});function K(e){const t=a.computed(()=>!!e.href&&!e.disabled),r=a.computed(()=>t.value?{href:e.href,target:e.target,rel:e.rel??(e.target==="_blank"?"noopener noreferrer":void 0)}:{});return{isLink:t,linkAttrs:r}}function ke(e,t){const{isLink:r,linkAttrs:o}=K(e),n=a.computed(()=>e.tag??(r.value?"a":t)),i=a.computed(()=>n.value==="a"&&r.value),l=a.computed(()=>i.value?o.value:{type:n.value==="button"?"button":void 0,disabled:n.value==="button"?e.disabled:void 0});return{tagName:n,tagAttrs:l}}const $e=s.propsFactory({...W(),...s.makeGlassProps(),...L({borderWidth:void 0,borderRadius:void 0,interactive:!1})}),Ee=(e,t,r={})=>{const{colorStyles:o,resolvedColor:n,resolvedState:i}=s.useSurfaceColor(e),{glassStyles:l}=s.useGlass(e),d=j({baseClass:t,color:n,state:i,kind:r.kind??"surface",recipe:()=>e.gradientRecipe,effects:()=>!!(e.variant==="gradient"||e.shadow||e.dropShadow||e.shadowOptions||e.dropShadowOptions||e.morph||e.morphOptions),animations:()=>!!e.animationOptions,shadow:()=>e.shadowOptions,dropShadow:()=>e.dropShadowOptions,animation:()=>e.animationOptions,morph:()=>e.morphOptions??e.morph}),u=a.computed(()=>({...o.value,...d.materialStyles.value,...l.value})),c=a.computed(()=>({animateGlow:e.animateGlow,borderRadius:e.borderRadius,borderWidth:e.borderWidth??(e.glow||e.animateGlow||e.variant==="outlined"||e.variant==="glass"?1:0),color:n.value,glow:e.glow,gradientRecipe:e.gradientRecipe,inheritWidth:!0,interactive:!1,placement:e.placement,rounded:!1,shadow:!1,state:i.value,surfaceFill:"transparent"}));return{...d,...s.useSurfaceLayers(t),resolvedColor:n,resolvedState:i,materialFrameProps:c,surfaceStyles:u}};exports.createIcons=C;exports.installIcons=Z;exports.makeGradientGlowProps=O;exports.makeGradientProps=L;exports.makeMaterialProps=W;exports.makeMaterialSurfaceProps=$e;exports.makeTagNameProps=Ve;exports.mountGradientCss=D;exports.mountGradientMaterial=x;exports.mountGradientSvg=I;exports.provideIcons=Q;exports.useAsLink=K;exports.useGradient=we;exports.useGradientGlow=re;exports.useGradientMaterial=M;exports.useGradientRuntime=N;exports.useGradientSurface=oe;exports.useIcon=ee;exports.useIcons=B;exports.useMaterial=j;exports.useMaterialLayers=F;exports.useMaterialSurface=Ee;exports.useTagName=ke;
|
package/dist/services.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useSnackbar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useSnackbar-BHQshEZ8.cjs");exports.useLoading=e.useLoading;exports.useSnackbar=e.useSnackbar;
|
package/dist/services.mjs
CHANGED