@tide-tds/foundation 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/dist/cli.js +699 -0
- package/dist/color-css.d.ts +46 -0
- package/dist/color-css.js +105 -0
- package/dist/color-family.d.ts +54 -0
- package/dist/color-family.js +112 -0
- package/dist/color-name.d.ts +40 -0
- package/dist/color-name.js +61 -0
- package/dist/color-slot.d.ts +80 -0
- package/dist/color-slot.js +90 -0
- package/dist/color.d.ts +95 -0
- package/dist/color.js +96 -0
- package/dist/contrast.d.ts +51 -0
- package/dist/contrast.js +129 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/internal.d.ts +15 -0
- package/dist/internal.js +10 -0
- package/dist/motion.d.ts +20 -0
- package/dist/motion.js +17 -0
- package/dist/semantic.d.ts +230 -0
- package/dist/semantic.js +177 -0
- package/dist/shape.d.ts +89 -0
- package/dist/shape.js +93 -0
- package/dist/stacking.d.ts +17 -0
- package/dist/stacking.js +18 -0
- package/dist/tailwind-merge.d.ts +5 -0
- package/dist/tailwind-merge.js +407 -0
- package/dist/tailwind.css +243 -0
- package/dist/tokens.css +551 -0
- package/dist/typography.d.ts +132 -0
- package/dist/typography.js +145 -0
- package/package.json +60 -3
- package/README.md +0 -3
package/dist/color.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export declare const color: {
|
|
2
|
+
readonly white: "#ffffff";
|
|
3
|
+
readonly black: "#000000";
|
|
4
|
+
readonly blue: {
|
|
5
|
+
readonly 50: "#f0f6fe";
|
|
6
|
+
readonly 100: "#ddeafc";
|
|
7
|
+
readonly 200: "#c3dafb";
|
|
8
|
+
readonly 300: "#9bc3fd";
|
|
9
|
+
readonly 400: "#65a1f9";
|
|
10
|
+
readonly 500: "#3183f5";
|
|
11
|
+
readonly 600: "#006ae2";
|
|
12
|
+
readonly 700: "#005ac2";
|
|
13
|
+
readonly 800: "#0049a1";
|
|
14
|
+
readonly 900: "#093f85";
|
|
15
|
+
readonly 950: "#0d2850";
|
|
16
|
+
};
|
|
17
|
+
readonly gray: {
|
|
18
|
+
readonly 50: "#f5f5f6";
|
|
19
|
+
readonly 100: "#e8e8ea";
|
|
20
|
+
readonly 200: "#d7d8da";
|
|
21
|
+
readonly 300: "#bec1c4";
|
|
22
|
+
readonly 400: "#9da1a6";
|
|
23
|
+
readonly 500: "#82878e";
|
|
24
|
+
readonly 600: "#6b7179";
|
|
25
|
+
readonly 700: "#5b6068";
|
|
26
|
+
readonly 800: "#4a4e54";
|
|
27
|
+
readonly 900: "#3f4247";
|
|
28
|
+
readonly 950: "#28292c";
|
|
29
|
+
};
|
|
30
|
+
readonly green: {
|
|
31
|
+
readonly 50: "#f0f7f1";
|
|
32
|
+
readonly 100: "#deeee0";
|
|
33
|
+
readonly 200: "#c4e1c9";
|
|
34
|
+
readonly 300: "#9bd0a5";
|
|
35
|
+
readonly 400: "#60b775";
|
|
36
|
+
readonly 500: "#15a14c";
|
|
37
|
+
readonly 600: "#00873d";
|
|
38
|
+
readonly 700: "#007433";
|
|
39
|
+
readonly 800: "#005f28";
|
|
40
|
+
readonly 900: "#005121";
|
|
41
|
+
readonly 950: "#073315";
|
|
42
|
+
};
|
|
43
|
+
readonly amber: {
|
|
44
|
+
readonly 50: "#faf4ed";
|
|
45
|
+
readonly 100: "#f3e7d7";
|
|
46
|
+
readonly 200: "#ead5b8";
|
|
47
|
+
readonly 300: "#e0ba85";
|
|
48
|
+
readonly 400: "#ce9437";
|
|
49
|
+
readonly 500: "#b47900";
|
|
50
|
+
readonly 600: "#976500";
|
|
51
|
+
readonly 700: "#815600";
|
|
52
|
+
readonly 800: "#6a4600";
|
|
53
|
+
readonly 900: "#5b3b00";
|
|
54
|
+
readonly 950: "#3a2400";
|
|
55
|
+
};
|
|
56
|
+
readonly red: {
|
|
57
|
+
readonly 50: "#fff2f0";
|
|
58
|
+
readonly 100: "#fde1dd";
|
|
59
|
+
readonly 200: "#fccac4";
|
|
60
|
+
readonly 300: "#fca79d";
|
|
61
|
+
readonly 400: "#f47368";
|
|
62
|
+
readonly 500: "#ea3e39";
|
|
63
|
+
readonly 600: "#d30016";
|
|
64
|
+
readonly 700: "#b60011";
|
|
65
|
+
readonly 800: "#96000c";
|
|
66
|
+
readonly 900: "#7d0e10";
|
|
67
|
+
readonly 950: "#4c120f";
|
|
68
|
+
};
|
|
69
|
+
readonly cyan: {
|
|
70
|
+
readonly 50: "#eff7fa";
|
|
71
|
+
readonly 100: "#dcecf2";
|
|
72
|
+
readonly 200: "#c0deea";
|
|
73
|
+
readonly 300: "#93cae0";
|
|
74
|
+
readonly 400: "#51aed0";
|
|
75
|
+
readonly 500: "#0094bc";
|
|
76
|
+
readonly 600: "#007c9e";
|
|
77
|
+
readonly 700: "#006a87";
|
|
78
|
+
readonly 800: "#00576f";
|
|
79
|
+
readonly 900: "#004a5f";
|
|
80
|
+
readonly 950: "#002f3d";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
type ColorTable = typeof color;
|
|
84
|
+
/** 11단계 스케일을 가진 계열 이름. 예: `blue` */
|
|
85
|
+
export type ColorFamily = { [Key in keyof ColorTable]: ColorTable[Key] extends string ? never : Key; }[keyof ColorTable];
|
|
86
|
+
/** 스케일 단계. 50~950의 11단계 */
|
|
87
|
+
export type ColorStep = keyof ColorTable["blue"];
|
|
88
|
+
/** Primitive 이름. 예: `blue-600`, `white` */
|
|
89
|
+
export type PrimitiveColorName = { [Key in keyof ColorTable]: ColorTable[Key] extends string ? Key : never; }[keyof ColorTable] | { [Family in ColorFamily]: `${Family}-${ColorStep}`; }[ColorFamily];
|
|
90
|
+
/**
|
|
91
|
+
* Primitive 이름을 정본 hex로 바꾼다.
|
|
92
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
93
|
+
*/
|
|
94
|
+
export declare function primitiveHex(name: PrimitiveColorName): string;
|
|
95
|
+
export {};
|
package/dist/color.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// src/color.ts
|
|
2
|
+
const color = {
|
|
3
|
+
white: "#ffffff",
|
|
4
|
+
black: "#000000",
|
|
5
|
+
blue: {
|
|
6
|
+
50: "#f0f6fe",
|
|
7
|
+
100: "#ddeafc",
|
|
8
|
+
200: "#c3dafb",
|
|
9
|
+
300: "#9bc3fd",
|
|
10
|
+
400: "#65a1f9",
|
|
11
|
+
500: "#3183f5",
|
|
12
|
+
600: "#006ae2",
|
|
13
|
+
700: "#005ac2",
|
|
14
|
+
800: "#0049a1",
|
|
15
|
+
900: "#093f85",
|
|
16
|
+
950: "#0d2850"
|
|
17
|
+
},
|
|
18
|
+
gray: {
|
|
19
|
+
50: "#f5f5f6",
|
|
20
|
+
100: "#e8e8ea",
|
|
21
|
+
200: "#d7d8da",
|
|
22
|
+
300: "#bec1c4",
|
|
23
|
+
400: "#9da1a6",
|
|
24
|
+
500: "#82878e",
|
|
25
|
+
600: "#6b7179",
|
|
26
|
+
700: "#5b6068",
|
|
27
|
+
800: "#4a4e54",
|
|
28
|
+
900: "#3f4247",
|
|
29
|
+
950: "#28292c"
|
|
30
|
+
},
|
|
31
|
+
green: {
|
|
32
|
+
50: "#f0f7f1",
|
|
33
|
+
100: "#deeee0",
|
|
34
|
+
200: "#c4e1c9",
|
|
35
|
+
300: "#9bd0a5",
|
|
36
|
+
400: "#60b775",
|
|
37
|
+
500: "#15a14c",
|
|
38
|
+
600: "#00873d",
|
|
39
|
+
700: "#007433",
|
|
40
|
+
800: "#005f28",
|
|
41
|
+
900: "#005121",
|
|
42
|
+
950: "#073315"
|
|
43
|
+
},
|
|
44
|
+
amber: {
|
|
45
|
+
50: "#faf4ed",
|
|
46
|
+
100: "#f3e7d7",
|
|
47
|
+
200: "#ead5b8",
|
|
48
|
+
300: "#e0ba85",
|
|
49
|
+
400: "#ce9437",
|
|
50
|
+
500: "#b47900",
|
|
51
|
+
600: "#976500",
|
|
52
|
+
700: "#815600",
|
|
53
|
+
800: "#6a4600",
|
|
54
|
+
900: "#5b3b00",
|
|
55
|
+
950: "#3a2400"
|
|
56
|
+
},
|
|
57
|
+
red: {
|
|
58
|
+
50: "#fff2f0",
|
|
59
|
+
100: "#fde1dd",
|
|
60
|
+
200: "#fccac4",
|
|
61
|
+
300: "#fca79d",
|
|
62
|
+
400: "#f47368",
|
|
63
|
+
500: "#ea3e39",
|
|
64
|
+
600: "#d30016",
|
|
65
|
+
700: "#b60011",
|
|
66
|
+
800: "#96000c",
|
|
67
|
+
900: "#7d0e10",
|
|
68
|
+
950: "#4c120f"
|
|
69
|
+
},
|
|
70
|
+
cyan: {
|
|
71
|
+
50: "#eff7fa",
|
|
72
|
+
100: "#dcecf2",
|
|
73
|
+
200: "#c0deea",
|
|
74
|
+
300: "#93cae0",
|
|
75
|
+
400: "#51aed0",
|
|
76
|
+
500: "#0094bc",
|
|
77
|
+
600: "#007c9e",
|
|
78
|
+
700: "#006a87",
|
|
79
|
+
800: "#00576f",
|
|
80
|
+
900: "#004a5f",
|
|
81
|
+
950: "#002f3d"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Primitive 이름을 정본 hex로 바꾼다.
|
|
86
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
87
|
+
*/
|
|
88
|
+
function primitiveHex(name) {
|
|
89
|
+
if (name === "white" || name === "black") return color[name];
|
|
90
|
+
const index = name.lastIndexOf("-");
|
|
91
|
+
const family = name.slice(0, index);
|
|
92
|
+
const step = Number(name.slice(index + 1));
|
|
93
|
+
return color[family][step];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { color, primitiveHex };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ColorSlot } from "./color-slot.js";
|
|
2
|
+
import { SemanticColorName, ThemeName } from "./semantic.js";
|
|
3
|
+
/** 함께 쓰이는 글자(또는 경계)와 배경의 짝. Utility class 이름으로 적는다. */
|
|
4
|
+
export interface ContrastPair {
|
|
5
|
+
readonly foreground: SemanticColorName;
|
|
6
|
+
readonly background: SemanticColorName;
|
|
7
|
+
/** 텍스트는 4.5, UI 경계와 포커스는 3 */
|
|
8
|
+
readonly minRatio: 4.5 | 3;
|
|
9
|
+
}
|
|
10
|
+
/** 대비 검사에서 빼는 Semantic Token과 그 이유 */
|
|
11
|
+
export interface ContrastExclusion {
|
|
12
|
+
readonly token: SemanticColorName;
|
|
13
|
+
readonly reason: string;
|
|
14
|
+
}
|
|
15
|
+
declare const surfaces: readonly ["bg-canvas", "bg-surface", "bg-raised"];
|
|
16
|
+
export declare const contrastPairs: readonly ContrastPair[];
|
|
17
|
+
/**
|
|
18
|
+
* 대비 검사에서 뺀 Semantic Token과 이유.
|
|
19
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
20
|
+
*/
|
|
21
|
+
export declare const contrastExclusions: readonly ContrastExclusion[];
|
|
22
|
+
/** 색 이름 하나에서 함께 쓰는 슬롯 짝. 배경은 같은 색의 슬롯이거나 표면 층 Token이다. */
|
|
23
|
+
export interface ColorContrastRule {
|
|
24
|
+
readonly foreground: ColorSlot;
|
|
25
|
+
readonly background: ColorSlot | (typeof surfaces)[number];
|
|
26
|
+
/** 텍스트는 4.5, UI 경계는 3 */
|
|
27
|
+
readonly minRatio: 4.5 | 3;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 색 이름 하나의 대비 쌍 규칙.
|
|
31
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
32
|
+
*/
|
|
33
|
+
export declare const colorContrastRules: readonly ColorContrastRule[];
|
|
34
|
+
/** 대비 쌍 규칙 하나를 Theme 하나에서 검사한 결과 */
|
|
35
|
+
export interface ColorContrastResult extends ColorContrastRule {
|
|
36
|
+
readonly theme: ThemeName;
|
|
37
|
+
readonly ratio: number;
|
|
38
|
+
readonly pass: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 색 이름 하나의 슬롯 hex로 대비 쌍 규칙을 light·dark에서 검사한다. 표면 층은 Tide Token 값을 쓴다.
|
|
42
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkColorContrast(slotHex: Readonly<Record<ThemeName, Readonly<Record<ColorSlot, string>>>>): ColorContrastResult[];
|
|
45
|
+
/**
|
|
46
|
+
* 두 색의 WCAG 2.x 대비비(1~21). 순서는 상관없다.
|
|
47
|
+
* 반투명 색(8자리 hex)은 받지 않는다. 대비 검사에서 overlay와 shadow는 제외한다.
|
|
48
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
49
|
+
*/
|
|
50
|
+
export declare function contrastRatio(foreground: string, background: string): number;
|
|
51
|
+
export {};
|
package/dist/contrast.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { semanticHex } from "./semantic.js";
|
|
2
|
+
|
|
3
|
+
// src/contrast.ts
|
|
4
|
+
const surfaces = [
|
|
5
|
+
"bg-canvas",
|
|
6
|
+
"bg-surface",
|
|
7
|
+
"bg-raised"
|
|
8
|
+
];
|
|
9
|
+
const roles = [
|
|
10
|
+
"primary",
|
|
11
|
+
"success",
|
|
12
|
+
"warning",
|
|
13
|
+
"danger",
|
|
14
|
+
"info"
|
|
15
|
+
];
|
|
16
|
+
const allRoles = ["neutral", ...roles];
|
|
17
|
+
const subtleStates = [
|
|
18
|
+
"subtle",
|
|
19
|
+
"subtle-hover",
|
|
20
|
+
"subtle-active"
|
|
21
|
+
];
|
|
22
|
+
const solidStates = [
|
|
23
|
+
"solid",
|
|
24
|
+
"solid-hover",
|
|
25
|
+
"solid-active"
|
|
26
|
+
];
|
|
27
|
+
function pairs(foregrounds, backgrounds, minRatio) {
|
|
28
|
+
return foregrounds.flatMap((foreground) => backgrounds.map((background) => ({
|
|
29
|
+
foreground,
|
|
30
|
+
background,
|
|
31
|
+
minRatio
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
const contrastPairs = [
|
|
35
|
+
...pairs(["text-default", "text-muted"], surfaces, 4.5),
|
|
36
|
+
...pairs(["text-default"], subtleStates.map((state) => `bg-neutral-${state}`), 4.5),
|
|
37
|
+
...roles.flatMap((role) => pairs([`text-${role}`], [...surfaces, ...subtleStates.map((state) => `bg-${role}-${state}`)], 4.5)),
|
|
38
|
+
...pairs(["text-on-solid"], allRoles.flatMap((role) => solidStates.map((state) => `bg-${role}-${state}`)), 4.5),
|
|
39
|
+
...pairs([
|
|
40
|
+
"border-strong",
|
|
41
|
+
...roles.map((role) => `border-${role}`),
|
|
42
|
+
"outline-focus"
|
|
43
|
+
], surfaces, 3)
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* 대비 검사에서 뺀 Semantic Token과 이유.
|
|
47
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
48
|
+
*/
|
|
49
|
+
const contrastExclusions = [
|
|
50
|
+
{
|
|
51
|
+
token: "border-default",
|
|
52
|
+
reason: "장식용 구분선이다. 경계 식별에 쓰지 않는다."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
token: "border-raised",
|
|
56
|
+
reason: "raised 표면의 장식용 경계다(light 투명, dark gray-800). 표면 구분은 그림자와 배경 밝기가 맡고, 대비 의무가 없다."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
token: "bg-disabled",
|
|
60
|
+
reason: "비활성 상태는 WCAG 대비 요건 밖이다. Component가 속성과 cursor로도 표현한다."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
token: "text-disabled",
|
|
64
|
+
reason: "비활성 상태는 WCAG 대비 요건 밖이다. Component가 속성과 cursor로도 표현한다."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
token: "bg-overlay",
|
|
68
|
+
reason: "modal 뒤를 가리는 반투명 막이다. 위에 글자를 두지 않는다."
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* 색 이름 하나의 대비 쌍 규칙.
|
|
73
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
74
|
+
*/
|
|
75
|
+
const colorContrastRules = [
|
|
76
|
+
...[...surfaces, ...subtleStates].map((background) => ({
|
|
77
|
+
foreground: "text",
|
|
78
|
+
background,
|
|
79
|
+
minRatio: 4.5
|
|
80
|
+
})),
|
|
81
|
+
...solidStates.map((background) => ({
|
|
82
|
+
foreground: "on-solid",
|
|
83
|
+
background,
|
|
84
|
+
minRatio: 4.5
|
|
85
|
+
})),
|
|
86
|
+
...surfaces.map((background) => ({
|
|
87
|
+
foreground: "border",
|
|
88
|
+
background,
|
|
89
|
+
minRatio: 3
|
|
90
|
+
}))
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* 색 이름 하나의 슬롯 hex로 대비 쌍 규칙을 light·dark에서 검사한다. 표면 층은 Tide Token 값을 쓴다.
|
|
94
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
95
|
+
*/
|
|
96
|
+
function checkColorContrast(slotHex) {
|
|
97
|
+
return ["light", "dark"].flatMap((theme) => colorContrastRules.map((rule) => {
|
|
98
|
+
const background = rule.background.startsWith("bg-") ? semanticHex(rule.background, theme) : slotHex[theme][rule.background];
|
|
99
|
+
const ratio = contrastRatio(slotHex[theme][rule.foreground], background);
|
|
100
|
+
return {
|
|
101
|
+
...rule,
|
|
102
|
+
theme,
|
|
103
|
+
ratio,
|
|
104
|
+
pass: ratio >= rule.minRatio
|
|
105
|
+
};
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
/** WCAG 2.x 상대 휘도. `#rrggbb`만 받는다. */
|
|
109
|
+
function relativeLuminance(hex) {
|
|
110
|
+
const match = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex);
|
|
111
|
+
if (!match) throw new Error(`불투명한 6자리 hex가 아니다: ${hex}`);
|
|
112
|
+
const [r, g, b] = match.slice(1).map((channel) => {
|
|
113
|
+
const value = Number.parseInt(channel, 16) / 255;
|
|
114
|
+
return value <= .04045 ? value / 12.92 : ((value + .055) / 1.055) ** 2.4;
|
|
115
|
+
});
|
|
116
|
+
return .2126 * r + .7152 * g + .0722 * b;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 두 색의 WCAG 2.x 대비비(1~21). 순서는 상관없다.
|
|
120
|
+
* 반투명 색(8자리 hex)은 받지 않는다. 대비 검사에서 overlay와 shadow는 제외한다.
|
|
121
|
+
* @internal `@tide-tds/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
|
|
122
|
+
*/
|
|
123
|
+
function contrastRatio(foreground, background) {
|
|
124
|
+
const a = relativeLuminance(foreground);
|
|
125
|
+
const b = relativeLuminance(background);
|
|
126
|
+
return (Math.max(a, b) + .05) / (Math.min(a, b) + .05);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { checkColorContrast, colorContrastRules, contrastExclusions, contrastPairs, contrastRatio };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColorFamily, ColorStep, PrimitiveColorName, color } from "./color.js";
|
|
2
|
+
import { ColorSlot } from "./color-slot.js";
|
|
3
|
+
import { AlphaColor, Color, ColorFamilyName, ColorFamilyRegistry, Role, RoleRegistry, SemanticColorName, SemanticColorValue, SemanticNamespace, ThemeName, ThemedColor, TideRole, semantic, semanticPrefix } from "./semantic.js";
|
|
4
|
+
import { ContrastExclusion, ContrastPair, contrastPairs } from "./contrast.js";
|
|
5
|
+
import { FontFamilyName, FontSizeStep, FontWeightName, TextStyleName, TextStyleValue, fontFamily, fontSize, fontWeight, textStyle } from "./typography.js";
|
|
6
|
+
import { RadiusName, ShadowLayer, ShadowName, focusRing, radius, shadow } from "./shape.js";
|
|
7
|
+
import { DurationName, EasingName, duration, easing } from "./motion.js";
|
|
8
|
+
import { ZIndexName, zIndex } from "./stacking.js";
|
|
9
|
+
export { type AlphaColor, type Color, type ColorFamily, type ColorFamilyName, type ColorFamilyRegistry, type ColorSlot, type ColorStep, type ContrastExclusion, type ContrastPair, type DurationName, type EasingName, type FontFamilyName, type FontSizeStep, type FontWeightName, type PrimitiveColorName, type RadiusName, type Role, type RoleRegistry, type SemanticColorName, type SemanticColorValue, type SemanticNamespace, type ShadowLayer, type ShadowName, type TextStyleName, type TextStyleValue, type ThemeName, type ThemedColor, type TideRole, type ZIndexName, color, contrastPairs, duration, easing, focusRing, fontFamily, fontSize, fontWeight, radius, semantic, semanticPrefix, shadow, textStyle, zIndex };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { color } from "./color.js";
|
|
2
|
+
import { semantic, semanticPrefix } from "./semantic.js";
|
|
3
|
+
import { contrastPairs } from "./contrast.js";
|
|
4
|
+
import { fontFamily, fontSize, fontWeight, textStyle } from "./typography.js";
|
|
5
|
+
import { focusRing, radius, shadow } from "./shape.js";
|
|
6
|
+
import { duration, easing } from "./motion.js";
|
|
7
|
+
import { zIndex } from "./stacking.js";
|
|
8
|
+
|
|
9
|
+
export { color, contrastPairs, duration, easing, focusRing, fontFamily, fontSize, fontWeight, radius, semantic, semanticPrefix, shadow, textStyle, zIndex };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@tide-tds/foundation/internal`: 문서 앱(Token 블록), 빌드 스크립트, 테스트가 쓰는 내부 도우미.
|
|
3
|
+
*
|
|
4
|
+
* @internal 앱 개발자용 공개 계약이 아니다. 문서에 싣지 않고, 예고 없이 바뀌거나 사라질 수 있다.
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import { primitiveHex } from "./color.js";
|
|
8
|
+
import { BackgroundSlot, SlotOverrides, SlotRule, SlotStep, colorSlots, familyOverrides, familySlotSteps, resolveSlotSteps, slotPrimitive, slotRule } from "./color-slot.js";
|
|
9
|
+
import { colorValueHex, roleFamily, roleOverrides, roleSharedSlots, semanticEntries, semanticHex, shadowColor } from "./semantic.js";
|
|
10
|
+
import { TideColor, colorFamilyNames, colorSlotHex, colorSlotValues, isRole, roleNames, roleSlotToken, tideColorNames } from "./color-name.js";
|
|
11
|
+
import { AccentUtility, accentDefaultDeclarations, accentUtilities, accentVar, dataColorRule, familyThemeDeclarations, familyVar, primitiveVar, roleAliasCss, semanticVar, tideFamilyThemeDeclarations } from "./color-css.js";
|
|
12
|
+
import { ColorContrastResult, ColorContrastRule, checkColorContrast, colorContrastRules, contrastExclusions, contrastRatio } from "./contrast.js";
|
|
13
|
+
import { fontFamilyCss } from "./typography.js";
|
|
14
|
+
import { shadowCss } from "./shape.js";
|
|
15
|
+
export { type AccentUtility, type BackgroundSlot, type ColorContrastResult, type ColorContrastRule, type SlotOverrides, type SlotRule, type SlotStep, type TideColor, accentDefaultDeclarations, accentUtilities, accentVar, checkColorContrast, colorContrastRules, colorFamilyNames, colorSlotHex, colorSlotValues, colorSlots, colorValueHex, contrastExclusions, contrastRatio, dataColorRule, familyOverrides, familySlotSteps, familyThemeDeclarations, familyVar, fontFamilyCss, isRole, primitiveHex, primitiveVar, resolveSlotSteps, roleAliasCss, roleFamily, roleNames, roleOverrides, roleSharedSlots, roleSlotToken, semanticEntries, semanticHex, semanticVar, shadowColor, shadowCss, slotPrimitive, slotRule, tideColorNames, tideFamilyThemeDeclarations };
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { primitiveHex } from "./color.js";
|
|
2
|
+
import { colorSlots, familyOverrides, familySlotSteps, resolveSlotSteps, slotPrimitive, slotRule } from "./color-slot.js";
|
|
3
|
+
import { colorValueHex, roleFamily, roleOverrides, roleSharedSlots, semanticEntries, semanticHex, shadowColor } from "./semantic.js";
|
|
4
|
+
import { colorFamilyNames, colorSlotHex, colorSlotValues, isRole, roleNames, roleSlotToken, tideColorNames } from "./color-name.js";
|
|
5
|
+
import { accentDefaultDeclarations, accentUtilities, accentVar, dataColorRule, familyThemeDeclarations, familyVar, primitiveVar, roleAliasCss, semanticVar, tideFamilyThemeDeclarations } from "./color-css.js";
|
|
6
|
+
import { checkColorContrast, colorContrastRules, contrastExclusions, contrastRatio } from "./contrast.js";
|
|
7
|
+
import { fontFamilyCss } from "./typography.js";
|
|
8
|
+
import { shadowCss } from "./shape.js";
|
|
9
|
+
|
|
10
|
+
export { accentDefaultDeclarations, accentUtilities, accentVar, checkColorContrast, colorContrastRules, colorFamilyNames, colorSlotHex, colorSlotValues, colorSlots, colorValueHex, contrastExclusions, contrastRatio, dataColorRule, familyOverrides, familySlotSteps, familyThemeDeclarations, familyVar, fontFamilyCss, isRole, primitiveHex, primitiveVar, resolveSlotSteps, roleAliasCss, roleFamily, roleNames, roleOverrides, roleSharedSlots, roleSlotToken, semanticEntries, semanticHex, semanticVar, shadowColor, shadowCss, slotPrimitive, slotRule, tideColorNames, tideFamilyThemeDeclarations };
|
package/dist/motion.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* duration 2단계. `duration-<이름>` class와 공개 계약 `--tide-duration-<이름>`이 쓴다.
|
|
3
|
+
* - fast: hover·press, 색 전환, Switch thumb, 오버레이가 사라질 때. 시간을 적지 않은 transition의 기본값이다.
|
|
4
|
+
* - normal: 가끔 쓰는 오버레이(Popover, Toast, Dialog류)가 나타날 때
|
|
5
|
+
*/
|
|
6
|
+
export declare const duration: {
|
|
7
|
+
readonly fast: "150ms";
|
|
8
|
+
readonly normal: "300ms";
|
|
9
|
+
};
|
|
10
|
+
/** duration 단계 이름 */
|
|
11
|
+
export type DurationName = keyof typeof duration;
|
|
12
|
+
/**
|
|
13
|
+
* easing. `ease-<이름>` class와 공개 계약 `--tide-ease-<이름>`이 쓴다.
|
|
14
|
+
* - out: Tide Component 전부. 나타날 때와 사라질 때 모두. 시간을 적지 않은 transition의 기본값이다.
|
|
15
|
+
*/
|
|
16
|
+
export declare const easing: {
|
|
17
|
+
readonly out: "cubic-bezier(0, 0, 0.2, 1)";
|
|
18
|
+
};
|
|
19
|
+
/** easing 이름 */
|
|
20
|
+
export type EasingName = keyof typeof easing;
|
package/dist/motion.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/motion.ts
|
|
2
|
+
/**
|
|
3
|
+
* duration 2단계. `duration-<이름>` class와 공개 계약 `--tide-duration-<이름>`이 쓴다.
|
|
4
|
+
* - fast: hover·press, 색 전환, Switch thumb, 오버레이가 사라질 때. 시간을 적지 않은 transition의 기본값이다.
|
|
5
|
+
* - normal: 가끔 쓰는 오버레이(Popover, Toast, Dialog류)가 나타날 때
|
|
6
|
+
*/
|
|
7
|
+
const duration = {
|
|
8
|
+
fast: "150ms",
|
|
9
|
+
normal: "300ms"
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* easing. `ease-<이름>` class와 공개 계약 `--tide-ease-<이름>`이 쓴다.
|
|
13
|
+
* - out: Tide Component 전부. 나타날 때와 사라질 때 모두. 시간을 적지 않은 transition의 기본값이다.
|
|
14
|
+
*/
|
|
15
|
+
const easing = { out: "cubic-bezier(0, 0, 0.2, 1)" };
|
|
16
|
+
|
|
17
|
+
export { duration, easing };
|