@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.
@@ -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-tds/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-tds/foundation",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
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/color-family.d.ts",
32
+ "default": "./dist/color-family.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.