vlite3 1.3.7 → 1.3.9
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/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Dropdown/Dropdown.vue.d.ts +8 -2
- package/components/Dropdown/Dropdown.vue.js +117 -104
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/ThemeToggle.vue.d.ts +1 -1
- package/components/ThemeToggle.vue.js +2 -2
- package/composables/useTheme.d.ts +1 -1
- package/composables/useTheme.js +15 -15
- package/package.json +1 -1
- package/style.css +29 -9
- /package/components/Dropdown/{DropdownMenu.vue3.js → DropdownMenu.vue2.js} +0 -0
|
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
|
|
|
4
4
|
import { $t as E } from "../../utils/i18n.js";
|
|
5
5
|
import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
|
|
6
6
|
import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
|
|
7
|
-
import ee from "./CommandPaletteItem.
|
|
7
|
+
import ee from "./CommandPaletteItem.vue2.js";
|
|
8
8
|
const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
|
|
@@ -60,7 +60,10 @@ declare function __VLS_template(): {
|
|
|
60
60
|
header?(_: {}): any;
|
|
61
61
|
footer?(_: {}): any;
|
|
62
62
|
};
|
|
63
|
-
refs: {
|
|
63
|
+
refs: {
|
|
64
|
+
dropdownWrapper: HTMLDivElement;
|
|
65
|
+
focusTrapAfter: HTMLSpanElement;
|
|
66
|
+
};
|
|
64
67
|
rootEl: HTMLDivElement;
|
|
65
68
|
};
|
|
66
69
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -116,7 +119,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
116
119
|
showSelectedIcon: boolean;
|
|
117
120
|
doubleConfirmation: boolean;
|
|
118
121
|
isNested: boolean;
|
|
119
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
122
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
123
|
+
dropdownWrapper: HTMLDivElement;
|
|
124
|
+
focusTrapAfter: HTMLSpanElement;
|
|
125
|
+
}, HTMLDivElement>;
|
|
120
126
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
121
127
|
export default _default;
|
|
122
128
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as ae, ref as a, computed as f, inject as ie, onMounted as se, onUnmounted as re, watch as x, provide as L, reactive as de, toRefs as ue, openBlock as R, createElementBlock as ce, normalizeStyle as fe, createVNode as N, unref as u, withCtx as m, createBlock as me, normalizeClass as ve, createSlots as he, renderSlot as v, normalizeProps as z, guardReactiveProps as j, createCommentVNode as ye, createElementVNode as ge } from "vue";
|
|
2
|
+
import be from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownIds as
|
|
8
|
-
import { useDropdownSelection as
|
|
9
|
-
import { useDropdownHydration as
|
|
10
|
-
const
|
|
4
|
+
import pe from "./DropdownMenu.vue.js";
|
|
5
|
+
import Ce from "./DropdownTrigger.vue.js";
|
|
6
|
+
import we from "../ConfirmationModal.vue.js";
|
|
7
|
+
import { useDropdownIds as Oe } from "./composables/useDropdownIds.js";
|
|
8
|
+
import { useDropdownSelection as Se } from "./composables/useDropdownSelection.js";
|
|
9
|
+
import { useDropdownHydration as $e } from "./composables/useDropdownHydration.js";
|
|
10
|
+
const He = /* @__PURE__ */ ae({
|
|
11
11
|
__name: "Dropdown",
|
|
12
12
|
props: {
|
|
13
13
|
selected: {},
|
|
@@ -52,152 +52,158 @@ const xe = /* @__PURE__ */ le({
|
|
|
52
52
|
variant: { default: "default" }
|
|
53
53
|
},
|
|
54
54
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
55
|
-
setup(t, { emit:
|
|
56
|
-
const l = t, h =
|
|
55
|
+
setup(t, { emit: U }) {
|
|
56
|
+
const l = t, h = U, b = a(!1), y = a(null), r = a({
|
|
57
57
|
title: "Confirm Selection",
|
|
58
58
|
description: "Are you sure you want to select this option?",
|
|
59
59
|
confirmText: "Confirm",
|
|
60
60
|
cancelText: "Cancel",
|
|
61
61
|
variant: "primary"
|
|
62
|
-
}),
|
|
62
|
+
}), q = f(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), F = f(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), p = a(l.isOpen || !1), C = a(0), G = a(null), S = a(null), $ = () => {
|
|
63
|
+
S.value && setTimeout(() => {
|
|
64
|
+
S.value?.focus({ preventScroll: !0 });
|
|
65
|
+
}, 10);
|
|
66
|
+
}, J = `dropdown-${Math.random().toString(36).substring(2, 9)}`, I = f(() => l.menuId || J), g = a([]), s = ie("dropdown-context", null), K = (e) => {
|
|
63
67
|
g.value.includes(e) || g.value.push(e), s?.registerChildId?.(e);
|
|
64
|
-
},
|
|
68
|
+
}, Q = (e) => {
|
|
65
69
|
g.value = g.value.filter((o) => o !== e), s?.unregisterChildId?.(e);
|
|
66
70
|
};
|
|
67
|
-
|
|
68
|
-
s?.registerChildId && s.registerChildId(`#${
|
|
69
|
-
}),
|
|
70
|
-
s?.unregisterChildId && s.unregisterChildId(`#${
|
|
71
|
-
}),
|
|
71
|
+
se(() => {
|
|
72
|
+
s?.registerChildId && s.registerChildId(`#${I.value}`);
|
|
73
|
+
}), re(() => {
|
|
74
|
+
s?.unregisterChildId && s.unregisterChildId(`#${I.value}`);
|
|
75
|
+
}), x(
|
|
72
76
|
() => l.isOpen,
|
|
73
77
|
(e) => {
|
|
74
78
|
if (e !== void 0) {
|
|
75
79
|
if ((l.disabled || l.readonly) && e) return;
|
|
76
|
-
|
|
80
|
+
p.value = e;
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
);
|
|
80
|
-
const
|
|
84
|
+
const A = (e) => {
|
|
81
85
|
if (l.disabled || l.readonly) {
|
|
82
|
-
|
|
86
|
+
p.value = !1, h("update:isOpen", !1);
|
|
83
87
|
return;
|
|
84
88
|
}
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
e ?
|
|
89
|
+
p.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
90
|
+
}, w = () => {
|
|
91
|
+
A(!1);
|
|
92
|
+
}, X = (e) => {
|
|
93
|
+
e ? C.value++ : C.value = Math.max(0, C.value - 1);
|
|
90
94
|
};
|
|
91
95
|
L("dropdown-context", {
|
|
92
|
-
close:
|
|
96
|
+
close: w,
|
|
93
97
|
onChildToggle: (e) => {
|
|
94
|
-
|
|
98
|
+
X(e), s?.onChildToggle?.(e);
|
|
95
99
|
},
|
|
96
|
-
registerChildId:
|
|
97
|
-
unregisterChildId:
|
|
100
|
+
registerChildId: K,
|
|
101
|
+
unregisterChildId: Q
|
|
98
102
|
}), L("modal-context", null);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
const k = f(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), O = a([]), E = a(!1), T = a(!1);
|
|
104
|
+
x(
|
|
105
|
+
k,
|
|
102
106
|
(e) => {
|
|
103
107
|
if (e) {
|
|
104
108
|
if (l.remote) {
|
|
105
|
-
const o = [...
|
|
109
|
+
const o = [...O.value];
|
|
106
110
|
e.forEach((n) => {
|
|
107
|
-
o.some((
|
|
108
|
-
}),
|
|
111
|
+
o.some((i) => i.value !== void 0 && n.value !== void 0 ? typeof i.value == "object" && i.key && n.key ? i.key === n.key && i.value[i.key] === n.value[n.key] : i.value === n.value : i.label === n.label) || o.push(n);
|
|
112
|
+
}), O.value = o;
|
|
109
113
|
} else
|
|
110
|
-
|
|
111
|
-
!
|
|
112
|
-
|
|
114
|
+
O.value = e;
|
|
115
|
+
!E.value && e.length > 0 && (E.value = !0, setTimeout(() => {
|
|
116
|
+
T.value = !0, H(M.value);
|
|
113
117
|
}, 10));
|
|
114
118
|
}
|
|
115
119
|
},
|
|
116
120
|
{ immediate: !0 }
|
|
117
121
|
);
|
|
118
122
|
const c = f(() => {
|
|
119
|
-
const e = [...
|
|
120
|
-
return
|
|
121
|
-
o.has(
|
|
123
|
+
const e = [...O.value], o = new Set(e.map((n) => n.value ?? n.label));
|
|
124
|
+
return B.value.forEach((n, d) => {
|
|
125
|
+
o.has(d) || (e.unshift(n), o.add(d));
|
|
122
126
|
}), e;
|
|
123
|
-
}), { selectedBuffer:
|
|
127
|
+
}), { selectedBuffer: B, isHydrating: Y, hydrateSelected: H } = $e({
|
|
124
128
|
fetchSelected: l.fetchSelected,
|
|
125
129
|
getAvailableOptions: () => c.value,
|
|
126
|
-
isReady: () =>
|
|
127
|
-
}), { getAllRecursiveIds:
|
|
128
|
-
...
|
|
130
|
+
isReady: () => T.value
|
|
131
|
+
}), { getAllRecursiveIds: Z } = Oe(), _ = de({
|
|
132
|
+
...ue(l),
|
|
129
133
|
options: c
|
|
130
|
-
}), { currentValue:
|
|
131
|
-
|
|
134
|
+
}), { currentValue: M, selectedLabel: V, selectedIcon: W, selectOption: ee } = Se(
|
|
135
|
+
_,
|
|
132
136
|
h
|
|
133
|
-
),
|
|
134
|
-
const e = l.ignoreClickOutside || [], o =
|
|
137
|
+
), te = f(() => {
|
|
138
|
+
const e = l.ignoreClickOutside || [], o = Z(c.value);
|
|
135
139
|
return [.../* @__PURE__ */ new Set([...e, ...o, ...g.value])];
|
|
136
140
|
});
|
|
137
|
-
|
|
138
|
-
() =>
|
|
141
|
+
x(
|
|
142
|
+
() => M.value,
|
|
139
143
|
(e) => {
|
|
140
|
-
|
|
144
|
+
T.value && H(e);
|
|
141
145
|
},
|
|
142
146
|
{ deep: !0 }
|
|
143
147
|
);
|
|
144
|
-
const
|
|
148
|
+
const le = (e) => {
|
|
145
149
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
146
|
-
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ?
|
|
150
|
+
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? r.value = {
|
|
147
151
|
title: e.confirmation.title || "Confirm Selection",
|
|
148
152
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
149
153
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
150
154
|
cancelText: e.confirmation.cancelText || "Cancel",
|
|
151
155
|
variant: e.confirmation.variant || "primary"
|
|
152
|
-
} :
|
|
156
|
+
} : r.value = {
|
|
153
157
|
title: "Confirm Selection",
|
|
154
158
|
description: `Are you sure you want to select "${e.label}"?`,
|
|
155
159
|
confirmText: "Confirm",
|
|
156
160
|
cancelText: "Cancel",
|
|
157
161
|
variant: "primary"
|
|
158
|
-
}, b.value = !0,
|
|
162
|
+
}, b.value = !0, w()) : (D(e), l.closeOnSelect && (w(), $()));
|
|
159
163
|
}, D = (e) => {
|
|
160
164
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
161
165
|
const o = e.value ?? e.label;
|
|
162
|
-
|
|
163
|
-
const n =
|
|
166
|
+
B.value.has(o) || B.value.set(o, e);
|
|
167
|
+
const n = ee(e);
|
|
164
168
|
if (!l.isNested) {
|
|
165
|
-
const
|
|
166
|
-
(e._path || [
|
|
167
|
-
typeof
|
|
168
|
-
value:
|
|
169
|
-
option:
|
|
169
|
+
const d = e._originalOption || e, i = d.value ?? d.label;
|
|
170
|
+
(e._path || [d]).forEach((P) => {
|
|
171
|
+
typeof P.onSelect == "function" && P.onSelect({
|
|
172
|
+
value: i,
|
|
173
|
+
option: P,
|
|
170
174
|
data: c.value || [],
|
|
171
175
|
values: n
|
|
172
176
|
});
|
|
173
177
|
});
|
|
174
178
|
}
|
|
175
|
-
},
|
|
176
|
-
y.value && (D(y.value), y.value = null, b.value = !1);
|
|
177
|
-
},
|
|
178
|
-
y.value = null, b.value = !1;
|
|
179
|
+
}, ne = () => {
|
|
180
|
+
y.value && (D(y.value), y.value = null, b.value = !1, $());
|
|
181
|
+
}, oe = () => {
|
|
182
|
+
y.value = null, b.value = !1, $();
|
|
179
183
|
};
|
|
180
|
-
return (e, o) => (
|
|
184
|
+
return (e, o) => (R(), ce("div", {
|
|
181
185
|
class: "relative inline-block text-left",
|
|
182
|
-
style:
|
|
186
|
+
style: fe({ direction: t.direction }),
|
|
187
|
+
ref_key: "dropdownWrapper",
|
|
188
|
+
ref: G
|
|
183
189
|
}, [
|
|
184
|
-
|
|
190
|
+
N(u(be), {
|
|
185
191
|
content: "",
|
|
186
192
|
trigger: "click",
|
|
187
193
|
arrow: !1,
|
|
188
194
|
disabled: t.disabled || t.readonly,
|
|
189
195
|
teleport: t.teleport,
|
|
190
196
|
offset: t.offset,
|
|
191
|
-
placement:
|
|
192
|
-
isOpen:
|
|
193
|
-
keepAlive:
|
|
194
|
-
menuId:
|
|
195
|
-
ignoreClickOutside:
|
|
197
|
+
placement: q.value,
|
|
198
|
+
isOpen: p.value,
|
|
199
|
+
keepAlive: C.value > 0,
|
|
200
|
+
menuId: I.value,
|
|
201
|
+
ignoreClickOutside: te.value,
|
|
196
202
|
class: "w-full",
|
|
197
203
|
className: "dropdown " + (t.className || "") + (t.variant === "transparent" ? " unstyled-dropdown" : "") + (t.variant === "secondary" ? " dropdown-secondary" : ""),
|
|
198
204
|
onOnShow: o[2] || (o[2] = (n) => e.$emit("onOpen")),
|
|
199
205
|
onOnHide: o[3] || (o[3] = (n) => e.$emit("onClose")),
|
|
200
|
-
"onUpdate:isOpen":
|
|
206
|
+
"onUpdate:isOpen": A,
|
|
201
207
|
triggerClass: "w-full",
|
|
202
208
|
styles: {
|
|
203
209
|
padding: "0",
|
|
@@ -207,14 +213,14 @@ const xe = /* @__PURE__ */ le({
|
|
|
207
213
|
}
|
|
208
214
|
}, {
|
|
209
215
|
trigger: m(({ isOpen: n }) => [
|
|
210
|
-
v(e.$slots, "trigger",
|
|
211
|
-
selectedLabel: u(
|
|
212
|
-
selectedIcon: t.showSelectedIcon ? u(
|
|
216
|
+
v(e.$slots, "trigger", z(j({
|
|
217
|
+
selectedLabel: u(V),
|
|
218
|
+
selectedIcon: t.showSelectedIcon ? u(W) : void 0,
|
|
213
219
|
isOpen: n
|
|
214
220
|
})), () => [
|
|
215
|
-
|
|
216
|
-
"selected-label": u(
|
|
217
|
-
"selected-icon": t.showSelectedIcon ? u(
|
|
221
|
+
N(Ce, {
|
|
222
|
+
"selected-label": u(V),
|
|
223
|
+
"selected-icon": t.showSelectedIcon ? u(W) : void 0,
|
|
218
224
|
"is-open": n,
|
|
219
225
|
direction: t.direction,
|
|
220
226
|
disabled: t.disabled,
|
|
@@ -225,33 +231,33 @@ const xe = /* @__PURE__ */ le({
|
|
|
225
231
|
])
|
|
226
232
|
]),
|
|
227
233
|
default: m(() => [
|
|
228
|
-
!(t.disabled || t.readonly) && (
|
|
234
|
+
!(t.disabled || t.readonly) && (k.value.length || c.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (R(), me(pe, {
|
|
229
235
|
key: 0,
|
|
230
|
-
options:
|
|
236
|
+
options: k.value,
|
|
231
237
|
cachedOptions: c.value,
|
|
232
|
-
class:
|
|
238
|
+
class: ve(t.className),
|
|
233
239
|
emptyMessage: t.emptyMessage,
|
|
234
240
|
searchEmptyMessage: t.searchEmptyMessage,
|
|
235
|
-
selected: u(
|
|
241
|
+
selected: u(M),
|
|
236
242
|
selectedIndex: t.selectedIndex,
|
|
237
243
|
maxHeight: t.maxHeight,
|
|
238
|
-
nestedPosition:
|
|
244
|
+
nestedPosition: F.value,
|
|
239
245
|
nestedOffset: t.nestedOffset,
|
|
240
246
|
selectable: t.selectable,
|
|
241
247
|
direction: t.direction,
|
|
242
248
|
isCustomSlotMenu: !!e.$slots?.default || !!e.$slots?.menu,
|
|
243
249
|
layout: t.layout,
|
|
244
250
|
columns: t.columns,
|
|
245
|
-
loading: t.loading || u(
|
|
251
|
+
loading: t.loading || u(Y),
|
|
246
252
|
hasMore: t.hasMore,
|
|
247
253
|
searchable: t.searchable,
|
|
248
254
|
remote: t.remote,
|
|
249
255
|
debounceTime: t.debounceTime,
|
|
250
|
-
onSelect:
|
|
251
|
-
onClose:
|
|
256
|
+
onSelect: le,
|
|
257
|
+
onClose: w,
|
|
252
258
|
onLoadMore: o[0] || (o[0] = (n) => e.$emit("load-more")),
|
|
253
259
|
onSearch: o[1] || (o[1] = (n) => e.$emit("search", n))
|
|
254
|
-
},
|
|
260
|
+
}, he({ _: 2 }, [
|
|
255
261
|
e.$slots.menu || e.$slots?.default ? {
|
|
256
262
|
name: "menu",
|
|
257
263
|
fn: m(() => [
|
|
@@ -263,7 +269,7 @@ const xe = /* @__PURE__ */ le({
|
|
|
263
269
|
e.$slots.item ? {
|
|
264
270
|
name: "item",
|
|
265
271
|
fn: m((n) => [
|
|
266
|
-
v(e.$slots, "item",
|
|
272
|
+
v(e.$slots, "item", z(j(n)))
|
|
267
273
|
]),
|
|
268
274
|
key: "1"
|
|
269
275
|
} : void 0,
|
|
@@ -281,23 +287,30 @@ const xe = /* @__PURE__ */ le({
|
|
|
281
287
|
]),
|
|
282
288
|
key: "3"
|
|
283
289
|
} : void 0
|
|
284
|
-
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) :
|
|
290
|
+
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : ye("", !0)
|
|
285
291
|
]),
|
|
286
292
|
_: 3
|
|
287
293
|
}, 8, ["disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
288
|
-
|
|
294
|
+
N(we, {
|
|
289
295
|
show: b.value,
|
|
290
|
-
title:
|
|
291
|
-
description:
|
|
292
|
-
"confirm-text":
|
|
293
|
-
"cancel-text":
|
|
294
|
-
variant:
|
|
295
|
-
onConfirm:
|
|
296
|
-
onCancel:
|
|
297
|
-
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
|
|
296
|
+
title: r.value.title,
|
|
297
|
+
description: r.value.description,
|
|
298
|
+
"confirm-text": r.value.confirmText,
|
|
299
|
+
"cancel-text": r.value.cancelText,
|
|
300
|
+
variant: r.value.variant,
|
|
301
|
+
onConfirm: ne,
|
|
302
|
+
onCancel: oe
|
|
303
|
+
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"]),
|
|
304
|
+
ge("span", {
|
|
305
|
+
ref_key: "focusTrapAfter",
|
|
306
|
+
ref: S,
|
|
307
|
+
tabindex: "-1",
|
|
308
|
+
class: "outline-none pointer-events-none absolute opacity-0 w-0 h-0",
|
|
309
|
+
"aria-hidden": "true"
|
|
310
|
+
}, null, 512)
|
|
298
311
|
], 4));
|
|
299
312
|
}
|
|
300
313
|
});
|
|
301
314
|
export {
|
|
302
|
-
|
|
315
|
+
He as default
|
|
303
316
|
};
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as U } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -12,7 +12,7 @@ const w = /* @__PURE__ */ m({
|
|
|
12
12
|
},
|
|
13
13
|
setup(t) {
|
|
14
14
|
const { theme: i, toggleTheme: s } = f(), a = d(() => {
|
|
15
|
-
const n = i.value === "light
|
|
15
|
+
const n = i.value === "light", l = "vlite.themeToggle.switchToDark", r = "vlite.themeToggle.switchToLight";
|
|
16
16
|
if (n) {
|
|
17
17
|
const e = c(l);
|
|
18
18
|
return e !== l ? e : "Switch to dark mode";
|
|
@@ -26,7 +26,7 @@ const w = /* @__PURE__ */ m({
|
|
|
26
26
|
theme: o(i)
|
|
27
27
|
}, () => [
|
|
28
28
|
h(T, {
|
|
29
|
-
icon: o(i) === "light
|
|
29
|
+
icon: o(i) === "light" ? "lucide:sun" : "lucide:moon",
|
|
30
30
|
variant: t.variant || "secondary",
|
|
31
31
|
rounded: t.rounded || "full",
|
|
32
32
|
size: t.size,
|
package/composables/useTheme.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const t =
|
|
3
|
-
function
|
|
4
|
-
if (typeof window > "u") return "light
|
|
1
|
+
import { ref as a, watch as d, onMounted as r } from "vue";
|
|
2
|
+
const t = a(o());
|
|
3
|
+
function o() {
|
|
4
|
+
if (typeof window > "u") return "light";
|
|
5
5
|
const e = localStorage.getItem("builto-theme");
|
|
6
|
-
return e === "light
|
|
6
|
+
return e === "light" || e === "dark" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
document.documentElement.classList.remove("light
|
|
8
|
+
function n(e) {
|
|
9
|
+
document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(e);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function l() {
|
|
12
12
|
typeof window > "u" || !window.matchMedia || window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
|
|
13
|
-
localStorage.getItem("builto-theme") || (t.value = e.matches ? "dark" : "light
|
|
13
|
+
localStorage.getItem("builto-theme") || (t.value = e.matches ? "dark" : "light", n(t.value));
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function u() {
|
|
17
|
-
t.value =
|
|
17
|
+
t.value = o(), n(t.value), l();
|
|
18
18
|
}
|
|
19
19
|
function c() {
|
|
20
|
-
|
|
20
|
+
d(
|
|
21
21
|
t,
|
|
22
|
-
(
|
|
23
|
-
localStorage.setItem("builto-theme",
|
|
22
|
+
(i) => {
|
|
23
|
+
localStorage.setItem("builto-theme", i), n(i);
|
|
24
24
|
},
|
|
25
25
|
{ immediate: !0 }
|
|
26
|
-
),
|
|
26
|
+
), r(() => {
|
|
27
27
|
document.documentElement.classList.add("bg-body");
|
|
28
28
|
});
|
|
29
29
|
function e() {
|
|
30
|
-
t.value = t.value === "light
|
|
30
|
+
t.value = t.value === "light" ? "dark" : "light";
|
|
31
31
|
}
|
|
32
32
|
return {
|
|
33
33
|
theme: t,
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
--color-border: '';
|
|
18
18
|
--color-input: '';
|
|
19
19
|
--color-card: '';
|
|
20
|
+
--color-card-light: '';
|
|
20
21
|
--color-secondary: '';
|
|
21
22
|
--color-secondary-foreground: '';
|
|
22
23
|
--color-muted: '';
|
|
@@ -292,8 +293,9 @@
|
|
|
292
293
|
.dark .sidepanel-body,
|
|
293
294
|
.dark .tooltip-container,
|
|
294
295
|
.bg-card,
|
|
296
|
+
.bg-card-light,
|
|
295
297
|
.theme-section,
|
|
296
|
-
.light
|
|
298
|
+
.light,
|
|
297
299
|
:root {
|
|
298
300
|
|
|
299
301
|
--color-white: #ffffff;
|
|
@@ -395,7 +397,7 @@
|
|
|
395
397
|
|
|
396
398
|
}
|
|
397
399
|
|
|
398
|
-
.light
|
|
400
|
+
.light {
|
|
399
401
|
--color-white: #ffffff !important;
|
|
400
402
|
--color-mixture-1: #ffffff !important;
|
|
401
403
|
--color-mixture-2: #0c0c0c !important;
|
|
@@ -579,6 +581,16 @@
|
|
|
579
581
|
background-color: var(--color-body) !important;
|
|
580
582
|
}
|
|
581
583
|
|
|
584
|
+
.dark .modal-body .bg-card-light,
|
|
585
|
+
.dark .sidepanel-body .bg-card-light,
|
|
586
|
+
.dark .tooltip-container .bg-card-light {
|
|
587
|
+
--color-body: #1c1c1c !important;
|
|
588
|
+
--color-white: #1c1c1c !important;
|
|
589
|
+
--color-mixture-1: #202020 !important;
|
|
590
|
+
--color-mixture-2: #ffffff !important;
|
|
591
|
+
background-color: var(--color-body) !important;
|
|
592
|
+
}
|
|
593
|
+
|
|
582
594
|
.dark .bg-card {
|
|
583
595
|
--color-body: #141414 !important;
|
|
584
596
|
--color-white: #141414 !important;
|
|
@@ -608,7 +620,8 @@
|
|
|
608
620
|
}
|
|
609
621
|
|
|
610
622
|
|
|
611
|
-
.bg-card
|
|
623
|
+
.bg-card,
|
|
624
|
+
.bg-card-light {
|
|
612
625
|
--color-body: #f7f7f7 !important;
|
|
613
626
|
--color-white: #f7f7f7 !important;
|
|
614
627
|
--color-mixture-1: #f7f7f7 !important;
|
|
@@ -617,7 +630,9 @@
|
|
|
617
630
|
border-color: color-mix(in oklab, var(--color-mixture-1) 94%, var(--color-mixture-2));
|
|
618
631
|
}
|
|
619
632
|
|
|
620
|
-
|
|
633
|
+
|
|
634
|
+
.bg-card .bg-card,
|
|
635
|
+
.bg-card-light .bg-card-light {
|
|
621
636
|
--color-body: #f1f1f1 !important;
|
|
622
637
|
--color-white: #f1f1f1 !important;
|
|
623
638
|
--color-mixture-1: #f1f1f1;
|
|
@@ -625,7 +640,8 @@
|
|
|
625
640
|
background-color: #f1f1f1 !important;
|
|
626
641
|
}
|
|
627
642
|
|
|
628
|
-
.bg-card .bg-card .bg-card
|
|
643
|
+
.bg-card .bg-card .bg-card,
|
|
644
|
+
.bg-card-light .bg-card-light .bg-card-light {
|
|
629
645
|
--color-body: #e8e8e8 !important;
|
|
630
646
|
--color-white: #e8e8e8 !important;
|
|
631
647
|
--color-mixture-1: #e8e8e8;
|
|
@@ -633,15 +649,19 @@
|
|
|
633
649
|
background-color: #e8e8e8 !important;
|
|
634
650
|
}
|
|
635
651
|
|
|
636
|
-
.dark .bg-card
|
|
652
|
+
.dark .bg-card-light {
|
|
637
653
|
--color-body: #121212 !important;
|
|
638
654
|
--color-white: #121212 !important;
|
|
655
|
+
--color-mixture-1: #1b1b1b !important;
|
|
656
|
+
--color-mixture-2: #ffffff !important;
|
|
639
657
|
background-color: #121212 !important;
|
|
640
658
|
}
|
|
641
659
|
|
|
642
|
-
.dark .bg-card .bg-card
|
|
643
|
-
--color-body:
|
|
644
|
-
--color-white:
|
|
660
|
+
.dark .bg-card .bg-card-light {
|
|
661
|
+
--color-body: #1a1a1a !important;
|
|
662
|
+
--color-white: #1a1a1a !important;
|
|
663
|
+
--color-mixture-1: #232323 !important;
|
|
664
|
+
--color-mixture-2: #000000;
|
|
645
665
|
background-color: #1a1a1a !important;
|
|
646
666
|
}
|
|
647
667
|
|
|
File without changes
|