@ekkolyth/ui 0.1.16 → 0.1.18
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/LICENSE +21 -0
- package/README.md +153 -97
- package/dist/base.css +263 -0
- package/dist/blocks.d.ts +4 -0
- package/dist/blocks.js +4 -0
- package/dist/container-BBg21poC.js +10 -0
- package/dist/convex.d.ts +2 -0
- package/dist/convex.js +2 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +2 -0
- package/dist/icon-picker-ByfHyJ7i.js +4078 -0
- package/dist/index-Bwp0YMmG.d.ts +5 -0
- package/dist/index-BxcqwZNT.d.ts +30 -0
- package/dist/index-DHF8OR1R.d.ts +60 -0
- package/dist/index-DsLGf2HX.d.ts +9 -0
- package/dist/index-qji4ohJZ.d.ts +24 -0
- package/dist/index.d.ts +793 -533
- package/dist/index.js +3236 -5578
- package/dist/layout.d.ts +2 -0
- package/dist/layout.js +2 -0
- package/dist/loading-screen-DB3youyT.js +63 -0
- package/dist/shiki-code-Bg__Vnt1.js +29 -0
- package/dist/text.d.ts +17 -0
- package/dist/text.js +177 -0
- package/dist/themes/catpuccin/frappe.css +33 -33
- package/dist/themes/catpuccin/latte.css +33 -33
- package/dist/themes/catpuccin/macchiato.css +33 -33
- package/dist/themes/catpuccin/mocha.css +33 -33
- package/dist/themes/ekko-os.css +92 -37
- package/dist/themes/ekkolyth.css +2 -2
- package/dist/themes/index.css +7 -66
- package/dist/themes/provider.d.ts +62 -0
- package/dist/themes/provider.js +271 -0
- package/dist/themes/tokyo-night.css +33 -33
- package/dist/themes.css +7 -0
- package/dist/toggle-B2PFPImC.js +182 -0
- package/dist/use-mobile-BVGje-2e.d.ts +4 -0
- package/dist/use-mobile-CqHXB_Nc.js +18 -0
- package/dist/utils-C_uf36nf.js +8 -0
- package/dist/widget-C2vjxQms.js +94 -0
- package/dist/widget.d.ts +6 -0
- package/dist/widget.js +19 -0
- package/package.json +125 -170
- package/dist/index-C3ceanPz.d.ts +0 -18
- package/dist/index-C7t_lwpi.d.ts +0 -13
- package/dist/next.d.ts +0 -13
- package/dist/next.js +0 -271
- package/dist/providers/next.d.ts +0 -25
- package/dist/providers/next.js +0 -216
- package/dist/providers/tanstack.d.ts +0 -24
- package/dist/providers/tanstack.js +0 -120
- package/dist/tanstack.d.ts +0 -12
- package/dist/tanstack.js +0 -203
- package/dist/themes/ekko-playlist.css +0 -71
- package/dist/themes/theme-select.d.ts +0 -12
- package/dist/themes/theme-select.js +0 -357
- package/dist/themes/theme-toggle.d.ts +0 -15
- package/dist/themes/theme-toggle.js +0 -179
- package/dist/types-fUfvw1Mz.d.ts +0 -8
package/dist/tanstack.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { TanstackThemeProvider as ThemeProvider, useTanstackTheme as useTheme } from './providers/tanstack.js';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { ToasterProps } from 'sonner';
|
|
4
|
-
export { S as SystemTheme, T as ThemeName } from './types-fUfvw1Mz.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Theme-aware Toaster for TanStack Router apps
|
|
8
|
-
* Automatically syncs with TanstackThemeProvider
|
|
9
|
-
*/
|
|
10
|
-
declare function TanstackToaster(props: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
export { TanstackToaster as Toaster };
|
package/dist/tanstack.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { createContext, useState, useMemo, useEffect, use } from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Toaster as Toaster$1 } from 'sonner';
|
|
4
|
-
import { Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
|
-
var initialState = {
|
|
35
|
-
systemTheme: "system",
|
|
36
|
-
resolvedTheme: "ekkolyth-light",
|
|
37
|
-
availableThemes: {
|
|
38
|
-
light: ["ekkolyth-light"],
|
|
39
|
-
dark: ["ekkolyth-dark"]
|
|
40
|
-
},
|
|
41
|
-
setSystemTheme: () => null,
|
|
42
|
-
setSpecificTheme: () => null
|
|
43
|
-
};
|
|
44
|
-
var TanstackThemeProviderContext = createContext(initialState);
|
|
45
|
-
var resolveSystemTheme = (systemTheme) => {
|
|
46
|
-
if (systemTheme === "system" || systemTheme === "normal") {
|
|
47
|
-
if (typeof window !== "undefined") {
|
|
48
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
49
|
-
}
|
|
50
|
-
return "light";
|
|
51
|
-
}
|
|
52
|
-
return systemTheme;
|
|
53
|
-
};
|
|
54
|
-
function TanstackThemeProvider({
|
|
55
|
-
children,
|
|
56
|
-
defaultTheme = "system",
|
|
57
|
-
lightTheme = ["ekkolyth-light"],
|
|
58
|
-
darkTheme = ["ekkolyth-dark"],
|
|
59
|
-
storageKey = "ekko-ui"
|
|
60
|
-
}) {
|
|
61
|
-
const lightThemes = Array.isArray(lightTheme) ? lightTheme : [lightTheme];
|
|
62
|
-
const darkThemes = Array.isArray(darkTheme) ? darkTheme : [darkTheme];
|
|
63
|
-
const [systemTheme, setSystemThemeState] = useState(() => {
|
|
64
|
-
if (typeof window !== "undefined") {
|
|
65
|
-
const stored = localStorage.getItem(
|
|
66
|
-
`${storageKey}.theme-mode`
|
|
67
|
-
);
|
|
68
|
-
return stored || defaultTheme;
|
|
69
|
-
}
|
|
70
|
-
return defaultTheme;
|
|
71
|
-
});
|
|
72
|
-
const [selectedLightTheme, setSelectedLightThemeState] = useState(() => {
|
|
73
|
-
if (typeof window !== "undefined") {
|
|
74
|
-
const stored = localStorage.getItem(
|
|
75
|
-
`${storageKey}.theme-light`
|
|
76
|
-
);
|
|
77
|
-
return stored && lightThemes.includes(stored) ? stored : lightThemes[0];
|
|
78
|
-
}
|
|
79
|
-
return lightThemes[0];
|
|
80
|
-
});
|
|
81
|
-
const [selectedDarkTheme, setSelectedDarkThemeState] = useState(
|
|
82
|
-
() => {
|
|
83
|
-
if (typeof window !== "undefined") {
|
|
84
|
-
const stored = localStorage.getItem(
|
|
85
|
-
`${storageKey}.theme-dark`
|
|
86
|
-
);
|
|
87
|
-
return stored && darkThemes.includes(stored) ? stored : darkThemes[0];
|
|
88
|
-
}
|
|
89
|
-
return darkThemes[0];
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
const resolvedTheme = useMemo(() => {
|
|
93
|
-
const resolvedSystem = resolveSystemTheme(systemTheme);
|
|
94
|
-
return resolvedSystem === "light" ? selectedLightTheme : selectedDarkTheme;
|
|
95
|
-
}, [systemTheme, selectedLightTheme, selectedDarkTheme]);
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
const root = document.documentElement;
|
|
98
|
-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
99
|
-
const updateTheme = () => {
|
|
100
|
-
const resolvedSystem = resolveSystemTheme(systemTheme);
|
|
101
|
-
const themeToApply = resolvedSystem === "light" ? selectedLightTheme : selectedDarkTheme;
|
|
102
|
-
root.setAttribute("data-theme", themeToApply);
|
|
103
|
-
};
|
|
104
|
-
updateTheme();
|
|
105
|
-
if (systemTheme === "system" || systemTheme === "normal") {
|
|
106
|
-
mediaQuery.addEventListener("change", updateTheme);
|
|
107
|
-
return () => mediaQuery.removeEventListener("change", updateTheme);
|
|
108
|
-
}
|
|
109
|
-
}, [systemTheme, selectedLightTheme, selectedDarkTheme]);
|
|
110
|
-
const value = useMemo(
|
|
111
|
-
() => ({
|
|
112
|
-
systemTheme,
|
|
113
|
-
resolvedTheme,
|
|
114
|
-
availableThemes: {
|
|
115
|
-
light: lightThemes,
|
|
116
|
-
dark: darkThemes
|
|
117
|
-
},
|
|
118
|
-
setSystemTheme: (newTheme) => {
|
|
119
|
-
if (typeof window !== "undefined") {
|
|
120
|
-
localStorage.setItem(`${storageKey}.theme-mode`, newTheme);
|
|
121
|
-
}
|
|
122
|
-
setSystemThemeState(newTheme);
|
|
123
|
-
},
|
|
124
|
-
setSpecificTheme: (mode, theme) => {
|
|
125
|
-
if (typeof window !== "undefined") {
|
|
126
|
-
const key = mode === "light" ? `${storageKey}.theme-light` : `${storageKey}.theme-dark`;
|
|
127
|
-
localStorage.setItem(key, theme);
|
|
128
|
-
}
|
|
129
|
-
if (mode === "light" && lightThemes.includes(theme)) {
|
|
130
|
-
setSelectedLightThemeState(theme);
|
|
131
|
-
} else if (mode === "dark" && darkThemes.includes(theme)) {
|
|
132
|
-
setSelectedDarkThemeState(theme);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}),
|
|
136
|
-
[systemTheme, resolvedTheme, lightThemes, darkThemes, storageKey]
|
|
137
|
-
);
|
|
138
|
-
return /* @__PURE__ */ jsx(TanstackThemeProviderContext.Provider, { value, children });
|
|
139
|
-
}
|
|
140
|
-
function useTanstackTheme() {
|
|
141
|
-
const context = use(TanstackThemeProviderContext);
|
|
142
|
-
if (context === void 0) {
|
|
143
|
-
throw new Error(
|
|
144
|
-
"useTanstackTheme must be used within a TanstackThemeProvider"
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
return context;
|
|
148
|
-
}
|
|
149
|
-
var Toaster = (_a) => {
|
|
150
|
-
var _b = _a, { theme = "system" } = _b, props = __objRest(_b, ["theme"]);
|
|
151
|
-
return /* @__PURE__ */ jsx(
|
|
152
|
-
Toaster$1,
|
|
153
|
-
__spreadValues({
|
|
154
|
-
theme,
|
|
155
|
-
className: "toaster group",
|
|
156
|
-
icons: {
|
|
157
|
-
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
158
|
-
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
159
|
-
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
160
|
-
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
161
|
-
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
|
|
162
|
-
},
|
|
163
|
-
style: {
|
|
164
|
-
"--normal-bg": "var(--popover)",
|
|
165
|
-
"--normal-text": "var(--popover-foreground)",
|
|
166
|
-
"--normal-border": "var(--border)",
|
|
167
|
-
"--border-radius": "var(--radius)"
|
|
168
|
-
},
|
|
169
|
-
toastOptions: {
|
|
170
|
-
classNames: {
|
|
171
|
-
toast: "cn-toast"
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}, props)
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
// src/lib/types.ts
|
|
179
|
-
var DARK_THEMES = [
|
|
180
|
-
"mocha",
|
|
181
|
-
"frappe",
|
|
182
|
-
"macchiato",
|
|
183
|
-
"tokyo-night",
|
|
184
|
-
"ekkoos-dark",
|
|
185
|
-
"ekkolyth-dark",
|
|
186
|
-
"ekko-playlist-dark"
|
|
187
|
-
];
|
|
188
|
-
|
|
189
|
-
// src/lib/theme.ts
|
|
190
|
-
function isDarkTheme(theme) {
|
|
191
|
-
return DARK_THEMES.includes(theme);
|
|
192
|
-
}
|
|
193
|
-
function TanstackToaster(props) {
|
|
194
|
-
try {
|
|
195
|
-
const { resolvedTheme } = useTanstackTheme();
|
|
196
|
-
const theme = isDarkTheme(resolvedTheme) ? "dark" : "light";
|
|
197
|
-
return /* @__PURE__ */ jsx(Toaster, __spreadValues({ theme }, props));
|
|
198
|
-
} catch (e) {
|
|
199
|
-
return /* @__PURE__ */ jsx(Toaster, __spreadValues({ theme: "system" }, props));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export { TanstackThemeProvider as ThemeProvider, TanstackToaster as Toaster, useTanstackTheme as useTheme };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* Ekko Playlist - Light */
|
|
2
|
-
html[data-theme="ekko-playlist-light"] {
|
|
3
|
-
--background: oklch(1 0 0);
|
|
4
|
-
--foreground: oklch(0.145 0 0);
|
|
5
|
-
--card: oklch(1 0 0);
|
|
6
|
-
--card-foreground: oklch(0.145 0 0);
|
|
7
|
-
--popover: oklch(1 0 0);
|
|
8
|
-
--popover-foreground: oklch(0.145 0 0);
|
|
9
|
-
--primary: oklch(0.586 0.253 17.585);
|
|
10
|
-
--primary-foreground: oklch(0.969 0.015 12.422);
|
|
11
|
-
--secondary: oklch(0.967 0.001 286.375);
|
|
12
|
-
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
13
|
-
--muted: oklch(0.97 0 0);
|
|
14
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
15
|
-
--accent: oklch(0.97 0 0);
|
|
16
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
17
|
-
--destructive: oklch(0.58 0.22 27);
|
|
18
|
-
--border: oklch(0.922 0 0);
|
|
19
|
-
--input: oklch(0.922 0 0);
|
|
20
|
-
--ring: oklch(0.708 0 0);
|
|
21
|
-
--radius: 0.625rem;
|
|
22
|
-
--chart-1: oklch(0.81 0.117 11.638);
|
|
23
|
-
--chart-2: oklch(0.645 0.246 16.439);
|
|
24
|
-
--chart-3: oklch(0.586 0.253 17.585);
|
|
25
|
-
--chart-4: oklch(0.514 0.222 16.935);
|
|
26
|
-
--chart-5: oklch(0.455 0.188 13.697);
|
|
27
|
-
--sidebar: oklch(0.985 0 0);
|
|
28
|
-
--sidebar-foreground: oklch(0.145 0 0);
|
|
29
|
-
--sidebar-primary: oklch(0.586 0.253 17.585);
|
|
30
|
-
--sidebar-primary-foreground: oklch(0.969 0.015 12.422);
|
|
31
|
-
--sidebar-accent: oklch(0.97 0 0);
|
|
32
|
-
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
33
|
-
--sidebar-border: oklch(0.922 0 0);
|
|
34
|
-
--sidebar-ring: oklch(0.708 0 0);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Ekko Playlist - Dark */
|
|
38
|
-
html[data-theme="ekko-playlist-dark"] {
|
|
39
|
-
--background: oklch(0.145 0 0);
|
|
40
|
-
--foreground: oklch(0.985 0 0);
|
|
41
|
-
--card: oklch(0.205 0 0);
|
|
42
|
-
--card-foreground: oklch(0.985 0 0);
|
|
43
|
-
--popover: oklch(0.205 0 0);
|
|
44
|
-
--popover-foreground: oklch(0.985 0 0);
|
|
45
|
-
--primary: oklch(0.645 0.246 16.439);
|
|
46
|
-
--primary-foreground: oklch(0.969 0.015 12.422);
|
|
47
|
-
--secondary: oklch(0.274 0.006 286.033);
|
|
48
|
-
--secondary-foreground: oklch(0.985 0 0);
|
|
49
|
-
--muted: oklch(0.269 0 0);
|
|
50
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
51
|
-
--accent: oklch(0.371 0 0);
|
|
52
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
53
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
54
|
-
--border: oklch(1 0 0 / 10%);
|
|
55
|
-
--input: oklch(1 0 0 / 15%);
|
|
56
|
-
--ring: oklch(0.556 0 0);
|
|
57
|
-
--radius: 0.625rem;
|
|
58
|
-
--chart-1: oklch(0.81 0.117 11.638);
|
|
59
|
-
--chart-2: oklch(0.645 0.246 16.439);
|
|
60
|
-
--chart-3: oklch(0.586 0.253 17.585);
|
|
61
|
-
--chart-4: oklch(0.514 0.222 16.935);
|
|
62
|
-
--chart-5: oklch(0.455 0.188 13.697);
|
|
63
|
-
--sidebar: oklch(0.21 0.006 285.885);
|
|
64
|
-
--sidebar-foreground: oklch(0.985 0 0);
|
|
65
|
-
--sidebar-primary: oklch(0.645 0.246 16.439);
|
|
66
|
-
--sidebar-primary-foreground: oklch(0.969 0.015 12.422);
|
|
67
|
-
--sidebar-accent: oklch(0.269 0 0);
|
|
68
|
-
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
69
|
-
--sidebar-border: oklch(1 0 0 / 10%);
|
|
70
|
-
--sidebar-ring: oklch(0.556 0 0);
|
|
71
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { S as Select } from '../index-C3ceanPz.js';
|
|
4
|
-
import 'radix-ui';
|
|
5
|
-
|
|
6
|
-
interface ThemeSelectProps extends React.ComponentProps<typeof Select> {
|
|
7
|
-
size?: 'sm' | 'default';
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
declare function ThemeSelect({ size, className, ...props }: ThemeSelectProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
export { ThemeSelect, type ThemeSelectProps };
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import { Select as Select$1 } from 'radix-ui';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from 'lucide-react';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import 'next-themes';
|
|
7
|
-
import { createContext, use } from 'react';
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __defProps = Object.defineProperties;
|
|
11
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
-
var __spreadValues = (a, b) => {
|
|
17
|
-
for (var prop in b || (b = {}))
|
|
18
|
-
if (__hasOwnProp.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
if (__getOwnPropSymbols)
|
|
21
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
-
if (__propIsEnum.call(b, prop))
|
|
23
|
-
__defNormalProp(a, prop, b[prop]);
|
|
24
|
-
}
|
|
25
|
-
return a;
|
|
26
|
-
};
|
|
27
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
-
var __objRest = (source, exclude) => {
|
|
29
|
-
var target = {};
|
|
30
|
-
for (var prop in source)
|
|
31
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
if (source != null && __getOwnPropSymbols)
|
|
34
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
35
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
36
|
-
target[prop] = source[prop];
|
|
37
|
-
}
|
|
38
|
-
return target;
|
|
39
|
-
};
|
|
40
|
-
function cn(...inputs) {
|
|
41
|
-
return twMerge(clsx(inputs));
|
|
42
|
-
}
|
|
43
|
-
function Select(_a) {
|
|
44
|
-
var props = __objRest(_a, []);
|
|
45
|
-
return /* @__PURE__ */ jsx(Select$1.Root, __spreadValues({ "data-slot": "select" }, props));
|
|
46
|
-
}
|
|
47
|
-
function SelectGroup(_a) {
|
|
48
|
-
var props = __objRest(_a, []);
|
|
49
|
-
return /* @__PURE__ */ jsx(Select$1.Group, __spreadValues({ "data-slot": "select-group" }, props));
|
|
50
|
-
}
|
|
51
|
-
function SelectValue(_a) {
|
|
52
|
-
var props = __objRest(_a, []);
|
|
53
|
-
return /* @__PURE__ */ jsx(Select$1.Value, __spreadValues({ "data-slot": "select-value" }, props));
|
|
54
|
-
}
|
|
55
|
-
function SelectTrigger(_a) {
|
|
56
|
-
var _b = _a, {
|
|
57
|
-
className,
|
|
58
|
-
size = "default",
|
|
59
|
-
children
|
|
60
|
-
} = _b, props = __objRest(_b, [
|
|
61
|
-
"className",
|
|
62
|
-
"size",
|
|
63
|
-
"children"
|
|
64
|
-
]);
|
|
65
|
-
return /* @__PURE__ */ jsxs(
|
|
66
|
-
Select$1.Trigger,
|
|
67
|
-
__spreadProps(__spreadValues({
|
|
68
|
-
"data-slot": "select-trigger",
|
|
69
|
-
"data-size": size,
|
|
70
|
-
className: cn(
|
|
71
|
-
"cursor-pointer border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
72
|
-
className
|
|
73
|
-
)
|
|
74
|
-
}, props), {
|
|
75
|
-
children: [
|
|
76
|
-
children,
|
|
77
|
-
/* @__PURE__ */ jsx(Select$1.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
78
|
-
]
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
function SelectContent(_a) {
|
|
83
|
-
var _b = _a, {
|
|
84
|
-
className,
|
|
85
|
-
children,
|
|
86
|
-
position = "item-aligned",
|
|
87
|
-
align = "center"
|
|
88
|
-
} = _b, props = __objRest(_b, [
|
|
89
|
-
"className",
|
|
90
|
-
"children",
|
|
91
|
-
"position",
|
|
92
|
-
"align"
|
|
93
|
-
]);
|
|
94
|
-
return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsxs(
|
|
95
|
-
Select$1.Content,
|
|
96
|
-
__spreadProps(__spreadValues({
|
|
97
|
-
"data-slot": "select-content",
|
|
98
|
-
className: cn(
|
|
99
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
100
|
-
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
101
|
-
className
|
|
102
|
-
),
|
|
103
|
-
position,
|
|
104
|
-
align
|
|
105
|
-
}, props), {
|
|
106
|
-
children: [
|
|
107
|
-
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
-
Select$1.Viewport,
|
|
110
|
-
{
|
|
111
|
-
className: cn(
|
|
112
|
-
"p-1",
|
|
113
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
114
|
-
),
|
|
115
|
-
children
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
119
|
-
]
|
|
120
|
-
})
|
|
121
|
-
) });
|
|
122
|
-
}
|
|
123
|
-
function SelectLabel(_a) {
|
|
124
|
-
var _b = _a, {
|
|
125
|
-
className
|
|
126
|
-
} = _b, props = __objRest(_b, [
|
|
127
|
-
"className"
|
|
128
|
-
]);
|
|
129
|
-
return /* @__PURE__ */ jsx(
|
|
130
|
-
Select$1.Label,
|
|
131
|
-
__spreadValues({
|
|
132
|
-
"data-slot": "select-label",
|
|
133
|
-
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className)
|
|
134
|
-
}, props)
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
function SelectItem(_a) {
|
|
138
|
-
var _b = _a, {
|
|
139
|
-
className,
|
|
140
|
-
children
|
|
141
|
-
} = _b, props = __objRest(_b, [
|
|
142
|
-
"className",
|
|
143
|
-
"children"
|
|
144
|
-
]);
|
|
145
|
-
return /* @__PURE__ */ jsxs(
|
|
146
|
-
Select$1.Item,
|
|
147
|
-
__spreadProps(__spreadValues({
|
|
148
|
-
"data-slot": "select-item",
|
|
149
|
-
className: cn(
|
|
150
|
-
"cursor-pointer focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
151
|
-
className
|
|
152
|
-
)
|
|
153
|
-
}, props), {
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ jsx(
|
|
156
|
-
"span",
|
|
157
|
-
{
|
|
158
|
-
"data-slot": "select-item-indicator",
|
|
159
|
-
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
160
|
-
children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
/* @__PURE__ */ jsx(Select$1.ItemText, { children })
|
|
164
|
-
]
|
|
165
|
-
})
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
function SelectScrollUpButton(_a) {
|
|
169
|
-
var _b = _a, {
|
|
170
|
-
className
|
|
171
|
-
} = _b, props = __objRest(_b, [
|
|
172
|
-
"className"
|
|
173
|
-
]);
|
|
174
|
-
return /* @__PURE__ */ jsx(
|
|
175
|
-
Select$1.ScrollUpButton,
|
|
176
|
-
__spreadProps(__spreadValues({
|
|
177
|
-
"data-slot": "select-scroll-up-button",
|
|
178
|
-
className: cn(
|
|
179
|
-
"flex cursor-default items-center justify-center py-1",
|
|
180
|
-
className
|
|
181
|
-
)
|
|
182
|
-
}, props), {
|
|
183
|
-
children: /* @__PURE__ */ jsx(
|
|
184
|
-
ChevronUpIcon,
|
|
185
|
-
{}
|
|
186
|
-
)
|
|
187
|
-
})
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
function SelectScrollDownButton(_a) {
|
|
191
|
-
var _b = _a, {
|
|
192
|
-
className
|
|
193
|
-
} = _b, props = __objRest(_b, [
|
|
194
|
-
"className"
|
|
195
|
-
]);
|
|
196
|
-
return /* @__PURE__ */ jsx(
|
|
197
|
-
Select$1.ScrollDownButton,
|
|
198
|
-
__spreadProps(__spreadValues({
|
|
199
|
-
"data-slot": "select-scroll-down-button",
|
|
200
|
-
className: cn(
|
|
201
|
-
"flex cursor-default items-center justify-center py-1",
|
|
202
|
-
className
|
|
203
|
-
)
|
|
204
|
-
}, props), {
|
|
205
|
-
children: /* @__PURE__ */ jsx(
|
|
206
|
-
ChevronDownIcon,
|
|
207
|
-
{}
|
|
208
|
-
)
|
|
209
|
-
})
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
var initialState = {
|
|
213
|
-
systemTheme: "system",
|
|
214
|
-
resolvedTheme: "ekkolyth-light",
|
|
215
|
-
availableThemes: {
|
|
216
|
-
light: ["ekkolyth-light"],
|
|
217
|
-
dark: ["ekkolyth-dark"]
|
|
218
|
-
},
|
|
219
|
-
setSystemTheme: () => null,
|
|
220
|
-
setSpecificTheme: () => null
|
|
221
|
-
};
|
|
222
|
-
var NextThemeProviderContext = createContext(initialState);
|
|
223
|
-
function useNextTheme() {
|
|
224
|
-
const context = use(NextThemeProviderContext);
|
|
225
|
-
if (context === void 0) {
|
|
226
|
-
throw new Error("useNextTheme must be used within a NextThemeProvider");
|
|
227
|
-
}
|
|
228
|
-
return context;
|
|
229
|
-
}
|
|
230
|
-
var initialState2 = {
|
|
231
|
-
systemTheme: "system",
|
|
232
|
-
resolvedTheme: "ekkolyth-light",
|
|
233
|
-
availableThemes: {
|
|
234
|
-
light: ["ekkolyth-light"],
|
|
235
|
-
dark: ["ekkolyth-dark"]
|
|
236
|
-
},
|
|
237
|
-
setSystemTheme: () => null,
|
|
238
|
-
setSpecificTheme: () => null
|
|
239
|
-
};
|
|
240
|
-
var TanstackThemeProviderContext = createContext(initialState2);
|
|
241
|
-
function useTanstackTheme() {
|
|
242
|
-
const context = use(TanstackThemeProviderContext);
|
|
243
|
-
if (context === void 0) {
|
|
244
|
-
throw new Error(
|
|
245
|
-
"useTanstackTheme must be used within a TanstackThemeProvider"
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
return context;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// src/lib/types.ts
|
|
252
|
-
var LIGHT_THEMES = [
|
|
253
|
-
"latte",
|
|
254
|
-
"ekkoos-light",
|
|
255
|
-
"ekkolyth-light",
|
|
256
|
-
"ekko-playlist-light"
|
|
257
|
-
];
|
|
258
|
-
var DARK_THEMES = [
|
|
259
|
-
"mocha",
|
|
260
|
-
"frappe",
|
|
261
|
-
"macchiato",
|
|
262
|
-
"tokyo-night",
|
|
263
|
-
"ekkoos-dark",
|
|
264
|
-
"ekkolyth-dark",
|
|
265
|
-
"ekko-playlist-dark"
|
|
266
|
-
];
|
|
267
|
-
|
|
268
|
-
// src/lib/theme.ts
|
|
269
|
-
function isLightTheme(theme) {
|
|
270
|
-
return LIGHT_THEMES.includes(theme);
|
|
271
|
-
}
|
|
272
|
-
function isDarkTheme(theme) {
|
|
273
|
-
return DARK_THEMES.includes(theme);
|
|
274
|
-
}
|
|
275
|
-
function useTheme() {
|
|
276
|
-
try {
|
|
277
|
-
return useNextTheme();
|
|
278
|
-
} catch (e) {
|
|
279
|
-
try {
|
|
280
|
-
return useTanstackTheme();
|
|
281
|
-
} catch (e2) {
|
|
282
|
-
throw new Error(
|
|
283
|
-
"useTheme must be used within a ThemeProvider (NextThemeProvider or TanstackThemeProvider)"
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
function ThemeSelect(_a) {
|
|
289
|
-
var _b = _a, {
|
|
290
|
-
size = "default",
|
|
291
|
-
className
|
|
292
|
-
} = _b, props = __objRest(_b, [
|
|
293
|
-
"size",
|
|
294
|
-
"className"
|
|
295
|
-
]);
|
|
296
|
-
const { resolvedTheme, availableThemes, setSpecificTheme, setSystemTheme } = useTheme();
|
|
297
|
-
const handleThemeChange = (value) => {
|
|
298
|
-
const theme = value;
|
|
299
|
-
if (isLightTheme(theme)) {
|
|
300
|
-
setSpecificTheme("light", theme);
|
|
301
|
-
setSystemTheme("light");
|
|
302
|
-
} else if (isDarkTheme(theme)) {
|
|
303
|
-
setSpecificTheme("dark", theme);
|
|
304
|
-
setSystemTheme("dark");
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
const formatThemeName = (theme) => {
|
|
308
|
-
if (theme === "ekkoos-light") return "EkkoOS Light";
|
|
309
|
-
if (theme === "ekkoos-dark") return "EkkoOS Dark";
|
|
310
|
-
if (theme === "tokyo-night") return "Tokyo Night";
|
|
311
|
-
return theme.charAt(0).toUpperCase() + theme.slice(1);
|
|
312
|
-
};
|
|
313
|
-
return /* @__PURE__ */ jsxs(
|
|
314
|
-
Select,
|
|
315
|
-
__spreadProps(__spreadValues({
|
|
316
|
-
value: resolvedTheme,
|
|
317
|
-
onValueChange: handleThemeChange
|
|
318
|
-
}, props), {
|
|
319
|
-
children: [
|
|
320
|
-
/* @__PURE__ */ jsx(
|
|
321
|
-
SelectTrigger,
|
|
322
|
-
{
|
|
323
|
-
size,
|
|
324
|
-
className: cn(className),
|
|
325
|
-
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select theme" })
|
|
326
|
-
}
|
|
327
|
-
),
|
|
328
|
-
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
329
|
-
availableThemes.light.length > 0 && /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
330
|
-
/* @__PURE__ */ jsx(SelectLabel, { children: "Light Themes" }),
|
|
331
|
-
availableThemes.light.map((theme) => /* @__PURE__ */ jsx(
|
|
332
|
-
SelectItem,
|
|
333
|
-
{
|
|
334
|
-
value: theme,
|
|
335
|
-
children: formatThemeName(theme)
|
|
336
|
-
},
|
|
337
|
-
theme
|
|
338
|
-
))
|
|
339
|
-
] }),
|
|
340
|
-
availableThemes.dark.length > 0 && /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
341
|
-
/* @__PURE__ */ jsx(SelectLabel, { children: "Dark Themes" }),
|
|
342
|
-
availableThemes.dark.map((theme) => /* @__PURE__ */ jsx(
|
|
343
|
-
SelectItem,
|
|
344
|
-
{
|
|
345
|
-
value: theme,
|
|
346
|
-
children: formatThemeName(theme)
|
|
347
|
-
},
|
|
348
|
-
theme
|
|
349
|
-
))
|
|
350
|
-
] })
|
|
351
|
-
] })
|
|
352
|
-
]
|
|
353
|
-
})
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export { ThemeSelect };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { T as Toggle } from '../index-C7t_lwpi.js';
|
|
4
|
-
import 'class-variance-authority/types';
|
|
5
|
-
import 'class-variance-authority';
|
|
6
|
-
import 'radix-ui';
|
|
7
|
-
|
|
8
|
-
interface ThemeToggleProps extends React.ComponentProps<typeof Toggle> {
|
|
9
|
-
variant?: 'default' | 'outline';
|
|
10
|
-
size?: 'default' | 'sm' | 'lg';
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
declare function ThemeToggle({ variant, size, className, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
|
|
14
|
-
|
|
15
|
-
export { ThemeToggle, type ThemeToggleProps };
|