@ghostly-solutions/ui 0.3.1 → 0.3.3
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/dist/chunk-rbysacxc.js +12 -0
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/badge/badge.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.d.ts +3 -3
- package/dist/components/button/button.d.ts +3 -3
- package/dist/components/calendar/calendar.d.ts +8 -8
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/code-block/code-block.d.ts +8 -8
- package/dist/components/command/command.d.ts +1 -1
- package/dist/components/context-menu/context-menu.d.ts +5 -5
- package/dist/components/dialog/dialog.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/dist/components/empty-state/empty-state.d.ts +4 -4
- package/dist/components/error-boundary/error-boundary.d.ts +7 -7
- package/dist/components/file-upload/file-upload.d.ts +5 -5
- package/dist/components/form-field/form-field.d.ts +1 -1
- package/dist/components/hover-card/hover-card.d.ts +1 -1
- package/dist/components/kbd/kbd.d.ts +1 -1
- package/dist/components/label/label.d.ts +1 -1
- package/dist/components/loader/index.d.ts +2 -0
- package/dist/components/loader/index.d.ts.map +1 -0
- package/dist/components/loader/loader.d.ts +5 -0
- package/dist/components/loader/loader.d.ts.map +1 -0
- package/dist/components/multiselect/multiselect.d.ts +1 -1
- package/dist/components/navbar/navbar.d.ts +10 -10
- package/dist/components/navigation-menu/navigation-menu.d.ts +2 -2
- package/dist/components/otp-input/otp-input.d.ts +6 -6
- package/dist/components/pagination/pagination.d.ts +2 -2
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +3 -3
- package/dist/components/sidebar/sidebar.d.ts +12 -12
- package/dist/components/skeleton/skeleton.d.ts +3 -3
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/spotlight/spotlight.d.ts +1 -1
- package/dist/components/stat-card/stat-card.d.ts +1 -1
- package/dist/components/stepper/stepper.d.ts +4 -4
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/table/table.d.ts +3 -3
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +7 -7
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/toggle/toggle.d.ts +1 -1
- package/dist/components/toolbar/toolbar.d.ts +2 -2
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/ui-provider/index.d.ts +2 -0
- package/dist/components/ui-provider/index.d.ts.map +1 -0
- package/dist/components/ui-provider/ui-provider.d.ts +13 -0
- package/dist/components/ui-provider/ui-provider.d.ts.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/density.d.ts +6 -8
- package/dist/lib/density.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/theme/constants.d.ts +17 -0
- package/dist/lib/theme/constants.d.ts.map +1 -0
- package/dist/lib/theme/core.d.ts +94 -0
- package/dist/lib/theme/core.d.ts.map +1 -0
- package/dist/lib/theme/index.d.ts +5 -0
- package/dist/lib/theme/index.d.ts.map +1 -0
- package/dist/lib/theme/provider.d.ts +43 -0
- package/dist/lib/theme/provider.d.ts.map +1 -0
- package/dist/lib/theme/system.d.ts +82 -0
- package/dist/lib/theme/system.d.ts.map +1 -0
- package/dist/server.d.ts +1 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-rd0k3j0c.js +0 -2
- package/dist/lib/theme-constants.d.ts +0 -13
- package/dist/lib/theme-constants.d.ts.map +0 -1
- package/dist/lib/theme-script.d.ts +0 -12
- package/dist/lib/theme-script.d.ts.map +0 -1
- package/dist/lib/theme.d.ts +0 -26
- package/dist/lib/theme.d.ts.map +0 -1
package/dist/lib/density.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type DensityValue = (typeof Density)[keyof typeof Density];
|
|
7
|
-
declare const DensityContext: import("react").Context<DensityValue>;
|
|
2
|
+
import type { Size } from "./types";
|
|
3
|
+
type DensityValue = Size;
|
|
4
|
+
declare const DENSITY_DEFAULT: DensityValue;
|
|
5
|
+
declare const DensityContext: import("react").Context<Size>;
|
|
8
6
|
interface DensityProviderProps {
|
|
9
7
|
density: DensityValue;
|
|
10
8
|
children: ReactNode;
|
|
@@ -15,6 +13,6 @@ declare const DensityProvider: {
|
|
|
15
13
|
};
|
|
16
14
|
declare const useDensity: () => DensityValue;
|
|
17
15
|
declare function useDensitySize<T extends string>(size: T): T;
|
|
18
|
-
declare function useDensitySize<T extends string>(size: T | undefined): T
|
|
19
|
-
export {
|
|
16
|
+
declare function useDensitySize<T extends string>(size: T | undefined): T;
|
|
17
|
+
export { DENSITY_DEFAULT, DensityContext, DensityProvider, type DensityProviderProps, type DensityValue, useDensity, useDensitySize, };
|
|
20
18
|
//# sourceMappingURL=density.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"density.d.ts","sourceRoot":"","sources":["../../src/lib/density.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"density.d.ts","sourceRoot":"","sources":["../../src/lib/density.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AACxF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,KAAK,YAAY,GAAG,IAAI,CAAC;AAEzB,QAAA,MAAM,eAAe,EAAE,YAAmB,CAAC;AAE3C,QAAA,MAAM,cAAc,+BAAoD,CAAC;AAEzE,UAAU,oBAAoB;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,QAAA,MAAM,eAAe;4BAA2B,oBAAoB;;CAEnE,CAAC;AAIF,QAAA,MAAM,UAAU,QAAO,YAEtB,CAAC;AAEF,iBAAS,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;AACtD,iBAAS,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;AAOlE,OAAO,EACN,eAAe,EACf,cAAc,EACd,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,UAAU,EACV,cAAc,GACd,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { type ClassValue, cn } from "./cn";
|
|
5
5
|
export { composeRefs, createContext, createOptionalContext, useComposedRefs } from "./compose";
|
|
6
|
-
export {
|
|
6
|
+
export { DENSITY_DEFAULT, DensityProvider, type DensityProviderProps, type DensityValue, useDensity, useDensitySize, } from "./density";
|
|
7
7
|
export * from "./types";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,EACN,eAAe,EACf,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,UAAU,EACV,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const ColorScheme: {
|
|
2
|
+
readonly light: "light";
|
|
3
|
+
readonly dark: "dark";
|
|
4
|
+
readonly system: "system";
|
|
5
|
+
};
|
|
6
|
+
type ColorSchemeValue = (typeof ColorScheme)[keyof typeof ColorScheme];
|
|
7
|
+
type ResolvedColorScheme = "light" | "dark";
|
|
8
|
+
declare const THEME_ATTR = "data-gs-theme";
|
|
9
|
+
declare const THEME_COLOR_SCHEME_ATTR = "data-gs-color-scheme";
|
|
10
|
+
declare const DARK_CLASS = "dark";
|
|
11
|
+
declare const STORAGE_VERSION = 1;
|
|
12
|
+
declare const STORAGE_PREFIX = "gs";
|
|
13
|
+
declare const STORAGE_THEME_STATE_KEY = "gs-theme-state";
|
|
14
|
+
declare const STORAGE_DENSITY_KEY = "gs-density";
|
|
15
|
+
declare const THEME_COOKIE_NAME = "gs-theme-state";
|
|
16
|
+
export { ColorScheme, DARK_CLASS, STORAGE_DENSITY_KEY, STORAGE_PREFIX, STORAGE_THEME_STATE_KEY, STORAGE_VERSION, THEME_ATTR, THEME_COLOR_SCHEME_ATTR, THEME_COOKIE_NAME, type ColorSchemeValue, type ResolvedColorScheme, };
|
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/theme/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW;;;;CAIP,CAAC;AAEX,KAAK,gBAAgB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AACvE,KAAK,mBAAmB,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,QAAA,MAAM,UAAU,kBAAkB,CAAC;AACnC,QAAA,MAAM,uBAAuB,yBAAyB,CAAC;AACvD,QAAA,MAAM,UAAU,SAAS,CAAC;AAE1B,QAAA,MAAM,eAAe,IAAI,CAAC;AAC1B,QAAA,MAAM,cAAc,OAAO,CAAC;AAC5B,QAAA,MAAM,uBAAuB,mBAAkC,CAAC;AAChE,QAAA,MAAM,mBAAmB,eAA8B,CAAC;AACxD,QAAA,MAAM,iBAAiB,mBAAkC,CAAC;AAE1D,OAAO,EACN,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACxB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type ColorSchemeValue, type ResolvedColorScheme } from "./constants";
|
|
2
|
+
type ThemeStorageMode = "localStorage" | "cookie" | "both";
|
|
3
|
+
type ThemeCookieSameSite = "lax" | "strict" | "none";
|
|
4
|
+
interface ThemeState {
|
|
5
|
+
theme: string;
|
|
6
|
+
colorScheme: ColorSchemeValue;
|
|
7
|
+
}
|
|
8
|
+
interface ResolvedThemeState extends ThemeState {
|
|
9
|
+
resolvedColorScheme: ResolvedColorScheme;
|
|
10
|
+
}
|
|
11
|
+
interface ThemeCookieOptions {
|
|
12
|
+
name?: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
maxAge?: number;
|
|
15
|
+
sameSite?: ThemeCookieSameSite;
|
|
16
|
+
secure?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ThemeStorageOptions {
|
|
19
|
+
mode?: ThemeStorageMode;
|
|
20
|
+
key?: string;
|
|
21
|
+
cookie?: ThemeCookieOptions;
|
|
22
|
+
}
|
|
23
|
+
interface ThemeContractOptions {
|
|
24
|
+
defaultTheme?: string;
|
|
25
|
+
defaultColorScheme?: ColorSchemeValue;
|
|
26
|
+
themes?: readonly string[];
|
|
27
|
+
attribute?: string;
|
|
28
|
+
colorSchemeAttribute?: string | false;
|
|
29
|
+
darkClassName?: string;
|
|
30
|
+
storage?: ThemeStorageOptions | false;
|
|
31
|
+
}
|
|
32
|
+
interface ThemeContract {
|
|
33
|
+
defaultTheme: string;
|
|
34
|
+
defaultColorScheme: ColorSchemeValue;
|
|
35
|
+
themes: readonly string[];
|
|
36
|
+
attribute: string;
|
|
37
|
+
colorSchemeAttribute: string | false;
|
|
38
|
+
darkClassName: string;
|
|
39
|
+
storage: NormalizedThemeStorageOptions | false;
|
|
40
|
+
}
|
|
41
|
+
interface NormalizedThemeStorageOptions {
|
|
42
|
+
mode: ThemeStorageMode;
|
|
43
|
+
key: string;
|
|
44
|
+
cookie: Required<ThemeCookieOptions>;
|
|
45
|
+
}
|
|
46
|
+
interface ResolveThemeStateOptions extends ThemeContractOptions {
|
|
47
|
+
state?: Partial<ThemeState> | null;
|
|
48
|
+
cookieHeader?: string | null;
|
|
49
|
+
systemColorScheme?: ResolvedColorScheme;
|
|
50
|
+
}
|
|
51
|
+
interface ThemeRootProps {
|
|
52
|
+
attributes: Record<string, string>;
|
|
53
|
+
className: string;
|
|
54
|
+
style: {
|
|
55
|
+
colorScheme: ResolvedColorScheme;
|
|
56
|
+
};
|
|
57
|
+
state: ResolvedThemeState;
|
|
58
|
+
}
|
|
59
|
+
type ThemeTokenValue = string;
|
|
60
|
+
type ThemeTokenMap = Record<string, ThemeTokenValue>;
|
|
61
|
+
interface CreateThemeCssOptions {
|
|
62
|
+
theme: string;
|
|
63
|
+
light: ThemeTokenMap;
|
|
64
|
+
dark?: ThemeTokenMap;
|
|
65
|
+
attribute?: string;
|
|
66
|
+
darkClassName?: string;
|
|
67
|
+
}
|
|
68
|
+
interface ThemeCssDefinition {
|
|
69
|
+
theme: string;
|
|
70
|
+
light: ThemeTokenMap;
|
|
71
|
+
dark?: ThemeTokenMap;
|
|
72
|
+
}
|
|
73
|
+
interface CreateThemesCssOptions {
|
|
74
|
+
themes: readonly ThemeCssDefinition[];
|
|
75
|
+
attribute?: string;
|
|
76
|
+
darkClassName?: string;
|
|
77
|
+
}
|
|
78
|
+
declare function createThemeContract(options?: ThemeContractOptions): ThemeContract;
|
|
79
|
+
declare function normalizeThemeState(state: Partial<ThemeState> | null | undefined, options?: ThemeContractOptions): ThemeState;
|
|
80
|
+
declare function serializeThemeState(state: ThemeState, options?: ThemeContractOptions): string;
|
|
81
|
+
declare function parseThemeState(raw: string | null | undefined): ThemeState | null;
|
|
82
|
+
declare function readThemeStateFromCookieHeader(cookieHeader: string | null | undefined, options?: ThemeContractOptions): ThemeState | null;
|
|
83
|
+
declare function createThemeSetCookieHeader(state: ThemeState, options?: ThemeContractOptions): string | null;
|
|
84
|
+
declare function readThemeStateFromBrowserStorage(options?: ThemeContractOptions): ThemeState | null;
|
|
85
|
+
declare function writeThemeStateToBrowserStorage(state: ThemeState, options?: ThemeContractOptions): void;
|
|
86
|
+
declare function resolveColorScheme(colorScheme: ColorSchemeValue, systemColorScheme: ResolvedColorScheme): ResolvedColorScheme;
|
|
87
|
+
declare function getSystemColorScheme(): ResolvedColorScheme;
|
|
88
|
+
declare function resolveThemeState(options?: ResolveThemeStateOptions): ResolvedThemeState;
|
|
89
|
+
declare function getThemeRootProps(state: ThemeState | ResolvedThemeState, options?: ThemeContractOptions, systemColorScheme?: ResolvedColorScheme): ThemeRootProps;
|
|
90
|
+
declare function applyThemeStateToElement(element: HTMLElement, state: ThemeState | ResolvedThemeState, options?: ThemeContractOptions): ResolvedThemeState;
|
|
91
|
+
declare function createThemeCss(options: CreateThemeCssOptions): string;
|
|
92
|
+
declare function createThemesCss(options: CreateThemesCssOptions): string;
|
|
93
|
+
export { applyThemeStateToElement, createThemeContract, createThemeCss, createThemeSetCookieHeader, createThemesCss, getSystemColorScheme, getThemeRootProps, normalizeThemeState, parseThemeState, readThemeStateFromBrowserStorage, readThemeStateFromCookieHeader, resolveColorScheme, resolveThemeState, serializeThemeState, writeThemeStateToBrowserStorage, type CreateThemeCssOptions, type CreateThemesCssOptions, type ResolveThemeStateOptions, type ResolvedThemeState, type ThemeContract, type ThemeContractOptions, type ThemeCookieOptions, type ThemeCookieSameSite, type ThemeCssDefinition, type ThemeRootProps, type ThemeState, type ThemeStorageMode, type ThemeStorageOptions, type ThemeTokenMap, type ThemeTokenValue, };
|
|
94
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/lib/theme/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,gBAAgB,EAErB,KAAK,mBAAmB,EAKxB,MAAM,aAAa,CAAC;AAErB,KAAK,gBAAgB,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3D,KAAK,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErD,UAAU,UAAU;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,gBAAgB,CAAC;CAC9B;AAED,UAAU,kBAAmB,SAAQ,UAAU;IAC9C,mBAAmB,EAAE,mBAAmB,CAAC;CACzC;AAED,UAAU,kBAAkB;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC5B,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EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,eAAe,GACpB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ColorScheme, type ColorSchemeValue, DARK_CLASS, type ResolvedColorScheme, STORAGE_DENSITY_KEY, STORAGE_PREFIX, STORAGE_THEME_STATE_KEY, STORAGE_VERSION, THEME_ATTR, THEME_COLOR_SCHEME_ATTR, THEME_COOKIE_NAME, } from "./constants";
|
|
2
|
+
export { applyThemeStateToElement, type CreateThemeCssOptions, type CreateThemesCssOptions, createThemeContract, createThemeCss, createThemeSetCookieHeader, createThemesCss, getSystemColorScheme, getThemeRootProps, normalizeThemeState, parseThemeState, type ResolvedThemeState, type ResolveThemeStateOptions, readThemeStateFromBrowserStorage, readThemeStateFromCookieHeader, resolveColorScheme, resolveThemeState, serializeThemeState, type ThemeContract, type ThemeContractOptions, type ThemeCookieOptions, type ThemeCookieSameSite, type ThemeCssDefinition, type ThemeRootProps, type ThemeState, type ThemeStorageMode, type ThemeStorageOptions, type ThemeTokenMap, type ThemeTokenValue, writeThemeStateToBrowserStorage, } from "./core";
|
|
3
|
+
export { ThemeContext, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, type ThemeStateChangeMeta, type ThemeStateChangeReason, type ThemeStateReader, type ThemeStateWriter, useTheme, } from "./provider";
|
|
4
|
+
export { createThemeRegistry, createThemeSystem, defineThemes, type CreateThemeSystemOptions, type ResolvedThemeStateFor, type ThemeContextValueFor, type ThemeCssTextDefinition, type ThemeRegistry, type ThemeRegistryDefinition, type ThemeRegistryInput, type ThemeRegistryOptions, ThemeRegistryProvider, type ThemeRegistryProviderProps, type ThemeRegistryRecord, type ThemeRegistryRecordValue, type ThemeStateFor, type ThemeStateUpdateFor, ThemeStyles, type ThemeStylesProps, type ThemeSystem, type ThemeSystemProviderProps, type ThemeSystemStylesProps, type ThemeTokenDefinition, } from "./system";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,+BAA+B,GAC/B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACN,YAAY,EACZ,KAAK,iBAAiB,EACtB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,QAAQ,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GACzB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { ColorScheme, type ColorSchemeValue, type ResolvedColorScheme } from "./constants";
|
|
3
|
+
import { type ResolvedThemeState, type ThemeContract, type ThemeContractOptions, type ThemeState } from "./core";
|
|
4
|
+
type ThemeStateUpdate = ThemeState | Partial<ThemeState> | ((current: ThemeState) => ThemeState | Partial<ThemeState>);
|
|
5
|
+
type ThemeStateChangeReason = "hydrate" | "set-state" | "set-theme" | "set-color-scheme" | "toggle-color-scheme";
|
|
6
|
+
interface ThemeStateChangeMeta {
|
|
7
|
+
reason: ThemeStateChangeReason;
|
|
8
|
+
previousState: ThemeState;
|
|
9
|
+
}
|
|
10
|
+
type ThemeStateReader = (contract: ThemeContract) => ThemeState | null;
|
|
11
|
+
type ThemeStateWriter = (state: ThemeState, contract: ThemeContract, meta: ThemeStateChangeMeta) => void;
|
|
12
|
+
interface ThemeContextValue {
|
|
13
|
+
theme: string;
|
|
14
|
+
colorScheme: ColorSchemeValue;
|
|
15
|
+
resolvedColorScheme: ResolvedColorScheme;
|
|
16
|
+
state: ThemeState;
|
|
17
|
+
resolvedState: ResolvedThemeState;
|
|
18
|
+
contract: ThemeContract;
|
|
19
|
+
themes: readonly string[];
|
|
20
|
+
setTheme: (theme: string) => void;
|
|
21
|
+
setColorScheme: (scheme: ColorSchemeValue) => void;
|
|
22
|
+
setState: (state: ThemeStateUpdate) => void;
|
|
23
|
+
toggleColorScheme: () => void;
|
|
24
|
+
}
|
|
25
|
+
declare const ThemeContext: import("react").Context<ThemeContextValue | null>;
|
|
26
|
+
interface ThemeProviderProps extends ThemeContractOptions {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
value?: ThemeState;
|
|
29
|
+
initialState?: Partial<ThemeState>;
|
|
30
|
+
onChange?: (state: ThemeState, meta: ThemeStateChangeMeta) => void;
|
|
31
|
+
onStateChange?: (state: ThemeState, meta: ThemeStateChangeMeta) => void;
|
|
32
|
+
transformState?: (state: ThemeState, meta: ThemeStateChangeMeta) => ThemeState;
|
|
33
|
+
readState?: ThemeStateReader;
|
|
34
|
+
writeState?: ThemeStateWriter;
|
|
35
|
+
syncWithSystem?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const ThemeProvider: {
|
|
38
|
+
({ children, value, initialState, onChange, onStateChange, transformState, readState, writeState, syncWithSystem, defaultTheme, defaultColorScheme, themes, attribute, colorSchemeAttribute, darkClassName, storage, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
declare const useTheme: () => ThemeContextValue;
|
|
42
|
+
export { ColorScheme, ThemeContext, ThemeProvider, useTheme, type ColorSchemeValue, type ResolvedColorScheme, type ResolvedThemeState, type ThemeStateChangeMeta, type ThemeStateChangeReason, type ThemeContextValue, type ThemeProviderProps, type ThemeState, type ThemeStateReader, type ThemeStateWriter, };
|
|
43
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/theme/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,SAAS,EAQd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAKN,KAAK,kBAAkB,EAGvB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAEf,MAAM,QAAQ,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C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACnE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,KAAK,UAAU,CAAC;IAC/E,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAMD,QAAA,MAAM,aAAa;4NAiBhB,kBAAkB;;CA+OpB,CAAC;AAIF,QAAA,MAAM,QAAQ,QAAO,iBAMpB,CAAC;AAEF,OAAO,EACN,WAAW,EACX,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACrB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { createThemeContract, type ResolvedThemeState, type ThemeContractOptions, type ThemeState, type ThemeTokenMap } from "./core";
|
|
3
|
+
import { type ThemeContextValue, type ThemeProviderProps } from "./provider";
|
|
4
|
+
interface ThemeTokenDefinition {
|
|
5
|
+
light: ThemeTokenMap;
|
|
6
|
+
dark?: ThemeTokenMap;
|
|
7
|
+
}
|
|
8
|
+
interface ThemeCssTextDefinition {
|
|
9
|
+
cssText: string;
|
|
10
|
+
}
|
|
11
|
+
type ThemeRegistryRecordValue = ThemeTokenDefinition | ThemeCssTextDefinition | string;
|
|
12
|
+
type ThemeRegistryRecord<ThemeName extends string = string> = Record<ThemeName, ThemeRegistryRecordValue>;
|
|
13
|
+
interface ThemeTokenRegistryDefinition<ThemeName extends string = string> extends ThemeTokenDefinition {
|
|
14
|
+
theme: ThemeName;
|
|
15
|
+
}
|
|
16
|
+
interface ThemeCssRegistryDefinition<ThemeName extends string = string> extends ThemeCssTextDefinition {
|
|
17
|
+
theme: ThemeName;
|
|
18
|
+
}
|
|
19
|
+
type ThemeRegistryDefinition<ThemeName extends string = string> = ThemeName | ThemeTokenRegistryDefinition<ThemeName> | ThemeCssRegistryDefinition<ThemeName>;
|
|
20
|
+
type ThemeRegistryInput<ThemeName extends string = string> = readonly ThemeRegistryDefinition<ThemeName>[] | ThemeRegistryRecord<ThemeName>;
|
|
21
|
+
type ThemeNameFromInput<TThemes> = TThemes extends readonly (infer TEntry)[] ? TEntry extends string ? TEntry : TEntry extends {
|
|
22
|
+
theme: infer TThemeName extends string;
|
|
23
|
+
} ? TThemeName : never : TThemes extends Record<string, unknown> ? Extract<keyof TThemes, string> : string;
|
|
24
|
+
interface ThemeRegistryOptions<TThemes extends ThemeRegistryInput = ThemeRegistryInput> extends Omit<ThemeContractOptions, "themes"> {
|
|
25
|
+
themes: TThemes;
|
|
26
|
+
cssText?: string;
|
|
27
|
+
}
|
|
28
|
+
interface ThemeRegistry<ThemeName extends string = string> {
|
|
29
|
+
defaultTheme: ThemeName;
|
|
30
|
+
themes: readonly ThemeName[];
|
|
31
|
+
cssText: string;
|
|
32
|
+
contract: ReturnType<typeof createThemeContract>;
|
|
33
|
+
}
|
|
34
|
+
type ThemeStateFor<ThemeName extends string> = Omit<ThemeState, "theme"> & {
|
|
35
|
+
theme: ThemeName;
|
|
36
|
+
};
|
|
37
|
+
type ResolvedThemeStateFor<ThemeName extends string> = Omit<ResolvedThemeState, "theme"> & {
|
|
38
|
+
theme: ThemeName;
|
|
39
|
+
};
|
|
40
|
+
type ThemeStateUpdateFor<ThemeName extends string> = ThemeStateFor<ThemeName> | Partial<ThemeStateFor<ThemeName>> | ((current: ThemeStateFor<ThemeName>) => ThemeStateFor<ThemeName> | Partial<ThemeStateFor<ThemeName>>);
|
|
41
|
+
interface ThemeContextValueFor<ThemeName extends string> extends Omit<ThemeContextValue, "theme" | "state" | "resolvedState" | "themes" | "setTheme" | "setState"> {
|
|
42
|
+
theme: ThemeName;
|
|
43
|
+
state: ThemeStateFor<ThemeName>;
|
|
44
|
+
resolvedState: ResolvedThemeStateFor<ThemeName>;
|
|
45
|
+
themes: readonly ThemeName[];
|
|
46
|
+
setTheme: (theme: ThemeName) => void;
|
|
47
|
+
setState: (state: ThemeStateUpdateFor<ThemeName>) => void;
|
|
48
|
+
}
|
|
49
|
+
interface ThemeRegistryProviderProps<ThemeName extends string = string> extends Omit<ThemeProviderProps, "defaultTheme" | "themes" | "attribute" | "colorSchemeAttribute" | "darkClassName"> {
|
|
50
|
+
registry: ThemeRegistry<ThemeName>;
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
}
|
|
53
|
+
interface ThemeStylesProps<ThemeName extends string = string> {
|
|
54
|
+
registry: ThemeRegistry<ThemeName>;
|
|
55
|
+
id?: string;
|
|
56
|
+
nonce?: string;
|
|
57
|
+
media?: string;
|
|
58
|
+
}
|
|
59
|
+
type ThemeSystemProviderProps = Omit<ThemeProviderProps, "children" | "defaultTheme" | "themes"> & {
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
};
|
|
62
|
+
type ThemeSystemStylesProps<ThemeName extends string> = Omit<ThemeStylesProps<ThemeName>, "registry">;
|
|
63
|
+
interface ThemeSystem<ThemeName extends string = string> {
|
|
64
|
+
registry: ThemeRegistry<ThemeName>;
|
|
65
|
+
provider: (props: ThemeSystemProviderProps) => ReactNode;
|
|
66
|
+
styles: (props?: ThemeSystemStylesProps<ThemeName>) => ReactNode;
|
|
67
|
+
useTheme: () => ThemeContextValueFor<ThemeName>;
|
|
68
|
+
}
|
|
69
|
+
type CreateThemeSystemOptions<TThemes extends ThemeRegistryInput = ThemeRegistryInput> = ThemeRegistryOptions<TThemes> & Omit<ThemeProviderProps, "children" | "defaultTheme" | "themes">;
|
|
70
|
+
declare function defineThemes<const TThemes extends ThemeRegistryInput>(themes: TThemes): TThemes;
|
|
71
|
+
declare function createThemeRegistry<const TThemes extends ThemeRegistryInput>(options: ThemeRegistryOptions<TThemes>): ThemeRegistry<ThemeNameFromInput<TThemes>>;
|
|
72
|
+
declare function ThemeRegistryProvider<ThemeName extends string>({ registry, children, ...props }: ThemeRegistryProviderProps<ThemeName>): import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
declare namespace ThemeRegistryProvider {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
declare function ThemeStyles<ThemeName extends string>({ registry, id, nonce, media, }: ThemeStylesProps<ThemeName>): import("react/jsx-runtime").JSX.Element | null;
|
|
77
|
+
declare namespace ThemeStyles {
|
|
78
|
+
var displayName: string;
|
|
79
|
+
}
|
|
80
|
+
declare function createThemeSystem<const TThemes extends ThemeRegistryInput>(options: CreateThemeSystemOptions<TThemes>): ThemeSystem<ThemeNameFromInput<TThemes>>;
|
|
81
|
+
export { createThemeRegistry, createThemeSystem, defineThemes, ThemeRegistryProvider, ThemeStyles, type CreateThemeSystemOptions, type ResolvedThemeStateFor, type ThemeContextValueFor, type ThemeCssTextDefinition, type ThemeRegistry, type ThemeRegistryDefinition, type ThemeRegistryInput, type ThemeRegistryOptions, type ThemeRegistryProviderProps, type ThemeRegistryRecord, type ThemeRegistryRecordValue, type ThemeStateFor, type ThemeStateUpdateFor, type ThemeStylesProps, type ThemeSystem, type ThemeSystemProviderProps, type ThemeSystemStylesProps, type ThemeTokenDefinition, };
|
|
82
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../src/lib/theme/system.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACN,mBAAmB,EA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AC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GACzB,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export { type ClassValue, cn } from "./lib/cn";
|
|
|
3
3
|
export { composeRefs, createContext, createOptionalContext } from "./lib/compose";
|
|
4
4
|
export { formatHotkey, formatHotkeyTokens, type HotkeyDefinition, matchHotkey, parseHotkey, } from "./lib/hotkey";
|
|
5
5
|
export { detectPlatform, type PlatformInfo, type PlatformOS } from "./lib/platform";
|
|
6
|
-
export { ColorScheme, type ColorSchemeValue, type ResolvedColorScheme, } from "./lib/theme
|
|
7
|
-
export { getThemeInitScript, type ThemeScriptOptions } from "./lib/theme-script";
|
|
6
|
+
export { ColorScheme, type ColorSchemeValue, type CreateThemeCssOptions, type CreateThemesCssOptions, createThemeContract, createThemeCss, createThemeRegistry, createThemeSetCookieHeader, createThemeSystem, createThemesCss, DARK_CLASS, defineThemes, getSystemColorScheme, getThemeRootProps, normalizeThemeState, parseThemeState, type ResolvedColorScheme, type ResolvedThemeState, type ResolvedThemeStateFor, type ResolveThemeStateOptions, readThemeStateFromCookieHeader, resolveThemeState, STORAGE_DENSITY_KEY, STORAGE_PREFIX, STORAGE_THEME_STATE_KEY, STORAGE_VERSION, serializeThemeState, THEME_ATTR, THEME_COLOR_SCHEME_ATTR, THEME_COOKIE_NAME, type CreateThemeSystemOptions, type ThemeContract, type ThemeContractOptions, type ThemeContextValueFor, type ThemeCookieOptions, type ThemeCookieSameSite, type ThemeCssDefinition, type ThemeCssTextDefinition, type ThemeRegistry, type ThemeRegistryDefinition, type ThemeRegistryInput, type ThemeRegistryOptions, ThemeRegistryProvider, type ThemeRegistryProviderProps, type ThemeRegistryRecord, type ThemeRegistryRecordValue, type ThemeRootProps, type ThemeState, type ThemeStateFor, type ThemeStateUpdateFor, type ThemeStorageMode, type ThemeStorageOptions, ThemeStyles, type ThemeStylesProps, type ThemeSystem, type ThemeSystemProviderProps, type ThemeSystemStylesProps, type ThemeTokenDefinition, type ThemeTokenMap, type ThemeTokenValue, } from "./lib/theme";
|
|
8
7
|
export type { Align, BaseProps, ControlSize, ControlStatus, ControlVariant, DisableableProps, EmphasisLevel, LoadableProps, MotionLevel, Orientation, PolymorphicComponentProps, PolymorphicComponentPropsWithRef, Side, Size, SlotProps, Status, SurfaceStyle, Variant, } from "./lib/types";
|
|
9
8
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,UAAU,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,WAAW,EACX,WAAW,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACN,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,UAAU,EAAE,EAAE,EAAE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,EAChB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,eAAe,GACpB,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,KAAK,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,yBAAyB,EACzB,gCAAgC,EAChC,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,MAAM,EACN,YAAY,EACZ,OAAO,GACP,MAAM,aAAa,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{B as _,C as k,D as H,E as v,F as x,I as A,J as u,K as M,L as V,M as D,a as e,b as t,d as o,e as r,f as p,g as m,h as s,i as y,j as T,k as a,l as i,m as h,n,o as S,p as l,q as C,r as R,s as c,t as E,u as f,v as P,w as O,x as d,y as g}from"./chunk-rbysacxc.js";import{cva as L}from"class-variance-authority";export{P as serializeThemeState,k as resolveThemeState,d as readThemeStateFromCookieHeader,O as parseThemeState,m as parseHotkey,f as normalizeThemeState,s as matchHotkey,H as getThemeRootProps,_ as getSystemColorScheme,T as formatHotkeyTokens,y as formatHotkey,p as detectPlatform,A as defineThemes,L as cva,x as createThemesCss,D as createThemeSystem,g as createThemeSetCookieHeader,u as createThemeRegistry,v as createThemeCss,E as createThemeContract,r as createOptionalContext,o as createContext,t as composeRefs,e as cn,V as ThemeStyles,M as ThemeRegistryProvider,c as THEME_COOKIE_NAME,h as THEME_COLOR_SCHEME_ATTR,i as THEME_ATTR,S as STORAGE_VERSION,C as STORAGE_THEME_STATE_KEY,l as STORAGE_PREFIX,R as STORAGE_DENSITY_KEY,n as DARK_CLASS,a as ColorScheme};
|