@liner-fe/design-token-rn 1.2.0 → 1.2.2
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/lib/color/index.d.ts +8 -3
- package/lib/hooks/useDarkTheme.d.ts +1 -1
- package/lib/index.cjs +32 -21
- package/lib/index.cjs.map +3 -3
- package/lib/index.mjs +33 -22
- package/lib/index.mjs.map +3 -3
- package/lib/store/theme.d.ts +2 -1
- package/package.json +1 -1
- package/src/color/index.ts +35 -25
- package/src/hooks/useDarkTheme.ts +4 -6
- package/src/store/theme.ts +6 -1
package/lib/color/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { vars } from '../generated/vars';
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
2
|
+
export type ColorType = typeof vars.color.light;
|
|
3
|
+
export type EffectiveAppearance = 'dark' | 'light';
|
|
4
|
+
export type AppAppearance = EffectiveAppearance | 'sys';
|
|
5
|
+
export type SystemAppearance = EffectiveAppearance | 'notDetermined';
|
|
6
|
+
export declare const useAppearance: () => {
|
|
7
|
+
effectiveAppearance: EffectiveAppearance;
|
|
4
8
|
appAppearance: AppAppearance;
|
|
9
|
+
systemAppearance: SystemAppearance;
|
|
5
10
|
setAppAppearance: import("recoil").SetterOrUpdater<AppAppearance>;
|
|
11
|
+
setSystemAppearance: import("recoil").SetterOrUpdater<SystemAppearance>;
|
|
6
12
|
};
|
|
7
|
-
export type ColorType = typeof vars.color.light;
|
|
8
13
|
export declare const useColor: <T>(StyleSheetFunction: (color: ColorType) => T) => {
|
|
9
14
|
styles: T;
|
|
10
15
|
color: ColorType;
|
package/lib/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var index_exports = {};
|
|
23
23
|
__export(index_exports, {
|
|
24
24
|
MMKV_KEY: () => MMKV_KEY,
|
|
25
|
-
|
|
25
|
+
useAppearance: () => useAppearance,
|
|
26
26
|
useColor: () => useColor,
|
|
27
27
|
useDarkTheme: () => useDarkTheme,
|
|
28
28
|
vars: () => vars
|
|
@@ -34,7 +34,6 @@ var vars = { "color": { "light": { "neutral-container-lowest": "#ffffff", "neutr
|
|
|
34
34
|
|
|
35
35
|
// src/color/index.ts
|
|
36
36
|
var import_recoil2 = require("recoil");
|
|
37
|
-
var import_react_native = require("react-native");
|
|
38
37
|
|
|
39
38
|
// src/store/theme.ts
|
|
40
39
|
var import_recoil = require("recoil");
|
|
@@ -42,40 +41,52 @@ var appAppearanceAtom = (0, import_recoil.atom)({
|
|
|
42
41
|
key: "themeAtoms",
|
|
43
42
|
default: "sys"
|
|
44
43
|
});
|
|
44
|
+
var systemAppearanceAtom = (0, import_recoil.atom)({
|
|
45
|
+
key: "systemThemeAtoms",
|
|
46
|
+
default: "notDetermined"
|
|
47
|
+
});
|
|
45
48
|
|
|
46
49
|
// src/color/index.ts
|
|
47
|
-
var
|
|
50
|
+
var import_react = require("react");
|
|
51
|
+
var useAppearance = /* @__PURE__ */ __name(() => {
|
|
52
|
+
const [systemAppearance, setSystemAppearance] = (0, import_recoil2.useRecoilState)(systemAppearanceAtom);
|
|
48
53
|
const [appAppearance, setAppAppearance] = (0, import_recoil2.useRecoilState)(appAppearanceAtom);
|
|
49
|
-
|
|
50
|
-
}, "useAppAppearance");
|
|
51
|
-
var useColor = /* @__PURE__ */ __name((StyleSheetFunction) => {
|
|
52
|
-
const appAppearance = (0, import_recoil2.useRecoilValue)(appAppearanceAtom);
|
|
53
|
-
const colorToken = (() => {
|
|
54
|
+
const effectiveAppearance = (0, import_react.useMemo)(() => {
|
|
54
55
|
if (appAppearance === "sys") {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return vars.color[colorScheme];
|
|
56
|
+
if (systemAppearance === "notDetermined") {
|
|
57
|
+
return "light";
|
|
58
58
|
}
|
|
59
|
-
return
|
|
60
|
-
} else {
|
|
61
|
-
return vars.color[appAppearance];
|
|
59
|
+
return systemAppearance;
|
|
62
60
|
}
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
return appAppearance;
|
|
62
|
+
}, [appAppearance, systemAppearance]);
|
|
63
|
+
return {
|
|
64
|
+
effectiveAppearance,
|
|
65
|
+
appAppearance,
|
|
66
|
+
systemAppearance,
|
|
67
|
+
setAppAppearance,
|
|
68
|
+
setSystemAppearance
|
|
69
|
+
};
|
|
70
|
+
}, "useAppearance");
|
|
71
|
+
var useColor = /* @__PURE__ */ __name((StyleSheetFunction) => {
|
|
72
|
+
const { effectiveAppearance } = useAppearance();
|
|
73
|
+
const colorToken = vars.color[effectiveAppearance];
|
|
74
|
+
return {
|
|
75
|
+
styles: StyleSheetFunction(colorToken),
|
|
76
|
+
color: colorToken
|
|
77
|
+
};
|
|
65
78
|
}, "useColor");
|
|
66
79
|
var MMKV_KEY = "MMKV_KEY_THEME";
|
|
67
80
|
|
|
68
81
|
// src/hooks/useDarkTheme.ts
|
|
69
|
-
var import_recoil3 = require("recoil");
|
|
70
|
-
var import_react_native2 = require("react-native");
|
|
71
82
|
var useDarkTheme = /* @__PURE__ */ __name(() => {
|
|
72
|
-
const
|
|
83
|
+
const { effectiveAppearance, appAppearance } = useAppearance();
|
|
73
84
|
return {
|
|
74
|
-
isDarkTheme:
|
|
85
|
+
isDarkTheme: effectiveAppearance === "dark",
|
|
75
86
|
/**
|
|
76
87
|
* darkMode를 구분하고 싶다면 theme말고 isDarkTheme를 사용해주세요.
|
|
77
88
|
*/
|
|
78
|
-
theme
|
|
89
|
+
theme: appAppearance
|
|
79
90
|
};
|
|
80
91
|
}, "useDarkTheme");
|
|
81
92
|
//# sourceMappingURL=index.cjs.map
|
package/lib/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/generated/vars.ts", "../src/color/index.ts", "../src/store/theme.ts", "../src/hooks/useDarkTheme.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './generated/vars';\nexport * from './color';\nexport * from './hooks/useDarkTheme';\n", "export const vars = {\"color\":{\"light\":{\"neutral-container-lowest\":\"#ffffff\",\"neutral-container-lowest-hover\":\"#F9F9FA\",\"neutral-container-low\":\"#F9F9FA\",\"neutral-container-low-hover\":\"#F6F6F7\",\"neutral-container-mid\":\"#F6F6F7\",\"neutral-container-mid-hover\":\"#F1F1F2\",\"neutral-container-high\":\"#EDEEF0\",\"neutral-container-high-hover\":\"#E3E3E6\",\"neutral-container-highest\":\"#E9E9EB\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#ffffff\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.06)\",\"neutral-fill-low\":\"rgba(109,109,112,0.04)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"neutral-fill-high\":\"rgba(109,109,112,0.2)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.28)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#1E1E1F\",\"neutral-label-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-label-tertiary\":\"rgba(109,109,112,0.48)\",\"neutral-label-quaternary\":\"rgba(109,109,112,0.24)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"neutral-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"neutral-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"neutral-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"neutral-border-opaque-strong\":\"#1E1E1F\",\"neutral-border-opaque-normal\":\"#D7D7D9\",\"neutral-border-opaque-subtle\":\"#E9E9EB\",\"inverse-container-lowest\":\"#1E1E1F\",\"inverse-container-lowest-hover\":\"#272729\",\"inverse-container-low\":\"#272729\",\"inverse-container-low-hover\":\"#313133\",\"inverse-container-mid\":\"#313133\",\"inverse-container-mid-hover\":\"#39393B\",\"inverse-container-high\":\"#313133\",\"inverse-container-high-hover\":\"#4A4A4D\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#4A4A4D\",\"inverse-fill-mid\":\"#ffffff\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"inverse-label-primary\":\"#ffffff\",\"inverse-label-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-label-tertiary\":\"rgba(233,233,235,0.32)\",\"inverse-label-quaternary\":\"rgba(233,233,235,0.2)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"inverse-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"inverse-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"inverse-border-opaque-strong\":\"#ffffff\",\"inverse-border-opaque-normal\":\"#58595C\",\"inverse-border-opaque-subtle\":\"#313133\",\"brand-container-mid\":\"#14371B\",\"brand-container-mid-hover\":\"#082C11\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#14371B\",\"brand-fill-mid-hover\":\"#082C11\",\"brand-fill-low\":\"#F6FFF1\",\"brand-fill-low-hover\":\"#EBFFE7\",\"brand-label-primary\":\"#0C893B\",\"brand-label-secondary\":\"#14371B\",\"brand-label-variation-secondary\":\"#14371B\",\"brand-border-opaque-normal\":\"#14371B\",\"brand-border-opaque-strong\":\"#0C893B\",\"brandinverse-label-primary\":\"#C3FFD0\",\"brandinverse-label-secondary\":\"#ffffff\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FE8F16\",\"accent-label-yellow\":\"#FFCC00\",\"accent-label-mint\":\"#02B0B0\",\"accent-label-cyan\":\"#40B3FF\",\"accent-label-purple\":\"#B450E6\",\"accent-label-pink\":\"#FF3377\",\"accent-container-primary\":\"#FFB77C\",\"function-container-positive\":\"#30BF48\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#DB2323\",\"function-container-caution\":\"#FE8F16\",\"function-container-highlight\":\"#EAFFB6\",\"function-container-selection\":\"rgba(4,17,102,0.08)\",\"function-container-drag\":\"rgba(4,17,102,0.12)\",\"function-label-positive\":\"#30BF48\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FE8F16\",\"function-label-link\":\"#1A79B8\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"},\"dark\":{\"neutral-container-lowest\":\"#1E1E1F\",\"neutral-container-lowest-hover\":\"#272729\",\"neutral-container-low\":\"#272729\",\"neutral-container-low-hover\":\"#313133\",\"neutral-container-mid\":\"#313133\",\"neutral-container-mid-hover\":\"#39393B\",\"neutral-container-high\":\"#313133\",\"neutral-container-high-hover\":\"#4A4A4D\",\"neutral-container-highest\":\"#4A4A4D\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#272729\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.12)\",\"neutral-fill-low\":\"rgba(109,109,112,0.08)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.2)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.16)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.44)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#ffffff\",\"neutral-label-secondary\":\"rgba(233,233,235,0.64)\",\"neutral-label-tertiary\":\"rgba(233,233,235,0.32)\",\"neutral-label-quaternary\":\"rgba(233,233,235,0.2)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"neutral-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"neutral-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"neutral-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"neutral-border-opaque-strong\":\"#ffffff\",\"neutral-border-opaque-normal\":\"#58595C\",\"neutral-border-opaque-subtle\":\"#313133\",\"inverse-container-lowest\":\"#ffffff\",\"inverse-container-lowest-hover\":\"#F9F9FA\",\"inverse-container-low\":\"#F9F9FA\",\"inverse-container-low-hover\":\"#F6F6F7\",\"inverse-container-mid\":\"#F6F6F7\",\"inverse-container-mid-hover\":\"#F1F1F2\",\"inverse-container-high\":\"#EDEEF0\",\"inverse-container-high-hover\":\"#E3E3E6\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#E9E9EB\",\"inverse-fill-mid\":\"rgba(233,233,235,0.24)\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"inverse-label-primary\":\"#1E1E1F\",\"inverse-label-secondary\":\"rgba(109,109,112,0.8)\",\"inverse-label-tertiary\":\"rgba(109,109,112,0.48)\",\"inverse-label-quaternary\":\"rgba(109,109,112,0.24)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"inverse-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"inverse-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"inverse-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"inverse-border-opaque-strong\":\"#1E1E1F\",\"inverse-border-opaque-normal\":\"#D7D7D9\",\"inverse-border-opaque-subtle\":\"#E9E9EB\",\"brand-container-mid\":\"#236638\",\"brand-container-mid-hover\":\"#00733E\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#236638\",\"brand-fill-mid-hover\":\"#00733E\",\"brand-fill-low\":\"#1A5E31\",\"brand-fill-low-hover\":\"#236638\",\"brand-label-primary\":\"#C3FFD0\",\"brand-label-secondary\":\"#ffffff\",\"brand-label-variation-secondary\":\"rgba(255,255,255,0.8)\",\"brand-border-opaque-normal\":\"#ffffff\",\"brand-border-opaque-strong\":\"#C3FFD0\",\"brandinverse-label-primary\":\"#0C893B\",\"brandinverse-label-secondary\":\"#14371B\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FF9B3E\",\"accent-label-yellow\":\"#FFD739\",\"accent-label-mint\":\"#00CCCC\",\"accent-label-cyan\":\"#6AC4FF\",\"accent-label-purple\":\"#C978F2\",\"accent-label-pink\":\"#FF6095\",\"accent-container-primary\":\"#B46200\",\"function-container-positive\":\"#5DDF73\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#FF6060\",\"function-container-caution\":\"#FF9B3E\",\"function-container-highlight\":\"#394D00\",\"function-container-selection\":\"rgba(255,255,255,0.12)\",\"function-container-drag\":\"rgba(255,255,255,0.16)\",\"function-label-positive\":\"#5DDF73\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FF9B3E\",\"function-label-link\":\"#6AC4FF\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"}},\"radius\":{\"xxs\":\"2px\",\"xs\":\"4px\",\"s\":\"6px\",\"m\":\"8px\",\"l\":\"10px\",\"xl\":\"12px\",\"xxl\":\"200px\"},\"opacity\":{\"0\":\"0%\",\"1\":\"1%\",\"4\":\"4%\",\"8\":\"8%\",\"12\":\"12%\",\"16\":\"16%\",\"20\":\"20%\",\"24\":\"24%\",\"28\":\"28%\",\"32\":\"32%\",\"36\":\"36%\",\"40\":\"40%\",\"44\":\"44%\",\"48\":\"48%\",\"50\":\"50%\",\"56\":\"56%\",\"64\":\"64%\",\"72\":\"72%\",\"80\":\"80%\"},\"padding\":{\"component-50\":\"2px\",\"component-100\":\"4px\",\"component-150\":\"6px\",\"component-200\":\"8px\",\"component-300\":\"12px\",\"component-400\":\"16px\",\"component-500\":\"20px\",\"component-600\":\"24px\",\"component-700\":\"32px\",\"component-800\":\"40px\",\"component-900\":\"48px\",\"section-50\":\"20px\",\"section-100\":\"24px\",\"section-200\":\"32px\",\"section-300\":\"40px\",\"section-400\":\"48px\",\"section-500\":\"56px\",\"section-600\":\"64px\",\"section-700\":\"80px\",\"section-800\":\"100px\",\"section-900\":\"120px\"},\"size\":{\"0\":\"0px\",\"1\":\"1px\",\"2\":\"2px\",\"3\":\"3px\",\"4\":\"4px\",\"6\":\"6px\",\"8\":\"8px\",\"10\":\"10px\",\"12\":\"12px\",\"14\":\"14px\",\"16\":\"16px\",\"18\":\"18px\",\"20\":\"20px\",\"24\":\"24px\",\"32\":\"32px\",\"40\":\"40px\",\"48\":\"48px\",\"56\":\"56px\",\"64\":\"64px\",\"80\":\"80px\",\"100\":\"100px\",\"120\":\"120px\",\"140\":\"140px\",\"160\":\"160px\",\"180\":\"180px\",\"200\":\"200px\",\"minus6\":\"-6px\",\"minus4\":\"-4px\",\"minus2\":\"-2px\"},\"gap\":{\"positive-50\":\"2px\",\"positive-100\":\"4px\",\"positive-150\":\"6px\",\"positive-200\":\"8px\",\"positive-300\":\"12px\",\"positive-400\":\"16px\",\"positive-500\":\"20px\",\"positive-600\":\"24px\",\"positive-700\":\"32px\",\"positive-800\":\"40px\",\"positive-900\":\"48px\"},\"shadow\":{\"normal\":[\"0px 2px 12px 0px rgba(0, 0, 0, 0.08), 0px 1px 8px 0px rgba(0, 0, 0, 0.06), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)\",\"0px 2px 12px 0px rgba(0, 0, 0, 0.24), 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.2)\"],\"strong\":[\"0px 6px 16px 0px rgba(0, 0, 0, 0.12), 0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 6px 16px 0px rgba(0, 0, 0, 0.36), 0px 4px 12px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"],\"heavy\":[\"0px 16px 20px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 16px 20px 0px rgba(0, 0, 0, 0.36), 0px 8px 16px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"]},\"iconSize\":{\"xs\":\"16px\",\"s\":\"20px\",\"m\":\"24px\",\"l\":\"32px\",\"xl\":\"40px\"}}", "import { useRecoilState, useRecoilValue } from 'recoil';\nimport { vars } from '../generated/vars';\nimport { Appearance } from 'react-native';\nimport { appAppearanceAtom } from '../store/theme';\n\nexport type AppAppearance = 'dark' | 'light' | 'sys';\n\nexport const useAppAppearance = () => {\n const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);\n return { appAppearance, setAppAppearance };\n};\n\nexport type ColorType = typeof vars.color.light;\n\nexport const useColor = <T>(\n StyleSheetFunction: (color: ColorType) => T,\n): { styles: T; color: ColorType } => {\n const appAppearance = useRecoilValue(appAppearanceAtom);\n\n const colorToken = (() => {\n if (appAppearance === 'sys') {\n const colorScheme = Appearance.getColorScheme();\n\n if (colorScheme) {\n return vars.color[colorScheme];\n }\n\n // colorScheme\uC774 \uC5C6\uB294 \uACBD\uC6B0 light \uD14C\uB9C8\uB97C \uBC18\uD658\uD569\uB2C8\uB2E4.\n return vars.color.light;\n } else {\n return vars.color[appAppearance];\n }\n })();\n\n return { styles: StyleSheetFunction(colorToken), color: colorToken };\n};\n\nexport const MMKV_KEY = 'MMKV_KEY_THEME';\n", "import { atom } from 'recoil';\nimport { AppAppearance } from '../color';\n\nexport const appAppearanceAtom = atom<AppAppearance>({\n key: 'themeAtoms',\n default: 'sys',\n});\n", "import { useRecoilValue } from 'recoil';\nimport { appAppearanceAtom } from '../store/theme';\nimport { Appearance } from 'react-native';\n\nexport const useDarkTheme = () => {\n const theme = useRecoilValue(appAppearanceAtom);\n\n return {\n isDarkTheme: theme === 'dark' || (theme === 'sys' && Appearance.getColorScheme() === 'dark'),\n /**\n * darkMode\uB97C \uAD6C\uBD84\uD558\uACE0 \uC2F6\uB2E4\uBA74 theme\uB9D0\uACE0 isDarkTheme\uB97C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n */\n theme,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,OAAO,EAAC,SAAQ,EAAC,SAAQ,EAAC,4BAA2B,WAAU,kCAAiC,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,0BAAyB,WAAU,gCAA+B,WAAU,6BAA4B,WAAU,mCAAkC,WAAU,yCAAwC,WAAU,sCAAqC,WAAU,uBAAsB,uBAAsB,6BAA4B,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,qBAAoB,yBAAwB,2BAA0B,0BAAyB,wBAAuB,0BAAyB,yBAAwB,WAAU,2BAA0B,yBAAwB,0BAAyB,0BAAyB,4BAA2B,0BAAyB,gCAA+B,WAAU,kCAAiC,yBAAwB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,+BAA8B,0BAAyB,gCAA+B,WAAU,gCAA+B,WAAU,gCAA+B,WAAU,4BAA2B,WAAU,kCAAiC,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,0BA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_recoil"
|
|
4
|
+
"sourcesContent": ["export * from './generated/vars';\nexport * from './color';\nexport * from './hooks/useDarkTheme';\n", "export const vars = {\"color\":{\"light\":{\"neutral-container-lowest\":\"#ffffff\",\"neutral-container-lowest-hover\":\"#F9F9FA\",\"neutral-container-low\":\"#F9F9FA\",\"neutral-container-low-hover\":\"#F6F6F7\",\"neutral-container-mid\":\"#F6F6F7\",\"neutral-container-mid-hover\":\"#F1F1F2\",\"neutral-container-high\":\"#EDEEF0\",\"neutral-container-high-hover\":\"#E3E3E6\",\"neutral-container-highest\":\"#E9E9EB\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#ffffff\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.06)\",\"neutral-fill-low\":\"rgba(109,109,112,0.04)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"neutral-fill-high\":\"rgba(109,109,112,0.2)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.28)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#1E1E1F\",\"neutral-label-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-label-tertiary\":\"rgba(109,109,112,0.48)\",\"neutral-label-quaternary\":\"rgba(109,109,112,0.24)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"neutral-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"neutral-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"neutral-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"neutral-border-opaque-strong\":\"#1E1E1F\",\"neutral-border-opaque-normal\":\"#D7D7D9\",\"neutral-border-opaque-subtle\":\"#E9E9EB\",\"inverse-container-lowest\":\"#1E1E1F\",\"inverse-container-lowest-hover\":\"#272729\",\"inverse-container-low\":\"#272729\",\"inverse-container-low-hover\":\"#313133\",\"inverse-container-mid\":\"#313133\",\"inverse-container-mid-hover\":\"#39393B\",\"inverse-container-high\":\"#313133\",\"inverse-container-high-hover\":\"#4A4A4D\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#4A4A4D\",\"inverse-fill-mid\":\"#ffffff\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"inverse-label-primary\":\"#ffffff\",\"inverse-label-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-label-tertiary\":\"rgba(233,233,235,0.32)\",\"inverse-label-quaternary\":\"rgba(233,233,235,0.2)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"inverse-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"inverse-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"inverse-border-opaque-strong\":\"#ffffff\",\"inverse-border-opaque-normal\":\"#58595C\",\"inverse-border-opaque-subtle\":\"#313133\",\"brand-container-mid\":\"#14371B\",\"brand-container-mid-hover\":\"#082C11\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#14371B\",\"brand-fill-mid-hover\":\"#082C11\",\"brand-fill-low\":\"#F6FFF1\",\"brand-fill-low-hover\":\"#EBFFE7\",\"brand-label-primary\":\"#0C893B\",\"brand-label-secondary\":\"#14371B\",\"brand-label-variation-secondary\":\"#14371B\",\"brand-border-opaque-normal\":\"#14371B\",\"brand-border-opaque-strong\":\"#0C893B\",\"brandinverse-label-primary\":\"#C3FFD0\",\"brandinverse-label-secondary\":\"#ffffff\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FE8F16\",\"accent-label-yellow\":\"#FFCC00\",\"accent-label-mint\":\"#02B0B0\",\"accent-label-cyan\":\"#40B3FF\",\"accent-label-purple\":\"#B450E6\",\"accent-label-pink\":\"#FF3377\",\"accent-container-primary\":\"#FFB77C\",\"function-container-positive\":\"#30BF48\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#DB2323\",\"function-container-caution\":\"#FE8F16\",\"function-container-highlight\":\"#EAFFB6\",\"function-container-selection\":\"rgba(4,17,102,0.08)\",\"function-container-drag\":\"rgba(4,17,102,0.12)\",\"function-label-positive\":\"#30BF48\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FE8F16\",\"function-label-link\":\"#1A79B8\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"},\"dark\":{\"neutral-container-lowest\":\"#1E1E1F\",\"neutral-container-lowest-hover\":\"#272729\",\"neutral-container-low\":\"#272729\",\"neutral-container-low-hover\":\"#313133\",\"neutral-container-mid\":\"#313133\",\"neutral-container-mid-hover\":\"#39393B\",\"neutral-container-high\":\"#313133\",\"neutral-container-high-hover\":\"#4A4A4D\",\"neutral-container-highest\":\"#4A4A4D\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#272729\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.12)\",\"neutral-fill-low\":\"rgba(109,109,112,0.08)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.2)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.16)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.44)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#ffffff\",\"neutral-label-secondary\":\"rgba(233,233,235,0.64)\",\"neutral-label-tertiary\":\"rgba(233,233,235,0.32)\",\"neutral-label-quaternary\":\"rgba(233,233,235,0.2)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"neutral-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"neutral-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"neutral-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"neutral-border-opaque-strong\":\"#ffffff\",\"neutral-border-opaque-normal\":\"#58595C\",\"neutral-border-opaque-subtle\":\"#313133\",\"inverse-container-lowest\":\"#ffffff\",\"inverse-container-lowest-hover\":\"#F9F9FA\",\"inverse-container-low\":\"#F9F9FA\",\"inverse-container-low-hover\":\"#F6F6F7\",\"inverse-container-mid\":\"#F6F6F7\",\"inverse-container-mid-hover\":\"#F1F1F2\",\"inverse-container-high\":\"#EDEEF0\",\"inverse-container-high-hover\":\"#E3E3E6\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#E9E9EB\",\"inverse-fill-mid\":\"rgba(233,233,235,0.24)\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"inverse-label-primary\":\"#1E1E1F\",\"inverse-label-secondary\":\"rgba(109,109,112,0.8)\",\"inverse-label-tertiary\":\"rgba(109,109,112,0.48)\",\"inverse-label-quaternary\":\"rgba(109,109,112,0.24)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"inverse-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"inverse-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"inverse-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"inverse-border-opaque-strong\":\"#1E1E1F\",\"inverse-border-opaque-normal\":\"#D7D7D9\",\"inverse-border-opaque-subtle\":\"#E9E9EB\",\"brand-container-mid\":\"#236638\",\"brand-container-mid-hover\":\"#00733E\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#236638\",\"brand-fill-mid-hover\":\"#00733E\",\"brand-fill-low\":\"#1A5E31\",\"brand-fill-low-hover\":\"#236638\",\"brand-label-primary\":\"#C3FFD0\",\"brand-label-secondary\":\"#ffffff\",\"brand-label-variation-secondary\":\"rgba(255,255,255,0.8)\",\"brand-border-opaque-normal\":\"#ffffff\",\"brand-border-opaque-strong\":\"#C3FFD0\",\"brandinverse-label-primary\":\"#0C893B\",\"brandinverse-label-secondary\":\"#14371B\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FF9B3E\",\"accent-label-yellow\":\"#FFD739\",\"accent-label-mint\":\"#00CCCC\",\"accent-label-cyan\":\"#6AC4FF\",\"accent-label-purple\":\"#C978F2\",\"accent-label-pink\":\"#FF6095\",\"accent-container-primary\":\"#B46200\",\"function-container-positive\":\"#5DDF73\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#FF6060\",\"function-container-caution\":\"#FF9B3E\",\"function-container-highlight\":\"#394D00\",\"function-container-selection\":\"rgba(255,255,255,0.12)\",\"function-container-drag\":\"rgba(255,255,255,0.16)\",\"function-label-positive\":\"#5DDF73\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FF9B3E\",\"function-label-link\":\"#6AC4FF\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"}},\"radius\":{\"xxs\":\"2px\",\"xs\":\"4px\",\"s\":\"6px\",\"m\":\"8px\",\"l\":\"10px\",\"xl\":\"12px\",\"xxl\":\"200px\"},\"opacity\":{\"0\":\"0%\",\"1\":\"1%\",\"4\":\"4%\",\"8\":\"8%\",\"12\":\"12%\",\"16\":\"16%\",\"20\":\"20%\",\"24\":\"24%\",\"28\":\"28%\",\"32\":\"32%\",\"36\":\"36%\",\"40\":\"40%\",\"44\":\"44%\",\"48\":\"48%\",\"50\":\"50%\",\"56\":\"56%\",\"64\":\"64%\",\"72\":\"72%\",\"80\":\"80%\"},\"padding\":{\"component-50\":\"2px\",\"component-100\":\"4px\",\"component-150\":\"6px\",\"component-200\":\"8px\",\"component-300\":\"12px\",\"component-400\":\"16px\",\"component-500\":\"20px\",\"component-600\":\"24px\",\"component-700\":\"32px\",\"component-800\":\"40px\",\"component-900\":\"48px\",\"section-50\":\"20px\",\"section-100\":\"24px\",\"section-200\":\"32px\",\"section-300\":\"40px\",\"section-400\":\"48px\",\"section-500\":\"56px\",\"section-600\":\"64px\",\"section-700\":\"80px\",\"section-800\":\"100px\",\"section-900\":\"120px\"},\"size\":{\"0\":\"0px\",\"1\":\"1px\",\"2\":\"2px\",\"3\":\"3px\",\"4\":\"4px\",\"6\":\"6px\",\"8\":\"8px\",\"10\":\"10px\",\"12\":\"12px\",\"14\":\"14px\",\"16\":\"16px\",\"18\":\"18px\",\"20\":\"20px\",\"24\":\"24px\",\"32\":\"32px\",\"40\":\"40px\",\"48\":\"48px\",\"56\":\"56px\",\"64\":\"64px\",\"80\":\"80px\",\"100\":\"100px\",\"120\":\"120px\",\"140\":\"140px\",\"160\":\"160px\",\"180\":\"180px\",\"200\":\"200px\",\"minus6\":\"-6px\",\"minus4\":\"-4px\",\"minus2\":\"-2px\"},\"gap\":{\"positive-50\":\"2px\",\"positive-100\":\"4px\",\"positive-150\":\"6px\",\"positive-200\":\"8px\",\"positive-300\":\"12px\",\"positive-400\":\"16px\",\"positive-500\":\"20px\",\"positive-600\":\"24px\",\"positive-700\":\"32px\",\"positive-800\":\"40px\",\"positive-900\":\"48px\"},\"shadow\":{\"normal\":[\"0px 2px 12px 0px rgba(0, 0, 0, 0.08), 0px 1px 8px 0px rgba(0, 0, 0, 0.06), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)\",\"0px 2px 12px 0px rgba(0, 0, 0, 0.24), 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.2)\"],\"strong\":[\"0px 6px 16px 0px rgba(0, 0, 0, 0.12), 0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 6px 16px 0px rgba(0, 0, 0, 0.36), 0px 4px 12px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"],\"heavy\":[\"0px 16px 20px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 16px 20px 0px rgba(0, 0, 0, 0.36), 0px 8px 16px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"]},\"iconSize\":{\"xs\":\"16px\",\"s\":\"20px\",\"m\":\"24px\",\"l\":\"32px\",\"xl\":\"40px\"}}", "import { useRecoilState } from 'recoil';\nimport { vars } from '../generated/vars';\nimport { appAppearanceAtom, systemAppearanceAtom } from '../store/theme';\nimport { useMemo } from 'react';\n\nexport type ColorType = typeof vars.color.light;\nexport type EffectiveAppearance = 'dark' | 'light';\nexport type AppAppearance = EffectiveAppearance | 'sys';\nexport type SystemAppearance = EffectiveAppearance | 'notDetermined';\n\nexport const useAppearance = () => {\n const [systemAppearance, setSystemAppearance] = useRecoilState(systemAppearanceAtom);\n const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);\n\n const effectiveAppearance: EffectiveAppearance = useMemo(() => {\n if (appAppearance === 'sys') {\n if (systemAppearance === 'notDetermined') {\n return 'light';\n }\n\n return systemAppearance;\n }\n\n return appAppearance;\n }, [appAppearance, systemAppearance]);\n\n return {\n effectiveAppearance,\n appAppearance,\n systemAppearance,\n setAppAppearance,\n setSystemAppearance,\n };\n};\n\nexport const useColor = <T>(\n StyleSheetFunction: (color: ColorType) => T,\n): { styles: T; color: ColorType } => {\n const { effectiveAppearance } = useAppearance();\n const colorToken = vars.color[effectiveAppearance];\n\n return {\n styles: StyleSheetFunction(colorToken),\n color: colorToken,\n };\n};\n\nexport const MMKV_KEY = 'MMKV_KEY_THEME';\n", "import { atom } from 'recoil';\nimport { AppAppearance, SystemAppearance } from '../color';\n\nexport const appAppearanceAtom = atom<AppAppearance>({\n key: 'themeAtoms',\n default: 'sys',\n});\n\nexport const systemAppearanceAtom = atom<SystemAppearance>({\n key: 'systemThemeAtoms',\n default: 'notDetermined',\n});\n", "import { useAppearance } from '../color';\n\nexport const useDarkTheme = () => {\n const { effectiveAppearance, appAppearance } = useAppearance();\n\n return {\n isDarkTheme: effectiveAppearance === 'dark',\n /**\n * darkMode\uB97C \uAD6C\uBD84\uD558\uACE0 \uC2F6\uB2E4\uBA74 theme\uB9D0\uACE0 isDarkTheme\uB97C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n */\n theme: appAppearance,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,OAAO,EAAC,SAAQ,EAAC,SAAQ,EAAC,4BAA2B,WAAU,kCAAiC,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,0BAAyB,WAAU,gCAA+B,WAAU,6BAA4B,WAAU,mCAAkC,WAAU,yCAAwC,WAAU,sCAAqC,WAAU,uBAAsB,uBAAsB,6BAA4B,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,qBAAoB,yBAAwB,2BAA0B,0BAAyB,wBAAuB,0BAAyB,yBAAwB,WAAU,2BAA0B,yBAAwB,0BAAyB,0BAAyB,4BAA2B,0BAAyB,gCAA+B,WAAU,kCAAiC,yBAAwB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,+BAA8B,0BAAyB,gCAA+B,W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,YAAW,EAAC,MAAK,QAAO,KAAI,QAAO,KAAI,QAAO,KAAI,QAAO,MAAK,OAAM,EAAC;;;ACAh5T,IAAAA,iBAA+B;;;ACA/B,oBAAqB;AAGd,IAAM,wBAAoB,oBAAoB;AAAA,EACnD,KAAK;AAAA,EACL,SAAS;AACX,CAAC;AAEM,IAAM,2BAAuB,oBAAuB;AAAA,EACzD,KAAK;AAAA,EACL,SAAS;AACX,CAAC;;;ADRD,mBAAwB;AAOjB,IAAM,gBAAgB,6BAAM;AACjC,QAAM,CAAC,kBAAkB,mBAAmB,QAAI,+BAAe,oBAAoB;AACnF,QAAM,CAAC,eAAe,gBAAgB,QAAI,+BAAe,iBAAiB;AAE1E,QAAM,0BAA2C,sBAAQ,MAAM;AAC7D,QAAI,kBAAkB,OAAO;AAC3B,UAAI,qBAAqB,iBAAiB;AACxC,eAAO;AAAA,MACT;AAEA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,gBAAgB,CAAC;AAEpC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF,GAvB6B;AAyBtB,IAAM,WAAW,wBACtB,uBACoC;AACpC,QAAM,EAAE,oBAAoB,IAAI,cAAc;AAC9C,QAAM,aAAa,KAAK,MAAM,mBAAmB;AAEjD,SAAO;AAAA,IACL,QAAQ,mBAAmB,UAAU;AAAA,IACrC,OAAO;AAAA,EACT;AACF,GAVwB;AAYjB,IAAM,WAAW;;;AE7CjB,IAAM,eAAe,6BAAM;AAChC,QAAM,EAAE,qBAAqB,cAAc,IAAI,cAAc;AAE7D,SAAO;AAAA,IACL,aAAa,wBAAwB;AAAA;AAAA;AAAA;AAAA,IAIrC,OAAO;AAAA,EACT;AACF,GAV4B;",
|
|
6
|
+
"names": ["import_recoil"]
|
|
7
7
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -5,8 +5,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
5
5
|
var vars = { "color": { "light": { "neutral-container-lowest": "#ffffff", "neutral-container-lowest-hover": "#F9F9FA", "neutral-container-low": "#F9F9FA", "neutral-container-low-hover": "#F6F6F7", "neutral-container-mid": "#F6F6F7", "neutral-container-mid-hover": "#F1F1F2", "neutral-container-high": "#EDEEF0", "neutral-container-high-hover": "#E3E3E6", "neutral-container-highest": "#E9E9EB", "neutral-container-static-lowest": "#ffffff", "neutral-container-static-lowest-hover": "#F9F9FA", "neutral-container-variation-lowest": "#ffffff", "neutral-fill-lowest": "rgba(109,109,112,0)", "neutral-fill-lowest-hover": "rgba(109,109,112,0.06)", "neutral-fill-low": "rgba(109,109,112,0.04)", "neutral-fill-low-hover": "rgba(109,109,112,0.08)", "neutral-fill-mid": "rgba(109,109,112,0.08)", "neutral-fill-mid-hover": "rgba(109,109,112,0.16)", "neutral-fill-high": "rgba(109,109,112,0.2)", "neutral-fill-high-hover": "rgba(109,109,112,0.28)", "neutral-fill-highest": "rgba(109,109,112,0.72)", "neutral-label-primary": "#1E1E1F", "neutral-label-secondary": "rgba(109,109,112,0.8)", "neutral-label-tertiary": "rgba(109,109,112,0.48)", "neutral-label-quaternary": "rgba(109,109,112,0.24)", "neutral-label-static-primary": "#1E1E1F", "neutral-label-static-secondary": "rgba(109,109,112,0.8)", "neutral-border-overlay-strong": "rgba(109,109,112,0.64)", "neutral-border-overlay-normal": "rgba(109,109,112,0.24)", "neutral-border-overlay-subtle": "rgba(109,109,112,0.16)", "neutral-border-overlay-hint": "rgba(109,109,112,0.12)", "neutral-border-opaque-strong": "#1E1E1F", "neutral-border-opaque-normal": "#D7D7D9", "neutral-border-opaque-subtle": "#E9E9EB", "inverse-container-lowest": "#1E1E1F", "inverse-container-lowest-hover": "#272729", "inverse-container-low": "#272729", "inverse-container-low-hover": "#313133", "inverse-container-mid": "#313133", "inverse-container-mid-hover": "#39393B", "inverse-container-high": "#313133", "inverse-container-high-hover": "#4A4A4D", "inverse-container-static-high": "#313133", "inverse-container-static-high-hover": "#58595C", "inverse-container-highest": "#4A4A4D", "inverse-fill-mid": "#ffffff", "inverse-fill-mid-hover": "rgba(109,109,112,0.32)", "inverse-label-primary": "#ffffff", "inverse-label-secondary": "rgba(233,233,235,0.64)", "inverse-label-tertiary": "rgba(233,233,235,0.32)", "inverse-label-quaternary": "rgba(233,233,235,0.2)", "inverse-label-static-primary": "#ffffff", "inverse-label-static-secondary": "rgba(233,233,235,0.64)", "inverse-border-overlay-strong": "rgba(233,233,235,0.64)", "inverse-border-overlay-normal": "rgba(233,233,235,0.28)", "inverse-border-overlay-subtle": "rgba(233,233,235,0.2)", "inverse-border-overlay-hint": "rgba(233,233,235,0.12)", "inverse-border-opaque-strong": "#ffffff", "inverse-border-opaque-normal": "#58595C", "inverse-border-opaque-subtle": "#313133", "brand-container-mid": "#14371B", "brand-container-mid-hover": "#082C11", "brand-container-high": "#0C893B", "brand-fill-mid": "#14371B", "brand-fill-mid-hover": "#082C11", "brand-fill-low": "#F6FFF1", "brand-fill-low-hover": "#EBFFE7", "brand-label-primary": "#0C893B", "brand-label-secondary": "#14371B", "brand-label-variation-secondary": "#14371B", "brand-border-opaque-normal": "#14371B", "brand-border-opaque-strong": "#0C893B", "brandinverse-label-primary": "#C3FFD0", "brandinverse-label-secondary": "#ffffff", "brandinverse-label-static-primary": "#C3FFD0", "accent-label-primary": "#FE8F16", "accent-label-yellow": "#FFCC00", "accent-label-mint": "#02B0B0", "accent-label-cyan": "#40B3FF", "accent-label-purple": "#B450E6", "accent-label-pink": "#FF3377", "accent-container-primary": "#FFB77C", "function-container-positive": "#30BF48", "function-container-negative": "#FF3333", "function-container-negative-hover": "#DB2323", "function-container-caution": "#FE8F16", "function-container-highlight": "#EAFFB6", "function-container-selection": "rgba(4,17,102,0.08)", "function-container-drag": "rgba(4,17,102,0.12)", "function-label-positive": "#30BF48", "function-label-negative": "#FF3333", "function-label-caution": "#FE8F16", "function-label-link": "#1A79B8", "cover-dim-page": "rgba(0,0,0,0.48)" }, "dark": { "neutral-container-lowest": "#1E1E1F", "neutral-container-lowest-hover": "#272729", "neutral-container-low": "#272729", "neutral-container-low-hover": "#313133", "neutral-container-mid": "#313133", "neutral-container-mid-hover": "#39393B", "neutral-container-high": "#313133", "neutral-container-high-hover": "#4A4A4D", "neutral-container-highest": "#4A4A4D", "neutral-container-static-lowest": "#ffffff", "neutral-container-static-lowest-hover": "#F9F9FA", "neutral-container-variation-lowest": "#272729", "neutral-fill-lowest": "rgba(109,109,112,0)", "neutral-fill-lowest-hover": "rgba(109,109,112,0.12)", "neutral-fill-low": "rgba(109,109,112,0.08)", "neutral-fill-low-hover": "rgba(109,109,112,0.2)", "neutral-fill-mid": "rgba(109,109,112,0.16)", "neutral-fill-mid-hover": "rgba(109,109,112,0.32)", "neutral-fill-high": "rgba(109,109,112,0.32)", "neutral-fill-high-hover": "rgba(109,109,112,0.44)", "neutral-fill-highest": "rgba(109,109,112,0.72)", "neutral-label-primary": "#ffffff", "neutral-label-secondary": "rgba(233,233,235,0.64)", "neutral-label-tertiary": "rgba(233,233,235,0.32)", "neutral-label-quaternary": "rgba(233,233,235,0.2)", "neutral-label-static-primary": "#1E1E1F", "neutral-label-static-secondary": "rgba(109,109,112,0.8)", "neutral-border-overlay-strong": "rgba(233,233,235,0.64)", "neutral-border-overlay-normal": "rgba(233,233,235,0.28)", "neutral-border-overlay-subtle": "rgba(233,233,235,0.2)", "neutral-border-overlay-hint": "rgba(233,233,235,0.12)", "neutral-border-opaque-strong": "#ffffff", "neutral-border-opaque-normal": "#58595C", "neutral-border-opaque-subtle": "#313133", "inverse-container-lowest": "#ffffff", "inverse-container-lowest-hover": "#F9F9FA", "inverse-container-low": "#F9F9FA", "inverse-container-low-hover": "#F6F6F7", "inverse-container-mid": "#F6F6F7", "inverse-container-mid-hover": "#F1F1F2", "inverse-container-high": "#EDEEF0", "inverse-container-high-hover": "#E3E3E6", "inverse-container-static-high": "#313133", "inverse-container-static-high-hover": "#58595C", "inverse-container-highest": "#E9E9EB", "inverse-fill-mid": "rgba(233,233,235,0.24)", "inverse-fill-mid-hover": "rgba(109,109,112,0.16)", "inverse-label-primary": "#1E1E1F", "inverse-label-secondary": "rgba(109,109,112,0.8)", "inverse-label-tertiary": "rgba(109,109,112,0.48)", "inverse-label-quaternary": "rgba(109,109,112,0.24)", "inverse-label-static-primary": "#ffffff", "inverse-label-static-secondary": "rgba(233,233,235,0.64)", "inverse-border-overlay-strong": "rgba(109,109,112,0.64)", "inverse-border-overlay-normal": "rgba(109,109,112,0.24)", "inverse-border-overlay-subtle": "rgba(109,109,112,0.16)", "inverse-border-overlay-hint": "rgba(109,109,112,0.12)", "inverse-border-opaque-strong": "#1E1E1F", "inverse-border-opaque-normal": "#D7D7D9", "inverse-border-opaque-subtle": "#E9E9EB", "brand-container-mid": "#236638", "brand-container-mid-hover": "#00733E", "brand-container-high": "#0C893B", "brand-fill-mid": "#236638", "brand-fill-mid-hover": "#00733E", "brand-fill-low": "#1A5E31", "brand-fill-low-hover": "#236638", "brand-label-primary": "#C3FFD0", "brand-label-secondary": "#ffffff", "brand-label-variation-secondary": "rgba(255,255,255,0.8)", "brand-border-opaque-normal": "#ffffff", "brand-border-opaque-strong": "#C3FFD0", "brandinverse-label-primary": "#0C893B", "brandinverse-label-secondary": "#14371B", "brandinverse-label-static-primary": "#C3FFD0", "accent-label-primary": "#FF9B3E", "accent-label-yellow": "#FFD739", "accent-label-mint": "#00CCCC", "accent-label-cyan": "#6AC4FF", "accent-label-purple": "#C978F2", "accent-label-pink": "#FF6095", "accent-container-primary": "#B46200", "function-container-positive": "#5DDF73", "function-container-negative": "#FF3333", "function-container-negative-hover": "#FF6060", "function-container-caution": "#FF9B3E", "function-container-highlight": "#394D00", "function-container-selection": "rgba(255,255,255,0.12)", "function-container-drag": "rgba(255,255,255,0.16)", "function-label-positive": "#5DDF73", "function-label-negative": "#FF3333", "function-label-caution": "#FF9B3E", "function-label-link": "#6AC4FF", "cover-dim-page": "rgba(0,0,0,0.48)" } }, "radius": { "xxs": "2px", "xs": "4px", "s": "6px", "m": "8px", "l": "10px", "xl": "12px", "xxl": "200px" }, "opacity": { "0": "0%", "1": "1%", "4": "4%", "8": "8%", "12": "12%", "16": "16%", "20": "20%", "24": "24%", "28": "28%", "32": "32%", "36": "36%", "40": "40%", "44": "44%", "48": "48%", "50": "50%", "56": "56%", "64": "64%", "72": "72%", "80": "80%" }, "padding": { "component-50": "2px", "component-100": "4px", "component-150": "6px", "component-200": "8px", "component-300": "12px", "component-400": "16px", "component-500": "20px", "component-600": "24px", "component-700": "32px", "component-800": "40px", "component-900": "48px", "section-50": "20px", "section-100": "24px", "section-200": "32px", "section-300": "40px", "section-400": "48px", "section-500": "56px", "section-600": "64px", "section-700": "80px", "section-800": "100px", "section-900": "120px" }, "size": { "0": "0px", "1": "1px", "2": "2px", "3": "3px", "4": "4px", "6": "6px", "8": "8px", "10": "10px", "12": "12px", "14": "14px", "16": "16px", "18": "18px", "20": "20px", "24": "24px", "32": "32px", "40": "40px", "48": "48px", "56": "56px", "64": "64px", "80": "80px", "100": "100px", "120": "120px", "140": "140px", "160": "160px", "180": "180px", "200": "200px", "minus6": "-6px", "minus4": "-4px", "minus2": "-2px" }, "gap": { "positive-50": "2px", "positive-100": "4px", "positive-150": "6px", "positive-200": "8px", "positive-300": "12px", "positive-400": "16px", "positive-500": "20px", "positive-600": "24px", "positive-700": "32px", "positive-800": "40px", "positive-900": "48px" }, "shadow": { "normal": ["0px 2px 12px 0px rgba(0, 0, 0, 0.08), 0px 1px 8px 0px rgba(0, 0, 0, 0.06), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)", "0px 2px 12px 0px rgba(0, 0, 0, 0.24), 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.2)"], "strong": ["0px 6px 16px 0px rgba(0, 0, 0, 0.12), 0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)", "0px 6px 16px 0px rgba(0, 0, 0, 0.36), 0px 4px 12px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)"], "heavy": ["0px 16px 20px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)", "0px 16px 20px 0px rgba(0, 0, 0, 0.36), 0px 8px 16px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)"] }, "iconSize": { "xs": "16px", "s": "20px", "m": "24px", "l": "32px", "xl": "40px" } };
|
|
6
6
|
|
|
7
7
|
// src/color/index.ts
|
|
8
|
-
import { useRecoilState
|
|
9
|
-
import { Appearance } from "react-native";
|
|
8
|
+
import { useRecoilState } from "recoil";
|
|
10
9
|
|
|
11
10
|
// src/store/theme.ts
|
|
12
11
|
import { atom } from "recoil";
|
|
@@ -14,45 +13,57 @@ var appAppearanceAtom = atom({
|
|
|
14
13
|
key: "themeAtoms",
|
|
15
14
|
default: "sys"
|
|
16
15
|
});
|
|
16
|
+
var systemAppearanceAtom = atom({
|
|
17
|
+
key: "systemThemeAtoms",
|
|
18
|
+
default: "notDetermined"
|
|
19
|
+
});
|
|
17
20
|
|
|
18
21
|
// src/color/index.ts
|
|
19
|
-
|
|
22
|
+
import { useMemo } from "react";
|
|
23
|
+
var useAppearance = /* @__PURE__ */ __name(() => {
|
|
24
|
+
const [systemAppearance, setSystemAppearance] = useRecoilState(systemAppearanceAtom);
|
|
20
25
|
const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);
|
|
21
|
-
|
|
22
|
-
}, "useAppAppearance");
|
|
23
|
-
var useColor = /* @__PURE__ */ __name((StyleSheetFunction) => {
|
|
24
|
-
const appAppearance = useRecoilValue(appAppearanceAtom);
|
|
25
|
-
const colorToken = (() => {
|
|
26
|
+
const effectiveAppearance = useMemo(() => {
|
|
26
27
|
if (appAppearance === "sys") {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return vars.color[colorScheme];
|
|
28
|
+
if (systemAppearance === "notDetermined") {
|
|
29
|
+
return "light";
|
|
30
30
|
}
|
|
31
|
-
return
|
|
32
|
-
} else {
|
|
33
|
-
return vars.color[appAppearance];
|
|
31
|
+
return systemAppearance;
|
|
34
32
|
}
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
return appAppearance;
|
|
34
|
+
}, [appAppearance, systemAppearance]);
|
|
35
|
+
return {
|
|
36
|
+
effectiveAppearance,
|
|
37
|
+
appAppearance,
|
|
38
|
+
systemAppearance,
|
|
39
|
+
setAppAppearance,
|
|
40
|
+
setSystemAppearance
|
|
41
|
+
};
|
|
42
|
+
}, "useAppearance");
|
|
43
|
+
var useColor = /* @__PURE__ */ __name((StyleSheetFunction) => {
|
|
44
|
+
const { effectiveAppearance } = useAppearance();
|
|
45
|
+
const colorToken = vars.color[effectiveAppearance];
|
|
46
|
+
return {
|
|
47
|
+
styles: StyleSheetFunction(colorToken),
|
|
48
|
+
color: colorToken
|
|
49
|
+
};
|
|
37
50
|
}, "useColor");
|
|
38
51
|
var MMKV_KEY = "MMKV_KEY_THEME";
|
|
39
52
|
|
|
40
53
|
// src/hooks/useDarkTheme.ts
|
|
41
|
-
import { useRecoilValue as useRecoilValue2 } from "recoil";
|
|
42
|
-
import { Appearance as Appearance2 } from "react-native";
|
|
43
54
|
var useDarkTheme = /* @__PURE__ */ __name(() => {
|
|
44
|
-
const
|
|
55
|
+
const { effectiveAppearance, appAppearance } = useAppearance();
|
|
45
56
|
return {
|
|
46
|
-
isDarkTheme:
|
|
57
|
+
isDarkTheme: effectiveAppearance === "dark",
|
|
47
58
|
/**
|
|
48
59
|
* darkMode를 구분하고 싶다면 theme말고 isDarkTheme를 사용해주세요.
|
|
49
60
|
*/
|
|
50
|
-
theme
|
|
61
|
+
theme: appAppearance
|
|
51
62
|
};
|
|
52
63
|
}, "useDarkTheme");
|
|
53
64
|
export {
|
|
54
65
|
MMKV_KEY,
|
|
55
|
-
|
|
66
|
+
useAppearance,
|
|
56
67
|
useColor,
|
|
57
68
|
useDarkTheme,
|
|
58
69
|
vars
|
package/lib/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/generated/vars.ts", "../src/color/index.ts", "../src/store/theme.ts", "../src/hooks/useDarkTheme.ts"],
|
|
4
|
-
"sourcesContent": ["export const vars = {\"color\":{\"light\":{\"neutral-container-lowest\":\"#ffffff\",\"neutral-container-lowest-hover\":\"#F9F9FA\",\"neutral-container-low\":\"#F9F9FA\",\"neutral-container-low-hover\":\"#F6F6F7\",\"neutral-container-mid\":\"#F6F6F7\",\"neutral-container-mid-hover\":\"#F1F1F2\",\"neutral-container-high\":\"#EDEEF0\",\"neutral-container-high-hover\":\"#E3E3E6\",\"neutral-container-highest\":\"#E9E9EB\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#ffffff\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.06)\",\"neutral-fill-low\":\"rgba(109,109,112,0.04)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"neutral-fill-high\":\"rgba(109,109,112,0.2)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.28)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#1E1E1F\",\"neutral-label-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-label-tertiary\":\"rgba(109,109,112,0.48)\",\"neutral-label-quaternary\":\"rgba(109,109,112,0.24)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"neutral-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"neutral-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"neutral-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"neutral-border-opaque-strong\":\"#1E1E1F\",\"neutral-border-opaque-normal\":\"#D7D7D9\",\"neutral-border-opaque-subtle\":\"#E9E9EB\",\"inverse-container-lowest\":\"#1E1E1F\",\"inverse-container-lowest-hover\":\"#272729\",\"inverse-container-low\":\"#272729\",\"inverse-container-low-hover\":\"#313133\",\"inverse-container-mid\":\"#313133\",\"inverse-container-mid-hover\":\"#39393B\",\"inverse-container-high\":\"#313133\",\"inverse-container-high-hover\":\"#4A4A4D\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#4A4A4D\",\"inverse-fill-mid\":\"#ffffff\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"inverse-label-primary\":\"#ffffff\",\"inverse-label-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-label-tertiary\":\"rgba(233,233,235,0.32)\",\"inverse-label-quaternary\":\"rgba(233,233,235,0.2)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"inverse-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"inverse-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"inverse-border-opaque-strong\":\"#ffffff\",\"inverse-border-opaque-normal\":\"#58595C\",\"inverse-border-opaque-subtle\":\"#313133\",\"brand-container-mid\":\"#14371B\",\"brand-container-mid-hover\":\"#082C11\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#14371B\",\"brand-fill-mid-hover\":\"#082C11\",\"brand-fill-low\":\"#F6FFF1\",\"brand-fill-low-hover\":\"#EBFFE7\",\"brand-label-primary\":\"#0C893B\",\"brand-label-secondary\":\"#14371B\",\"brand-label-variation-secondary\":\"#14371B\",\"brand-border-opaque-normal\":\"#14371B\",\"brand-border-opaque-strong\":\"#0C893B\",\"brandinverse-label-primary\":\"#C3FFD0\",\"brandinverse-label-secondary\":\"#ffffff\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FE8F16\",\"accent-label-yellow\":\"#FFCC00\",\"accent-label-mint\":\"#02B0B0\",\"accent-label-cyan\":\"#40B3FF\",\"accent-label-purple\":\"#B450E6\",\"accent-label-pink\":\"#FF3377\",\"accent-container-primary\":\"#FFB77C\",\"function-container-positive\":\"#30BF48\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#DB2323\",\"function-container-caution\":\"#FE8F16\",\"function-container-highlight\":\"#EAFFB6\",\"function-container-selection\":\"rgba(4,17,102,0.08)\",\"function-container-drag\":\"rgba(4,17,102,0.12)\",\"function-label-positive\":\"#30BF48\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FE8F16\",\"function-label-link\":\"#1A79B8\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"},\"dark\":{\"neutral-container-lowest\":\"#1E1E1F\",\"neutral-container-lowest-hover\":\"#272729\",\"neutral-container-low\":\"#272729\",\"neutral-container-low-hover\":\"#313133\",\"neutral-container-mid\":\"#313133\",\"neutral-container-mid-hover\":\"#39393B\",\"neutral-container-high\":\"#313133\",\"neutral-container-high-hover\":\"#4A4A4D\",\"neutral-container-highest\":\"#4A4A4D\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#272729\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.12)\",\"neutral-fill-low\":\"rgba(109,109,112,0.08)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.2)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.16)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.44)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#ffffff\",\"neutral-label-secondary\":\"rgba(233,233,235,0.64)\",\"neutral-label-tertiary\":\"rgba(233,233,235,0.32)\",\"neutral-label-quaternary\":\"rgba(233,233,235,0.2)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"neutral-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"neutral-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"neutral-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"neutral-border-opaque-strong\":\"#ffffff\",\"neutral-border-opaque-normal\":\"#58595C\",\"neutral-border-opaque-subtle\":\"#313133\",\"inverse-container-lowest\":\"#ffffff\",\"inverse-container-lowest-hover\":\"#F9F9FA\",\"inverse-container-low\":\"#F9F9FA\",\"inverse-container-low-hover\":\"#F6F6F7\",\"inverse-container-mid\":\"#F6F6F7\",\"inverse-container-mid-hover\":\"#F1F1F2\",\"inverse-container-high\":\"#EDEEF0\",\"inverse-container-high-hover\":\"#E3E3E6\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#E9E9EB\",\"inverse-fill-mid\":\"rgba(233,233,235,0.24)\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"inverse-label-primary\":\"#1E1E1F\",\"inverse-label-secondary\":\"rgba(109,109,112,0.8)\",\"inverse-label-tertiary\":\"rgba(109,109,112,0.48)\",\"inverse-label-quaternary\":\"rgba(109,109,112,0.24)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"inverse-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"inverse-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"inverse-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"inverse-border-opaque-strong\":\"#1E1E1F\",\"inverse-border-opaque-normal\":\"#D7D7D9\",\"inverse-border-opaque-subtle\":\"#E9E9EB\",\"brand-container-mid\":\"#236638\",\"brand-container-mid-hover\":\"#00733E\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#236638\",\"brand-fill-mid-hover\":\"#00733E\",\"brand-fill-low\":\"#1A5E31\",\"brand-fill-low-hover\":\"#236638\",\"brand-label-primary\":\"#C3FFD0\",\"brand-label-secondary\":\"#ffffff\",\"brand-label-variation-secondary\":\"rgba(255,255,255,0.8)\",\"brand-border-opaque-normal\":\"#ffffff\",\"brand-border-opaque-strong\":\"#C3FFD0\",\"brandinverse-label-primary\":\"#0C893B\",\"brandinverse-label-secondary\":\"#14371B\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FF9B3E\",\"accent-label-yellow\":\"#FFD739\",\"accent-label-mint\":\"#00CCCC\",\"accent-label-cyan\":\"#6AC4FF\",\"accent-label-purple\":\"#C978F2\",\"accent-label-pink\":\"#FF6095\",\"accent-container-primary\":\"#B46200\",\"function-container-positive\":\"#5DDF73\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#FF6060\",\"function-container-caution\":\"#FF9B3E\",\"function-container-highlight\":\"#394D00\",\"function-container-selection\":\"rgba(255,255,255,0.12)\",\"function-container-drag\":\"rgba(255,255,255,0.16)\",\"function-label-positive\":\"#5DDF73\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FF9B3E\",\"function-label-link\":\"#6AC4FF\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"}},\"radius\":{\"xxs\":\"2px\",\"xs\":\"4px\",\"s\":\"6px\",\"m\":\"8px\",\"l\":\"10px\",\"xl\":\"12px\",\"xxl\":\"200px\"},\"opacity\":{\"0\":\"0%\",\"1\":\"1%\",\"4\":\"4%\",\"8\":\"8%\",\"12\":\"12%\",\"16\":\"16%\",\"20\":\"20%\",\"24\":\"24%\",\"28\":\"28%\",\"32\":\"32%\",\"36\":\"36%\",\"40\":\"40%\",\"44\":\"44%\",\"48\":\"48%\",\"50\":\"50%\",\"56\":\"56%\",\"64\":\"64%\",\"72\":\"72%\",\"80\":\"80%\"},\"padding\":{\"component-50\":\"2px\",\"component-100\":\"4px\",\"component-150\":\"6px\",\"component-200\":\"8px\",\"component-300\":\"12px\",\"component-400\":\"16px\",\"component-500\":\"20px\",\"component-600\":\"24px\",\"component-700\":\"32px\",\"component-800\":\"40px\",\"component-900\":\"48px\",\"section-50\":\"20px\",\"section-100\":\"24px\",\"section-200\":\"32px\",\"section-300\":\"40px\",\"section-400\":\"48px\",\"section-500\":\"56px\",\"section-600\":\"64px\",\"section-700\":\"80px\",\"section-800\":\"100px\",\"section-900\":\"120px\"},\"size\":{\"0\":\"0px\",\"1\":\"1px\",\"2\":\"2px\",\"3\":\"3px\",\"4\":\"4px\",\"6\":\"6px\",\"8\":\"8px\",\"10\":\"10px\",\"12\":\"12px\",\"14\":\"14px\",\"16\":\"16px\",\"18\":\"18px\",\"20\":\"20px\",\"24\":\"24px\",\"32\":\"32px\",\"40\":\"40px\",\"48\":\"48px\",\"56\":\"56px\",\"64\":\"64px\",\"80\":\"80px\",\"100\":\"100px\",\"120\":\"120px\",\"140\":\"140px\",\"160\":\"160px\",\"180\":\"180px\",\"200\":\"200px\",\"minus6\":\"-6px\",\"minus4\":\"-4px\",\"minus2\":\"-2px\"},\"gap\":{\"positive-50\":\"2px\",\"positive-100\":\"4px\",\"positive-150\":\"6px\",\"positive-200\":\"8px\",\"positive-300\":\"12px\",\"positive-400\":\"16px\",\"positive-500\":\"20px\",\"positive-600\":\"24px\",\"positive-700\":\"32px\",\"positive-800\":\"40px\",\"positive-900\":\"48px\"},\"shadow\":{\"normal\":[\"0px 2px 12px 0px rgba(0, 0, 0, 0.08), 0px 1px 8px 0px rgba(0, 0, 0, 0.06), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)\",\"0px 2px 12px 0px rgba(0, 0, 0, 0.24), 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.2)\"],\"strong\":[\"0px 6px 16px 0px rgba(0, 0, 0, 0.12), 0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 6px 16px 0px rgba(0, 0, 0, 0.36), 0px 4px 12px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"],\"heavy\":[\"0px 16px 20px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 16px 20px 0px rgba(0, 0, 0, 0.36), 0px 8px 16px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"]},\"iconSize\":{\"xs\":\"16px\",\"s\":\"20px\",\"m\":\"24px\",\"l\":\"32px\",\"xl\":\"40px\"}}", "import { useRecoilState, useRecoilValue } from 'recoil';\nimport { vars } from '../generated/vars';\nimport { Appearance } from 'react-native';\nimport { appAppearanceAtom } from '../store/theme';\n\nexport type AppAppearance = 'dark' | 'light' | 'sys';\n\nexport const useAppAppearance = () => {\n const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);\n return { appAppearance, setAppAppearance };\n};\n\nexport type ColorType = typeof vars.color.light;\n\nexport const useColor = <T>(\n StyleSheetFunction: (color: ColorType) => T,\n): { styles: T; color: ColorType } => {\n const appAppearance = useRecoilValue(appAppearanceAtom);\n\n const colorToken = (() => {\n if (appAppearance === 'sys') {\n const colorScheme = Appearance.getColorScheme();\n\n if (colorScheme) {\n return vars.color[colorScheme];\n }\n\n // colorScheme\uC774 \uC5C6\uB294 \uACBD\uC6B0 light \uD14C\uB9C8\uB97C \uBC18\uD658\uD569\uB2C8\uB2E4.\n return vars.color.light;\n } else {\n return vars.color[appAppearance];\n }\n })();\n\n return { styles: StyleSheetFunction(colorToken), color: colorToken };\n};\n\nexport const MMKV_KEY = 'MMKV_KEY_THEME';\n", "import { atom } from 'recoil';\nimport { AppAppearance } from '../color';\n\nexport const appAppearanceAtom = atom<AppAppearance>({\n key: 'themeAtoms',\n default: 'sys',\n});\n", "import { useRecoilValue } from 'recoil';\nimport { appAppearanceAtom } from '../store/theme';\nimport { Appearance } from 'react-native';\n\nexport const useDarkTheme = () => {\n const theme = useRecoilValue(appAppearanceAtom);\n\n return {\n isDarkTheme: theme === 'dark' || (theme === 'sys' && Appearance.getColorScheme() === 'dark'),\n /**\n * darkMode\uB97C \uAD6C\uBD84\uD558\uACE0 \uC2F6\uB2E4\uBA74 theme\uB9D0\uACE0 isDarkTheme\uB97C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n */\n theme,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;AAAO,IAAM,OAAO,EAAC,SAAQ,EAAC,SAAQ,EAAC,4BAA2B,WAAU,kCAAiC,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,0BAAyB,WAAU,gCAA+B,WAAU,6BAA4B,WAAU,mCAAkC,WAAU,yCAAwC,WAAU,sCAAqC,WAAU,uBAAsB,uBAAsB,6BAA4B,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,qBAAoB,yBAAwB,2BAA0B,0BAAyB,wBAAuB,0BAAyB,yBAAwB,WAAU,2BAA0B,yBAAwB,0BAAyB,0BAAyB,4BAA2B,0BAAyB,gCAA+B,WAAU,kCAAiC,yBAAwB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,+BAA8B,0BAAyB,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AAC,GAAE,YAAW,EAAC,MAAK,QAAO,KAAI,QAAO,KAAI,QAAO,KAAI,QAAO,MAAK,OAAM,EAAC;;;ACAh5T,SAAS,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["export const vars = {\"color\":{\"light\":{\"neutral-container-lowest\":\"#ffffff\",\"neutral-container-lowest-hover\":\"#F9F9FA\",\"neutral-container-low\":\"#F9F9FA\",\"neutral-container-low-hover\":\"#F6F6F7\",\"neutral-container-mid\":\"#F6F6F7\",\"neutral-container-mid-hover\":\"#F1F1F2\",\"neutral-container-high\":\"#EDEEF0\",\"neutral-container-high-hover\":\"#E3E3E6\",\"neutral-container-highest\":\"#E9E9EB\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#ffffff\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.06)\",\"neutral-fill-low\":\"rgba(109,109,112,0.04)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.08)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"neutral-fill-high\":\"rgba(109,109,112,0.2)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.28)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#1E1E1F\",\"neutral-label-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-label-tertiary\":\"rgba(109,109,112,0.48)\",\"neutral-label-quaternary\":\"rgba(109,109,112,0.24)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"neutral-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"neutral-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"neutral-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"neutral-border-opaque-strong\":\"#1E1E1F\",\"neutral-border-opaque-normal\":\"#D7D7D9\",\"neutral-border-opaque-subtle\":\"#E9E9EB\",\"inverse-container-lowest\":\"#1E1E1F\",\"inverse-container-lowest-hover\":\"#272729\",\"inverse-container-low\":\"#272729\",\"inverse-container-low-hover\":\"#313133\",\"inverse-container-mid\":\"#313133\",\"inverse-container-mid-hover\":\"#39393B\",\"inverse-container-high\":\"#313133\",\"inverse-container-high-hover\":\"#4A4A4D\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#4A4A4D\",\"inverse-fill-mid\":\"#ffffff\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"inverse-label-primary\":\"#ffffff\",\"inverse-label-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-label-tertiary\":\"rgba(233,233,235,0.32)\",\"inverse-label-quaternary\":\"rgba(233,233,235,0.2)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"inverse-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"inverse-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"inverse-border-opaque-strong\":\"#ffffff\",\"inverse-border-opaque-normal\":\"#58595C\",\"inverse-border-opaque-subtle\":\"#313133\",\"brand-container-mid\":\"#14371B\",\"brand-container-mid-hover\":\"#082C11\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#14371B\",\"brand-fill-mid-hover\":\"#082C11\",\"brand-fill-low\":\"#F6FFF1\",\"brand-fill-low-hover\":\"#EBFFE7\",\"brand-label-primary\":\"#0C893B\",\"brand-label-secondary\":\"#14371B\",\"brand-label-variation-secondary\":\"#14371B\",\"brand-border-opaque-normal\":\"#14371B\",\"brand-border-opaque-strong\":\"#0C893B\",\"brandinverse-label-primary\":\"#C3FFD0\",\"brandinverse-label-secondary\":\"#ffffff\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FE8F16\",\"accent-label-yellow\":\"#FFCC00\",\"accent-label-mint\":\"#02B0B0\",\"accent-label-cyan\":\"#40B3FF\",\"accent-label-purple\":\"#B450E6\",\"accent-label-pink\":\"#FF3377\",\"accent-container-primary\":\"#FFB77C\",\"function-container-positive\":\"#30BF48\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#DB2323\",\"function-container-caution\":\"#FE8F16\",\"function-container-highlight\":\"#EAFFB6\",\"function-container-selection\":\"rgba(4,17,102,0.08)\",\"function-container-drag\":\"rgba(4,17,102,0.12)\",\"function-label-positive\":\"#30BF48\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FE8F16\",\"function-label-link\":\"#1A79B8\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"},\"dark\":{\"neutral-container-lowest\":\"#1E1E1F\",\"neutral-container-lowest-hover\":\"#272729\",\"neutral-container-low\":\"#272729\",\"neutral-container-low-hover\":\"#313133\",\"neutral-container-mid\":\"#313133\",\"neutral-container-mid-hover\":\"#39393B\",\"neutral-container-high\":\"#313133\",\"neutral-container-high-hover\":\"#4A4A4D\",\"neutral-container-highest\":\"#4A4A4D\",\"neutral-container-static-lowest\":\"#ffffff\",\"neutral-container-static-lowest-hover\":\"#F9F9FA\",\"neutral-container-variation-lowest\":\"#272729\",\"neutral-fill-lowest\":\"rgba(109,109,112,0)\",\"neutral-fill-lowest-hover\":\"rgba(109,109,112,0.12)\",\"neutral-fill-low\":\"rgba(109,109,112,0.08)\",\"neutral-fill-low-hover\":\"rgba(109,109,112,0.2)\",\"neutral-fill-mid\":\"rgba(109,109,112,0.16)\",\"neutral-fill-mid-hover\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high\":\"rgba(109,109,112,0.32)\",\"neutral-fill-high-hover\":\"rgba(109,109,112,0.44)\",\"neutral-fill-highest\":\"rgba(109,109,112,0.72)\",\"neutral-label-primary\":\"#ffffff\",\"neutral-label-secondary\":\"rgba(233,233,235,0.64)\",\"neutral-label-tertiary\":\"rgba(233,233,235,0.32)\",\"neutral-label-quaternary\":\"rgba(233,233,235,0.2)\",\"neutral-label-static-primary\":\"#1E1E1F\",\"neutral-label-static-secondary\":\"rgba(109,109,112,0.8)\",\"neutral-border-overlay-strong\":\"rgba(233,233,235,0.64)\",\"neutral-border-overlay-normal\":\"rgba(233,233,235,0.28)\",\"neutral-border-overlay-subtle\":\"rgba(233,233,235,0.2)\",\"neutral-border-overlay-hint\":\"rgba(233,233,235,0.12)\",\"neutral-border-opaque-strong\":\"#ffffff\",\"neutral-border-opaque-normal\":\"#58595C\",\"neutral-border-opaque-subtle\":\"#313133\",\"inverse-container-lowest\":\"#ffffff\",\"inverse-container-lowest-hover\":\"#F9F9FA\",\"inverse-container-low\":\"#F9F9FA\",\"inverse-container-low-hover\":\"#F6F6F7\",\"inverse-container-mid\":\"#F6F6F7\",\"inverse-container-mid-hover\":\"#F1F1F2\",\"inverse-container-high\":\"#EDEEF0\",\"inverse-container-high-hover\":\"#E3E3E6\",\"inverse-container-static-high\":\"#313133\",\"inverse-container-static-high-hover\":\"#58595C\",\"inverse-container-highest\":\"#E9E9EB\",\"inverse-fill-mid\":\"rgba(233,233,235,0.24)\",\"inverse-fill-mid-hover\":\"rgba(109,109,112,0.16)\",\"inverse-label-primary\":\"#1E1E1F\",\"inverse-label-secondary\":\"rgba(109,109,112,0.8)\",\"inverse-label-tertiary\":\"rgba(109,109,112,0.48)\",\"inverse-label-quaternary\":\"rgba(109,109,112,0.24)\",\"inverse-label-static-primary\":\"#ffffff\",\"inverse-label-static-secondary\":\"rgba(233,233,235,0.64)\",\"inverse-border-overlay-strong\":\"rgba(109,109,112,0.64)\",\"inverse-border-overlay-normal\":\"rgba(109,109,112,0.24)\",\"inverse-border-overlay-subtle\":\"rgba(109,109,112,0.16)\",\"inverse-border-overlay-hint\":\"rgba(109,109,112,0.12)\",\"inverse-border-opaque-strong\":\"#1E1E1F\",\"inverse-border-opaque-normal\":\"#D7D7D9\",\"inverse-border-opaque-subtle\":\"#E9E9EB\",\"brand-container-mid\":\"#236638\",\"brand-container-mid-hover\":\"#00733E\",\"brand-container-high\":\"#0C893B\",\"brand-fill-mid\":\"#236638\",\"brand-fill-mid-hover\":\"#00733E\",\"brand-fill-low\":\"#1A5E31\",\"brand-fill-low-hover\":\"#236638\",\"brand-label-primary\":\"#C3FFD0\",\"brand-label-secondary\":\"#ffffff\",\"brand-label-variation-secondary\":\"rgba(255,255,255,0.8)\",\"brand-border-opaque-normal\":\"#ffffff\",\"brand-border-opaque-strong\":\"#C3FFD0\",\"brandinverse-label-primary\":\"#0C893B\",\"brandinverse-label-secondary\":\"#14371B\",\"brandinverse-label-static-primary\":\"#C3FFD0\",\"accent-label-primary\":\"#FF9B3E\",\"accent-label-yellow\":\"#FFD739\",\"accent-label-mint\":\"#00CCCC\",\"accent-label-cyan\":\"#6AC4FF\",\"accent-label-purple\":\"#C978F2\",\"accent-label-pink\":\"#FF6095\",\"accent-container-primary\":\"#B46200\",\"function-container-positive\":\"#5DDF73\",\"function-container-negative\":\"#FF3333\",\"function-container-negative-hover\":\"#FF6060\",\"function-container-caution\":\"#FF9B3E\",\"function-container-highlight\":\"#394D00\",\"function-container-selection\":\"rgba(255,255,255,0.12)\",\"function-container-drag\":\"rgba(255,255,255,0.16)\",\"function-label-positive\":\"#5DDF73\",\"function-label-negative\":\"#FF3333\",\"function-label-caution\":\"#FF9B3E\",\"function-label-link\":\"#6AC4FF\",\"cover-dim-page\":\"rgba(0,0,0,0.48)\"}},\"radius\":{\"xxs\":\"2px\",\"xs\":\"4px\",\"s\":\"6px\",\"m\":\"8px\",\"l\":\"10px\",\"xl\":\"12px\",\"xxl\":\"200px\"},\"opacity\":{\"0\":\"0%\",\"1\":\"1%\",\"4\":\"4%\",\"8\":\"8%\",\"12\":\"12%\",\"16\":\"16%\",\"20\":\"20%\",\"24\":\"24%\",\"28\":\"28%\",\"32\":\"32%\",\"36\":\"36%\",\"40\":\"40%\",\"44\":\"44%\",\"48\":\"48%\",\"50\":\"50%\",\"56\":\"56%\",\"64\":\"64%\",\"72\":\"72%\",\"80\":\"80%\"},\"padding\":{\"component-50\":\"2px\",\"component-100\":\"4px\",\"component-150\":\"6px\",\"component-200\":\"8px\",\"component-300\":\"12px\",\"component-400\":\"16px\",\"component-500\":\"20px\",\"component-600\":\"24px\",\"component-700\":\"32px\",\"component-800\":\"40px\",\"component-900\":\"48px\",\"section-50\":\"20px\",\"section-100\":\"24px\",\"section-200\":\"32px\",\"section-300\":\"40px\",\"section-400\":\"48px\",\"section-500\":\"56px\",\"section-600\":\"64px\",\"section-700\":\"80px\",\"section-800\":\"100px\",\"section-900\":\"120px\"},\"size\":{\"0\":\"0px\",\"1\":\"1px\",\"2\":\"2px\",\"3\":\"3px\",\"4\":\"4px\",\"6\":\"6px\",\"8\":\"8px\",\"10\":\"10px\",\"12\":\"12px\",\"14\":\"14px\",\"16\":\"16px\",\"18\":\"18px\",\"20\":\"20px\",\"24\":\"24px\",\"32\":\"32px\",\"40\":\"40px\",\"48\":\"48px\",\"56\":\"56px\",\"64\":\"64px\",\"80\":\"80px\",\"100\":\"100px\",\"120\":\"120px\",\"140\":\"140px\",\"160\":\"160px\",\"180\":\"180px\",\"200\":\"200px\",\"minus6\":\"-6px\",\"minus4\":\"-4px\",\"minus2\":\"-2px\"},\"gap\":{\"positive-50\":\"2px\",\"positive-100\":\"4px\",\"positive-150\":\"6px\",\"positive-200\":\"8px\",\"positive-300\":\"12px\",\"positive-400\":\"16px\",\"positive-500\":\"20px\",\"positive-600\":\"24px\",\"positive-700\":\"32px\",\"positive-800\":\"40px\",\"positive-900\":\"48px\"},\"shadow\":{\"normal\":[\"0px 2px 12px 0px rgba(0, 0, 0, 0.08), 0px 1px 8px 0px rgba(0, 0, 0, 0.06), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)\",\"0px 2px 12px 0px rgba(0, 0, 0, 0.24), 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.2)\"],\"strong\":[\"0px 6px 16px 0px rgba(0, 0, 0, 0.12), 0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 6px 16px 0px rgba(0, 0, 0, 0.36), 0px 4px 12px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"],\"heavy\":[\"0px 16px 20px 0px rgba(0, 0, 0, 0.12), 0px 8px 16px 0px rgba(0, 0, 0, 0.08), 0px 0px 8px 0px rgba(0, 0, 0, 0.08)\",\"0px 16px 20px 0px rgba(0, 0, 0, 0.36), 0px 8px 16px 0px rgba(0, 0, 0, 0.24), 0px 0px 8px 0px rgba(0, 0, 0, 0.24)\"]},\"iconSize\":{\"xs\":\"16px\",\"s\":\"20px\",\"m\":\"24px\",\"l\":\"32px\",\"xl\":\"40px\"}}", "import { useRecoilState } from 'recoil';\nimport { vars } from '../generated/vars';\nimport { appAppearanceAtom, systemAppearanceAtom } from '../store/theme';\nimport { useMemo } from 'react';\n\nexport type ColorType = typeof vars.color.light;\nexport type EffectiveAppearance = 'dark' | 'light';\nexport type AppAppearance = EffectiveAppearance | 'sys';\nexport type SystemAppearance = EffectiveAppearance | 'notDetermined';\n\nexport const useAppearance = () => {\n const [systemAppearance, setSystemAppearance] = useRecoilState(systemAppearanceAtom);\n const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);\n\n const effectiveAppearance: EffectiveAppearance = useMemo(() => {\n if (appAppearance === 'sys') {\n if (systemAppearance === 'notDetermined') {\n return 'light';\n }\n\n return systemAppearance;\n }\n\n return appAppearance;\n }, [appAppearance, systemAppearance]);\n\n return {\n effectiveAppearance,\n appAppearance,\n systemAppearance,\n setAppAppearance,\n setSystemAppearance,\n };\n};\n\nexport const useColor = <T>(\n StyleSheetFunction: (color: ColorType) => T,\n): { styles: T; color: ColorType } => {\n const { effectiveAppearance } = useAppearance();\n const colorToken = vars.color[effectiveAppearance];\n\n return {\n styles: StyleSheetFunction(colorToken),\n color: colorToken,\n };\n};\n\nexport const MMKV_KEY = 'MMKV_KEY_THEME';\n", "import { atom } from 'recoil';\nimport { AppAppearance, SystemAppearance } from '../color';\n\nexport const appAppearanceAtom = atom<AppAppearance>({\n key: 'themeAtoms',\n default: 'sys',\n});\n\nexport const systemAppearanceAtom = atom<SystemAppearance>({\n key: 'systemThemeAtoms',\n default: 'notDetermined',\n});\n", "import { useAppearance } from '../color';\n\nexport const useDarkTheme = () => {\n const { effectiveAppearance, appAppearance } = useAppearance();\n\n return {\n isDarkTheme: effectiveAppearance === 'dark',\n /**\n * darkMode\uB97C \uAD6C\uBD84\uD558\uACE0 \uC2F6\uB2E4\uBA74 theme\uB9D0\uACE0 isDarkTheme\uB97C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n */\n theme: appAppearance,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;AAAO,IAAM,OAAO,EAAC,SAAQ,EAAC,SAAQ,EAAC,4BAA2B,WAAU,kCAAiC,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,yBAAwB,WAAU,+BAA8B,WAAU,0BAAyB,WAAU,gCAA+B,WAAU,6BAA4B,WAAU,mCAAkC,WAAU,yCAAwC,WAAU,sCAAqC,WAAU,uBAAsB,uBAAsB,6BAA4B,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,oBAAmB,0BAAyB,0BAAyB,0BAAyB,qBAAoB,yBAAwB,2BAA0B,0BAAyB,wBAAuB,0BAAyB,yBAAwB,WAAU,2BAA0B,yBAAwB,0BAAyB,0BAAyB,4BAA2B,0BAAyB,gCAA+B,WAAU,kCAAiC,yBAAwB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,iCAAgC,0BAAyB,+BAA8B,0BAAyB,gCAA+B,WAAU,gCAA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Appearance, SystemAppearance } from '../color';
|
|
2
2
|
export declare const appAppearanceAtom: import("recoil").RecoilState<AppAppearance>;
|
|
3
|
+
export declare const systemAppearanceAtom: import("recoil").RecoilState<SystemAppearance>;
|
package/package.json
CHANGED
package/src/color/index.ts
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import { useRecoilState
|
|
1
|
+
import { useRecoilState } from 'recoil';
|
|
2
2
|
import { vars } from '../generated/vars';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export type AppAppearance = 'dark' | 'light' | 'sys';
|
|
7
|
-
|
|
8
|
-
export const useAppAppearance = () => {
|
|
9
|
-
const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);
|
|
10
|
-
return { appAppearance, setAppAppearance };
|
|
11
|
-
};
|
|
3
|
+
import { appAppearanceAtom, systemAppearanceAtom } from '../store/theme';
|
|
4
|
+
import { useMemo } from 'react';
|
|
12
5
|
|
|
13
6
|
export type ColorType = typeof vars.color.light;
|
|
7
|
+
export type EffectiveAppearance = 'dark' | 'light';
|
|
8
|
+
export type AppAppearance = EffectiveAppearance | 'sys';
|
|
9
|
+
export type SystemAppearance = EffectiveAppearance | 'notDetermined';
|
|
14
10
|
|
|
15
|
-
export const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const appAppearance = useRecoilValue(appAppearanceAtom);
|
|
11
|
+
export const useAppearance = () => {
|
|
12
|
+
const [systemAppearance, setSystemAppearance] = useRecoilState(systemAppearanceAtom);
|
|
13
|
+
const [appAppearance, setAppAppearance] = useRecoilState(appAppearanceAtom);
|
|
19
14
|
|
|
20
|
-
const
|
|
15
|
+
const effectiveAppearance: EffectiveAppearance = useMemo(() => {
|
|
21
16
|
if (appAppearance === 'sys') {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (colorScheme) {
|
|
25
|
-
return vars.color[colorScheme];
|
|
17
|
+
if (systemAppearance === 'notDetermined') {
|
|
18
|
+
return 'light';
|
|
26
19
|
}
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
return vars.color.light;
|
|
30
|
-
} else {
|
|
31
|
-
return vars.color[appAppearance];
|
|
21
|
+
return systemAppearance;
|
|
32
22
|
}
|
|
33
|
-
})();
|
|
34
23
|
|
|
35
|
-
|
|
24
|
+
return appAppearance;
|
|
25
|
+
}, [appAppearance, systemAppearance]);
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
effectiveAppearance,
|
|
29
|
+
appAppearance,
|
|
30
|
+
systemAppearance,
|
|
31
|
+
setAppAppearance,
|
|
32
|
+
setSystemAppearance,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const useColor = <T>(
|
|
37
|
+
StyleSheetFunction: (color: ColorType) => T,
|
|
38
|
+
): { styles: T; color: ColorType } => {
|
|
39
|
+
const { effectiveAppearance } = useAppearance();
|
|
40
|
+
const colorToken = vars.color[effectiveAppearance];
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
styles: StyleSheetFunction(colorToken),
|
|
44
|
+
color: colorToken,
|
|
45
|
+
};
|
|
36
46
|
};
|
|
37
47
|
|
|
38
48
|
export const MMKV_KEY = 'MMKV_KEY_THEME';
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { appAppearanceAtom } from '../store/theme';
|
|
3
|
-
import { Appearance } from 'react-native';
|
|
1
|
+
import { useAppearance } from '../color';
|
|
4
2
|
|
|
5
3
|
export const useDarkTheme = () => {
|
|
6
|
-
const
|
|
4
|
+
const { effectiveAppearance, appAppearance } = useAppearance();
|
|
7
5
|
|
|
8
6
|
return {
|
|
9
|
-
isDarkTheme:
|
|
7
|
+
isDarkTheme: effectiveAppearance === 'dark',
|
|
10
8
|
/**
|
|
11
9
|
* darkMode를 구분하고 싶다면 theme말고 isDarkTheme를 사용해주세요.
|
|
12
10
|
*/
|
|
13
|
-
theme,
|
|
11
|
+
theme: appAppearance,
|
|
14
12
|
};
|
|
15
13
|
};
|
package/src/store/theme.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { atom } from 'recoil';
|
|
2
|
-
import { AppAppearance } from '../color';
|
|
2
|
+
import { AppAppearance, SystemAppearance } from '../color';
|
|
3
3
|
|
|
4
4
|
export const appAppearanceAtom = atom<AppAppearance>({
|
|
5
5
|
key: 'themeAtoms',
|
|
6
6
|
default: 'sys',
|
|
7
7
|
});
|
|
8
|
+
|
|
9
|
+
export const systemAppearanceAtom = atom<SystemAppearance>({
|
|
10
|
+
key: 'systemThemeAtoms',
|
|
11
|
+
default: 'notDetermined',
|
|
12
|
+
});
|