@loafacto/ui 0.1.3 → 0.2.0

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.
@@ -0,0 +1,26 @@
1
+ import { type ThemeConfig } from './applyTheme';
2
+ export type ThemeMode = 'light' | 'dark';
3
+ /**
4
+ * 앱 부팅 시 1회. createApp 보다 먼저 부른다 — CSS 변수만 세팅하는 동기 함수라
5
+ * 첫 페인트 전에 끝나고, 그래야 다른 테마가 잠깐 비쳤다가 바뀌는 일이 없다.
6
+ *
7
+ * 저장된 선택이 있으면 그걸 쓰고, 없으면 OS 설정을 따른다.
8
+ */
9
+ export declare function initTheme(options?: {
10
+ light?: ThemeConfig;
11
+ dark?: ThemeConfig;
12
+ }): void;
13
+ /**
14
+ * 테마 상태와 조작.
15
+ *
16
+ * const { mode, toggle } = useTheme()
17
+ */
18
+ export declare function useTheme(): {
19
+ mode: Readonly<import("vue").Ref<ThemeMode, ThemeMode>>;
20
+ /** 사용자가 직접 고른 상태인지. false 면 OS 설정을 따라가는 중이다. */
21
+ isExplicit: Readonly<import("vue").Ref<boolean, boolean>>;
22
+ setMode: (next: ThemeMode) => void;
23
+ toggle: () => void;
24
+ /** 저장된 선택을 지우고 다시 OS 설정을 따르게 한다. */
25
+ followSystem(): void;
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loafacto/ui",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Loafacto 공용 UI — 테마(시맨틱 팔레트 파생), 애플리케이션 셸, 공통 오버레이 컴포넌트",
5
5
  "type": "module",
6
6
  "files": [