@codefast/theme 0.3.12-canary.0 → 0.3.12-canary.1
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/CHANGELOG.md +36 -0
- package/dist/adapters/tanstack-start/server.d.ts +2 -2
- package/dist/core/provider.d.ts +1 -1
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/dom.js +2 -2
- package/dist/utils/system.js +3 -3
- package/package.json +15 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @codefast/theme
|
|
2
2
|
|
|
3
|
+
## 0.3.12-canary.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`b393c9b`](https://github.com/codefastlabs/codefast/commit/b393c9b780c6776c04cc26d6058c574929bbc6b5) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): update imports to use scoped `@codefast/tailwind-variants`
|
|
8
|
+
|
|
9
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`e1b045f`](https://github.com/codefastlabs/codefast/commit/e1b045f16621807e61648cd77cc2486e10021ce5) Thanks [@thevuong](https://github.com/thevuong)! - feat(scripts): add bucket label summarization for grouping
|
|
10
|
+
|
|
11
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`165e92a`](https://github.com/codefastlabs/codefast/commit/165e92a92f6198493e17d29fc225216622c6c5ab) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): improve test coverage and simplify utilities
|
|
12
|
+
|
|
13
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`8670d9e`](https://github.com/codefastlabs/codefast/commit/8670d9e2dc593fc569471dd96e2df185fa0a68b5) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): enhance comments and logging in `arrange` module
|
|
14
|
+
|
|
15
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`5165100`](https://github.com/codefastlabs/codefast/commit/5165100bdf6af2b13c30cc3f257f05dd7b3c859b) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): remove outdated unit tests for `arrange`
|
|
16
|
+
|
|
17
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`881b85f`](https://github.com/codefastlabs/codefast/commit/881b85fc2759c49137e7dcb049fb1a88a9ad67f0) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): reduce visual noise in Tailwind classes
|
|
18
|
+
|
|
19
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`b7feafb`](https://github.com/codefastlabs/codefast/commit/b7feafb02188ea6fcc34a75440d190dd5809b744) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): standardize variable names in `arrange` module for clarity
|
|
20
|
+
|
|
21
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`2f14ad3`](https://github.com/codefastlabs/codefast/commit/2f14ad317df1f13b48db69e0927abebb63dafc3e) Thanks [@thevuong](https://github.com/thevuong)! - feat(cli): implement `arrange` module for token analysis and formatting
|
|
22
|
+
|
|
23
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`2c4b3de`](https://github.com/codefastlabs/codefast/commit/2c4b3def4b249a02646d0a4ca68670955ec033e9) Thanks [@thevuong](https://github.com/thevuong)! - feat(docs): update CLI README with expanded usage details
|
|
24
|
+
|
|
25
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`6b32eb5`](https://github.com/codefastlabs/codefast/commit/6b32eb56d81b411c1a3736208a6f3b93c0f9aeba) Thanks [@thevuong](https://github.com/thevuong)! - feat(cli): localize `arrange` module and enhance error handling
|
|
26
|
+
|
|
27
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`f964767`](https://github.com/codefastlabs/codefast/commit/f96476757b4cf40100e0ee92f777219fd69f406b) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): replace `ArrangeFs` and `ArrangeLogger` with `CliFs` and `CliLogger`
|
|
28
|
+
|
|
29
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`9c3a840`](https://github.com/codefastlabs/codefast/commit/9c3a840f024ecd401b9052e104933fd2189ff51a) Thanks [@thevuong](https://github.com/thevuong)! - feat(cli): refine `arrange` token handling and enhance compatibility
|
|
30
|
+
|
|
31
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`a721bb6`](https://github.com/codefastlabs/codefast/commit/a721bb6e938308194bf810c9e1143d389dc17c61) Thanks [@thevuong](https://github.com/thevuong)! - test(cli): improve test coverage and add repo root tests
|
|
32
|
+
|
|
33
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`e11a468`](https://github.com/codefastlabs/codefast/commit/e11a4689cc3821624c93cbd151fc86616fb59578) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): restructure `arrange` imports and improve dependency management
|
|
34
|
+
|
|
35
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`bb616f0`](https://github.com/codefastlabs/codefast/commit/bb616f0fddab38e1fc87c296dac5506a7e0386c3) Thanks [@thevuong](https://github.com/thevuong)! - refactor(cli): reorganize `arrange` and `mirror` modules, extract utilities
|
|
36
|
+
|
|
37
|
+
- [#387](https://github.com/codefastlabs/codefast/pull/387) [`56b6f43`](https://github.com/codefastlabs/codefast/commit/56b6f43ff42be0e80d81392f5104ce6fc3e2d022) Thanks [@thevuong](https://github.com/thevuong)! - feat(cli): enhance workspace package discovery in `mirror sync`
|
|
38
|
+
|
|
3
39
|
## 0.3.12-canary.0
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -32,7 +32,7 @@ export declare const getRootThemeServerFn: import("@tanstack/react-start").Optio
|
|
|
32
32
|
* const theme = await getThemeServerFn();
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare const getThemeServerFn: import("@tanstack/react-start").OptionalFetcher<undefined, undefined, "
|
|
35
|
+
export declare const getThemeServerFn: import("@tanstack/react-start").OptionalFetcher<undefined, undefined, "dark" | "light" | "system">;
|
|
36
36
|
/**
|
|
37
37
|
* Resolved OS theme for SSR / hydration, from Client Hints when the browser sends them.
|
|
38
38
|
*
|
|
@@ -59,8 +59,8 @@ export declare const getSsrSystemThemeServerFn: import("@tanstack/react-start").
|
|
|
59
59
|
* @see [TanStack Start Server Functions](https://tanstack.com/start/latest/docs/framework/react/server-functions)
|
|
60
60
|
*/
|
|
61
61
|
export declare const setThemeServerFn: import("@tanstack/react-start").RequiredFetcher<undefined, import("zod").ZodEnum<{
|
|
62
|
-
light: "light";
|
|
63
62
|
dark: "dark";
|
|
63
|
+
light: "light";
|
|
64
64
|
system: "system";
|
|
65
65
|
}>, void>;
|
|
66
66
|
/**
|
package/dist/core/provider.d.ts
CHANGED
|
@@ -72,6 +72,6 @@ interface ThemeProviderProps {
|
|
|
72
72
|
* </ThemeProvider>
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
export declare function ThemeProvider({ children, disableTransitionOnChange, nonce, persistTheme, ssrSystemTheme, syncThemeFromServer, theme: initialTheme
|
|
75
|
+
export declare function ThemeProvider({ children, disableTransitionOnChange, nonce, persistTheme, ssrSystemTheme, syncThemeFromServer, theme: initialTheme }: ThemeProviderProps): JSX.Element;
|
|
76
76
|
export {};
|
|
77
77
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/core/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAc5C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAoB,MAAM,QAAQ,CAAC;AAwCrE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE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KAAK,EACL,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,KAAK,EAAE,YAAY,EACpB,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAwIlC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { z } from "zod";
|
|
|
6
6
|
* Valid values: 'light', 'dark', 'system'.
|
|
7
7
|
*/
|
|
8
8
|
export declare const themeSchema: z.ZodEnum<{
|
|
9
|
-
light: "light";
|
|
10
9
|
dark: "dark";
|
|
10
|
+
light: "light";
|
|
11
11
|
system: "system";
|
|
12
12
|
}>;
|
|
13
13
|
/**
|
|
@@ -29,7 +29,7 @@ export type ResolvedTheme = Exclude<Theme, "system">;
|
|
|
29
29
|
*
|
|
30
30
|
* Useful for rendering theme selectors in UI components.
|
|
31
31
|
*/
|
|
32
|
-
export declare const themes: ("
|
|
32
|
+
export declare const themes: ("dark" | "light" | "system")[];
|
|
33
33
|
/**
|
|
34
34
|
* Shape of the theme context value provided by ThemeProvider.
|
|
35
35
|
*
|
package/dist/utils/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAM5C;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAMxD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAM5C;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAMxD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI,CA6C3D"}
|
package/dist/utils/dom.js
CHANGED
|
@@ -33,12 +33,12 @@ export function applyTheme(resolved) {
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export function disableAnimation(nonce) {
|
|
36
|
-
if (typeof window === "undefined")
|
|
36
|
+
if (typeof globalThis.window === "undefined")
|
|
37
37
|
return () => {
|
|
38
38
|
/* noop */
|
|
39
39
|
};
|
|
40
40
|
// Respect user's motion preferences
|
|
41
|
-
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
41
|
+
const prefersReducedMotion = globalThis.window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
42
42
|
if (prefersReducedMotion) {
|
|
43
43
|
return () => {
|
|
44
44
|
/* noop */
|
package/dist/utils/system.js
CHANGED
|
@@ -11,10 +11,10 @@ import { DEFAULT_RESOLVED_THEME, MEDIA } from "#constants";
|
|
|
11
11
|
* @returns 'light' or 'dark' based on OS preference
|
|
12
12
|
*/
|
|
13
13
|
export function getSystemTheme() {
|
|
14
|
-
if (typeof window === "undefined") {
|
|
14
|
+
if (typeof globalThis.window === "undefined") {
|
|
15
15
|
return DEFAULT_RESOLVED_THEME;
|
|
16
16
|
}
|
|
17
|
-
return window.matchMedia(MEDIA).matches ? "dark" : "light";
|
|
17
|
+
return globalThis.window.matchMedia(MEDIA).matches ? "dark" : "light";
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Resolve theme preference to actual light/dark value.
|
|
@@ -35,7 +35,7 @@ export function resolveTheme(theme, ssrSystemTheme) {
|
|
|
35
35
|
if (theme !== "system") {
|
|
36
36
|
return theme;
|
|
37
37
|
}
|
|
38
|
-
if (typeof window === "undefined") {
|
|
38
|
+
if (typeof globalThis.window === "undefined") {
|
|
39
39
|
return ssrSystemTheme ?? DEFAULT_RESOLVED_THEME;
|
|
40
40
|
}
|
|
41
41
|
return getSystemTheme();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/theme",
|
|
3
|
-
"version": "0.3.12-canary.
|
|
3
|
+
"version": "0.3.12-canary.1",
|
|
4
4
|
"description": "Theme management with React 19 features - optimistic updates, cross-tab sync, and SSR support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dark-mode",
|
|
@@ -36,7 +36,12 @@
|
|
|
36
36
|
"#*": [
|
|
37
37
|
"./dist/*",
|
|
38
38
|
"./dist/*.js",
|
|
39
|
-
"./dist/*/index.js"
|
|
39
|
+
"./dist/*/index.js",
|
|
40
|
+
"./src/*",
|
|
41
|
+
"./src/*.ts",
|
|
42
|
+
"./src/*.tsx",
|
|
43
|
+
"./src/*/index.ts",
|
|
44
|
+
"./src/*/index.tsx"
|
|
40
45
|
]
|
|
41
46
|
},
|
|
42
47
|
"exports": {
|
|
@@ -105,19 +110,20 @@
|
|
|
105
110
|
"zod": "^4.3.6"
|
|
106
111
|
},
|
|
107
112
|
"devDependencies": {
|
|
108
|
-
"@swc/core": "^1.15.
|
|
113
|
+
"@swc/core": "^1.15.24",
|
|
109
114
|
"@swc/jest": "^0.2.39",
|
|
110
|
-
"@tanstack/react-start": "^1.167.
|
|
115
|
+
"@tanstack/react-start": "^1.167.32",
|
|
111
116
|
"@testing-library/dom": "^10.4.1",
|
|
112
117
|
"@testing-library/jest-dom": "^6.9.1",
|
|
113
118
|
"@testing-library/react": "^16.3.2",
|
|
114
119
|
"@testing-library/user-event": "^14.6.1",
|
|
115
120
|
"@types/jest": "^30.0.0",
|
|
116
|
-
"@types/node": "^25.
|
|
121
|
+
"@types/node": "^25.6.0",
|
|
122
|
+
"@typescript/native-preview": "7.0.0-dev.20260411.1",
|
|
117
123
|
"jest": "^30.3.0",
|
|
118
124
|
"jest-environment-jsdom": "^30.3.0",
|
|
119
125
|
"typescript": "^6.0.2",
|
|
120
|
-
"@codefast/typescript-config": "0.3.12-canary.
|
|
126
|
+
"@codefast/typescript-config": "0.3.12-canary.1"
|
|
121
127
|
},
|
|
122
128
|
"peerDependencies": {
|
|
123
129
|
"@tanstack/react-start": "^1.0",
|
|
@@ -138,10 +144,10 @@
|
|
|
138
144
|
}
|
|
139
145
|
},
|
|
140
146
|
"scripts": {
|
|
141
|
-
"build": "rm -rf dist &&
|
|
142
|
-
"check-types": "
|
|
147
|
+
"build": "rm -rf dist && tsgo -p tsconfig.build.json",
|
|
148
|
+
"check-types": "tsgo --noEmit",
|
|
143
149
|
"clean": "rm -rf dist",
|
|
144
|
-
"dev": "
|
|
150
|
+
"dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
145
151
|
"test": "jest",
|
|
146
152
|
"test:coverage": "jest --coverage",
|
|
147
153
|
"test:coverage:ci": "jest --coverage --ci",
|