qstd 0.3.30 → 0.3.31
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/react/index.cjs +6 -0
- package/dist/react/index.js +6 -0
- package/dist/react/use-theme/fns.d.ts.map +1 -1
- package/package.json +21 -20
package/dist/react/index.cjs
CHANGED
|
@@ -3968,11 +3968,16 @@ var THEME_STORE_STORAGE_KEY = "themeStore";
|
|
|
3968
3968
|
var THEME_CHANGE_EVENT = "qstd:theme-change";
|
|
3969
3969
|
|
|
3970
3970
|
// src/react/use-theme/fns.ts
|
|
3971
|
+
var isBrowser2 = typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
3971
3972
|
var getInitialTheme = () => {
|
|
3973
|
+
if (!isBrowser2) return "light";
|
|
3972
3974
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
3973
3975
|
return stored === "light" || stored === "dark" ? stored : "light";
|
|
3974
3976
|
};
|
|
3975
3977
|
var getInitialStore = () => {
|
|
3978
|
+
if (!isBrowser2) {
|
|
3979
|
+
return { value: "light", isManual: false };
|
|
3980
|
+
}
|
|
3976
3981
|
try {
|
|
3977
3982
|
const stored = localStorage.getItem(THEME_STORE_STORAGE_KEY);
|
|
3978
3983
|
if (stored) {
|
|
@@ -3990,6 +3995,7 @@ var getInitialStore = () => {
|
|
|
3990
3995
|
};
|
|
3991
3996
|
};
|
|
3992
3997
|
var saveStore = (store) => {
|
|
3998
|
+
if (!isBrowser2) return;
|
|
3993
3999
|
try {
|
|
3994
4000
|
localStorage.setItem(THEME_STORAGE_KEY, store.value);
|
|
3995
4001
|
localStorage.setItem(THEME_STORE_STORAGE_KEY, JSON.stringify(store));
|
package/dist/react/index.js
CHANGED
|
@@ -3945,11 +3945,16 @@ var THEME_STORE_STORAGE_KEY = "themeStore";
|
|
|
3945
3945
|
var THEME_CHANGE_EVENT = "qstd:theme-change";
|
|
3946
3946
|
|
|
3947
3947
|
// src/react/use-theme/fns.ts
|
|
3948
|
+
var isBrowser2 = typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
3948
3949
|
var getInitialTheme = () => {
|
|
3950
|
+
if (!isBrowser2) return "light";
|
|
3949
3951
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
3950
3952
|
return stored === "light" || stored === "dark" ? stored : "light";
|
|
3951
3953
|
};
|
|
3952
3954
|
var getInitialStore = () => {
|
|
3955
|
+
if (!isBrowser2) {
|
|
3956
|
+
return { value: "light", isManual: false };
|
|
3957
|
+
}
|
|
3953
3958
|
try {
|
|
3954
3959
|
const stored = localStorage.getItem(THEME_STORE_STORAGE_KEY);
|
|
3955
3960
|
if (stored) {
|
|
@@ -3967,6 +3972,7 @@ var getInitialStore = () => {
|
|
|
3967
3972
|
};
|
|
3968
3973
|
};
|
|
3969
3974
|
var saveStore = (store) => {
|
|
3975
|
+
if (!isBrowser2) return;
|
|
3970
3976
|
try {
|
|
3971
3977
|
localStorage.setItem(THEME_STORAGE_KEY, store.value);
|
|
3972
3978
|
localStorage.setItem(THEME_STORE_STORAGE_KEY, JSON.stringify(store));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../../src/react/use-theme/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../../src/react/use-theme/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAO9B,eAAO,MAAM,eAAe,QAAO,EAAE,CAAC,KAIrC,CAAC;AAGF,eAAO,MAAM,eAAe,QAAO,EAAE,CAAC,UAoBrC,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,OAAO,EAAE,CAAC,UAAU,SAY7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qstd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.31",
|
|
4
4
|
"description": "Standard Block component and utilities library with Panda CSS",
|
|
5
5
|
"author": "malin1",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,6 +42,24 @@
|
|
|
42
42
|
"sideEffects": [
|
|
43
43
|
"dist/react/index.css"
|
|
44
44
|
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "panda codegen && panda cssgen && tsup && tsc -p tsconfig.build.json && node scripts/inject-css-import.js",
|
|
47
|
+
"build:js": "tsup",
|
|
48
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
49
|
+
"dev": "tsup --watch",
|
|
50
|
+
"prepublishOnly": "pnpm build",
|
|
51
|
+
"prepare:local": "pnpm build && cd playground && pnpm prepare",
|
|
52
|
+
"test": "vitest run",
|
|
53
|
+
"test:watch": "vitest",
|
|
54
|
+
"test:all": "pnpx tsx tests/test-all.ts",
|
|
55
|
+
"test:block": "node tests/test-block.tsx",
|
|
56
|
+
"test:playground": "node tests/playground-e2e.mjs",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"typecheck:perf": "tsc --noEmit --extendedDiagnostics",
|
|
59
|
+
"typecheck:trace": "tsc --noEmit --generateTrace ./performance/ts-trace",
|
|
60
|
+
"analyze:tsserver": "bash performance/analyze-tsserver.sh",
|
|
61
|
+
"lint": "eslint ."
|
|
62
|
+
},
|
|
45
63
|
"peerDependencies": {
|
|
46
64
|
"react": "^18.0.0 || ^19.0.0",
|
|
47
65
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -108,22 +126,5 @@
|
|
|
108
126
|
"bugs": {
|
|
109
127
|
"url": "https://github.com/55cancri/qstd/issues"
|
|
110
128
|
},
|
|
111
|
-
"homepage": "https://github.com/55cancri/qstd#readme"
|
|
112
|
-
|
|
113
|
-
"build": "panda codegen && panda cssgen && tsup && tsc -p tsconfig.build.json && node scripts/inject-css-import.js",
|
|
114
|
-
"build:js": "tsup",
|
|
115
|
-
"build:types": "tsc -p tsconfig.build.json",
|
|
116
|
-
"dev": "tsup --watch",
|
|
117
|
-
"prepare:local": "pnpm build && cd playground && pnpm prepare",
|
|
118
|
-
"test": "vitest run",
|
|
119
|
-
"test:watch": "vitest",
|
|
120
|
-
"test:all": "pnpx tsx tests/test-all.ts",
|
|
121
|
-
"test:block": "node tests/test-block.tsx",
|
|
122
|
-
"test:playground": "node tests/playground-e2e.mjs",
|
|
123
|
-
"typecheck": "tsc --noEmit",
|
|
124
|
-
"typecheck:perf": "tsc --noEmit --extendedDiagnostics",
|
|
125
|
-
"typecheck:trace": "tsc --noEmit --generateTrace ./performance/ts-trace",
|
|
126
|
-
"analyze:tsserver": "bash performance/analyze-tsserver.sh",
|
|
127
|
-
"lint": "eslint ."
|
|
128
|
-
}
|
|
129
|
-
}
|
|
129
|
+
"homepage": "https://github.com/55cancri/qstd#readme"
|
|
130
|
+
}
|