@liner-fe/design-token 2.1.7 → 2.1.8

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.
Files changed (36) hide show
  1. package/lib/helpers/getTypoStyle.d.ts +2 -0
  2. package/lib/index.cjs +443 -0
  3. package/lib/index.cjs.map +4 -4
  4. package/lib/index.d.ts +1 -0
  5. package/lib/index.mjs +443 -0
  6. package/lib/index.mjs.map +4 -4
  7. package/lib/scripts/create-css/constants/typography/index.d.ts +13 -0
  8. package/lib/scripts/create-css/constants/typography/primitive.d.ts +37 -0
  9. package/lib/scripts/create-css/constants/typography/types.d.ts +17 -0
  10. package/package.json +2 -2
  11. package/src/helpers/getTypoStyle.ts +35 -0
  12. package/src/index.ts +1 -0
  13. package/src/scripts/create-css/constants/PATH.ts +3 -0
  14. package/src/scripts/create-css/constants/color/index.ts +257 -0
  15. package/src/scripts/create-css/constants/color/types.ts +135 -0
  16. package/src/scripts/create-css/constants/gap/index.ts +19 -0
  17. package/src/scripts/create-css/constants/icon/index.ts +9 -0
  18. package/src/scripts/create-css/constants/opacity/index.ts +21 -0
  19. package/src/scripts/create-css/constants/padding/index.ts +24 -0
  20. package/src/scripts/create-css/constants/primitiveRoot.ts +100 -0
  21. package/src/scripts/create-css/constants/radius/index.ts +12 -0
  22. package/src/scripts/create-css/constants/radius/type.ts +10 -0
  23. package/src/scripts/create-css/constants/rootScheme.ts +94 -0
  24. package/src/scripts/create-css/constants/shadow/index.ts +16 -0
  25. package/src/scripts/create-css/constants/size/index.ts +33 -0
  26. package/src/scripts/create-css/constants/size/type.ts +31 -0
  27. package/src/scripts/create-css/constants/typography/index.ts +437 -0
  28. package/src/scripts/create-css/constants/typography/primitive.ts +39 -0
  29. package/src/scripts/create-css/constants/typography/types.ts +85 -0
  30. package/src/scripts/create-css/index.ts +57 -0
  31. package/src/scripts/create-css/utils/convertFontFamily.ts +11 -0
  32. package/src/scripts/create-css/utils/convertObjectToCSSVariables.ts +5 -0
  33. package/src/scripts/create-css/utils/createFile.ts +12 -0
  34. package/src/scripts/create-css/utils/hexToRGBA.ts +15 -0
  35. package/src/scripts/create-css/utils/makeDir.ts +7 -0
  36. package/src/scripts/create-css/utils/replaceValuesWithKeys.ts +15 -0
@@ -0,0 +1,437 @@
1
+ import { font } from './primitive';
2
+ import { TypographyKeys } from './types';
3
+
4
+ export type FontFamily =
5
+ | 'lp-pri-font-family-poppins'
6
+ | 'lp-pri-font-family-variables-pretendard'
7
+ | 'lp-pri-font-family-variables-pretendard-jp';
8
+
9
+ interface TypographyValues {
10
+ family: Exclude<FontFamily, 'lp-pri-font-family-variables-pretendard-jp'>;
11
+ weight: keyof typeof font.weight;
12
+ lineHeight: keyof typeof font.lineHeight;
13
+ size: keyof typeof font.size;
14
+ }
15
+
16
+ export const typography: Record<TypographyKeys, TypographyValues> = {
17
+ 'lp-sys-typo-display1-accent-black': {
18
+ family: 'lp-pri-font-family-variables-pretendard',
19
+ weight: 'lp-pri-font-weight-800',
20
+ lineHeight: 'lp-pri-font-lineheight-120',
21
+ size: 'lp-pri-font-size-72',
22
+ },
23
+ 'lp-sys-typo-display2-accent-black': {
24
+ family: 'lp-pri-font-family-variables-pretendard',
25
+ weight: 'lp-pri-font-weight-800',
26
+ lineHeight: 'lp-pri-font-lineheight-120',
27
+ size: 'lp-pri-font-size-64',
28
+ },
29
+ 'lp-sys-typo-display3-accent-black': {
30
+ family: 'lp-pri-font-family-variables-pretendard',
31
+ weight: 'lp-pri-font-weight-800',
32
+ lineHeight: 'lp-pri-font-lineheight-120',
33
+ size: 'lp-pri-font-size-40',
34
+ },
35
+ 'lp-sys-typo-display1-normal-black': {
36
+ family: 'lp-pri-font-family-variables-pretendard',
37
+ weight: 'lp-pri-font-weight-800',
38
+ lineHeight: 'lp-pri-font-lineheight-120',
39
+ size: 'lp-pri-font-size-72',
40
+ },
41
+ 'lp-sys-typo-display2-normal-black': {
42
+ family: 'lp-pri-font-family-variables-pretendard',
43
+ weight: 'lp-pri-font-weight-800',
44
+ lineHeight: 'lp-pri-font-lineheight-120',
45
+ size: 'lp-pri-font-size-64',
46
+ },
47
+ 'lp-sys-typo-display3-normal-black': {
48
+ family: 'lp-pri-font-family-variables-pretendard',
49
+ weight: 'lp-pri-font-weight-800',
50
+ lineHeight: 'lp-pri-font-lineheight-120',
51
+ size: 'lp-pri-font-size-40',
52
+ },
53
+ 'lp-sys-typo-heading1-answer': {
54
+ family: 'lp-pri-font-family-variables-pretendard',
55
+ weight: 'lp-pri-font-weight-700',
56
+ lineHeight: 'lp-pri-font-lineheight-180',
57
+ size: 'lp-pri-font-size-28',
58
+ },
59
+ 'lp-sys-typo-heading2-answer': {
60
+ family: 'lp-pri-font-family-variables-pretendard',
61
+ weight: 'lp-pri-font-weight-700',
62
+ lineHeight: 'lp-pri-font-lineheight-180',
63
+ size: 'lp-pri-font-size-24',
64
+ },
65
+ 'lp-sys-typo-heading3-answer': {
66
+ family: 'lp-pri-font-family-variables-pretendard',
67
+ weight: 'lp-pri-font-weight-700',
68
+ lineHeight: 'lp-pri-font-lineheight-120',
69
+ size: 'lp-pri-font-size-40',
70
+ },
71
+ 'lp-sys-typo-heading4-answer': {
72
+ family: 'lp-pri-font-family-variables-pretendard',
73
+ weight: 'lp-pri-font-weight-800',
74
+ lineHeight: 'lp-pri-font-lineheight-120',
75
+ size: 'lp-pri-font-size-40',
76
+ },
77
+ 'lp-sys-typo-heading5-answer': {
78
+ family: 'lp-pri-font-family-variables-pretendard',
79
+ weight: 'lp-pri-font-weight-800',
80
+ lineHeight: 'lp-pri-font-lineheight-120',
81
+ size: 'lp-pri-font-size-40',
82
+ },
83
+ 'lp-sys-typo-heading6-answer': {
84
+ family: 'lp-pri-font-family-variables-pretendard',
85
+ weight: 'lp-pri-font-weight-800',
86
+ lineHeight: 'lp-pri-font-lineheight-120',
87
+ size: 'lp-pri-font-size-40',
88
+ },
89
+ 'lp-sys-typo-title1-accent-bold': {
90
+ family: 'lp-pri-font-family-variables-pretendard',
91
+ weight: 'lp-pri-font-weight-700',
92
+ lineHeight: 'lp-pri-font-lineheight-130',
93
+ size: 'lp-pri-font-size-32',
94
+ },
95
+ 'lp-sys-typo-title2-accent-bold': {
96
+ family: 'lp-pri-font-family-variables-pretendard',
97
+ weight: 'lp-pri-font-weight-700',
98
+ lineHeight: 'lp-pri-font-lineheight-130',
99
+ size: 'lp-pri-font-size-28',
100
+ },
101
+ 'lp-sys-typo-title3-accent-bold': {
102
+ family: 'lp-pri-font-family-variables-pretendard',
103
+ weight: 'lp-pri-font-weight-650',
104
+ lineHeight: 'lp-pri-font-lineheight-130',
105
+ size: 'lp-pri-font-size-24',
106
+ },
107
+ 'lp-sys-typo-title4-accent-bold': {
108
+ family: 'lp-pri-font-family-variables-pretendard',
109
+ weight: 'lp-pri-font-weight-650',
110
+ lineHeight: 'lp-pri-font-lineheight-130',
111
+ size: 'lp-pri-font-size-20',
112
+ },
113
+ 'lp-sys-typo-title1-accent-medium': {
114
+ family: 'lp-pri-font-family-variables-pretendard',
115
+ weight: 'lp-pri-font-weight-450',
116
+ lineHeight: 'lp-pri-font-lineheight-130',
117
+ size: 'lp-pri-font-size-32',
118
+ },
119
+ 'lp-sys-typo-title2-accent-medium': {
120
+ family: 'lp-pri-font-family-variables-pretendard',
121
+ weight: 'lp-pri-font-weight-450',
122
+ lineHeight: 'lp-pri-font-lineheight-130',
123
+ size: 'lp-pri-font-size-28',
124
+ },
125
+ 'lp-sys-typo-title3-accent-medium': {
126
+ family: 'lp-pri-font-family-variables-pretendard',
127
+ weight: 'lp-pri-font-weight-420',
128
+ lineHeight: 'lp-pri-font-lineheight-130',
129
+ size: 'lp-pri-font-size-24',
130
+ },
131
+ 'lp-sys-typo-title4-accent-medium': {
132
+ family: 'lp-pri-font-family-variables-pretendard',
133
+ weight: 'lp-pri-font-weight-420',
134
+ lineHeight: 'lp-pri-font-lineheight-130',
135
+ size: 'lp-pri-font-size-20',
136
+ },
137
+ 'lp-sys-typo-title1-normal-bold': {
138
+ family: 'lp-pri-font-family-variables-pretendard',
139
+ weight: 'lp-pri-font-weight-700',
140
+ lineHeight: 'lp-pri-font-lineheight-130',
141
+ size: 'lp-pri-font-size-32',
142
+ },
143
+ 'lp-sys-typo-title2-normal-bold': {
144
+ family: 'lp-pri-font-family-variables-pretendard',
145
+ weight: 'lp-pri-font-weight-700',
146
+ lineHeight: 'lp-pri-font-lineheight-130',
147
+ size: 'lp-pri-font-size-28',
148
+ },
149
+ 'lp-sys-typo-title3-normal-bold': {
150
+ family: 'lp-pri-font-family-variables-pretendard',
151
+ weight: 'lp-pri-font-weight-650',
152
+ lineHeight: 'lp-pri-font-lineheight-130',
153
+ size: 'lp-pri-font-size-24',
154
+ },
155
+ 'lp-sys-typo-title4-normal-bold': {
156
+ weight: 'lp-pri-font-weight-650',
157
+ lineHeight: 'lp-pri-font-lineheight-130',
158
+ size: 'lp-pri-font-size-20',
159
+ family: 'lp-pri-font-family-variables-pretendard',
160
+ },
161
+ 'lp-sys-typo-title1-normal-medium': {
162
+ family: 'lp-pri-font-family-variables-pretendard',
163
+ weight: 'lp-pri-font-weight-450',
164
+ size: 'lp-pri-font-size-32',
165
+ lineHeight: 'lp-pri-font-lineheight-130',
166
+ },
167
+ 'lp-sys-typo-title2-normal-medium': {
168
+ family: 'lp-pri-font-family-variables-pretendard',
169
+ weight: 'lp-pri-font-weight-450',
170
+ size: 'lp-pri-font-size-28',
171
+ lineHeight: 'lp-pri-font-lineheight-130',
172
+ },
173
+ 'lp-sys-typo-title3-normal-medium': {
174
+ family: 'lp-pri-font-family-variables-pretendard',
175
+ weight: 'lp-pri-font-weight-450',
176
+ size: 'lp-pri-font-size-24',
177
+ lineHeight: 'lp-pri-font-lineheight-130',
178
+ },
179
+ 'lp-sys-typo-title4-normal-medium': {
180
+ family: 'lp-pri-font-family-variables-pretendard',
181
+ weight: 'lp-pri-font-weight-450',
182
+ size: 'lp-pri-font-size-20',
183
+ lineHeight: 'lp-pri-font-lineheight-130',
184
+ },
185
+ 'lp-sys-typo-paragraph1-accent-bold': {
186
+ family: 'lp-pri-font-family-variables-pretendard',
187
+ weight: 'lp-pri-font-weight-700',
188
+ lineHeight: 'lp-pri-font-lineheight-130',
189
+ size: 'lp-pri-font-size-17',
190
+ },
191
+ 'lp-sys-typo-paragraph2-accent-bold': {
192
+ family: 'lp-pri-font-family-variables-pretendard',
193
+ weight: 'lp-pri-font-weight-700',
194
+ lineHeight: 'lp-pri-font-lineheight-130',
195
+ size: 'lp-pri-font-size-16',
196
+ },
197
+ 'lp-sys-typo-paragraph3-accent-bold': {
198
+ family: 'lp-pri-font-family-variables-pretendard',
199
+ weight: 'lp-pri-font-weight-700',
200
+ lineHeight: 'lp-pri-font-lineheight-130',
201
+ size: 'lp-pri-font-size-15',
202
+ },
203
+ 'lp-sys-typo-paragraph1-accent-medium': {
204
+ family: 'lp-pri-font-family-variables-pretendard',
205
+ weight: 'lp-pri-font-weight-420',
206
+ lineHeight: 'lp-pri-font-lineheight-130',
207
+ size: 'lp-pri-font-size-17',
208
+ },
209
+ 'lp-sys-typo-paragraph2-accent-medium': {
210
+ family: 'lp-pri-font-family-variables-pretendard',
211
+ weight: 'lp-pri-font-weight-420',
212
+ lineHeight: 'lp-pri-font-lineheight-130',
213
+ size: 'lp-pri-font-size-16',
214
+ },
215
+ 'lp-sys-typo-paragraph3-accent-medium': {
216
+ family: 'lp-pri-font-family-variables-pretendard',
217
+ weight: 'lp-pri-font-weight-420',
218
+ lineHeight: 'lp-pri-font-lineheight-130',
219
+ size: 'lp-pri-font-size-15',
220
+ },
221
+ 'lp-sys-typo-paragraph1-accent-regular': {
222
+ family: 'lp-pri-font-family-variables-pretendard',
223
+ weight: 'lp-pri-font-weight-350',
224
+ lineHeight: 'lp-pri-font-lineheight-130',
225
+ size: 'lp-pri-font-size-17',
226
+ },
227
+ 'lp-sys-typo-paragraph2-accent-regular': {
228
+ family: 'lp-pri-font-family-variables-pretendard',
229
+ weight: 'lp-pri-font-weight-350',
230
+ lineHeight: 'lp-pri-font-lineheight-130',
231
+ size: 'lp-pri-font-size-16',
232
+ },
233
+ 'lp-sys-typo-paragraph3-accent-regular': {
234
+ family: 'lp-pri-font-family-variables-pretendard',
235
+ weight: 'lp-pri-font-weight-350',
236
+ lineHeight: 'lp-pri-font-lineheight-130',
237
+ size: 'lp-pri-font-size-15',
238
+ },
239
+ 'lp-sys-typo-paragraph1-normal-bold': {
240
+ weight: 'lp-pri-font-weight-600',
241
+ lineHeight: 'lp-pri-font-lineheight-130',
242
+ size: 'lp-pri-font-size-17',
243
+ family: 'lp-pri-font-family-variables-pretendard',
244
+ },
245
+ 'lp-sys-typo-paragraph2-normal-bold': {
246
+ weight: 'lp-pri-font-weight-600',
247
+ lineHeight: 'lp-pri-font-lineheight-130',
248
+ size: 'lp-pri-font-size-16',
249
+ family: 'lp-pri-font-family-variables-pretendard',
250
+ },
251
+ 'lp-sys-typo-paragraph3-normal-bold': {
252
+ family: 'lp-pri-font-family-variables-pretendard',
253
+ weight: 'lp-pri-font-weight-600',
254
+ lineHeight: 'lp-pri-font-lineheight-130',
255
+ size: 'lp-pri-font-size-15',
256
+ },
257
+ 'lp-sys-typo-paragraph4-normal-bold': {
258
+ family: 'lp-pri-font-family-variables-pretendard',
259
+ weight: 'lp-pri-font-weight-600',
260
+ lineHeight: 'lp-pri-font-lineheight-130',
261
+ size: 'lp-pri-font-size-14',
262
+ },
263
+ 'lp-sys-typo-paragraph1-normal-medium': {
264
+ family: 'lp-pri-font-family-variables-pretendard',
265
+ weight: 'lp-pri-font-weight-420',
266
+ lineHeight: 'lp-pri-font-lineheight-130',
267
+ size: 'lp-pri-font-size-17',
268
+ },
269
+ 'lp-sys-typo-paragraph2-normal-medium': {
270
+ family: 'lp-pri-font-family-variables-pretendard',
271
+ weight: 'lp-pri-font-weight-420',
272
+ lineHeight: 'lp-pri-font-lineheight-130',
273
+ size: 'lp-pri-font-size-16',
274
+ },
275
+ 'lp-sys-typo-paragraph3-normal-medium': {
276
+ family: 'lp-pri-font-family-variables-pretendard',
277
+ weight: 'lp-pri-font-weight-420',
278
+ lineHeight: 'lp-pri-font-lineheight-130',
279
+ size: 'lp-pri-font-size-15',
280
+ },
281
+ 'lp-sys-typo-paragraph4-normal-medium': {
282
+ family: 'lp-pri-font-family-variables-pretendard',
283
+ weight: 'lp-pri-font-weight-420',
284
+ lineHeight: 'lp-pri-font-lineheight-130',
285
+ size: 'lp-pri-font-size-14',
286
+ },
287
+ 'lp-sys-typo-paragraph1-normal-regular': {
288
+ family: 'lp-pri-font-family-variables-pretendard',
289
+ weight: 'lp-pri-font-weight-350',
290
+ lineHeight: 'lp-pri-font-lineheight-130',
291
+ size: 'lp-pri-font-size-17',
292
+ },
293
+ 'lp-sys-typo-paragraph2-normal-regular': {
294
+ family: 'lp-pri-font-family-variables-pretendard',
295
+ weight: 'lp-pri-font-weight-350',
296
+ lineHeight: 'lp-pri-font-lineheight-130',
297
+ size: 'lp-pri-font-size-16',
298
+ },
299
+ 'lp-sys-typo-paragraph3-normal-regular': {
300
+ family: 'lp-pri-font-family-variables-pretendard',
301
+ weight: 'lp-pri-font-weight-350',
302
+ lineHeight: 'lp-pri-font-lineheight-130',
303
+ size: 'lp-pri-font-size-15',
304
+ },
305
+ 'lp-sys-typo-paragraph4-normal-regular': {
306
+ family: 'lp-pri-font-family-variables-pretendard',
307
+ weight: 'lp-pri-font-weight-350',
308
+ lineHeight: 'lp-pri-font-lineheight-130',
309
+ size: 'lp-pri-font-size-14',
310
+ },
311
+ 'lp-sys-typo-paragraph1-post-regular': {
312
+ family: 'lp-pri-font-family-variables-pretendard',
313
+ weight: 'lp-pri-font-weight-350',
314
+ lineHeight: 'lp-pri-font-lineheight-150',
315
+ size: 'lp-pri-font-size-17',
316
+ },
317
+ 'lp-sys-typo-paragraph3-post-regular': {
318
+ family: 'lp-pri-font-family-variables-pretendard',
319
+ weight: 'lp-pri-font-weight-350',
320
+ lineHeight: 'lp-pri-font-lineheight-150',
321
+ size: 'lp-pri-font-size-15',
322
+ },
323
+ 'lp-sys-typo-paragraph1-answer-bold': {
324
+ family: 'lp-pri-font-family-variables-pretendard',
325
+ weight: 'lp-pri-font-weight-600',
326
+ lineHeight: 'lp-pri-font-lineheight-180',
327
+ size: 'lp-pri-font-size-17',
328
+ },
329
+ 'lp-sys-typo-paragraph1-answer-regular': {
330
+ family: 'lp-pri-font-family-variables-pretendard',
331
+ weight: 'lp-pri-font-weight-350',
332
+ lineHeight: 'lp-pri-font-lineheight-180',
333
+ size: 'lp-pri-font-size-17',
334
+ },
335
+ 'lp-sys-typo-caption1-normal-bold': {
336
+ family: 'lp-pri-font-family-variables-pretendard',
337
+ weight: 'lp-pri-font-weight-600',
338
+ lineHeight: 'lp-pri-font-lineheight-130',
339
+ size: 'lp-pri-font-size-13',
340
+ },
341
+ 'lp-sys-typo-caption2-normal-bold': {
342
+ family: 'lp-pri-font-family-variables-pretendard',
343
+ weight: 'lp-pri-font-weight-600',
344
+ lineHeight: 'lp-pri-font-lineheight-130',
345
+ size: 'lp-pri-font-size-12',
346
+ },
347
+ 'lp-sys-typo-caption3-normal-bold': {
348
+ family: 'lp-pri-font-family-variables-pretendard',
349
+ weight: 'lp-pri-font-weight-600',
350
+ lineHeight: 'lp-pri-font-lineheight-130',
351
+ size: 'lp-pri-font-size-11',
352
+ },
353
+ 'lp-sys-typo-caption1-normal-medium': {
354
+ family: 'lp-pri-font-family-variables-pretendard',
355
+ weight: 'lp-pri-font-weight-420',
356
+ lineHeight: 'lp-pri-font-lineheight-130',
357
+ size: 'lp-pri-font-size-13',
358
+ },
359
+ 'lp-sys-typo-caption1-normal-regular': {
360
+ family: 'lp-pri-font-family-variables-pretendard',
361
+ weight: 'lp-pri-font-weight-350',
362
+ lineHeight: 'lp-pri-font-lineheight-130',
363
+ size: 'lp-pri-font-size-13',
364
+ },
365
+ 'lp-sys-typo-caption2-normal-regular': {
366
+ family: 'lp-pri-font-family-variables-pretendard',
367
+ weight: 'lp-pri-font-weight-350',
368
+ lineHeight: 'lp-pri-font-lineheight-130',
369
+ size: 'lp-pri-font-size-12',
370
+ },
371
+ 'lp-sys-typo-caption3-normal-regular': {
372
+ family: 'lp-pri-font-family-variables-pretendard',
373
+ weight: 'lp-pri-font-weight-350',
374
+ lineHeight: 'lp-pri-font-lineheight-130',
375
+ size: 'lp-pri-font-size-11',
376
+ },
377
+ };
378
+
379
+ export const typographyClassName = (() => {
380
+ const result: Partial<Record<TypographyKeys, TypographyKeys>> = {};
381
+
382
+ for (const key in typography) {
383
+ const typedKey = key as TypographyKeys;
384
+
385
+ result[typedKey] = typedKey;
386
+ }
387
+
388
+ return result;
389
+ })();
390
+
391
+ export const typographyEnglish: Partial<Record<TypographyKeys, TypographyValues>> = {
392
+ 'lp-sys-typo-paragraph1-accent-bold': {
393
+ ...typography['lp-sys-typo-paragraph1-accent-bold'],
394
+ family: 'lp-pri-font-family-poppins',
395
+ weight: 'lp-pri-font-weight-600',
396
+ },
397
+ 'lp-sys-typo-paragraph2-accent-bold': {
398
+ ...typography['lp-sys-typo-paragraph2-accent-bold'],
399
+ family: 'lp-pri-font-family-variables-pretendard',
400
+ weight: 'lp-pri-font-weight-600',
401
+ },
402
+ 'lp-sys-typo-paragraph3-accent-bold': {
403
+ ...typography['lp-sys-typo-paragraph3-accent-bold'],
404
+ family: 'lp-pri-font-family-variables-pretendard',
405
+ weight: 'lp-pri-font-weight-600',
406
+ },
407
+ 'lp-sys-typo-paragraph1-accent-medium': {
408
+ ...typography['lp-sys-typo-paragraph1-accent-medium'],
409
+ family: 'lp-pri-font-family-poppins',
410
+ weight: 'lp-pri-font-weight-500',
411
+ },
412
+ 'lp-sys-typo-paragraph2-accent-medium': {
413
+ ...typography['lp-sys-typo-paragraph2-accent-medium'],
414
+ family: 'lp-pri-font-family-poppins',
415
+ weight: 'lp-pri-font-weight-500',
416
+ },
417
+ 'lp-sys-typo-paragraph3-accent-medium': {
418
+ ...typography['lp-sys-typo-paragraph3-accent-medium'],
419
+ family: 'lp-pri-font-family-poppins',
420
+ weight: 'lp-pri-font-weight-500',
421
+ },
422
+ 'lp-sys-typo-paragraph1-accent-regular': {
423
+ ...typography['lp-sys-typo-paragraph3-accent-regular'],
424
+ weight: 'lp-pri-font-weight-300',
425
+ family: 'lp-pri-font-family-poppins',
426
+ },
427
+ 'lp-sys-typo-paragraph2-accent-regular': {
428
+ ...typography['lp-sys-typo-paragraph3-accent-regular'],
429
+ weight: 'lp-pri-font-weight-300',
430
+ family: 'lp-pri-font-family-poppins',
431
+ },
432
+ 'lp-sys-typo-paragraph3-accent-regular': {
433
+ ...typography['lp-sys-typo-paragraph3-accent-regular'],
434
+ weight: 'lp-pri-font-weight-300',
435
+ family: 'lp-pri-font-family-poppins',
436
+ },
437
+ };
@@ -0,0 +1,39 @@
1
+ const lineHeight = {
2
+ 'lp-pri-font-lineheight-120': '120%',
3
+ 'lp-pri-font-lineheight-130': '130%',
4
+ 'lp-pri-font-lineheight-150': '150%',
5
+ 'lp-pri-font-lineheight-180': '180%',
6
+ } as const;
7
+
8
+ const size = {
9
+ 'lp-pri-font-size-8': 8,
10
+ 'lp-pri-font-size-11': 11,
11
+ 'lp-pri-font-size-12': 12,
12
+ 'lp-pri-font-size-13': 13,
13
+ 'lp-pri-font-size-14': 14,
14
+ 'lp-pri-font-size-15': 15,
15
+ 'lp-pri-font-size-16': 16,
16
+ 'lp-pri-font-size-17': 17,
17
+ 'lp-pri-font-size-20': 20,
18
+ 'lp-pri-font-size-24': 24,
19
+ 'lp-pri-font-size-28': 28,
20
+ 'lp-pri-font-size-32': 32,
21
+ 'lp-pri-font-size-40': 40,
22
+ 'lp-pri-font-size-64': 64,
23
+ 'lp-pri-font-size-72': 72,
24
+ } as const;
25
+
26
+ const weight = {
27
+ 'lp-pri-font-weight-300': 300,
28
+ 'lp-pri-font-weight-350': 350,
29
+ 'lp-pri-font-weight-400': 400,
30
+ 'lp-pri-font-weight-420': 420,
31
+ 'lp-pri-font-weight-450': 450,
32
+ 'lp-pri-font-weight-500': 500,
33
+ 'lp-pri-font-weight-600': 600,
34
+ 'lp-pri-font-weight-650': 650,
35
+ 'lp-pri-font-weight-700': 700,
36
+ 'lp-pri-font-weight-800': 800,
37
+ } as const;
38
+
39
+ export const font = { weight, lineHeight, size };
@@ -0,0 +1,85 @@
1
+ export type TypographyPrefix = 'lp-sys-typo';
2
+
3
+ export type TypographyTitlePrefix = 'title';
4
+ export type TypographyTitle =
5
+ | '1-accent-bold'
6
+ | '2-accent-bold'
7
+ | '3-accent-bold'
8
+ | '4-accent-bold'
9
+ | '1-accent-medium'
10
+ | '2-accent-medium'
11
+ | '3-accent-medium'
12
+ | '4-accent-medium'
13
+ | '1-normal-bold'
14
+ | '2-normal-bold'
15
+ | '3-normal-bold'
16
+ | '4-normal-bold'
17
+ | '1-normal-medium'
18
+ | '2-normal-medium'
19
+ | '3-normal-medium'
20
+ | '4-normal-medium';
21
+ export type TypographyTitleType = `${TypographyTitlePrefix}${TypographyTitle}`;
22
+
23
+ export type TypographyDisplayPrefix = 'display';
24
+ export type TypographyDisplay =
25
+ | '1-accent-black'
26
+ | '2-accent-black'
27
+ | '3-accent-black'
28
+ | '1-normal-black'
29
+ | '2-normal-black'
30
+ | '3-normal-black';
31
+
32
+ export type TypographyDisplayType = `${TypographyDisplayPrefix}${TypographyDisplay}`;
33
+
34
+ export type TypographyHeadingPrefix = 'heading';
35
+ export type TypographyHeading = '1-answer' | '2-answer' | '3-answer' | '4-answer' | '5-answer' | '6-answer';
36
+ export type TypographyHeadingType = `${TypographyHeadingPrefix}${TypographyHeading}`;
37
+
38
+ export type TypographyParagraphPrefix = 'paragraph';
39
+ export type TypographyParagraph =
40
+ | '1-accent-bold'
41
+ | '2-accent-bold'
42
+ | '3-accent-bold'
43
+ | '1-accent-medium'
44
+ | '2-accent-medium'
45
+ | '3-accent-medium'
46
+ | '1-accent-regular'
47
+ | '2-accent-regular'
48
+ | '3-accent-regular'
49
+ | '1-normal-bold'
50
+ | '2-normal-bold'
51
+ | '3-normal-bold'
52
+ | '4-normal-bold'
53
+ | '1-normal-medium'
54
+ | '2-normal-medium'
55
+ | '3-normal-medium'
56
+ | '4-normal-medium'
57
+ | '1-normal-regular'
58
+ | '2-normal-regular'
59
+ | '3-normal-regular'
60
+ | '4-normal-regular'
61
+ | '1-post-regular'
62
+ | '3-post-regular'
63
+ | '1-answer-bold'
64
+ | '1-answer-regular';
65
+
66
+ export type TypographyParagraphType = `${TypographyParagraphPrefix}${TypographyParagraph}`;
67
+
68
+ export type TypographyCaptionPrefix = 'caption';
69
+ export type TypographyCaption =
70
+ | '1-normal-bold'
71
+ | '2-normal-bold'
72
+ | '3-normal-bold'
73
+ | '1-normal-medium'
74
+ | '1-normal-regular'
75
+ | '2-normal-regular'
76
+ | '3-normal-regular';
77
+
78
+ export type TypographyCaptionType = `${TypographyCaptionPrefix}${TypographyCaption}`;
79
+
80
+ export type TypographyKeys = `${TypographyPrefix}-${
81
+ | TypographyTitleType
82
+ | TypographyDisplayType
83
+ | TypographyHeadingType
84
+ | TypographyParagraphType
85
+ | TypographyCaptionType}`;
@@ -0,0 +1,57 @@
1
+ import fs from 'fs';
2
+ import { color } from './constants/color';
3
+ import { primitiveRoot } from './constants/primitiveRoot';
4
+ import {
5
+ languageEnglish,
6
+ themeDark,
7
+ themeDarkStorybook,
8
+ themeLight,
9
+ themeLightStorybook,
10
+ } from './constants/rootScheme';
11
+ import { radius } from './constants/radius';
12
+ import { iconSize } from './constants/icon';
13
+ import { opacity } from './constants/opacity';
14
+ import { padding } from './constants/padding';
15
+ import { size } from './constants/size';
16
+ import { gap } from './constants/gap';
17
+ import { PATH } from './constants/PATH';
18
+ import { makeDir } from './utils/makeDir';
19
+ import { replaceValuesWithKeys } from './utils/replaceValuesWithKeys';
20
+ import { shadow, SHADOW_KEYS } from './constants/shadow';
21
+ import { typographyClassName } from './constants/typography';
22
+ import { createFile } from './utils/createFile';
23
+
24
+ const cssFile = [primitiveRoot, themeDark, themeLight, languageEnglish].join('\n');
25
+ const cssFileStorybook = [primitiveRoot, themeDarkStorybook, themeLightStorybook, languageEnglish].join('\n');
26
+
27
+ const start = () => {
28
+ try {
29
+ createFile('./global.css', cssFile);
30
+ createFile('./globalStorybook.css', cssFileStorybook);
31
+
32
+ makeDir(PATH.SRC_GENERATED);
33
+
34
+ createFile(
35
+ `${PATH.SRC_GENERATED}/vars.ts`,
36
+ `export const vars = ${JSON.stringify({
37
+ ...replaceValuesWithKeys({ color: color.system.light }),
38
+ ...replaceValuesWithKeys({ radius }),
39
+ ...replaceValuesWithKeys({ opacity }),
40
+ ...replaceValuesWithKeys({ padding }),
41
+ ...replaceValuesWithKeys({ size }),
42
+ ...replaceValuesWithKeys({ gap }),
43
+ ...replaceValuesWithKeys({ shadow }),
44
+ ...replaceValuesWithKeys({ iconSize }),
45
+ })}`
46
+ );
47
+
48
+ createFile(
49
+ `${PATH.SRC_GENERATED}/classNames.ts`,
50
+ `export const classNames = ${JSON.stringify({ typography: typographyClassName })}`
51
+ );
52
+ } catch (e) {
53
+ console.log(e);
54
+ }
55
+ };
56
+
57
+ start();
@@ -0,0 +1,11 @@
1
+ import { FontFamily } from '../constants/typography';
2
+
3
+ export const convertFontFamily = (value: FontFamily) => {
4
+ if (value === 'lp-pri-font-family-poppins') {
5
+ return '"Poppins", sans-serif';
6
+ } else if (value === 'lp-pri-font-family-variables-pretendard') {
7
+ return '"Pretendard Variable"';
8
+ } else if (value === 'lp-pri-font-family-variables-pretendard-jp') {
9
+ return '"Pretendard JP Variable"';
10
+ }
11
+ };
@@ -0,0 +1,5 @@
1
+ export const convertObjectToCSSVariables = (obj: Record<string, string | number>) => {
2
+ return Object.entries(obj)
3
+ .map(([key, value]) => `${key}: ${value};`)
4
+ .join('\n');
5
+ };
@@ -0,0 +1,12 @@
1
+ import fs from 'fs';
2
+ import { NoParamCallback, PathOrFileDescriptor } from 'fs';
3
+
4
+ export const createFile = (
5
+ path: PathOrFileDescriptor,
6
+ data: string | NodeJS.ArrayBufferView,
7
+ callback?: NoParamCallback
8
+ ): void => {
9
+ const cb = callback || function () {};
10
+
11
+ fs.writeFile(path, data, cb);
12
+ };
@@ -0,0 +1,15 @@
1
+ export const hexToRgba = (hex: string, alpha: number) => {
2
+ if (hex.length === 3) {
3
+ hex = hex
4
+ .split('')
5
+ .map(char => char + char)
6
+ .join('');
7
+ }
8
+
9
+ const bigint = parseInt(hex, 16);
10
+ const r = (bigint >> 16) & 255;
11
+ const g = (bigint >> 8) & 255;
12
+ const b = bigint & 255;
13
+
14
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
15
+ };
@@ -0,0 +1,7 @@
1
+ import fs from 'fs';
2
+
3
+ export const makeDir = (path: string) => {
4
+ if (!fs.existsSync(path)) {
5
+ fs.mkdir(path, () => {});
6
+ }
7
+ };