vlite3 1.4.8 → 1.4.10

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.
Files changed (32) hide show
  1. package/components/Cart/CartVariant2.vue.js +1 -1
  2. package/components/Cart/CartVariant4.vue.js +28 -28
  3. package/components/CategoryManager/CategoryManager.vue2.js +3 -3
  4. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  5. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  6. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  7. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  8. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  9. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +44 -0
  10. package/components/ScaleGenerator/ScaleGenerator.vue.js +110 -0
  11. package/components/ScaleGenerator/ScaleGenerator.vue2.js +4 -0
  12. package/components/ScaleGenerator/index.d.ts +2 -0
  13. package/components/ScaleGenerator/types.d.ts +63 -0
  14. package/components/Screen/ScreenFilter.vue.js +3 -3
  15. package/components/ThemeProvider/ThemeProvider.vue.d.ts +27 -0
  16. package/components/ThemeProvider/ThemeProvider.vue.js +37 -0
  17. package/components/ThemeProvider/ThemeProvider.vue2.js +4 -0
  18. package/components/ThemeProvider/index.d.ts +3 -0
  19. package/components/ThemeProvider/themeVars.d.ts +23 -0
  20. package/components/ThemeProvider/themeVars.js +376 -0
  21. package/components/ThemeProvider/types.d.ts +46 -0
  22. package/composables/useThemeStyles.d.ts +8 -0
  23. package/composables/useThemeStyles.js +9 -0
  24. package/index.d.ts +3 -0
  25. package/index.js +387 -373
  26. package/package.json +1 -1
  27. package/utils/colorUtils.d.ts +41 -0
  28. package/utils/colorUtils.js +36 -0
  29. package/utils/index.d.ts +1 -0
  30. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  32. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -28,7 +28,7 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
28
28
  () => c.value.totals.itemCount ?? c.value.items?.reduce((h, t) => h + (t.quantity || 0), 0) ?? 0
29
29
  );
30
30
  return (h, t) => (a(), s("div", {
31
- class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border max-w-md mx-auto overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
31
+ class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
32
32
  }, [
33
33
  n("div", {
34
34
  class: o(["text-center border-b border-dashed border-border shrink-0", e.compact ? "p-3" : "p-4"])
@@ -1,4 +1,4 @@
1
- import { defineComponent as q, computed as c, openBlock as a, createElementBlock as i, normalizeClass as r, createElementVNode as m, createVNode as v, toDisplayString as b, createCommentVNode as u, unref as z, createBlock as y, Fragment as B, renderList as N, withCtx as k, createTextVNode as C } from "vue";
1
+ import { defineComponent as q, computed as c, openBlock as o, createElementBlock as i, normalizeClass as r, createElementVNode as m, createVNode as v, toDisplayString as b, createCommentVNode as u, unref as z, createBlock as y, Fragment as B, renderList as N, withCtx as k, createTextVNode as C } from "vue";
2
2
  import D from "../Icon.vue.js";
3
3
  import E from "../Price/Price.vue.js";
4
4
  import w from "../Button.vue.js";
@@ -28,11 +28,11 @@ const T = { class: "flex items-center gap-2 min-w-0" }, A = {
28
28
  },
29
29
  emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
30
30
  setup(e, { emit: $ }) {
31
- const p = e, l = $, s = c(() => p.data), g = c(() => p.labels || {}), o = c(() => p.actions || {}), f = c(() => p.features || {}), d = c(() => s.value.empty || !s.value.items || s.value.items.length === 0), S = c(
31
+ const p = e, l = $, s = c(() => p.data), g = c(() => p.labels || {}), n = c(() => p.actions || {}), f = c(() => p.features || {}), d = c(() => s.value.empty || !s.value.items || s.value.items.length === 0), S = c(
32
32
  () => s.value.totals.itemCount ?? s.value.items?.reduce((h, t) => h + (t.quantity || 0), 0) ?? 0
33
33
  );
34
- return (h, t) => (a(), i("div", {
35
- class: r(["v-cart v-cart-v4 flex flex-col bg-background text-foreground border border-border rounded-lg overflow-hidden w-full h-full", [e.containerClass, e.compact ? "max-w-xs" : "max-w-sm"]])
34
+ return (h, t) => (o(), i("div", {
35
+ class: r(["v-cart v-cart-v4 flex flex-col bg-background text-foreground border border-border rounded-lg overflow-hidden w-full h-full", [e.containerClass]])
36
36
  }, [
37
37
  m("div", {
38
38
  class: r(["flex items-center justify-between gap-2 border-b border-border shrink-0", e.compact ? "px-3 py-2" : "px-4 py-2.5"])
@@ -45,9 +45,9 @@ const T = { class: "flex items-center gap-2 min-w-0" }, A = {
45
45
  m("p", {
46
46
  class: r(["font-bold text-foreground truncate", (e.compact, "text-sm")])
47
47
  }, b(s.value.title || g.value.cart || "Cart"), 3),
48
- d.value ? u("", !0) : (a(), i("span", A, b(S.value), 1))
48
+ d.value ? u("", !0) : (o(), i("span", A, b(S.value), 1))
49
49
  ]),
50
- !d.value && !e.compact ? (a(), i("p", F, [
50
+ !d.value && !e.compact ? (o(), i("p", F, [
51
51
  m("span", U, [
52
52
  v(z(E), {
53
53
  value: e.data.totals.grandTotal,
@@ -57,20 +57,20 @@ const T = { class: "flex items-center gap-2 min-w-0" }, A = {
57
57
  ])) : u("", !0)
58
58
  ], 2),
59
59
  m("div", G, [
60
- d.value ? (a(), y(R, {
60
+ d.value ? (o(), y(R, {
61
61
  key: 0,
62
62
  labels: e.labels,
63
63
  compact: !0,
64
- onContinueShopping: t[0] || (t[0] = (n) => l("continue-shopping"))
65
- }, null, 8, ["labels"])) : (a(), i("ul", {
64
+ onContinueShopping: t[0] || (t[0] = (a) => l("continue-shopping"))
65
+ }, null, 8, ["labels"])) : (o(), i("ul", {
66
66
  key: 1,
67
67
  class: r(["divide-y divide-border", e.compact ? "px-3" : "px-4"])
68
68
  }, [
69
- (a(!0), i(B, null, N(e.data.items, (n) => (a(), i("li", {
70
- key: n.id
69
+ (o(!0), i(B, null, N(e.data.items, (a) => (o(), i("li", {
70
+ key: a.id
71
71
  }, [
72
72
  v(L, {
73
- item: n,
73
+ item: a,
74
74
  features: e.features,
75
75
  labels: e.labels,
76
76
  compact: e.compact,
@@ -82,7 +82,7 @@ const T = { class: "flex items-center gap-2 min-w-0" }, A = {
82
82
  ]))), 128))
83
83
  ], 2))
84
84
  ]),
85
- d.value ? u("", !0) : (a(), i("div", {
85
+ d.value ? u("", !0) : (o(), i("div", {
86
86
  key: 0,
87
87
  class: r(["border-t border-border bg-muted/30 shrink-0", e.compact ? "p-3 space-y-2" : "p-4 space-y-3"])
88
88
  }, [
@@ -94,44 +94,44 @@ const T = { class: "flex items-center gap-2 min-w-0" }, A = {
94
94
  coupon: e.data.coupon,
95
95
  variant: "Variant4"
96
96
  }, null, 8, ["totals", "features", "labels", "compact", "coupon"]),
97
- e.features.coupon ? (a(), y(I, {
97
+ e.features.coupon ? (o(), y(I, {
98
98
  key: 0,
99
99
  coupon: e.data.coupon,
100
100
  labels: e.labels,
101
101
  compact: e.compact,
102
102
  readonly: e.data.readonly,
103
- onApply: t[3] || (t[3] = (n) => l("apply-coupon", n)),
104
- onRemove: t[4] || (t[4] = (n) => l("remove-coupon")),
105
- onChange: t[5] || (t[5] = (n) => l("coupon-change", n))
103
+ onApply: t[3] || (t[3] = (a) => l("apply-coupon", a)),
104
+ onRemove: t[4] || (t[4] = (a) => l("remove-coupon")),
105
+ onChange: t[5] || (t[5] = (a) => l("coupon-change", a))
106
106
  }, null, 8, ["coupon", "labels", "compact", "readonly"])) : u("", !0),
107
- o.value.showContinue && f.value.continue || o.value.showContinueShopping && f.value.continueShopping ? (a(), i("div", H, [
108
- o.value.showContinue && f.value.continue ? (a(), y(w, {
107
+ n.value.showContinue && f.value.continue || n.value.showContinueShopping && f.value.continueShopping ? (o(), i("div", H, [
108
+ n.value.showContinue && f.value.continue ? (o(), y(w, {
109
109
  key: 0,
110
110
  variant: "primary",
111
111
  size: e.compact ? "sm" : "md",
112
112
  block: !0,
113
- icon: o.value.continueIcon || "lucide:arrow-right",
114
- disabled: o.value.continueDisabled || d.value,
113
+ icon: n.value.continueIcon || "lucide:arrow-right",
114
+ disabled: n.value.continueDisabled || d.value,
115
115
  class: "w-full",
116
- onClick: t[6] || (t[6] = (n) => l("continue"))
116
+ onClick: t[6] || (t[6] = (a) => l("continue"))
117
117
  }, {
118
118
  default: k(() => [
119
- C(b(o.value.continueLabel || g.value.continue || "Checkout"), 1)
119
+ C(b(n.value.continueLabel || g.value.continue || "Checkout"), 1)
120
120
  ]),
121
121
  _: 1
122
122
  }, 8, ["size", "icon", "disabled"])) : u("", !0),
123
- o.value.showContinueShopping && f.value.continueShopping ? (a(), y(w, {
123
+ n.value.showContinueShopping && f.value.continueShopping ? (o(), y(w, {
124
124
  key: 1,
125
125
  variant: "ghost",
126
126
  size: "sm",
127
127
  block: !0,
128
- icon: o.value.continueShoppingIcon || "lucide:arrow-left",
129
- disabled: o.value.continueShoppingDisabled,
128
+ icon: n.value.continueShoppingIcon || "lucide:arrow-left",
129
+ disabled: n.value.continueShoppingDisabled,
130
130
  class: "w-full",
131
- onClick: t[7] || (t[7] = (n) => l("continue-shopping"))
131
+ onClick: t[7] || (t[7] = (a) => l("continue-shopping"))
132
132
  }, {
133
133
  default: k(() => [
134
- C(b(o.value.continueShoppingLabel || g.value.continueShopping || "Continue shopping"), 1)
134
+ C(b(n.value.continueShoppingLabel || g.value.continueShopping || "Continue shopping"), 1)
135
135
  ]),
136
136
  _: 1
137
137
  }, 8, ["icon", "disabled"])) : u("", !0)
@@ -17,13 +17,13 @@ import "v-datepicker-lite";
17
17
  import "v-datepicker-lite/style.css";
18
18
  import "@jaames/iro";
19
19
  import "@vueuse/core";
20
- /* empty css */
20
+ /* empty css */
21
21
  import qe from "../IconPicker.vue.js";
22
22
  /* empty css */
23
23
  /* empty css */
24
24
  /* empty css */
25
- /* empty css */
26
- /* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
27
  import "../../core/config.js";
28
28
  /* empty css */
29
29
  /* empty css */
@@ -1,5 +1,5 @@
1
- import o from "./ColorIro.vue.js";
2
- /* empty css */
1
+ import o from "./ColorIro.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -7,8 +7,8 @@ import "../../core/config.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  import E from "../Button.vue.js";
10
- import _ from "./ColorIro.vue.js";
11
- /* empty css */
10
+ import _ from "./ColorIro.vue2.js";
11
+ /* empty css */
12
12
  import { useEyeDropper as I } from "@vueuse/core";
13
13
  const N = { class: "absolute left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center z-20 pointer-events-none" }, j = {
14
14
  key: 0,
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
2
2
  /* empty css */
3
- import se from "./RichTextToolbar.vue.js";
4
- /* empty css */
5
- import de from "./RichTextLinkPopover.vue.js";
6
- /* empty css */
3
+ import se from "./RichTextToolbar.vue2.js";
4
+ /* empty css */
5
+ import de from "./RichTextLinkPopover.vue2.js";
6
+ /* empty css */
7
7
  import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
8
8
  import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
9
9
  const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
@@ -1,5 +1,5 @@
1
- import o from "./RichTextLinkPopover.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextLinkPopover.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
- import o from "./RichTextToolbar.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextToolbar.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -0,0 +1,44 @@
1
+ import { ScaleGeneratorProps, ScaleHorizontalAlign } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {
6
+ scale: number;
7
+ containerWidth: number;
8
+ targetWidth: number;
9
+ }): any;
10
+ };
11
+ refs: {
12
+ frameRef: HTMLDivElement;
13
+ contentRef: HTMLDivElement;
14
+ };
15
+ rootEl: HTMLDivElement;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<ScaleGeneratorProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
+ "update:scale": (value: number) => any;
20
+ "update:containerWidth": (value: number) => any;
21
+ }, string, import('vue').PublicProps, Readonly<ScaleGeneratorProps> & Readonly<{
22
+ "onUpdate:scale"?: (value: number) => any;
23
+ "onUpdate:containerWidth"?: (value: number) => any;
24
+ }>, {
25
+ maxWidth: number;
26
+ contentClass: string;
27
+ enabled: boolean;
28
+ targetWidth: number;
29
+ minScale: number;
30
+ maxScale: number;
31
+ scale: number | null;
32
+ isEditMode: boolean;
33
+ horizontalAlign: ScaleHorizontalAlign;
34
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
35
+ frameRef: HTMLDivElement;
36
+ contentRef: HTMLDivElement;
37
+ }, HTMLDivElement>;
38
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
39
+ export default _default;
40
+ type __VLS_WithTemplateSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -0,0 +1,110 @@
1
+ import { defineComponent as w, ref as n, computed as l, onMounted as O, onBeforeUnmount as M, watch as B, openBlock as E, createElementBlock as k, normalizeStyle as S, createElementVNode as C, normalizeClass as L, renderSlot as _, nextTick as $ } from "vue";
2
+ const A = /* @__PURE__ */ w({
3
+ __name: "ScaleGenerator",
4
+ props: {
5
+ enabled: { type: Boolean, default: void 0 },
6
+ targetWidth: { default: void 0 },
7
+ maxWidth: { default: void 0 },
8
+ minScale: { default: 0.25 },
9
+ maxScale: { default: 1 },
10
+ scale: { default: null },
11
+ isEditMode: { type: Boolean, default: !1 },
12
+ horizontalAlign: { default: "center" },
13
+ contentClass: { default: "" }
14
+ },
15
+ emits: ["update:scale", "update:containerWidth"],
16
+ setup(v, { emit: b }) {
17
+ const e = v, c = b, o = n(null), r = n(null), a = n(1), m = n(0), h = n(0);
18
+ let u = null, d = null;
19
+ const f = l(() => e.enabled ?? !!e.isEditMode), i = l(
20
+ () => Math.max(1, e.targetWidth ?? e.maxWidth ?? 1440)
21
+ ), g = (t) => Math.min(e.maxScale, Math.max(e.minScale, t)), p = () => {
22
+ h.value = r.value?.scrollHeight ?? 0;
23
+ }, y = () => {
24
+ const t = o.value?.clientWidth ?? i.value;
25
+ if (m.value = t, c("update:containerWidth", t), !f.value) {
26
+ a.value = 1, p(), c("update:scale", 1);
27
+ return;
28
+ }
29
+ const W = typeof e.scale == "number" ? g(e.scale) : g(t / i.value);
30
+ a.value = Number(W.toFixed(4)), p(), c("update:scale", a.value);
31
+ }, s = async () => {
32
+ await $(), y();
33
+ };
34
+ O(() => {
35
+ s(), !(typeof ResizeObserver > "u") && (u = new ResizeObserver(() => {
36
+ s();
37
+ }), d = new ResizeObserver(() => {
38
+ s();
39
+ }), o.value && u.observe(o.value), r.value && d.observe(r.value));
40
+ }), M(() => {
41
+ u?.disconnect(), d?.disconnect();
42
+ }), B(
43
+ () => [
44
+ e.enabled,
45
+ e.isEditMode,
46
+ e.targetWidth,
47
+ e.maxWidth,
48
+ e.minScale,
49
+ e.maxScale,
50
+ e.scale,
51
+ e.horizontalAlign
52
+ ],
53
+ () => {
54
+ s();
55
+ }
56
+ );
57
+ const x = l(() => {
58
+ const t = e.horizontalAlign ?? "center";
59
+ return t === "left" ? {
60
+ marginLeft: "0",
61
+ marginRight: "auto",
62
+ transformOrigin: "top left"
63
+ } : t === "right" ? {
64
+ marginLeft: "auto",
65
+ marginRight: "0",
66
+ transformOrigin: "top right"
67
+ } : {
68
+ marginLeft: "auto",
69
+ marginRight: "auto",
70
+ transformOrigin: "top center"
71
+ };
72
+ }), R = l(() => {
73
+ if (!f.value) return;
74
+ const t = h.value * a.value;
75
+ return {
76
+ height: t > 0 ? `${t}px` : void 0
77
+ };
78
+ }), z = l(() => f.value ? {
79
+ width: `${i.value}px`,
80
+ transform: a.value !== 1 ? `scale(${a.value})` : "none",
81
+ ...x.value
82
+ } : {
83
+ maxWidth: e.maxWidth ? `${e.maxWidth}px` : void 0,
84
+ width: "100%",
85
+ ...x.value
86
+ });
87
+ return (t, W) => (E(), k("div", {
88
+ ref_key: "frameRef",
89
+ ref: o,
90
+ class: "vlite-scale-generator-frame relative w-full overflow-hidden",
91
+ style: S(R.value)
92
+ }, [
93
+ C("div", {
94
+ ref_key: "contentRef",
95
+ ref: r,
96
+ class: L(["vlite-scale-generator-content transition-transform duration-150 ease-out", v.contentClass]),
97
+ style: S(z.value)
98
+ }, [
99
+ _(t.$slots, "default", {
100
+ scale: a.value,
101
+ containerWidth: m.value,
102
+ targetWidth: i.value
103
+ })
104
+ ], 6)
105
+ ], 4));
106
+ }
107
+ });
108
+ export {
109
+ A as default
110
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScaleGenerator.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ScaleGenerator } from './ScaleGenerator.vue';
2
+ export type { ScaleGeneratorProps, ScaleGeneratorSlotScope, ScaleHorizontalAlign, } from './types';
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Public type surface for {@link ScaleGenerator}.
3
+ *
4
+ * `ScaleGenerator` is a generic CSS-transform based scaler for embed-style
5
+ * previews. It is not tied to any particular domain — it scales whatever
6
+ * content lives inside its default slot to a configurable target width.
7
+ *
8
+ * It is used by the ERP editor's "store preview" pane to fit a full
9
+ * storefront (typically 1440px wide) into the available preview viewport,
10
+ * and by the live storefront to opt-in to a fixed display width.
11
+ *
12
+ * The component exposes its current scale, container width, and target
13
+ * width through its scoped slot so descendants can render their own
14
+ * rulers / overlays if they need to.
15
+ */
16
+ export type ScaleHorizontalAlign = 'left' | 'center' | 'right';
17
+ export interface ScaleGeneratorProps {
18
+ /**
19
+ * Master switch. When `false` the content renders at its natural width
20
+ * (clamped to `maxWidth` if provided) without any transform. Defaults
21
+ * to `true` whenever `isEditMode` is also `true`.
22
+ */
23
+ enabled?: boolean;
24
+ /**
25
+ * The width (in `px`) the content was designed for. The component will
26
+ * scale content down to fit the available viewport. Defaults to
27
+ * `maxWidth ?? 1440`.
28
+ */
29
+ targetWidth?: number;
30
+ /**
31
+ * Hard cap on the content width when not scaling. Ignored when scaling
32
+ * is active (the content always renders at exactly `targetWidth` and is
33
+ * then scaled down).
34
+ */
35
+ maxWidth?: number;
36
+ /** Lower bound for the computed scale. Defaults to `0.25`. */
37
+ minScale?: number;
38
+ /** Upper bound for the computed scale. Defaults to `1`. */
39
+ maxScale?: number;
40
+ /**
41
+ * Manual override for the scale. When provided, the component does not
42
+ * derive a scale from the frame width — it uses this value (clamped to
43
+ * `[minScale, maxScale]`) verbatim. Useful for "zoom" controls.
44
+ */
45
+ scale?: number | null;
46
+ /**
47
+ * When `true`, scaling is enabled by default. Mostly used by editor
48
+ * previews where you want the preview to always scale-to-fit.
49
+ */
50
+ isEditMode?: boolean;
51
+ /**
52
+ * Where to align the (possibly scaled) content horizontally inside
53
+ * the frame. Defaults to `'center'`.
54
+ */
55
+ horizontalAlign?: ScaleHorizontalAlign;
56
+ /** Extra class for the inner content wrapper. */
57
+ contentClass?: string;
58
+ }
59
+ export interface ScaleGeneratorSlotScope {
60
+ scale: number;
61
+ containerWidth: number;
62
+ targetWidth: number;
63
+ }
@@ -15,14 +15,14 @@ import "v-datepicker-lite";
15
15
  import "v-datepicker-lite/style.css";
16
16
  import "@jaames/iro";
17
17
  import "@vueuse/core";
18
- /* empty css */
18
+ /* empty css */
19
19
  import "iconify-icon-picker";
20
20
  import "iconify-icon-picker/style.css";
21
21
  /* empty css */
22
22
  /* empty css */
23
23
  /* empty css */
24
- /* empty css */
25
- /* empty css */
24
+ /* empty css */
25
+ /* empty css */
26
26
  import "../../core/config.js";
27
27
  /* empty css */
28
28
  /* empty css */
@@ -0,0 +1,27 @@
1
+ import { ThemeProviderProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: HTMLDivElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<ThemeProviderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ThemeProviderProps> & Readonly<{}>, {
12
+ rootClass: string;
13
+ maxWidth: import('./types').ThemeMaxWidth;
14
+ borderRadius: number;
15
+ bgColor: string;
16
+ primaryColor: string;
17
+ footerBgColor: string;
18
+ baseFontSize: number;
19
+ headingScale: number;
20
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
21
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
+ export default _default;
23
+ type __VLS_WithTemplateSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as s, computed as o, provide as n, openBlock as a, createElementBlock as m, normalizeStyle as u, normalizeClass as c, createBlock as f, resolveDynamicComponent as v, withCtx as p, createTextVNode as C, toDisplayString as b, renderSlot as S } from "vue";
2
+ import { buildThemeVariables as g, buildCardOverrideStyles as h } from "./themeVars.js";
3
+ import { THEME_STYLES_KEY as y } from "../../composables/useThemeStyles.js";
4
+ import { isDarkColor as k } from "../../utils/colorUtils.js";
5
+ const D = /* @__PURE__ */ s({
6
+ __name: "ThemeProvider",
7
+ props: {
8
+ bgColor: { default: void 0 },
9
+ primaryColor: { default: void 0 },
10
+ footerBgColor: { default: void 0 },
11
+ baseFontSize: { default: void 0 },
12
+ headingScale: { default: void 0 },
13
+ borderRadius: { default: void 0 },
14
+ maxWidth: { default: void 0 },
15
+ rootClass: { default: "vlite-theme-provider" }
16
+ },
17
+ setup(t) {
18
+ const e = t, r = o(() => e.bgColor ? k(e.bgColor) : !1), l = o(() => g(e)), d = o(
19
+ () => e.bgColor ? h(e.bgColor, r.value) : ""
20
+ );
21
+ return n(y, l), (i, T) => (a(), m("div", {
22
+ class: c([t.rootClass, "transition-colors duration-300", { dark: r.value }]),
23
+ style: u(l.value)
24
+ }, [
25
+ (a(), f(v("style"), null, {
26
+ default: p(() => [
27
+ C(b(d.value), 1)
28
+ ]),
29
+ _: 1
30
+ })),
31
+ S(i.$slots, "default")
32
+ ], 6));
33
+ }
34
+ });
35
+ export {
36
+ D as default
37
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ThemeProvider.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,3 @@
1
+ export { default as ThemeProvider } from './ThemeProvider.vue';
2
+ export type { ThemeProviderProps, ThemeStyles, ThemeMaxWidth } from './types';
3
+ export { buildThemeVariables, buildCardOverrideStyles } from './themeVars';
@@ -0,0 +1,23 @@
1
+ import { ThemeProviderProps, ThemeStyles } from './types';
2
+ export declare const DEFAULT_BASE_FONT_SIZE = 16;
3
+ export declare const DEFAULT_HEADING_SCALE = 1.25;
4
+ export declare const DEFAULT_BORDER_RADIUS = 8;
5
+ export declare const DEFAULT_MAX_WIDTH = 1440;
6
+ /**
7
+ * Nested card overrides. Lives outside `buildThemeVariables` because the SFC
8
+ * has to inject it as a real `<style>` block (it targets descendant
9
+ * `.bg-card .bg-card` selectors which cannot be expressed as inline variables).
10
+ */
11
+ export declare function buildCardOverrideStyles(bg: string, isDark: boolean): string;
12
+ /**
13
+ * Compute the full theme-styles record from a {@link ThemeProviderProps}.
14
+ * Pure: no DOM, no Vue. Re-usable from tests and from server-side code.
15
+ *
16
+ * Every value is suffixed with `!important` so the provider's tokens
17
+ * reliably win the cascade against host-app stylesheets that may declare
18
+ * the same custom properties (e.g. an app-level `.dark { --color-primary:
19
+ * #xxx }` rule). The provider is the source of truth for the tokens it
20
+ * generates; `!important` in the value is the correct way to express
21
+ * that without forcing every consumer to re-style the entire app.
22
+ */
23
+ export declare function buildThemeVariables(props: ThemeProviderProps): ThemeStyles;