@ehfuse/taskbox 0.1.6 → 0.2.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 업무함 테마 해석 훅이다 — 기본 테마(MUI primary 상속)에 Provider 주입값을 깊은 병합해 돌려준다.
3
+ * 컴포넌트는 `useTaskboxTheme()` 결과(전 필드 확정)만 읽고, 색을 직접 하드코딩하지 않는다.
4
+ */
5
+ import type { TaskboxTheme, TaskboxThemeColors, TaskboxThemeInput } from "../types/theme";
6
+ /**
7
+ * 기본 테마를 만든다 — 팔레트에서 컴포넌트 스타일을 파생시킨다.
8
+ * 소비처가 `colors` 만 바꿔도 표·보드·요약이 함께 따라 바뀐다.
9
+ */
10
+ export declare function buildTaskboxTheme(colors: TaskboxThemeColors): TaskboxTheme;
11
+ /** 기본 테마에 주입값을 깊은 병합한다(컴포넌트 스타일 → 배지까지 부분 지정 가능). */
12
+ export declare function resolveTaskboxTheme(base: TaskboxTheme, input?: TaskboxThemeInput): TaskboxTheme;
13
+ /**
14
+ * 현재 업무함 테마를 읽는다.
15
+ * 기본 강조색은 MUI 테마의 primary 를 상속하므로(주 버튼과 동일), 별도 설정 없이도 앱 색과 맞는다.
16
+ * Provider `theme` 로 넘긴 값이 있으면 그 값이 우선한다.
17
+ */
18
+ export declare function useTaskboxTheme(): TaskboxTheme;
@@ -6,3 +6,4 @@ export * from "./calendar";
6
6
  export * from "./upload";
7
7
  export * from "./employee";
8
8
  export * from "./provider";
9
+ export * from "./theme";
@@ -1,5 +1,6 @@
1
1
  /** TaskboxProvider 설정·슬롯 타입이다. */
2
2
  import type { ComponentType } from "react";
3
+ import type { TaskboxThemeInput } from "./theme";
3
4
  /** 공휴일 한 건이다 — Provider `loadHolidays` 가 반환한다. */
4
5
  export interface TaskboxHoliday {
5
6
  date: string;
@@ -41,4 +42,9 @@ export interface TaskboxConfig {
41
42
  isMobile?: boolean;
42
43
  /** UI 교체 슬롯. */
43
44
  slots?: TaskboxSlots;
45
+ /**
46
+ * 테마(색·치수 토큰) 부분 지정. 미지정 시 기본 테마를 쓰고,
47
+ * 강조색은 MUI 테마의 primary 를 상속한다(앱 주 버튼과 같은 색).
48
+ */
49
+ theme?: TaskboxThemeInput;
44
50
  }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * 업무함 테마 타입이다 — 색·치수 토큰을 계층으로 나눠 소비처가 부분만 덮어쓸 수 있게 한다.
3
+ *
4
+ * 설계 원칙:
5
+ * 1. **2계층**: `colors`(의미 토큰 — 전역 팔레트)와 컴포넌트별 스타일(`table`/`board`/`summary`/`chip`)로 나눈다.
6
+ * 컴포넌트 스타일의 기본값은 `colors` 에서 파생되므로, 팔레트 한 곳만 바꿔도 전체가 따라 바뀐다.
7
+ * 2. **앱 색 자동 상속**: `colors.accent`/`accentContrast` 를 지정하지 않으면 MUI 테마의 primary 를 쓴다.
8
+ * → 별도 설정 없이도 강조 요소가 앱의 주 버튼(예: "새로 만들기")과 같은 색이 된다.
9
+ * 3. **부분 지정**: 모든 필드가 선택이라 바꾸고 싶은 값만 준다(`TaskboxThemeInput`, 깊은 병합).
10
+ * 4. **해석 후 전부 필수**: 컴포넌트는 `useTaskboxTheme()` 이 돌려준 `TaskboxTheme`(전 필드 확정)만 읽는다.
11
+ */
12
+ /** 의미 색 토큰이다(전역 팔레트 — 컴포넌트 기본값이 여기서 파생된다). */
13
+ export interface TaskboxThemeColors {
14
+ accent: string;
15
+ accentContrast: string;
16
+ accentSoft: string;
17
+ danger: string;
18
+ dangerSoft: string;
19
+ success: string;
20
+ warning: string;
21
+ textPrimary: string;
22
+ textSecondary: string;
23
+ textMuted: string;
24
+ textInverse: string;
25
+ surface: string;
26
+ surfaceSubtle: string;
27
+ surfaceHover: string;
28
+ border: string;
29
+ borderStrong: string;
30
+ }
31
+ /** 건수 배지 스타일이다(목록 그룹 헤더·보드 컬럼 헤더 공용 — 알약 배지). */
32
+ export interface TaskboxBadgeStyle {
33
+ bg: string;
34
+ color: string;
35
+ border: string;
36
+ fontSize: number;
37
+ fontWeight: number;
38
+ minWidth: number;
39
+ borderRadius: number;
40
+ paddingX: number;
41
+ }
42
+ /** 목록표 그룹 헤더 행 스타일이다. */
43
+ export interface TaskboxGroupHeaderStyle {
44
+ bg: string;
45
+ hoverBg: string;
46
+ borderColor: string;
47
+ labelColor: string;
48
+ labelFontSize: number;
49
+ labelFontWeight: number;
50
+ minHeight: number;
51
+ badge: TaskboxBadgeStyle;
52
+ }
53
+ /** 목록표(표) 스타일이다. */
54
+ export interface TaskboxTableStyle {
55
+ headerColor: string;
56
+ headerActiveColor: string;
57
+ headerFilteredColor: string;
58
+ headerFontSize: number;
59
+ rowHoverBg: string;
60
+ rowBorderColor: string;
61
+ groupHeader: TaskboxGroupHeaderStyle;
62
+ }
63
+ /** 보드(프로젝트·상태·목표) 스타일이다. */
64
+ export interface TaskboxBoardStyle {
65
+ columnBg: string;
66
+ columnHeaderColor: string;
67
+ columnHeaderFontSize: number;
68
+ badge: TaskboxBadgeStyle;
69
+ }
70
+ /** 요약 카드(진행 게이지 + 남은/지연/공수) 스타일이다. */
71
+ export interface TaskboxSummaryStyle {
72
+ gaugeTrackColor: string;
73
+ gaugeBarColor: string;
74
+ gaugeCompleteColor: string;
75
+ gaugeHeight: number;
76
+ numberColor: string;
77
+ overdueColor: string;
78
+ textColor: string;
79
+ }
80
+ /** 상태·중요도 칩 스타일이다(사전 색은 statusOptions 가 갖고, 여기는 공통 형태만). */
81
+ export interface TaskboxChipStyle {
82
+ borderRadius: number;
83
+ fontSize: number;
84
+ fontWeight: number;
85
+ plainColor: string;
86
+ plainDotColor: string;
87
+ }
88
+ /** 업무함 테마다(해석 완료 — 전 필드 확정). 컴포넌트는 이 타입만 읽는다. */
89
+ export interface TaskboxTheme {
90
+ colors: TaskboxThemeColors;
91
+ table: TaskboxTableStyle;
92
+ board: TaskboxBoardStyle;
93
+ summary: TaskboxSummaryStyle;
94
+ chip: TaskboxChipStyle;
95
+ }
96
+ /** 소비처가 넘기는 테마다 — 바꾸고 싶은 값만 부분 지정한다(깊은 병합). */
97
+ export interface TaskboxThemeInput {
98
+ colors?: Partial<TaskboxThemeColors>;
99
+ table?: Partial<Omit<TaskboxTableStyle, "groupHeader">> & {
100
+ groupHeader?: Partial<Omit<TaskboxGroupHeaderStyle, "badge">> & {
101
+ badge?: Partial<TaskboxBadgeStyle>;
102
+ };
103
+ };
104
+ board?: Partial<Omit<TaskboxBoardStyle, "badge">> & {
105
+ badge?: Partial<TaskboxBadgeStyle>;
106
+ };
107
+ summary?: Partial<TaskboxSummaryStyle>;
108
+ chip?: Partial<TaskboxChipStyle>;
109
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/taskbox",
3
- "version": "0.1.6",
3
+ "version": "0.2.1",
4
4
  "description": "A React/MUI task inbox component with notices, per-user assignments, read tracking, and mobile card UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",