@tide-design/foundation 0.0.0-stage → 0.11.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,132 @@
1
+ /**
2
+ * font-family 스택. 공개 계약은 `--tide-font-<이름>`이고 `font-<이름>` class와 기본 글꼴이 쓴다.
3
+ * - sans: Pretendard README의 「어디서든 동일한 환경」 스택. 가변판 이름(`Pretendard Variable`)을 맨 앞에 둔다.
4
+ * - mono: 시스템 고정폭 글꼴만 쓴다(tailwindcss 4.3.5 기본 `--font-mono`와 같은 순서).
5
+ */
6
+ export declare const fontFamily: {
7
+ readonly sans: readonly ["Pretendard Variable", "Pretendard", "-apple-system", "BlinkMacSystemFont", "system-ui", "Roboto", "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "sans-serif"];
8
+ readonly mono: readonly ["ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"];
9
+ };
10
+ /** font-family Token 이름 */
11
+ export type FontFamilyName = keyof typeof fontFamily;
12
+ /**
13
+ * Primitive 크기. 키는 px, 값은 rem이다. class로 노출하지 않고 공개 계약 `--tide-font-size-<px>`만 둔다.
14
+ * 텍스트 스타일이 이 값을 참조한다.
15
+ */
16
+ export declare const fontSize: {
17
+ readonly 12: "0.75rem";
18
+ readonly 14: "0.875rem";
19
+ readonly 16: "1rem";
20
+ readonly 18: "1.125rem";
21
+ readonly 20: "1.25rem";
22
+ readonly 24: "1.5rem";
23
+ readonly 32: "2rem";
24
+ readonly 40: "2.5rem";
25
+ readonly 48: "3rem";
26
+ readonly 56: "3.5rem";
27
+ };
28
+ /** Primitive 크기 단계(px) */
29
+ export type FontSizeStep = keyof typeof fontSize;
30
+ /** 굵기 Token. Tailwind 기본 굵기는 지우고 이 다섯 개만 `font-<이름>` class로 둔다. */
31
+ export declare const fontWeight: {
32
+ readonly light: 300;
33
+ readonly normal: 400;
34
+ readonly medium: 500;
35
+ readonly semibold: 600;
36
+ readonly bold: 700;
37
+ };
38
+ /** 굵기 Token 이름 */
39
+ export type FontWeightName = keyof typeof fontWeight;
40
+ /** 텍스트 스타일 하나의 값 */
41
+ export interface TextStyleValue {
42
+ /** Primitive 크기 단계(px) */
43
+ readonly fontSize: FontSizeStep;
44
+ /** 행간(rem). 4px 격자를 따른다. */
45
+ readonly lineHeight: string;
46
+ /** 굵기 Token 이름. 텍스트 스타일은 light를 쓰지 않는다. */
47
+ readonly fontWeight: Exclude<FontWeightName, "light">;
48
+ }
49
+ /**
50
+ * 텍스트 스타일 14개. `text-<이름>` class 하나가 크기, 행간, 굵기를 함께 정한다.
51
+ * 공개 계약은 `--tide-text-<이름>`과 그 `--line-height`, `--font-weight` 하위 변수다.
52
+ * 값은 spec 표를 그대로 옮겼다(크기/행간 px → rem).
53
+ */
54
+ export declare const textStyle: {
55
+ readonly "display-lg": {
56
+ readonly fontSize: 56;
57
+ readonly lineHeight: "4rem";
58
+ readonly fontWeight: "bold";
59
+ };
60
+ readonly "display-md": {
61
+ readonly fontSize: 48;
62
+ readonly lineHeight: "3.5rem";
63
+ readonly fontWeight: "bold";
64
+ };
65
+ readonly "heading-xl": {
66
+ readonly fontSize: 40;
67
+ readonly lineHeight: "3rem";
68
+ readonly fontWeight: "bold";
69
+ };
70
+ readonly "heading-lg": {
71
+ readonly fontSize: 32;
72
+ readonly lineHeight: "2.5rem";
73
+ readonly fontWeight: "bold";
74
+ };
75
+ readonly "heading-md": {
76
+ readonly fontSize: 24;
77
+ readonly lineHeight: "2rem";
78
+ readonly fontWeight: "bold";
79
+ };
80
+ readonly "heading-sm": {
81
+ readonly fontSize: 20;
82
+ readonly lineHeight: "1.75rem";
83
+ readonly fontWeight: "semibold";
84
+ };
85
+ readonly "heading-xs": {
86
+ readonly fontSize: 18;
87
+ readonly lineHeight: "1.75rem";
88
+ readonly fontWeight: "semibold";
89
+ };
90
+ readonly "body-lg": {
91
+ readonly fontSize: 18;
92
+ readonly lineHeight: "1.75rem";
93
+ readonly fontWeight: "normal";
94
+ };
95
+ readonly "body-md": {
96
+ readonly fontSize: 16;
97
+ readonly lineHeight: "1.5rem";
98
+ readonly fontWeight: "normal";
99
+ };
100
+ readonly "body-sm": {
101
+ readonly fontSize: 14;
102
+ readonly lineHeight: "1.25rem";
103
+ readonly fontWeight: "normal";
104
+ };
105
+ readonly "label-lg": {
106
+ readonly fontSize: 16;
107
+ readonly lineHeight: "1.25rem";
108
+ readonly fontWeight: "medium";
109
+ };
110
+ readonly "label-md": {
111
+ readonly fontSize: 14;
112
+ readonly lineHeight: "1.25rem";
113
+ readonly fontWeight: "medium";
114
+ };
115
+ readonly "label-sm": {
116
+ readonly fontSize: 12;
117
+ readonly lineHeight: "1rem";
118
+ readonly fontWeight: "medium";
119
+ };
120
+ readonly caption: {
121
+ readonly fontSize: 12;
122
+ readonly lineHeight: "1rem";
123
+ readonly fontWeight: "normal";
124
+ };
125
+ };
126
+ /** 텍스트 스타일 이름. Typography의 `variant` 값이다. */
127
+ export type TextStyleName = keyof typeof textStyle;
128
+ /**
129
+ * font-family 스택을 CSS 값으로 만든다. 영문과 하이픈만으로 된 이름은 그대로 두고, 나머지(공백이 있는 이름)는 따옴표로 감싼다.
130
+ * @internal `@tide-design/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
131
+ */
132
+ export declare function fontFamilyCss(name: FontFamilyName): string;
@@ -0,0 +1,145 @@
1
+ // src/typography.ts
2
+ /**
3
+ * font-family 스택. 공개 계약은 `--tide-font-<이름>`이고 `font-<이름>` class와 기본 글꼴이 쓴다.
4
+ * - sans: Pretendard README의 「어디서든 동일한 환경」 스택. 가변판 이름(`Pretendard Variable`)을 맨 앞에 둔다.
5
+ * - mono: 시스템 고정폭 글꼴만 쓴다(tailwindcss 4.3.5 기본 `--font-mono`와 같은 순서).
6
+ */
7
+ const fontFamily = {
8
+ sans: [
9
+ "Pretendard Variable",
10
+ "Pretendard",
11
+ "-apple-system",
12
+ "BlinkMacSystemFont",
13
+ "system-ui",
14
+ "Roboto",
15
+ "Helvetica Neue",
16
+ "Segoe UI",
17
+ "Apple SD Gothic Neo",
18
+ "Noto Sans KR",
19
+ "Malgun Gothic",
20
+ "Apple Color Emoji",
21
+ "Segoe UI Emoji",
22
+ "Segoe UI Symbol",
23
+ "sans-serif"
24
+ ],
25
+ mono: [
26
+ "ui-monospace",
27
+ "SFMono-Regular",
28
+ "Menlo",
29
+ "Monaco",
30
+ "Consolas",
31
+ "Liberation Mono",
32
+ "Courier New",
33
+ "monospace"
34
+ ]
35
+ };
36
+ /**
37
+ * Primitive 크기. 키는 px, 값은 rem이다. class로 노출하지 않고 공개 계약 `--tide-font-size-<px>`만 둔다.
38
+ * 텍스트 스타일이 이 값을 참조한다.
39
+ */
40
+ const fontSize = {
41
+ 12: "0.75rem",
42
+ 14: "0.875rem",
43
+ 16: "1rem",
44
+ 18: "1.125rem",
45
+ 20: "1.25rem",
46
+ 24: "1.5rem",
47
+ 32: "2rem",
48
+ 40: "2.5rem",
49
+ 48: "3rem",
50
+ 56: "3.5rem"
51
+ };
52
+ /** 굵기 Token. Tailwind 기본 굵기는 지우고 이 다섯 개만 `font-<이름>` class로 둔다. */
53
+ const fontWeight = {
54
+ light: 300,
55
+ normal: 400,
56
+ medium: 500,
57
+ semibold: 600,
58
+ bold: 700
59
+ };
60
+ /**
61
+ * 텍스트 스타일 14개. `text-<이름>` class 하나가 크기, 행간, 굵기를 함께 정한다.
62
+ * 공개 계약은 `--tide-text-<이름>`과 그 `--line-height`, `--font-weight` 하위 변수다.
63
+ * 값은 spec 표를 그대로 옮겼다(크기/행간 px → rem).
64
+ */
65
+ const textStyle = {
66
+ "display-lg": {
67
+ fontSize: 56,
68
+ lineHeight: "4rem",
69
+ fontWeight: "bold"
70
+ },
71
+ "display-md": {
72
+ fontSize: 48,
73
+ lineHeight: "3.5rem",
74
+ fontWeight: "bold"
75
+ },
76
+ "heading-xl": {
77
+ fontSize: 40,
78
+ lineHeight: "3rem",
79
+ fontWeight: "bold"
80
+ },
81
+ "heading-lg": {
82
+ fontSize: 32,
83
+ lineHeight: "2.5rem",
84
+ fontWeight: "bold"
85
+ },
86
+ "heading-md": {
87
+ fontSize: 24,
88
+ lineHeight: "2rem",
89
+ fontWeight: "bold"
90
+ },
91
+ "heading-sm": {
92
+ fontSize: 20,
93
+ lineHeight: "1.75rem",
94
+ fontWeight: "semibold"
95
+ },
96
+ "heading-xs": {
97
+ fontSize: 18,
98
+ lineHeight: "1.75rem",
99
+ fontWeight: "semibold"
100
+ },
101
+ "body-lg": {
102
+ fontSize: 18,
103
+ lineHeight: "1.75rem",
104
+ fontWeight: "normal"
105
+ },
106
+ "body-md": {
107
+ fontSize: 16,
108
+ lineHeight: "1.5rem",
109
+ fontWeight: "normal"
110
+ },
111
+ "body-sm": {
112
+ fontSize: 14,
113
+ lineHeight: "1.25rem",
114
+ fontWeight: "normal"
115
+ },
116
+ "label-lg": {
117
+ fontSize: 16,
118
+ lineHeight: "1.25rem",
119
+ fontWeight: "medium"
120
+ },
121
+ "label-md": {
122
+ fontSize: 14,
123
+ lineHeight: "1.25rem",
124
+ fontWeight: "medium"
125
+ },
126
+ "label-sm": {
127
+ fontSize: 12,
128
+ lineHeight: "1rem",
129
+ fontWeight: "medium"
130
+ },
131
+ caption: {
132
+ fontSize: 12,
133
+ lineHeight: "1rem",
134
+ fontWeight: "normal"
135
+ }
136
+ };
137
+ /**
138
+ * font-family 스택을 CSS 값으로 만든다. 영문과 하이픈만으로 된 이름은 그대로 두고, 나머지(공백이 있는 이름)는 따옴표로 감싼다.
139
+ * @internal `@tide-design/foundation/internal` 전용. 앱 개발자용 공개 계약이 아니다(문서 앱·빌드 스크립트·테스트용).
140
+ */
141
+ function fontFamilyCss(name) {
142
+ return fontFamily[name].map((family) => /^[-a-zA-Z]+$/.test(family) ? family : `"${family}"`).join(", ");
143
+ }
144
+
145
+ export { fontFamily, fontFamilyCss, fontSize, fontWeight, textStyle };
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@tide-design/foundation",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.11.1",
4
+ "description": "Tide 디자인 시스템의 Token과 CSS",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/chane81/tide-design-system.git",
9
+ "directory": "packages/foundation"
10
+ },
11
+ "bin": {
12
+ "tide-color": "./dist/cli.js"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "type": "module",
18
+ "sideEffects": [
19
+ "**/*.css"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./internal": {
27
+ "types": "./dist/internal.d.ts",
28
+ "default": "./dist/internal.js"
29
+ },
30
+ "./color-family": {
31
+ "types": "./dist/colorFamily.d.ts",
32
+ "default": "./dist/colorFamily.js"
33
+ },
34
+ "./tokens.css": "./dist/tokens.css",
35
+ "./tailwind.css": "./dist/tailwind.css",
36
+ "./tailwind-merge": {
37
+ "types": "./dist/tailwind-merge.d.ts",
38
+ "default": "./dist/tailwind-merge.js"
39
+ }
40
+ },
41
+ "devDependencies": {
42
+ "@tailwindcss/node": "^4.3.5",
43
+ "@types/node": "^26.6.6",
44
+ "tailwind-merge": "^3.7.0",
45
+ "tailwindcss": "^4.3.5",
46
+ "tsdown": "0.23.7",
47
+ "typescript": "^7.0.2",
48
+ "vitest": "^5.1.0"
49
+ },
50
+ "peerDependencies": {
51
+ "tailwind-merge": "^3"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "tailwind-merge": {
55
+ "optional": true
56
+ }
57
+ },
58
+ "scripts": {
59
+ "build": "tsdown && node scripts/build.ts",
60
+ "typecheck": "tsc --noEmit",
61
+ "test": "vitest run"
62
+ }
6
63
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.