vlite3 1.4.30 → 1.4.32
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/components/Accordion/Accordion.vue.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +3 -2
- package/components/Chart/GanttChart.vue.d.ts +13 -1
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +1185 -607
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +113 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +76 -1
- package/components/Chart/types.js +8 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
- package/components/FilePicker/index.vue.js +2 -4
- package/components/Form/AccordionView.vue2.js +5 -2
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.d.ts +0 -2
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +415 -354
- package/components/Form/FormField.vue.js +175 -196
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +8 -8
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +18 -17
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.d.ts +10 -1
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +271 -170
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/Tabes/tabes.utils.d.ts +14 -0
- package/components/Tabes/tabes.utils.js +26 -0
- package/components/Tabes/types.d.ts +32 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/index.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +415 -387
- package/package.json +3 -2
- package/style.css +1 -1
- package/components/Form/AccordionView.vue.js +0 -222
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function t(e) {
|
|
2
|
+
return Array.isArray(e.menu) && e.menu.length > 0;
|
|
3
|
+
}
|
|
4
|
+
function f(e) {
|
|
5
|
+
return e.value !== void 0 && e.value !== null ? e.value : e.label;
|
|
6
|
+
}
|
|
7
|
+
function u(e, r) {
|
|
8
|
+
if (!e?.length) return !1;
|
|
9
|
+
for (const n of e)
|
|
10
|
+
if (f(n) === r || n.children?.length && u(n.children, r)) return !0;
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
function i(e, r) {
|
|
14
|
+
return t(e) ? e.value === r || u(e.menu, r) : e.value === r;
|
|
15
|
+
}
|
|
16
|
+
function a(e, r) {
|
|
17
|
+
for (const n of e)
|
|
18
|
+
if (i(n, r)) return n.value;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a as getActiveMarkerKey,
|
|
22
|
+
f as getMenuOptionValue,
|
|
23
|
+
t as isMenuTab,
|
|
24
|
+
i as isTabActive,
|
|
25
|
+
u as menuContainsValue
|
|
26
|
+
};
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import { IDropdownOption } from '../../types';
|
|
2
|
+
import { TooltTipPlacement } from 'v-tooltip-lite/types';
|
|
3
|
+
/**
|
|
4
|
+
* Optional Dropdown configuration for a menu tab.
|
|
5
|
+
* Forwards a subset of the existing Dropdown API — no duplicated menu logic.
|
|
6
|
+
*/
|
|
7
|
+
export interface TabesDropdownConfig {
|
|
8
|
+
position?: TooltTipPlacement;
|
|
9
|
+
offset?: [number, number];
|
|
10
|
+
direction?: 'ltr' | 'rtl';
|
|
11
|
+
searchable?: boolean;
|
|
12
|
+
closeOnSelect?: boolean;
|
|
13
|
+
maxHeight?: string;
|
|
14
|
+
minWidth?: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
menuId?: string;
|
|
17
|
+
teleport?: boolean;
|
|
18
|
+
}
|
|
1
19
|
export interface TabesOption {
|
|
2
20
|
label: string;
|
|
3
21
|
labelI18n?: string;
|
|
@@ -9,6 +27,20 @@ export interface TabesOption {
|
|
|
9
27
|
[key: string]: any;
|
|
10
28
|
};
|
|
11
29
|
href?: string;
|
|
30
|
+
/**
|
|
31
|
+
* When provided, this tab becomes a dropdown menu trigger.
|
|
32
|
+
* Opening the menu does not change `v-model`. Selecting a menu item
|
|
33
|
+
* updates `v-model` to that item's value and emits `change` / `menu-select`.
|
|
34
|
+
* Reuses the existing `IDropdownOption` contract from Dropdown.
|
|
35
|
+
*/
|
|
36
|
+
menu?: IDropdownOption[];
|
|
37
|
+
/** Optional Dropdown configuration for this menu tab */
|
|
38
|
+
dropdown?: TabesDropdownConfig;
|
|
12
39
|
}
|
|
13
40
|
export type TabesSize = 'sm' | 'md' | 'lg';
|
|
14
41
|
export type TabesVariant = 'surface' | 'primary' | 'secondary' | 'danger' | 'success' | 'outline' | 'line';
|
|
42
|
+
export type TabesMenuSelectPayload = {
|
|
43
|
+
value: any;
|
|
44
|
+
option?: IDropdownOption;
|
|
45
|
+
tab: TabesOption;
|
|
46
|
+
};
|
|
@@ -14,8 +14,10 @@ declare const __VLS_component: import('vue').DefineComponent<ThemeProviderProps,
|
|
|
14
14
|
borderRadius: number;
|
|
15
15
|
bgColor: string;
|
|
16
16
|
primaryColor: string;
|
|
17
|
+
surfaceColor: string;
|
|
17
18
|
footerBgColor: string;
|
|
18
19
|
baseFontSize: number;
|
|
20
|
+
scaleSpacingWithBaseFontSize: boolean;
|
|
19
21
|
headingScale: number;
|
|
20
22
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
21
23
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,46 +1,52 @@
|
|
|
1
|
-
import { defineComponent as m, computed as o, provide as
|
|
2
|
-
import {
|
|
3
|
-
import { THEME_STYLES_KEY as
|
|
4
|
-
import { isDarkColor as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as m, useId as u, computed as o, provide as v, openBlock as d, createElementBlock as p, normalizeClass as C, unref as h, createBlock as S, resolveDynamicComponent as g, toDisplayString as y, renderSlot as b } from "vue";
|
|
2
|
+
import { getCachedThemeVariables as B, buildThemeStyleBlock as k, buildCardOverrideStyles as T } from "./themeVars.js";
|
|
3
|
+
import { THEME_STYLES_KEY as _ } from "../../composables/useThemeStyles.js";
|
|
4
|
+
import { isDarkColor as E } from "../../utils/colorUtils.js";
|
|
5
|
+
const x = ["data-vlite-theme-provider"], W = /* @__PURE__ */ m({
|
|
6
6
|
__name: "ThemeProvider",
|
|
7
7
|
props: {
|
|
8
8
|
bgColor: { default: void 0 },
|
|
9
|
+
surfaceColor: { default: void 0 },
|
|
9
10
|
primaryColor: { default: void 0 },
|
|
10
11
|
footerBgColor: { default: void 0 },
|
|
11
12
|
baseFontSize: { default: void 0 },
|
|
13
|
+
scaleSpacingWithBaseFontSize: { type: Boolean, default: !1 },
|
|
12
14
|
headingScale: { default: void 0 },
|
|
13
15
|
borderRadius: { default: void 0 },
|
|
14
16
|
maxWidth: { default: void 0 },
|
|
15
17
|
rootClass: { default: void 0 }
|
|
16
18
|
},
|
|
17
19
|
setup(t) {
|
|
18
|
-
const e = t, r = o(() => e.bgColor ?
|
|
19
|
-
() =>
|
|
20
|
-
),
|
|
21
|
-
() => e.bgColor
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const e = t, r = u(), l = `[data-vlite-theme-provider="${r}"]`, a = o(() => e.bgColor ? E(e.bgColor) : !1), i = o(() => B(e)), s = o(
|
|
21
|
+
() => k(i.value, l)
|
|
22
|
+
), n = o(
|
|
23
|
+
() => e.bgColor || e.surfaceColor ? T(
|
|
24
|
+
e.bgColor || "#ffffff",
|
|
25
|
+
a.value,
|
|
26
|
+
l,
|
|
27
|
+
e.surfaceColor,
|
|
28
|
+
e.primaryColor
|
|
29
|
+
) : ""
|
|
30
|
+
), c = o(
|
|
31
|
+
() => [s.value, n.value].filter(Boolean).join(`
|
|
24
32
|
`)
|
|
25
33
|
);
|
|
26
|
-
return
|
|
27
|
-
|
|
34
|
+
return v(_, i), (f, D) => (d(), p("div", {
|
|
35
|
+
"data-vlite-theme-provider": h(r),
|
|
36
|
+
class: C([
|
|
28
37
|
"vlite-theme-provider",
|
|
29
38
|
t.rootClass,
|
|
30
39
|
"transition-colors duration-300",
|
|
31
|
-
{ dark:
|
|
40
|
+
{ dark: a.value }
|
|
32
41
|
])
|
|
33
42
|
}, [
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})),
|
|
40
|
-
g(n.$slots, "default")
|
|
41
|
-
], 2));
|
|
43
|
+
(d(), S(g("style"), {
|
|
44
|
+
textContent: y(c.value)
|
|
45
|
+
}, null, 8, ["textContent"])),
|
|
46
|
+
b(f.$slots, "default")
|
|
47
|
+
], 10, x));
|
|
42
48
|
}
|
|
43
49
|
});
|
|
44
50
|
export {
|
|
45
|
-
|
|
51
|
+
W as default
|
|
46
52
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as ThemeProvider } from './ThemeProvider.vue';
|
|
2
2
|
export type { ThemeProviderProps, ThemeStyles, ThemeMaxWidth } from './types';
|
|
3
|
-
export { buildThemeVariables, buildCardOverrideStyles, buildThemeStyleBlock, } from './themeVars';
|
|
3
|
+
export { buildThemeVariables, getCachedThemeVariables, buildCardOverrideStyles, buildThemeStyleBlock, } from './themeVars';
|
|
@@ -8,7 +8,7 @@ export declare const DEFAULT_MAX_WIDTH = 1440;
|
|
|
8
8
|
* has to inject it as a real `<style>` block (it targets descendant
|
|
9
9
|
* `.bg-card .bg-card` selectors which cannot be expressed as inline variables).
|
|
10
10
|
*/
|
|
11
|
-
export declare function buildCardOverrideStyles(bg: string, isDark: boolean, scope?: string): string;
|
|
11
|
+
export declare function buildCardOverrideStyles(bg: string, isDark: boolean, scope?: string, surfaceColor?: string, primaryColor?: string): string;
|
|
12
12
|
/**
|
|
13
13
|
* Build a `<style>` text block that re-applies every generated CSS custom
|
|
14
14
|
* property with `!important`, scoped to a provider root selector.
|
|
@@ -37,18 +37,6 @@ export declare function buildCardOverrideStyles(bg: string, isDark: boolean, sco
|
|
|
37
37
|
* as `ShopThemeProvider`.
|
|
38
38
|
*/
|
|
39
39
|
export declare function buildThemeStyleBlock(vars: ThemeStyles, selector?: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* Note: We keep `!important` out of the theme variables object itself.
|
|
42
|
-
*
|
|
43
|
-
* However, Vue's DOM patching (`style.setProperty(key, value)`) strictly rejects
|
|
44
|
-
* the `value` argument if it contains `!important`. Thus, any inline style
|
|
45
|
-
* object with `!important` silently fails and drops the styles entirely in SPA
|
|
46
|
-
* environments.
|
|
47
|
-
*
|
|
48
|
-
* Therefore, we provide raw variables (without `!important`) to `useThemeStyles()`
|
|
49
|
-
* consumers, and rely on the `<style>` block generated by `buildThemeStyleBlock`
|
|
50
|
-
* to enforce `!important` overrides across the application.
|
|
51
|
-
*/
|
|
52
40
|
/**
|
|
53
41
|
* Compute the full theme-styles record from a {@link ThemeProviderProps}.
|
|
54
42
|
*
|
|
@@ -57,3 +45,11 @@ export declare function buildThemeStyleBlock(vars: ThemeStyles, selector?: strin
|
|
|
57
45
|
* by `buildThemeStyleBlock` when generating the high-priority style block.
|
|
58
46
|
*/
|
|
59
47
|
export declare function buildThemeVariables(props: ThemeProviderProps): ThemeStyles;
|
|
48
|
+
/**
|
|
49
|
+
* Return a shared, immutable theme map for identical token inputs.
|
|
50
|
+
*
|
|
51
|
+
* Theme providers are commonly repeated in previews and editor canvases. A
|
|
52
|
+
* small LRU cache prevents each instance from rebuilding the same 150+ token
|
|
53
|
+
* record while keeping memory bounded for interactive theme editors.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getCachedThemeVariables(props: ThemeProviderProps): ThemeStyles;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return Number.isFinite(
|
|
5
|
-
},
|
|
6
|
-
const
|
|
7
|
-
return Number.isFinite(
|
|
8
|
-
},
|
|
1
|
+
import { mixColorHex as i, hexToHSL as s } from "../../utils/colorUtils.js";
|
|
2
|
+
const g = 16, y = 1.25, C = 8, L = 1440, _ = 64, d = /* @__PURE__ */ new Map(), $ = (o, l) => {
|
|
3
|
+
const r = Number(o);
|
|
4
|
+
return Number.isFinite(r) && r > 0 ? r : l;
|
|
5
|
+
}, A = (o, l) => {
|
|
6
|
+
const r = Number(o);
|
|
7
|
+
return Number.isFinite(r) && r >= 0 ? r : l;
|
|
8
|
+
}, a = (o) => Number.parseFloat(o.toFixed(8)).toString(), N = [
|
|
9
9
|
"0.5",
|
|
10
10
|
"1",
|
|
11
11
|
"1.5",
|
|
@@ -46,7 +46,7 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
46
46
|
"19",
|
|
47
47
|
"19.5",
|
|
48
48
|
"20"
|
|
49
|
-
],
|
|
49
|
+
], D = {
|
|
50
50
|
1: 0.95,
|
|
51
51
|
"1.5": 0.91,
|
|
52
52
|
2: 0.85,
|
|
@@ -58,7 +58,7 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
58
58
|
6: 0.55,
|
|
59
59
|
7: 0.5,
|
|
60
60
|
8: 0.45
|
|
61
|
-
},
|
|
61
|
+
}, V = {
|
|
62
62
|
"0.5": 1,
|
|
63
63
|
1: 1.03030303,
|
|
64
64
|
"1.5": 1.06060606,
|
|
@@ -99,7 +99,7 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
99
99
|
19: 2.95,
|
|
100
100
|
"19.5": 3,
|
|
101
101
|
20: 3.05
|
|
102
|
-
},
|
|
102
|
+
}, I = [
|
|
103
103
|
["xs", 0.75, 1],
|
|
104
104
|
["sm", 0.875, 1.25],
|
|
105
105
|
["base", 1, 1.5],
|
|
@@ -110,7 +110,7 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
110
110
|
["4xl", 2.25, 2.5],
|
|
111
111
|
["5xl", 3, 3],
|
|
112
112
|
["6xl", 3.75, 3.75]
|
|
113
|
-
],
|
|
113
|
+
], O = {
|
|
114
114
|
"--font-weight-extralight": "200",
|
|
115
115
|
"--font-weight-light": "300",
|
|
116
116
|
"--font-weight-normal": "400",
|
|
@@ -119,35 +119,35 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
119
119
|
"--font-weight-bold": "700",
|
|
120
120
|
"--font-weight-extrabold": "800",
|
|
121
121
|
"--font-weight-black": "900"
|
|
122
|
-
},
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const u =
|
|
126
|
-
|
|
127
|
-
}), Object.entries(
|
|
128
|
-
|
|
122
|
+
}, z = (o, l, r) => {
|
|
123
|
+
const t = l / g;
|
|
124
|
+
o["font-size"] = `${l}px`, o["--font-size-base"] = `${l}px`, I.forEach(([c, e, n]) => {
|
|
125
|
+
const u = e * t;
|
|
126
|
+
o[`--text-${c}`] = `${a(u)}rem`, o[`--text-${c}--line-height`] = n === e ? "1" : `calc(${a(n * t)} / ${a(u)})`;
|
|
127
|
+
}), Object.entries(D).forEach(([c, e]) => {
|
|
128
|
+
o[`--text--fs-${c}`] = `${a(e)}em`;
|
|
129
129
|
});
|
|
130
|
-
const f =
|
|
131
|
-
|
|
132
|
-
const n = 1 + (
|
|
133
|
-
|
|
130
|
+
const f = r / y;
|
|
131
|
+
N.forEach((c) => {
|
|
132
|
+
const n = 1 + (V[c] - 1) * f;
|
|
133
|
+
o[`--text-fs-${c}`] = `${a(n)}em`;
|
|
134
134
|
});
|
|
135
|
-
},
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
if (typeof
|
|
140
|
-
const
|
|
141
|
-
|
|
135
|
+
}, R = (o, l) => {
|
|
136
|
+
const r = l / g;
|
|
137
|
+
o["--radius"] = `${a(r)}rem`, o["--radius-sm"] = `${a(r * 0.8)}rem`, o["--radius-md"] = `${a(r)}rem`, o["--radius-lg"] = `${a(r * 1.34)}rem`, o["--radius-xl"] = `${a(r * 1.6)}rem`, o["--radius-2xl"] = `${a(r * 2)}rem`, o["--radius-3xl"] = `${a(r * 3)}rem`;
|
|
138
|
+
}, U = (o, l) => {
|
|
139
|
+
if (typeof l == "string") {
|
|
140
|
+
const t = l.trim().toLowerCase();
|
|
141
|
+
o["--shop-max-width"] = t === "full" || t === "none" ? "none" : l;
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
if (
|
|
145
|
-
|
|
144
|
+
if (l === 0) {
|
|
145
|
+
o["--shop-max-width"] = "none";
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
},
|
|
148
|
+
const r = $(l ?? void 0, L);
|
|
149
|
+
o["--shop-max-width"] = `${r}px`;
|
|
150
|
+
}, H = {
|
|
151
151
|
danger: {
|
|
152
152
|
light: "#ffeeee",
|
|
153
153
|
default: "#ff3b30",
|
|
@@ -200,7 +200,7 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
200
200
|
pink: { subtle: "#fdebf3", subtleFg: "#be185d", subtleBorder: "#f8c6db" },
|
|
201
201
|
cyan: { subtle: "#E1F8F8", subtleFg: "#0e7490", subtleBorder: "#c2ecf5" },
|
|
202
202
|
chart: ["#6366f1", "#22c55e", "#f59e0b", "#ef4444", "#3b82f6", "#ec4899"]
|
|
203
|
-
},
|
|
203
|
+
}, M = {
|
|
204
204
|
danger: {
|
|
205
205
|
light: "#391413",
|
|
206
206
|
default: "#7F1D1D",
|
|
@@ -253,11 +253,11 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
253
253
|
pink: { subtle: "#2a0f1c", subtleFg: "#f472b6", subtleBorder: "#9d174d" },
|
|
254
254
|
cyan: { subtle: "#0e242a", subtleFg: "#22d3ee", subtleBorder: "#0e7490" },
|
|
255
255
|
chart: ["#818cf8", "#34d399", "#fbbf24", "#fb7185", "#60a5fa", "#f472b6"]
|
|
256
|
-
},
|
|
257
|
-
const
|
|
256
|
+
}, j = (o, l) => {
|
|
257
|
+
const r = l ? M : H;
|
|
258
258
|
["danger", "warning", "info", "success"].forEach((c) => {
|
|
259
|
-
const
|
|
260
|
-
|
|
259
|
+
const e = r[c];
|
|
260
|
+
o[`--color-${c}-light`] = e.light, o[`--color-${c}`] = e.default, o[`--color-${c}-dark`] = e.dark, o[`--color-${c}-fg`] = e.fg, o[`--color-${c}-fg-light`] = e.fgLight, o[`--color-${c}-subtle`] = e.subtle, o[`--color-${c}-subtle-fg`] = e.subtleFg, o[`--color-${c}-subtle-border`] = e.subtleBorder, c === "danger" && (o["--color-destructive"] = e.default, o["--color-destructive-foreground"] = e.fg);
|
|
261
261
|
}), [
|
|
262
262
|
"secondary",
|
|
263
263
|
"purple",
|
|
@@ -267,124 +267,172 @@ const x = 16, k = 1.25, p = 8, F = 1440, g = (r, o) => {
|
|
|
267
267
|
"pink",
|
|
268
268
|
"cyan"
|
|
269
269
|
].forEach((c) => {
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
}),
|
|
273
|
-
|
|
270
|
+
const e = r[c];
|
|
271
|
+
o[`--color-${c}-subtle`] = e.subtle, o[`--color-${c}-subtle-fg`] = e.subtleFg, o[`--color-${c}-subtle-border`] = e.subtleBorder;
|
|
272
|
+
}), r.chart.forEach((c, e) => {
|
|
273
|
+
o[`--color-chart-${e + 1}`] = c;
|
|
274
274
|
});
|
|
275
|
+
}, b = (o, l, r) => {
|
|
276
|
+
const t = p(l, r), f = F(l);
|
|
277
|
+
return `${G(t, o)}${o} {
|
|
278
|
+
background-color: ${f} !important;
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
281
|
+
}, X = (o, l, r) => {
|
|
282
|
+
const t = s(o).l < 50, f = t ? "#ffffff" : "#000000", c = i(o, f, t ? 0.07 : 0.03), e = i(o, f, t ? 0.1 : 0.055), n = i(o, f, t ? 0.04 : 0.015), u = i(o, f, t ? 0.08 : 0.04);
|
|
283
|
+
return [
|
|
284
|
+
b(`${r} .bg-card`, o, l),
|
|
285
|
+
b(`${r} .bg-card-light`, n, l),
|
|
286
|
+
b(`${r} .bg-card .bg-card`, c, l),
|
|
287
|
+
b(`${r} .bg-card .bg-card-light`, u, l),
|
|
288
|
+
b(`${r} .bg-card .bg-card .bg-card`, e, l)
|
|
289
|
+
].join("");
|
|
275
290
|
};
|
|
276
|
-
function
|
|
277
|
-
if (
|
|
278
|
-
|
|
279
|
-
|
|
291
|
+
function Z(o, l, r = ".vlite-theme-provider", t, f) {
|
|
292
|
+
if (t)
|
|
293
|
+
return X(t, f, r);
|
|
294
|
+
if (!o) return "";
|
|
295
|
+
if (l) {
|
|
296
|
+
const u = i(o, "#ffffff", 0.07), w = i(o, "#ffffff", 0.12), m = i(o, "#ffffff", 0.1), E = i(o, "#ffffff", 0.14), x = i(o, "#ffffff", 0.13), S = i(o, "#ffffff", 0.16), k = i(o, "#ffffff", 0.07), B = i(o, "#ffffff", 0.11), h = i(o, "#ffffff", 0.1), T = i(o, "#ffffff", 0.14);
|
|
280
297
|
return `
|
|
281
|
-
${
|
|
282
|
-
--color-body: ${t} !important;
|
|
283
|
-
--color-white: ${t} !important;
|
|
284
|
-
--color-mixture-1: ${n} !important;
|
|
285
|
-
--color-mixture-2: #ffffff !important;
|
|
286
|
-
background-color: ${t} !important;
|
|
287
|
-
}
|
|
288
|
-
${l}.dark .bg-card .bg-card {
|
|
298
|
+
${r}.dark .bg-card {
|
|
289
299
|
--color-body: ${u} !important;
|
|
290
300
|
--color-white: ${u} !important;
|
|
291
|
-
--color-mixture-1: ${
|
|
292
|
-
--color-mixture-2: #
|
|
301
|
+
--color-mixture-1: ${w} !important;
|
|
302
|
+
--color-mixture-2: #ffffff !important;
|
|
293
303
|
background-color: ${u} !important;
|
|
294
304
|
}
|
|
295
|
-
${
|
|
296
|
-
--color-body: ${
|
|
297
|
-
--color-white: ${
|
|
298
|
-
--color-mixture-1: ${
|
|
305
|
+
${r}.dark .bg-card .bg-card {
|
|
306
|
+
--color-body: ${m} !important;
|
|
307
|
+
--color-white: ${m} !important;
|
|
308
|
+
--color-mixture-1: ${E} !important;
|
|
309
|
+
--color-mixture-2: #000000;
|
|
310
|
+
background-color: ${m} !important;
|
|
311
|
+
}
|
|
312
|
+
${r}.dark .bg-card .bg-card .bg-card {
|
|
313
|
+
--color-body: ${x} !important;
|
|
314
|
+
--color-white: ${x} !important;
|
|
315
|
+
--color-mixture-1: ${S} !important;
|
|
299
316
|
--color-mixture-2: #000000;
|
|
300
|
-
background-color: ${
|
|
317
|
+
background-color: ${x} !important;
|
|
301
318
|
}
|
|
302
|
-
${
|
|
303
|
-
--color-body: ${
|
|
304
|
-
--color-white: ${
|
|
305
|
-
--color-mixture-1: ${
|
|
319
|
+
${r}.dark .bg-card-light {
|
|
320
|
+
--color-body: ${k} !important;
|
|
321
|
+
--color-white: ${k} !important;
|
|
322
|
+
--color-mixture-1: ${B} !important;
|
|
306
323
|
--color-mixture-2: #ffffff !important;
|
|
307
|
-
background-color: ${
|
|
324
|
+
background-color: ${k} !important;
|
|
308
325
|
}
|
|
309
|
-
${
|
|
310
|
-
--color-body: ${
|
|
311
|
-
--color-white: ${
|
|
312
|
-
--color-mixture-1: ${
|
|
326
|
+
${r}.dark .bg-card .bg-card-light {
|
|
327
|
+
--color-body: ${h} !important;
|
|
328
|
+
--color-white: ${h} !important;
|
|
329
|
+
--color-mixture-1: ${T} !important;
|
|
313
330
|
--color-mixture-2: #000000;
|
|
314
|
-
background-color: ${
|
|
331
|
+
background-color: ${h} !important;
|
|
315
332
|
}
|
|
316
333
|
`;
|
|
317
334
|
}
|
|
318
|
-
const
|
|
335
|
+
const c = i(o, "#000000", 0.03), e = i(o, "#000000", 0.055), n = i(o, "#000000", 0.09);
|
|
319
336
|
return `
|
|
320
|
-
${
|
|
321
|
-
${
|
|
322
|
-
--color-body: ${
|
|
323
|
-
--color-white: ${
|
|
324
|
-
--color-mixture-1: ${
|
|
337
|
+
${r} .bg-card,
|
|
338
|
+
${r} .bg-card-light {
|
|
339
|
+
--color-body: ${c} !important;
|
|
340
|
+
--color-white: ${c} !important;
|
|
341
|
+
--color-mixture-1: ${c} !important;
|
|
325
342
|
--color-mixture-2: #000000 !important;
|
|
326
|
-
background-color: ${
|
|
343
|
+
background-color: ${c} !important;
|
|
327
344
|
border-color: color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2));
|
|
328
345
|
}
|
|
329
|
-
${
|
|
330
|
-
${
|
|
331
|
-
--color-body: ${
|
|
332
|
-
--color-white: ${
|
|
333
|
-
--color-mixture-1: ${
|
|
346
|
+
${r} .bg-card .bg-card,
|
|
347
|
+
${r} .bg-card-light .bg-card-light {
|
|
348
|
+
--color-body: ${e} !important;
|
|
349
|
+
--color-white: ${e} !important;
|
|
350
|
+
--color-mixture-1: ${e};
|
|
334
351
|
--color-mixture-2: #000000;
|
|
335
|
-
background-color: ${
|
|
352
|
+
background-color: ${e} !important;
|
|
336
353
|
}
|
|
337
|
-
${
|
|
338
|
-
${
|
|
339
|
-
--color-body: ${
|
|
340
|
-
--color-white: ${
|
|
341
|
-
--color-mixture-1: ${
|
|
354
|
+
${r} .bg-card .bg-card .bg-card,
|
|
355
|
+
${r} .bg-card-light .bg-card-light .bg-card-light {
|
|
356
|
+
--color-body: ${n} !important;
|
|
357
|
+
--color-white: ${n} !important;
|
|
358
|
+
--color-mixture-1: ${n};
|
|
342
359
|
--color-mixture-2: #000000;
|
|
343
|
-
background-color: ${
|
|
360
|
+
background-color: ${n} !important;
|
|
344
361
|
}
|
|
345
362
|
`;
|
|
346
363
|
}
|
|
347
|
-
const
|
|
348
|
-
function
|
|
349
|
-
if (!
|
|
350
|
-
const
|
|
351
|
-
for (const [
|
|
352
|
-
if (!
|
|
353
|
-
const c =
|
|
354
|
-
c &&
|
|
355
|
-
c.includes("!important") ? ` ${
|
|
364
|
+
const F = (o) => o.replace(/[{};]/g, "");
|
|
365
|
+
function G(o, l = ".vlite-theme-provider") {
|
|
366
|
+
if (!l) return "";
|
|
367
|
+
const r = [];
|
|
368
|
+
for (const [t, f] of Object.entries(o)) {
|
|
369
|
+
if (!t.startsWith("--") && t !== "font-size") continue;
|
|
370
|
+
const c = F(f);
|
|
371
|
+
c && r.push(
|
|
372
|
+
c.includes("!important") ? ` ${t}: ${c};` : ` ${t}: ${c} !important;`
|
|
356
373
|
);
|
|
357
374
|
}
|
|
358
|
-
return
|
|
359
|
-
${
|
|
375
|
+
return r.length === 0 ? "" : `${l} {
|
|
376
|
+
${r.join(`
|
|
360
377
|
`)}
|
|
361
378
|
}
|
|
362
379
|
`;
|
|
363
380
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
381
|
+
const K = (o, l) => {
|
|
382
|
+
if (o["--color-white"] = l.bgColor ?? "#ffffff", o["--color-black"] = "#000000", l.bgColor) {
|
|
383
|
+
o["--color-background"] = l.bgColor, o["--color-body"] = l.bgColor;
|
|
384
|
+
const r = s(l.bgColor).l < 50;
|
|
385
|
+
r ? (o["--color-mixture-1"] = "#0c0c0c", o["--color-mixture-2"] = "#ffffff", o["--color-white"] = l.bgColor, o["--color-black"] = "#ffffff", o["--color-gray-50"] = "color-mix(in oklab, var(--color-mixture-1) 96.5%, var(--color-mixture-2))", o["--color-gray-100"] = "color-mix(in oklab, var(--color-mixture-1) 94.5%, var(--color-mixture-2))", o["--color-gray-150"] = "color-mix(in oklab, var(--color-mixture-1) 90.5%, var(--color-mixture-2))", o["--color-gray-200"] = "color-mix(in oklab, var(--color-mixture-1) 86.5%, var(--color-mixture-2))", o["--color-gray-250"] = "color-mix(in oklab, var(--color-mixture-1) 82.5%, var(--color-mixture-2))", o["--color-gray-300"] = "color-mix(in oklab, var(--color-mixture-1) 79.5%, var(--color-mixture-2))", o["--color-gray-350"] = "color-mix(in oklab, var(--color-mixture-1) 70%, var(--color-mixture-2))", o["--color-gray-400"] = "color-mix(in oklab, var(--color-mixture-1) 62%, var(--color-mixture-2))", o["--color-gray-500"] = "color-mix(in oklab, var(--color-mixture-1) 49%, var(--color-mixture-2))", o["--color-gray-600"] = "color-mix(in oklab, var(--color-mixture-1) 39%, var(--color-mixture-2))", o["--color-gray-700"] = "color-mix(in oklab, var(--color-mixture-1) 27%, var(--color-mixture-2))", o["--color-gray-800"] = "color-mix(in oklab, var(--color-mixture-1) 17%, var(--color-mixture-2))", o["--color-gray-850"] = "color-mix(in oklab, var(--color-mixture-1) 10%, var(--color-mixture-2))", o["--color-gray-900"] = "color-mix(in oklab, var(--color-mixture-1) 6%, var(--color-mixture-2))", o["--color-gray-950"] = "var(--color-mixture-2)", o["--color-foreground"] = "var(--color-gray-850)", o["--color-border"] = "color-mix(in oklab, var(--color-background) 74%, #ffffff)", o["--color-input"] = "color-mix(in oklab, var(--color-background) 70%, #ffffff)", o["--color-card"] = "color-mix(in oklab, var(--color-background) 94%, #ffffff)", o["--color-card-light"] = "color-mix(in oklab, var(--color-background) 96%, #ffffff)", o["--color-secondary"] = "color-mix(in oklab, var(--color-background) 87.5%, #ffffff)", o["--color-secondary-foreground"] = "var(--color-foreground)", o["--color-muted"] = "color-mix(in oklab, var(--color-background) 92.5%, #ffffff)", o["--color-muted-light"] = "color-mix(in oklab, var(--color-background) 95%, #ffffff)", o["--color-muted-foreground"] = "var(--color-gray-600)", o["--color-accent"] = "color-mix(in oklab, var(--color-background) 90%, #ffffff)", o["--color-accent-foreground"] = "var(--color-foreground)", o["--color-scrollbar"] = "color-mix(in oklab, var(--color-background) 80%, #ffffff)", o["--color-scrollbar-hover"] = "color-mix(in oklab, var(--color-background) 75%, #ffffff)", o["--shadow-sm"] = "none", o["--shadow-DEFAULT"] = "none", o["--shadow-md"] = "none", o["--shadow-lg"] = "none", o["--shadow-xl"] = "none") : (o["--color-mixture-1"] = "#ffffff", o["--color-mixture-2"] = "#000000", o["--color-gray-50"] = "color-mix(in oklab, var(--color-mixture-1) 98%, var(--color-mixture-2))", o["--color-gray-100"] = "color-mix(in oklab, var(--color-mixture-1) 97%, var(--color-mixture-2))", o["--color-gray-150"] = "color-mix(in oklab, var(--color-mixture-1) 96%, var(--color-mixture-2))", o["--color-gray-200"] = "color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2))", o["--color-gray-250"] = "color-mix(in oklab, var(--color-mixture-1) 92%, var(--color-mixture-2))", o["--color-gray-300"] = "color-mix(in oklab, var(--color-mixture-1) 86%, var(--color-mixture-2))", o["--color-gray-350"] = "color-mix(in oklab, var(--color-mixture-1) 80%, var(--color-mixture-2))", o["--color-gray-400"] = "color-mix(in oklab, var(--color-mixture-1) 62%, var(--color-mixture-2))", o["--color-gray-500"] = "color-mix(in oklab, var(--color-mixture-1) 49%, var(--color-mixture-2))", o["--color-gray-600"] = "color-mix(in oklab, var(--color-mixture-1) 39%, var(--color-mixture-2))", o["--color-gray-700"] = "color-mix(in oklab, var(--color-mixture-1) 27%, var(--color-mixture-2))", o["--color-gray-800"] = "color-mix(in oklab, var(--color-mixture-1) 17%, var(--color-mixture-2))", o["--color-gray-850"] = "color-mix(in oklab, var(--color-mixture-1) 10%, var(--color-mixture-2))", o["--color-gray-900"] = "color-mix(in oklab, var(--color-mixture-1) 6%, var(--color-mixture-2))", o["--color-gray-950"] = "var(--color-mixture-2)", o["--color-foreground"] = "var(--color-gray-850)", o["--color-border"] = "color-mix(in oklab, var(--color-background) 88%, #000000)", o["--color-input"] = "color-mix(in oklab, var(--color-background) 87%, #000000)", o["--color-card"] = "color-mix(in oklab, var(--color-background) 96%, #000000)", o["--color-card-light"] = "color-mix(in oklab, var(--color-background) 98%, #000000)", o["--color-secondary"] = "color-mix(in oklab, var(--color-background) 94.8%, #000000)", o["--color-secondary-foreground"] = "var(--color-foreground)", o["--color-muted"] = "color-mix(in oklab, var(--color-background) 94%, #000000)", o["--color-muted-light"] = "color-mix(in oklab, var(--color-background) 97%, #000000)", o["--color-muted-foreground"] = "color-mix(in oklab, var(--color-background) 10%, #000000)", o["--color-accent"] = "color-mix(in oklab, var(--color-background) 95%, #000000)", o["--color-accent-foreground"] = "var(--color-foreground)", o["--color-scrollbar"] = "color-mix(in oklab, var(--color-background) 80%, #000000)", o["--color-scrollbar-hover"] = "color-mix(in oklab, var(--color-background) 75%, #000000)", o["--shadow-sm"] = "rgba(95, 97, 100, 0.07) 0px 15px 90px 0px, rgba(0, 0, 0, 0.02) 0.2px 0.2px 1px 0px", o["--shadow-DEFAULT"] = "rgba(55, 59, 74, 0.074) 0px 10px 55px 3px", o["--shadow-md"] = "var(--shadow-DEFAULT)", o["--shadow-lg"] = "rgba(100, 100, 111, 0.15) 0px 7px 40px -1px", o["--shadow-xl"] = "rgba(0, 0, 0, 0.2) 0px 15px 50px -12px"), j(o, r);
|
|
386
|
+
}
|
|
387
|
+
if (l.primaryColor) {
|
|
388
|
+
o["--color-primary"] = l.primaryColor;
|
|
389
|
+
const { l: r } = s(l.primaryColor), t = r > 50 ? "#171717" : "#fafafa";
|
|
390
|
+
o["--color-primary-foreground"] = t, o["--color-primary-fg"] = t, o["--color-primary-dark"] = `color-mix(in oklab, ${l.primaryColor} 80%, #000000)`, o["--color-primary-light"] = `color-mix(in oklab, ${t} 92%, ${l.primaryColor})`, o["--color-primary-fg-light"] = o["--color-primary-dark"];
|
|
370
391
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
392
|
+
}, P = (o) => {
|
|
393
|
+
o["--tooltip-bg"] = "var(--color-background)", o["--tooltip-text"] = "var(--color-foreground)", o["--tooltip-border"] = "color-mix(in oklab, var(--color-mixture-1) 90%, var(--color-mixture-2))", o["--tooltip-shadow"] = "var(--shadow-DEFAULT)", o["--date-picker-border"] = "var(--color-border)", o["--timer-picker-bg"] = "var(--color-background)", o["--iconPicker-border"] = "var(--color-border)";
|
|
394
|
+
}, p = (o, l) => {
|
|
395
|
+
const r = {};
|
|
396
|
+
return K(r, { bgColor: o, primaryColor: l }), P(r), r;
|
|
397
|
+
};
|
|
398
|
+
function W(o) {
|
|
399
|
+
const l = p(o.bgColor, o.primaryColor);
|
|
400
|
+
o.footerBgColor && (l["--color-footer"] = o.footerBgColor);
|
|
401
|
+
const r = $(o.baseFontSize, g), t = o.scaleSpacingWithBaseFontSize ? 0.25 * (r / g) : 0.25;
|
|
402
|
+
return l["--spacing"] = `${a(t)}rem`, Object.assign(l, O), z(
|
|
403
|
+
l,
|
|
404
|
+
r,
|
|
405
|
+
$(o.headingScale, y)
|
|
406
|
+
), R(l, A(o.borderRadius, C)), U(l, o.maxWidth), l["--tooltip-radius"] = "var(--radius)", l["--tooltip-arrow-size"] = "0.5em", l["--tooltip-z-index"] = "50", l["--date-picker-radius"] = "var(--radius)", l;
|
|
407
|
+
}
|
|
408
|
+
function q(o) {
|
|
409
|
+
const l = JSON.stringify([
|
|
410
|
+
o.bgColor,
|
|
411
|
+
o.surfaceColor,
|
|
412
|
+
o.primaryColor,
|
|
413
|
+
o.footerBgColor,
|
|
414
|
+
o.baseFontSize,
|
|
415
|
+
o.scaleSpacingWithBaseFontSize,
|
|
416
|
+
o.headingScale,
|
|
417
|
+
o.borderRadius,
|
|
418
|
+
o.maxWidth
|
|
419
|
+
]), r = d.get(l);
|
|
420
|
+
if (r)
|
|
421
|
+
return d.delete(l), d.set(l, r), r;
|
|
422
|
+
const t = Object.freeze(W(o));
|
|
423
|
+
if (d.set(l, t), d.size > _) {
|
|
424
|
+
const f = d.keys().next().value;
|
|
425
|
+
f !== void 0 && d.delete(f);
|
|
375
426
|
}
|
|
376
|
-
return
|
|
377
|
-
o,
|
|
378
|
-
g(r.baseFontSize, x),
|
|
379
|
-
g(r.headingScale, k)
|
|
380
|
-
), S(o, w(r.borderRadius, p)), A(o, r.maxWidth), o["--tooltip-bg"] = "var(--color-background)", o["--tooltip-text"] = "var(--color-foreground)", o["--tooltip-border"] = "color-mix(in oklab, var(--color-mixture-1) 90%, var(--color-mixture-2))", o["--tooltip-radius"] = "var(--radius)", o["--tooltip-shadow"] = "var(--shadow-DEFAULT)", o["--tooltip-arrow-size"] = "0.5em", o["--tooltip-z-index"] = "50", o["--date-picker-border"] = "var(--color-border)", o["--date-picker-radius"] = "var(--radius)", o["--timer-picker-bg"] = "var(--color-background)", o["--iconPicker-border"] = "var(--color-border)", o;
|
|
427
|
+
return t;
|
|
381
428
|
}
|
|
382
429
|
export {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
430
|
+
g as DEFAULT_BASE_FONT_SIZE,
|
|
431
|
+
C as DEFAULT_BORDER_RADIUS,
|
|
432
|
+
y as DEFAULT_HEADING_SCALE,
|
|
433
|
+
L as DEFAULT_MAX_WIDTH,
|
|
434
|
+
Z as buildCardOverrideStyles,
|
|
435
|
+
G as buildThemeStyleBlock,
|
|
436
|
+
W as buildThemeVariables,
|
|
437
|
+
q as getCachedThemeVariables
|
|
390
438
|
};
|