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