asharyu-design-token 1.0.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.
- package/README.md +72 -0
- package/dist/index.css +171 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +268 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Asharyu-design-token
|
|
2
|
+
|
|
3
|
+
> 디자인 토큰
|
|
4
|
+
|
|
5
|
+
## Concept
|
|
6
|
+
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
철학적인 요소를 결합해서 CSS 디자인 시스템을 HTML 처럼 시맨틱하게 할 수 없을까? 라는 발상으로 컨셉을 잡고 시작한 프로젝트입니다. 음양오행설을 베이스로 삼고 어레인지해서 컨셉을 잡습니다.
|
|
10
|
+
오행 정색과 간색의 기본색을 정의하고 기본 베이스로 삼았습니다. 음양을 상징하는 흑백(동,서)의 경우 1단계씩 나머지 3정색은 2단계 또 간색은 1단계씩 색상의 단계를 정의하여서 0,1,2,3,4(0의 경우 무시) 5단계로 색상을 정의하였습니다.
|
|
11
|
+
오행 정색과 간색의 경우 색상에 대한 정의가 제각각인 점이 있어서 편의적으로 규정한 부분이 있습니다. 실제 철학적인 색상과 100% 일치하지 않습니다.
|
|
12
|
+
음양을 기반으로한 심플한 스타일의 디자인 테마와 오행을 기반으로 각 5원소와 그 5원소간의 상극 과정에서 도출되는 간색의 위계와 조화를 통해서 이론적으로 색의 조합과 그 색을 통한 문서의 철학적인(직관) 표현을 유도하는 것이 기본 컨셉입니다.
|
|
13
|
+
|
|
14
|
+
심플한 스타일의 음양 테마와 화려하면서도 정갈한 오행의 시맨틱한 디자인을 표현하는 것을 디자인 시스템의 컨셉으로 삼았습니다.
|
|
15
|
+
해당 프로젝트는 디자인 감각에 의존하지 않아도 되는 시맨틱 CSS를 추구합니다.
|
|
16
|
+
|
|
17
|
+
## Token Structure
|
|
18
|
+
|
|
19
|
+
core 토큰 구성요소 `label`, `scale`, `type`, `category`는 4가지.
|
|
20
|
+
|
|
21
|
+
`$red-1`: `label-scale`;
|
|
22
|
+
`$color-red-1`: `type-label-scale`;
|
|
23
|
+
`$light-color-red-1`:`category-type-label-scale`;
|
|
24
|
+
|
|
25
|
+
기본이 되는 value schema와 sementic layer가 존재한다.
|
|
26
|
+
토큰은 css와 js(타입스크립트 지원) 두가지 구조로 구성 되어있다.
|
|
27
|
+
css의 경우 [CSS var](https://developer.mozilla.org/ko/docs/Web/CSS/var)로 제공된다.
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
:root {
|
|
31
|
+
--color-yinyang-yin: #000000;
|
|
32
|
+
--color-yinyang-yin-1: #111111;
|
|
33
|
+
--color-yinyang-yin-2: #222222;
|
|
34
|
+
--color-yinyang-yin-3: #333333;
|
|
35
|
+
--color-yinyang-yin-4: #444444;
|
|
36
|
+
--color-yinyang-yang: #ffffff;
|
|
37
|
+
--color-yinyang-yang-1: #eeeeee;
|
|
38
|
+
--color-yinyang-yang-2: #dddddd;
|
|
39
|
+
--color-yinyang-yang-3: #cccccc;
|
|
40
|
+
--color-yinyang-yang-4: #bbbbbb;
|
|
41
|
+
--color-fiveelements-wood: #0000ff;
|
|
42
|
+
--color-fiveelements-wood-1: #0000dd;
|
|
43
|
+
--color-fiveelements-wood-2: #0000bb;
|
|
44
|
+
--color-fiveelements-wood-3: #000099;
|
|
45
|
+
--color-fiveelements-wood-4: #000077;
|
|
46
|
+
--color-fiveelements-fire: #ff0000;
|
|
47
|
+
--color-fiveelements-fire-1: #dd0000;
|
|
48
|
+
--color-fiveelements-fire-2: #bb0000;
|
|
49
|
+
--color-fiveelements-fire-3: #990000;
|
|
50
|
+
--color-fiveelements-fire-4: #770000;
|
|
51
|
+
--color-fiveelements-earth: #ffff00;
|
|
52
|
+
--color-fiveelements-earth-1: #dddd00;
|
|
53
|
+
--color-fiveelements-earth-2: #bbbb00;
|
|
54
|
+
--color-fiveelements-earth-3: #999900;
|
|
55
|
+
--color-fiveelements-earth-4: #777700;
|
|
56
|
+
--color-fiveelements-metal: #ffffff;
|
|
57
|
+
--color-fiveelements-metal-1: #eeeeee;
|
|
58
|
+
--color-fiveelements-metal-2: #dddddd;
|
|
59
|
+
--color-fiveelements-metal-3: #cccccc;
|
|
60
|
+
--color-fiveelements-metal-4: #bbbbbb;
|
|
61
|
+
--color-fiveelements-water: #000000;
|
|
62
|
+
--color-fiveelements-water-1: #111111;
|
|
63
|
+
--color-fiveelements-water-2: #222222;
|
|
64
|
+
--color-fiveelements-water-3: #333333;
|
|
65
|
+
--color-fiveelements-water-4: #444444;
|
|
66
|
+
......;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
This project is licensed under the [Apache 2.0 License](/LICENSE).
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
--color-yinyang-yin: #000000;
|
|
5
|
+
--color-yinyang-yin-1: #111111;
|
|
6
|
+
--color-yinyang-yin-2: #222222;
|
|
7
|
+
--color-yinyang-yin-3: #333333;
|
|
8
|
+
--color-yinyang-yin-4: #444444;
|
|
9
|
+
--color-yinyang-yang: #ffffff;
|
|
10
|
+
--color-yinyang-yang-1: #eeeeee;
|
|
11
|
+
--color-yinyang-yang-2: #dddddd;
|
|
12
|
+
--color-yinyang-yang-3: #cccccc;
|
|
13
|
+
--color-yinyang-yang-4: #bbbbbb;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
--color-fiveelements-wood: #0000ff;
|
|
17
|
+
--color-fiveelements-wood-1: #0000dd;
|
|
18
|
+
--color-fiveelements-wood-2: #0000bb;
|
|
19
|
+
--color-fiveelements-wood-3: #000099;
|
|
20
|
+
--color-fiveelements-wood-4: #000077;
|
|
21
|
+
--color-fiveelements-fire: #ff0000;
|
|
22
|
+
--color-fiveelements-fire-1: #dd0000;
|
|
23
|
+
--color-fiveelements-fire-2: #bb0000;
|
|
24
|
+
--color-fiveelements-fire-3: #990000;
|
|
25
|
+
--color-fiveelements-fire-4: #770000;
|
|
26
|
+
--color-fiveelements-earth: #ffff00;
|
|
27
|
+
--color-fiveelements-earth-1: #dddd00;
|
|
28
|
+
--color-fiveelements-earth-2: #bbbb00;
|
|
29
|
+
--color-fiveelements-earth-3: #999900;
|
|
30
|
+
--color-fiveelements-earth-4: #777700;
|
|
31
|
+
--color-fiveelements-metal: #ffffff;
|
|
32
|
+
--color-fiveelements-metal-1: #eeeeee;
|
|
33
|
+
--color-fiveelements-metal-2: #dddddd;
|
|
34
|
+
--color-fiveelements-metal-3: #cccccc;
|
|
35
|
+
--color-fiveelements-metal-4: #bbbbbb;
|
|
36
|
+
--color-fiveelements-water: #000000;
|
|
37
|
+
--color-fiveelements-water-1: #111111;
|
|
38
|
+
--color-fiveelements-water-2: #222222;
|
|
39
|
+
--color-fiveelements-water-3: #333333;
|
|
40
|
+
--color-fiveelements-water-4: #444444;
|
|
41
|
+
--color-fiveelements-firemetal: #ff4500;
|
|
42
|
+
--color-fiveelements-firemetal-1: #ee4500;
|
|
43
|
+
--color-fiveelements-firemetal-2: #dd4500;
|
|
44
|
+
--color-fiveelements-firemetal-3: #cc4500;
|
|
45
|
+
--color-fiveelements-firemetal-4: #bb4500;
|
|
46
|
+
--color-fiveelements-metalwood: #00ffff;
|
|
47
|
+
--color-fiveelements-metalwood-1: #00eeff;
|
|
48
|
+
--color-fiveelements-metalwood-2: #00ddff;
|
|
49
|
+
--color-fiveelements-metalwood-3: #00ccff;
|
|
50
|
+
--color-fiveelements-metalwood-4: #00bbff;
|
|
51
|
+
--color-fiveelements-woodearth: #00ff00;
|
|
52
|
+
--color-fiveelements-woodearth-1: #00ee00;
|
|
53
|
+
--color-fiveelements-woodearth-2: #00dd00;
|
|
54
|
+
--color-fiveelements-woodearth-3: #00cc00;
|
|
55
|
+
--color-fiveelements-woodearth-4: #00bb00;
|
|
56
|
+
--color-fiveelements-earthwater: #ffa500;
|
|
57
|
+
--color-fiveelements-earthwater-1: #eea500;
|
|
58
|
+
--color-fiveelements-earthwater-2: #dda500;
|
|
59
|
+
--color-fiveelements-earthwater-3: #cca500;
|
|
60
|
+
--color-fiveelements-earthwater-4: #bba500;
|
|
61
|
+
--color-fiveelements-waterfire: #800080;
|
|
62
|
+
--color-fiveelements-waterfire-1: #800070;
|
|
63
|
+
--color-fiveelements-waterfire-2: #800060;
|
|
64
|
+
--color-fiveelements-waterfire-3: #800050;
|
|
65
|
+
--color-fiveelements-waterfire-4: #800040;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
--color-colorschema-white0: #ffffff;
|
|
69
|
+
--color-colorschema-white1: #eeeeee;
|
|
70
|
+
--color-colorschema-white2: #dddddd;
|
|
71
|
+
--color-colorschema-white3: #cccccc;
|
|
72
|
+
--color-colorschema-white4: #bbbbbb;
|
|
73
|
+
--color-colorschema-black0: #000000;
|
|
74
|
+
--color-colorschema-black1: #111111;
|
|
75
|
+
--color-colorschema-black2: #222222;
|
|
76
|
+
--color-colorschema-black3: #333333;
|
|
77
|
+
--color-colorschema-black4: #444444;
|
|
78
|
+
--color-colorschema-red0: #ff0000;
|
|
79
|
+
--color-colorschema-red1: #dd0000;
|
|
80
|
+
--color-colorschema-red2: #bb0000;
|
|
81
|
+
--color-colorschema-red3: #990000;
|
|
82
|
+
--color-colorschema-red4: #770000;
|
|
83
|
+
--color-colorschema-blue0: #0000ff;
|
|
84
|
+
--color-colorschema-blue1: #0000dd;
|
|
85
|
+
--color-colorschema-blue2: #0000bb;
|
|
86
|
+
--color-colorschema-blue3: #000099;
|
|
87
|
+
--color-colorschema-blue4: #000077;
|
|
88
|
+
--color-colorschema-yellow0: #ffff00;
|
|
89
|
+
--color-colorschema-yellow1: #dddd00;
|
|
90
|
+
--color-colorschema-yellow2: #bbbb00;
|
|
91
|
+
--color-colorschema-yellow3: #999900;
|
|
92
|
+
--color-colorschema-yellow4: #777700;
|
|
93
|
+
--color-colorschema-orangered0: #ff4500;
|
|
94
|
+
--color-colorschema-orangered1: #ee4500;
|
|
95
|
+
--color-colorschema-orangered2: #dd4500;
|
|
96
|
+
--color-colorschema-orangered3: #cc4500;
|
|
97
|
+
--color-colorschema-orangered4: #bb4500;
|
|
98
|
+
--color-colorschema-purple0: #800080;
|
|
99
|
+
--color-colorschema-purple1: #800070;
|
|
100
|
+
--color-colorschema-purple2: #800060;
|
|
101
|
+
--color-colorschema-purple3: #800050;
|
|
102
|
+
--color-colorschema-purple4: #800040;
|
|
103
|
+
--color-colorschema-aqua0: #00ffff;
|
|
104
|
+
--color-colorschema-aqua1: #00eeff;
|
|
105
|
+
--color-colorschema-aqua2: #00ddff;
|
|
106
|
+
--color-colorschema-aqua3: #00ccff;
|
|
107
|
+
--color-colorschema-aqua4: #00bbff;
|
|
108
|
+
--color-colorschema-orange0: #ffa500;
|
|
109
|
+
--color-colorschema-orange1: #eea500;
|
|
110
|
+
--color-colorschema-orange2: #dda500;
|
|
111
|
+
--color-colorschema-orange3: #cca500;
|
|
112
|
+
--color-colorschema-orange4: #bba500;
|
|
113
|
+
--color-colorschema-green0: #00ff00;
|
|
114
|
+
--color-colorschema-green1: #00ee00;
|
|
115
|
+
--color-colorschema-green2: #00dd00;
|
|
116
|
+
--color-colorschema-green3: #00cc00;
|
|
117
|
+
--color-colorschema-green4: #00bb00;
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
--font-fontsize-h1: 4.25rem;
|
|
122
|
+
--font-fontsize-h2: 3rem;
|
|
123
|
+
--font-fontsize-h3: 2.125rem;
|
|
124
|
+
--font-fontsize-h4: 1.75rem;
|
|
125
|
+
--font-fontsize-h5: 1.375rem;
|
|
126
|
+
--font-fontsize-h6: 1.125rem;
|
|
127
|
+
--font-fontsize-subtitle-1: 1rem;
|
|
128
|
+
--font-fontsize-subtitle-2: 0.875rem;
|
|
129
|
+
--font-fontsize-subtitle-3: 0.75rem;
|
|
130
|
+
--font-fontsize-body-1: 1rem;
|
|
131
|
+
--font-fontsize-body-2: 0.875rem;
|
|
132
|
+
--font-fontsize-body-3: 0.75rem;
|
|
133
|
+
--font-fontsize-button: 0.75rem;
|
|
134
|
+
--font-fontsize-caption: 0.625rem;
|
|
135
|
+
--font-fontsize-overline: 0.5rem;
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
--font-fontsizeschema-8: 0.5rem;
|
|
139
|
+
--font-fontsizeschema-10: 0.625rem;
|
|
140
|
+
--font-fontsizeschema-12: 0.75rem;
|
|
141
|
+
--font-fontsizeschema-14: 0.875rem;
|
|
142
|
+
--font-fontsizeschema-16: 1rem;
|
|
143
|
+
--font-fontsizeschema-18: 1.125rem;
|
|
144
|
+
--font-fontsizeschema-20: 1.25rem;
|
|
145
|
+
--font-fontsizeschema-22: 1.375rem;
|
|
146
|
+
--font-fontsizeschema-24: 1.5rem;
|
|
147
|
+
--font-fontsizeschema-26: 1.625rem;
|
|
148
|
+
--font-fontsizeschema-28: 1.75rem;
|
|
149
|
+
--font-fontsizeschema-30: 1.875rem;
|
|
150
|
+
--font-fontsizeschema-32: 2rem;
|
|
151
|
+
--font-fontsizeschema-34: 2.125rem;
|
|
152
|
+
--font-fontsizeschema-36: 2.25rem;
|
|
153
|
+
--font-fontsizeschema-38: 2.375rem;
|
|
154
|
+
--font-fontsizeschema-40: 2.5rem;
|
|
155
|
+
--font-fontsizeschema-42: 2.625rem;
|
|
156
|
+
--font-fontsizeschema-44: 2.75rem;
|
|
157
|
+
--font-fontsizeschema-46: 2.875rem;
|
|
158
|
+
--font-fontsizeschema-48: 3rem;
|
|
159
|
+
--font-fontsizeschema-50: 3.125rem;
|
|
160
|
+
--font-fontsizeschema-52: 3.25rem;
|
|
161
|
+
--font-fontsizeschema-54: 3.375rem;
|
|
162
|
+
--font-fontsizeschema-56: 3.5rem;
|
|
163
|
+
--font-fontsizeschema-58: 3.625rem;
|
|
164
|
+
--font-fontsizeschema-60: 3.75rem;
|
|
165
|
+
--font-fontsizeschema-62: 3.875rem;
|
|
166
|
+
--font-fontsizeschema-64: 4rem;
|
|
167
|
+
--font-fontsizeschema-66: 4.125rem;
|
|
168
|
+
--font-fontsizeschema-68: 4.25rem;
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
declare module "color/value" {
|
|
2
|
+
export interface ColorValueProps {
|
|
3
|
+
$white: ValueProps;
|
|
4
|
+
$black: ValueProps;
|
|
5
|
+
$red: ValueProps;
|
|
6
|
+
$blue: ValueProps;
|
|
7
|
+
$yellow: ValueProps;
|
|
8
|
+
$orangered: ValueProps;
|
|
9
|
+
$purple: ValueProps;
|
|
10
|
+
$aqua: ValueProps;
|
|
11
|
+
$orange: ValueProps;
|
|
12
|
+
$green: ValueProps;
|
|
13
|
+
}
|
|
14
|
+
export interface ValueProps {
|
|
15
|
+
0: string;
|
|
16
|
+
1: string;
|
|
17
|
+
2: string;
|
|
18
|
+
3: string;
|
|
19
|
+
4: string;
|
|
20
|
+
}
|
|
21
|
+
const colorValue: Readonly<ColorValueProps>;
|
|
22
|
+
export default colorValue;
|
|
23
|
+
}
|
|
24
|
+
declare module "color/semanticValue" {
|
|
25
|
+
import { ValueProps } from "color/value";
|
|
26
|
+
export interface SemanticValueProps {
|
|
27
|
+
$yin: ValueProps;
|
|
28
|
+
$yang: ValueProps;
|
|
29
|
+
$wood: ValueProps;
|
|
30
|
+
$fire: ValueProps;
|
|
31
|
+
$earth: ValueProps;
|
|
32
|
+
$metal: ValueProps;
|
|
33
|
+
$water: ValueProps;
|
|
34
|
+
$firebwmetal: ValueProps;
|
|
35
|
+
$metalbwwood: ValueProps;
|
|
36
|
+
$woodbwearth: ValueProps;
|
|
37
|
+
$earthbwwater: ValueProps;
|
|
38
|
+
$waterbwfire: ValueProps;
|
|
39
|
+
}
|
|
40
|
+
const semanticValue: Readonly<SemanticValueProps>;
|
|
41
|
+
export default semanticValue;
|
|
42
|
+
}
|
|
43
|
+
declare module "color/index" {
|
|
44
|
+
type MakeTokenSet<Value extends string, Scale extends number[]> = `$${Value}${Scale[number]}`;
|
|
45
|
+
type ColorSchemaSet<T extends string> = `$${T}` | MakeTokenSet<T, [1, 2, 3, 4]>;
|
|
46
|
+
export interface YinYangProps {
|
|
47
|
+
schema: Record<ColorSchemaSet<'yin'> | ColorSchemaSet<'yang'>, string>;
|
|
48
|
+
}
|
|
49
|
+
export const yinYang: Readonly<YinYangProps>;
|
|
50
|
+
export interface FiveElementsProps {
|
|
51
|
+
schema: Record<ColorSchemaSet<'wood'> | ColorSchemaSet<'fire'> | ColorSchemaSet<'earth'> | ColorSchemaSet<'metal'> | ColorSchemaSet<'water'> | ColorSchemaSet<'firemetal'> | ColorSchemaSet<'metalwood'> | ColorSchemaSet<'woodearth'> | ColorSchemaSet<'earthwater'> | ColorSchemaSet<'waterfire'>, string>;
|
|
52
|
+
}
|
|
53
|
+
export const fiveElements: Readonly<FiveElementsProps>;
|
|
54
|
+
export const colorSchema: Readonly<import("color/value").ColorValueProps>;
|
|
55
|
+
}
|
|
56
|
+
declare module "font/value" {
|
|
57
|
+
/**
|
|
58
|
+
* @description 16px 기준으로 자주 쓰이는 px을 모두 rem 단위로 계산한 사이즈. 반응형 대응시 용이함
|
|
59
|
+
* @todo calc
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
type MakeSizeSet<T extends number[]> = `$${T[number]}`;
|
|
63
|
+
export interface FontSizeValueProps {
|
|
64
|
+
$basic: '16px';
|
|
65
|
+
$1x: '1rem';
|
|
66
|
+
$2x: '2rem';
|
|
67
|
+
$3x: '3rem';
|
|
68
|
+
$rem: Record<MakeSizeSet<[
|
|
69
|
+
8,
|
|
70
|
+
10,
|
|
71
|
+
12,
|
|
72
|
+
14,
|
|
73
|
+
16,
|
|
74
|
+
18,
|
|
75
|
+
20,
|
|
76
|
+
22,
|
|
77
|
+
24,
|
|
78
|
+
26,
|
|
79
|
+
28,
|
|
80
|
+
30,
|
|
81
|
+
32,
|
|
82
|
+
34,
|
|
83
|
+
36,
|
|
84
|
+
38,
|
|
85
|
+
40,
|
|
86
|
+
42,
|
|
87
|
+
44,
|
|
88
|
+
46,
|
|
89
|
+
48,
|
|
90
|
+
50,
|
|
91
|
+
52,
|
|
92
|
+
54,
|
|
93
|
+
56,
|
|
94
|
+
58,
|
|
95
|
+
60,
|
|
96
|
+
62,
|
|
97
|
+
64,
|
|
98
|
+
66,
|
|
99
|
+
68
|
|
100
|
+
]>, string>;
|
|
101
|
+
}
|
|
102
|
+
export const fontSizeValue: Readonly<FontSizeValueProps>;
|
|
103
|
+
}
|
|
104
|
+
declare module "font/index" {
|
|
105
|
+
/**
|
|
106
|
+
* @todo 폰트 사이즈 & 폰트 패밀리등 정의
|
|
107
|
+
*/
|
|
108
|
+
export const fontSizeSchema: Record<"$8" | "$10" | "$12" | "$14" | "$16" | "$18" | "$20" | "$22" | "$24" | "$26" | "$28" | "$30" | "$32" | "$34" | "$36" | "$38" | "$40" | "$42" | "$44" | "$46" | "$48" | "$50" | "$52" | "$54" | "$56" | "$58" | "$60" | "$62" | "$64" | "$66" | "$68", string>;
|
|
109
|
+
export interface FontSizeProps {
|
|
110
|
+
schema: Record<'$h1' | '$h2' | '$h3' | '$h4' | '$h5' | '$h6' | '$subtitle$1' | '$subtitle$2' | '$subTitle$3' | '$body$1' | '$body$2' | '$body$3' | '$button' | '$caption' | '$overline', string>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @todo 해드 태그들 사이즈 조정이 필요함. 디자인 샘플을 보면서 조정해야할듯
|
|
114
|
+
*/
|
|
115
|
+
export const fontSize: Readonly<FontSizeProps>;
|
|
116
|
+
}
|
|
117
|
+
declare module "index" {
|
|
118
|
+
import { yinYang, fiveElements, colorSchema } from "color/index";
|
|
119
|
+
import { fontSizeSchema, fontSize } from "font/index";
|
|
120
|
+
export { yinYang, fiveElements, colorSchema };
|
|
121
|
+
export { fontSize, fontSizeSchema };
|
|
122
|
+
const _default: {
|
|
123
|
+
color: Readonly<{
|
|
124
|
+
yinYang: Readonly<import("color").YinYangProps>;
|
|
125
|
+
fiveElements: Readonly<import("color").FiveElementsProps>;
|
|
126
|
+
colorSchema: Readonly<import("color/value").ColorValueProps>;
|
|
127
|
+
}>;
|
|
128
|
+
font: Readonly<{
|
|
129
|
+
fontSize: Readonly<import("font").FontSizeProps>;
|
|
130
|
+
fontSizeSchema: Record<"$8" | "$10" | "$12" | "$14" | "$16" | "$18" | "$20" | "$22" | "$24" | "$26" | "$28" | "$30" | "$32" | "$34" | "$36" | "$38" | "$40" | "$42" | "$44" | "$46" | "$48" | "$50" | "$52" | "$54" | "$56" | "$58" | "$60" | "$62" | "$64" | "$66" | "$68", string>;
|
|
131
|
+
}>;
|
|
132
|
+
};
|
|
133
|
+
export default _default;
|
|
134
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// src/color/value.ts
|
|
2
|
+
var colorValue = Object.freeze({
|
|
3
|
+
$white: {
|
|
4
|
+
0: "#FFFFFF",
|
|
5
|
+
1: "#EEEEEE",
|
|
6
|
+
2: "#DDDDDD",
|
|
7
|
+
3: "#CCCCCC",
|
|
8
|
+
4: "#BBBBBB"
|
|
9
|
+
},
|
|
10
|
+
$black: {
|
|
11
|
+
0: "#000000",
|
|
12
|
+
1: "#111111",
|
|
13
|
+
2: "#222222",
|
|
14
|
+
3: "#333333",
|
|
15
|
+
4: "#444444"
|
|
16
|
+
},
|
|
17
|
+
$red: {
|
|
18
|
+
0: "#FF0000",
|
|
19
|
+
1: "#DD0000",
|
|
20
|
+
2: "#BB0000",
|
|
21
|
+
3: "#990000",
|
|
22
|
+
4: "#770000"
|
|
23
|
+
},
|
|
24
|
+
$blue: {
|
|
25
|
+
0: "#0000FF",
|
|
26
|
+
1: "#0000DD",
|
|
27
|
+
2: "#0000BB",
|
|
28
|
+
3: "#000099",
|
|
29
|
+
4: "#000077"
|
|
30
|
+
},
|
|
31
|
+
$yellow: {
|
|
32
|
+
0: "#FFFF00",
|
|
33
|
+
1: "#DDDD00",
|
|
34
|
+
2: "#BBBB00",
|
|
35
|
+
3: "#999900",
|
|
36
|
+
4: "#777700"
|
|
37
|
+
},
|
|
38
|
+
$orangered: {
|
|
39
|
+
0: "#FF4500",
|
|
40
|
+
1: "#EE4500",
|
|
41
|
+
2: "#DD4500",
|
|
42
|
+
3: "#CC4500",
|
|
43
|
+
4: "#BB4500"
|
|
44
|
+
},
|
|
45
|
+
$purple: {
|
|
46
|
+
0: "#800080",
|
|
47
|
+
1: "#800070",
|
|
48
|
+
2: "#800060",
|
|
49
|
+
3: "#800050",
|
|
50
|
+
4: "#800040"
|
|
51
|
+
},
|
|
52
|
+
$aqua: {
|
|
53
|
+
0: "#00FFFF",
|
|
54
|
+
1: "#00EEFF",
|
|
55
|
+
2: "#00DDFF",
|
|
56
|
+
3: "#00CCFF",
|
|
57
|
+
4: "#00BBFF"
|
|
58
|
+
},
|
|
59
|
+
$orange: {
|
|
60
|
+
0: "#FFA500",
|
|
61
|
+
1: "#EEA500",
|
|
62
|
+
2: "#DDA500",
|
|
63
|
+
3: "#CCA500",
|
|
64
|
+
4: "#BBA500"
|
|
65
|
+
},
|
|
66
|
+
$green: {
|
|
67
|
+
0: "#00FF00",
|
|
68
|
+
1: "#00EE00",
|
|
69
|
+
2: "#00DD00",
|
|
70
|
+
3: "#00CC00",
|
|
71
|
+
4: "#00BB00"
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var value_default = colorValue;
|
|
75
|
+
|
|
76
|
+
// src/color/semanticValue.ts
|
|
77
|
+
var semanticValue = Object.freeze({
|
|
78
|
+
$yin: {
|
|
79
|
+
0: value_default.$black[0],
|
|
80
|
+
1: value_default.$black[1],
|
|
81
|
+
2: value_default.$black[2],
|
|
82
|
+
3: value_default.$black[3],
|
|
83
|
+
4: value_default.$black[4]
|
|
84
|
+
},
|
|
85
|
+
$yang: {
|
|
86
|
+
0: value_default.$white[0],
|
|
87
|
+
1: value_default.$white[1],
|
|
88
|
+
2: value_default.$white[2],
|
|
89
|
+
3: value_default.$white[3],
|
|
90
|
+
4: value_default.$white[4]
|
|
91
|
+
},
|
|
92
|
+
$wood: {
|
|
93
|
+
0: value_default.$blue[0],
|
|
94
|
+
1: value_default.$blue[1],
|
|
95
|
+
2: value_default.$blue[2],
|
|
96
|
+
3: value_default.$blue[3],
|
|
97
|
+
4: value_default.$blue[4]
|
|
98
|
+
},
|
|
99
|
+
$fire: {
|
|
100
|
+
0: value_default.$red[0],
|
|
101
|
+
1: value_default.$red[1],
|
|
102
|
+
2: value_default.$red[2],
|
|
103
|
+
3: value_default.$red[3],
|
|
104
|
+
4: value_default.$red[4]
|
|
105
|
+
},
|
|
106
|
+
$earth: {
|
|
107
|
+
0: value_default.$yellow[0],
|
|
108
|
+
1: value_default.$yellow[1],
|
|
109
|
+
2: value_default.$yellow[2],
|
|
110
|
+
3: value_default.$yellow[3],
|
|
111
|
+
4: value_default.$yellow[4]
|
|
112
|
+
},
|
|
113
|
+
$metal: {
|
|
114
|
+
0: value_default.$white[0],
|
|
115
|
+
1: value_default.$white[1],
|
|
116
|
+
2: value_default.$white[2],
|
|
117
|
+
3: value_default.$white[3],
|
|
118
|
+
4: value_default.$white[4]
|
|
119
|
+
},
|
|
120
|
+
$water: {
|
|
121
|
+
0: value_default.$black[0],
|
|
122
|
+
1: value_default.$black[1],
|
|
123
|
+
2: value_default.$black[2],
|
|
124
|
+
3: value_default.$black[3],
|
|
125
|
+
4: value_default.$black[4]
|
|
126
|
+
},
|
|
127
|
+
$firebwmetal: {
|
|
128
|
+
0: value_default.$orangered[0],
|
|
129
|
+
1: value_default.$orangered[1],
|
|
130
|
+
2: value_default.$orangered[2],
|
|
131
|
+
3: value_default.$orangered[3],
|
|
132
|
+
4: value_default.$orangered[4]
|
|
133
|
+
},
|
|
134
|
+
$metalbwwood: {
|
|
135
|
+
0: value_default.$aqua[0],
|
|
136
|
+
1: value_default.$aqua[1],
|
|
137
|
+
2: value_default.$aqua[2],
|
|
138
|
+
3: value_default.$aqua[3],
|
|
139
|
+
4: value_default.$aqua[4]
|
|
140
|
+
},
|
|
141
|
+
$woodbwearth: {
|
|
142
|
+
0: value_default.$green[0],
|
|
143
|
+
1: value_default.$green[1],
|
|
144
|
+
2: value_default.$green[2],
|
|
145
|
+
3: value_default.$green[3],
|
|
146
|
+
4: value_default.$green[4]
|
|
147
|
+
},
|
|
148
|
+
$earthbwwater: {
|
|
149
|
+
0: value_default.$orange[0],
|
|
150
|
+
1: value_default.$orange[1],
|
|
151
|
+
2: value_default.$orange[2],
|
|
152
|
+
3: value_default.$orange[3],
|
|
153
|
+
4: value_default.$orange[4]
|
|
154
|
+
},
|
|
155
|
+
$waterbwfire: {
|
|
156
|
+
0: value_default.$purple[0],
|
|
157
|
+
1: value_default.$purple[1],
|
|
158
|
+
2: value_default.$purple[2],
|
|
159
|
+
3: value_default.$purple[3],
|
|
160
|
+
4: value_default.$purple[4]
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
var semanticValue_default = semanticValue;
|
|
164
|
+
|
|
165
|
+
// src/color/index.ts
|
|
166
|
+
var yinYang = Object.freeze({
|
|
167
|
+
schema: {
|
|
168
|
+
...getSchema("yin", semanticValue_default.$yin),
|
|
169
|
+
...getSchema("yang", semanticValue_default.$yang)
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
var fiveElements = Object.freeze({
|
|
173
|
+
schema: {
|
|
174
|
+
...getSchema("wood", semanticValue_default.$wood),
|
|
175
|
+
...getSchema("fire", semanticValue_default.$fire),
|
|
176
|
+
...getSchema("earth", semanticValue_default.$earth),
|
|
177
|
+
...getSchema("metal", semanticValue_default.$metal),
|
|
178
|
+
...getSchema("water", semanticValue_default.$water),
|
|
179
|
+
...getSchema("firemetal", semanticValue_default.$firebwmetal),
|
|
180
|
+
...getSchema("metalwood", semanticValue_default.$metalbwwood),
|
|
181
|
+
...getSchema("woodearth", semanticValue_default.$woodbwearth),
|
|
182
|
+
...getSchema("earthwater", semanticValue_default.$earthbwwater),
|
|
183
|
+
...getSchema("waterfire", semanticValue_default.$waterbwfire)
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
var colorSchema = value_default;
|
|
187
|
+
function getSchema(key, model) {
|
|
188
|
+
return Object.values(model).reduce((result, current, idx) => {
|
|
189
|
+
idx > 0 ? result[`$${key}$${idx}`] = current : result[`$${key}`] = current;
|
|
190
|
+
return result;
|
|
191
|
+
}, {});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/font/value.ts
|
|
195
|
+
var fontSizeValue = Object.freeze({
|
|
196
|
+
$basic: "16px",
|
|
197
|
+
$1x: "1rem",
|
|
198
|
+
$2x: "2rem",
|
|
199
|
+
$3x: "3rem",
|
|
200
|
+
$rem: {
|
|
201
|
+
$8: "0.5rem",
|
|
202
|
+
$10: "0.625rem",
|
|
203
|
+
$12: "0.75rem",
|
|
204
|
+
$14: "0.875rem",
|
|
205
|
+
$16: "1rem",
|
|
206
|
+
$18: "1.125rem",
|
|
207
|
+
$20: "1.25rem",
|
|
208
|
+
$22: "1.375rem",
|
|
209
|
+
$24: "1.5rem",
|
|
210
|
+
$26: "1.625rem",
|
|
211
|
+
$28: "1.75rem",
|
|
212
|
+
$30: "1.875rem",
|
|
213
|
+
$32: "2rem",
|
|
214
|
+
$34: "2.125rem",
|
|
215
|
+
$36: "2.25rem",
|
|
216
|
+
$38: "2.375rem",
|
|
217
|
+
$40: "2.5rem",
|
|
218
|
+
$42: "2.625rem",
|
|
219
|
+
$44: "2.75rem",
|
|
220
|
+
$46: "2.875rem",
|
|
221
|
+
$48: "3rem",
|
|
222
|
+
$50: "3.125rem",
|
|
223
|
+
$52: "3.25rem",
|
|
224
|
+
$54: "3.375rem",
|
|
225
|
+
$56: "3.5rem",
|
|
226
|
+
$58: "3.625rem",
|
|
227
|
+
$60: "3.75rem",
|
|
228
|
+
$62: "3.875rem",
|
|
229
|
+
$64: "4rem",
|
|
230
|
+
$66: "4.125rem",
|
|
231
|
+
$68: "4.25rem"
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// src/font/index.ts
|
|
236
|
+
var fontSizeSchema = fontSizeValue.$rem;
|
|
237
|
+
var fontSize = Object.freeze({
|
|
238
|
+
schema: {
|
|
239
|
+
$h1: fontSizeValue.$rem.$68,
|
|
240
|
+
$h2: fontSizeValue.$rem.$48,
|
|
241
|
+
$h3: fontSizeValue.$rem.$34,
|
|
242
|
+
$h4: fontSizeValue.$rem.$28,
|
|
243
|
+
$h5: fontSizeValue.$rem.$22,
|
|
244
|
+
$h6: fontSizeValue.$rem.$18,
|
|
245
|
+
$subtitle$1: fontSizeValue.$rem.$16,
|
|
246
|
+
$subtitle$2: fontSizeValue.$rem.$14,
|
|
247
|
+
$subTitle$3: fontSizeValue.$rem.$12,
|
|
248
|
+
$body$1: fontSizeValue.$rem.$16,
|
|
249
|
+
$body$2: fontSizeValue.$rem.$14,
|
|
250
|
+
$body$3: fontSizeValue.$rem.$12,
|
|
251
|
+
$button: fontSizeValue.$rem.$12,
|
|
252
|
+
$caption: fontSizeValue.$rem.$10,
|
|
253
|
+
$overline: fontSizeValue.$rem.$8
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// src/index.ts
|
|
258
|
+
var color = Object.freeze({ yinYang, fiveElements, colorSchema });
|
|
259
|
+
var font = Object.freeze({ fontSize, fontSizeSchema });
|
|
260
|
+
var src_default = { color, font };
|
|
261
|
+
export {
|
|
262
|
+
colorSchema,
|
|
263
|
+
src_default as default,
|
|
264
|
+
fiveElements,
|
|
265
|
+
fontSize,
|
|
266
|
+
fontSizeSchema,
|
|
267
|
+
yinYang
|
|
268
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "asharyu-design-token",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "design token",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"designtoken"
|
|
7
|
+
],
|
|
8
|
+
"author": "Isa <yunjonglyu@gmail.com> (yunjongryu)",
|
|
9
|
+
"homepage": "https://github.com/yoonjonglyu/asharyu-design#readme",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js",
|
|
16
|
+
"./index.css": "./dist/index.css"
|
|
17
|
+
},
|
|
18
|
+
"directories": {
|
|
19
|
+
"dist": "dist"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/yoonjonglyu/asharyu-design.git"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc && esbuild src/index.ts --bundle --format=esm --outdir=dist",
|
|
30
|
+
"postbuild": "node makeCSS.js"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/yoonjonglyu/asharyu-design/issues"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"normalize.css": "^8.0.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"esbuild": "^0.15.3",
|
|
40
|
+
"typescript": "^4.7.4"
|
|
41
|
+
}
|
|
42
|
+
}
|