@bstage-sdk/design 0.1.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,753 @@
1
+ // src/admin/tokens.generated.ts
2
+ var modeColors = {
3
+ "bg/base": {
4
+ "dark": "#ffffff",
5
+ "light": "#ffffff"
6
+ },
7
+ "bg/bstage-admin": {
8
+ "dark": "#f5f6f8",
9
+ "light": "#f5f6f8"
10
+ },
11
+ "bg/elevated": {
12
+ "dark": "#ffffff",
13
+ "light": "#ffffff"
14
+ },
15
+ "bg/grouped-blue": {
16
+ "dark": "#f5f8ff",
17
+ "light": "#f5f8ff"
18
+ },
19
+ "bg/grouped-default": {
20
+ "dark": "#ffffff",
21
+ "light": "#ffffff"
22
+ },
23
+ "bg/grouped-strong": {
24
+ "dark": "#f5f6f8",
25
+ "light": "#f5f6f8"
26
+ },
27
+ "bg/grouped-strong-weak": {
28
+ "dark": "#f9fafb",
29
+ "light": "#f9fafb"
30
+ },
31
+ "border/blue": {
32
+ "dark": "#397af6",
33
+ "light": "#397af6"
34
+ },
35
+ "border/blue-weak-a": {
36
+ "dark": "#397af61a",
37
+ "light": "#397af61a"
38
+ },
39
+ "border/bstage": {
40
+ "dark": "#343d46",
41
+ "light": "#343d46"
42
+ },
43
+ "border/bstage-strong": {
44
+ "dark": "#1a1e23",
45
+ "light": "#1a1e23"
46
+ },
47
+ "border/bstage-weak": {
48
+ "dark": "#71777e",
49
+ "light": "#71777e"
50
+ },
51
+ "border/default-a": {
52
+ "dark": "#59667226",
53
+ "light": "#59667226"
54
+ },
55
+ "border/divider-a": {
56
+ "dark": "#5966721a",
57
+ "light": "#5966721a"
58
+ },
59
+ "border/divider-weak-a": {
60
+ "dark": "#5966720d",
61
+ "light": "#5966720d"
62
+ },
63
+ "border/eraser": {
64
+ "dark": "#ffffff",
65
+ "light": "#ffffff"
66
+ },
67
+ "border/green": {
68
+ "dark": "#32b27c",
69
+ "light": "#32b27c"
70
+ },
71
+ "border/green-weak-a": {
72
+ "dark": "#32b27c1a",
73
+ "light": "#32b27c1a"
74
+ },
75
+ "border/red": {
76
+ "dark": "#f41616",
77
+ "light": "#f41616"
78
+ },
79
+ "border/red-weak-a": {
80
+ "dark": "#f416161a",
81
+ "light": "#f416161a"
82
+ },
83
+ "border/strong-a": {
84
+ "dark": "#5966724d",
85
+ "light": "#5966724d"
86
+ },
87
+ "border/stronger-a": {
88
+ "dark": "#59667280",
89
+ "light": "#59667280"
90
+ },
91
+ "border/yellow": {
92
+ "dark": "#f29900",
93
+ "light": "#f29900"
94
+ },
95
+ "border/yellow-weak-a": {
96
+ "dark": "#ff99001a",
97
+ "light": "#ff99001a"
98
+ },
99
+ "bstagein/plan-essential": {
100
+ "dark": "#fdaffd",
101
+ "light": "#fdaffd"
102
+ },
103
+ "bstagein/plan-plus": {
104
+ "dark": "#151515",
105
+ "light": "#151515"
106
+ },
107
+ "bstagein/plan-standard": {
108
+ "dark": "#3067ec",
109
+ "light": "#3067ec"
110
+ },
111
+ "chart/default": {
112
+ "dark": "#595eff",
113
+ "light": "#595eff"
114
+ },
115
+ "chart/green": {
116
+ "dark": "#11ce8c",
117
+ "light": "#11ce8c"
118
+ },
119
+ "chart/grey": {
120
+ "dark": "#bdbdbd",
121
+ "light": "#bdbdbd"
122
+ },
123
+ "chart/orange": {
124
+ "dark": "#ff8057",
125
+ "light": "#ff8057"
126
+ },
127
+ "chart/red": {
128
+ "dark": "#ff505a",
129
+ "light": "#ff505a"
130
+ },
131
+ "chart/sky": {
132
+ "dark": "#54c1fb",
133
+ "light": "#54c1fb"
134
+ },
135
+ "chart/strong": {
136
+ "dark": "#5055e6",
137
+ "light": "#5055e6"
138
+ },
139
+ "chart/stronger": {
140
+ "dark": "#2c30b0",
141
+ "light": "#2c30b0"
142
+ },
143
+ "chart/weak": {
144
+ "dark": "#cdcfff",
145
+ "light": "#cdcfff"
146
+ },
147
+ "chart/yellow": {
148
+ "dark": "#ffce50",
149
+ "light": "#ffce50"
150
+ },
151
+ "icon/blue": {
152
+ "dark": "#397af6",
153
+ "light": "#397af6"
154
+ },
155
+ "icon/green": {
156
+ "dark": "#32b27c",
157
+ "light": "#32b27c"
158
+ },
159
+ "icon/indigo": {
160
+ "dark": "#5754f5",
161
+ "light": "#5754f5"
162
+ },
163
+ "icon/primary": {
164
+ "dark": "#3a424a",
165
+ "light": "#3a424a"
166
+ },
167
+ "icon/red": {
168
+ "dark": "#f41616",
169
+ "light": "#f41616"
170
+ },
171
+ "icon/secondary-a": {
172
+ "dark": "#596672d9",
173
+ "light": "#596672d9"
174
+ },
175
+ "icon/tertiary-a": {
176
+ "dark": "#5966724d",
177
+ "light": "#5966724d"
178
+ },
179
+ "icon/yellow": {
180
+ "dark": "#f29900",
181
+ "light": "#f29900"
182
+ },
183
+ "overlay/dim-a": {
184
+ "dark": "#00000080",
185
+ "light": "#00000080"
186
+ },
187
+ "overlay/dim-weak-a": {
188
+ "dark": "#0000001a",
189
+ "light": "#0000001a"
190
+ },
191
+ "overlay/hover-a": {
192
+ "dark": "#0000001a",
193
+ "light": "#0000001a"
194
+ },
195
+ "overlay/hover-blue-a": {
196
+ "dark": "#397af61a",
197
+ "light": "#397af61a"
198
+ },
199
+ "overlay/hover-blue-weak-a": {
200
+ "dark": "#397af60d",
201
+ "light": "#397af60d"
202
+ },
203
+ "overlay/hover-red-a": {
204
+ "dark": "#f416161a",
205
+ "light": "#f416161a"
206
+ },
207
+ "overlay/hover-weak-a": {
208
+ "dark": "#3453700d",
209
+ "light": "#3453700d"
210
+ },
211
+ "surface/avatar-default-a": {
212
+ "dark": "#3453700d",
213
+ "light": "#3453700d"
214
+ },
215
+ "surface/avatar-random-01": {
216
+ "dark": "#fa8a8a",
217
+ "light": "#fa8a8a"
218
+ },
219
+ "surface/avatar-random-02": {
220
+ "dark": "#ffcc80",
221
+ "light": "#ffcc80"
222
+ },
223
+ "surface/avatar-random-03": {
224
+ "dark": "#5bc196",
225
+ "light": "#5bc196"
226
+ },
227
+ "surface/avatar-random-04": {
228
+ "dark": "#4dbecd",
229
+ "light": "#4dbecd"
230
+ },
231
+ "surface/avatar-random-05": {
232
+ "dark": "#7976f7",
233
+ "light": "#7976f7"
234
+ },
235
+ "surface/avatar-random-06": {
236
+ "dark": "#aba9fa",
237
+ "light": "#aba9fa"
238
+ },
239
+ "surface/avatar-random-07": {
240
+ "dark": "#9c6beb",
241
+ "light": "#9c6beb"
242
+ },
243
+ "surface/display-blue": {
244
+ "dark": "#397af6",
245
+ "light": "#397af6"
246
+ },
247
+ "surface/display-blue-weak-a": {
248
+ "dark": "#397af61a",
249
+ "light": "#397af61a"
250
+ },
251
+ "surface/display-blue-weakest-a": {
252
+ "dark": "#397af608",
253
+ "light": "#397af608"
254
+ },
255
+ "surface/display-bstage": {
256
+ "dark": "#343d46",
257
+ "light": "#343d46"
258
+ },
259
+ "surface/display-default": {
260
+ "dark": "#ffffff",
261
+ "light": "#ffffff"
262
+ },
263
+ "surface/display-green": {
264
+ "dark": "#32b27c",
265
+ "light": "#32b27c"
266
+ },
267
+ "surface/display-green-weak-a": {
268
+ "dark": "#32b27c1a",
269
+ "light": "#32b27c1a"
270
+ },
271
+ "surface/display-grey-a": {
272
+ "dark": "#3453701a",
273
+ "light": "#3453701a"
274
+ },
275
+ "surface/display-grey-weak-a": {
276
+ "dark": "#3453700d",
277
+ "light": "#3453700d"
278
+ },
279
+ "surface/display-red": {
280
+ "dark": "#f41616",
281
+ "light": "#f41616"
282
+ },
283
+ "surface/display-red-weak-a": {
284
+ "dark": "#f416161a",
285
+ "light": "#f416161a"
286
+ },
287
+ "surface/display-toast": {
288
+ "dark": "#0a1116",
289
+ "light": "#0a1116"
290
+ },
291
+ "surface/display-tooltip": {
292
+ "dark": "#596672",
293
+ "light": "#596672"
294
+ },
295
+ "surface/display-yellow": {
296
+ "dark": "#ff9900",
297
+ "light": "#ff9900"
298
+ },
299
+ "surface/display-yellow-weak-a": {
300
+ "dark": "#ff99001a",
301
+ "light": "#ff99001a"
302
+ },
303
+ "surface/form-base": {
304
+ "dark": "#ffffff",
305
+ "light": "#ffffff"
306
+ },
307
+ "surface/form-blue": {
308
+ "dark": "#397af6",
309
+ "light": "#397af6"
310
+ },
311
+ "surface/form-blue-weak-a": {
312
+ "dark": "#397af626",
313
+ "light": "#397af626"
314
+ },
315
+ "surface/form-bstage": {
316
+ "dark": "#343d46",
317
+ "light": "#343d46"
318
+ },
319
+ "surface/form-bstage-strong": {
320
+ "dark": "#1a1e23",
321
+ "light": "#1a1e23"
322
+ },
323
+ "surface/form-bstage-weak": {
324
+ "dark": "#71777e",
325
+ "light": "#71777e"
326
+ },
327
+ "surface/form-default": {
328
+ "dark": "#ebeef1",
329
+ "light": "#ebeef1"
330
+ },
331
+ "surface/form-default-a": {
332
+ "dark": "#3453701a",
333
+ "light": "#3453701a"
334
+ },
335
+ "surface/form-green-weak-a": {
336
+ "dark": "#32b27c1a",
337
+ "light": "#32b27c1a"
338
+ },
339
+ "surface/form-red": {
340
+ "dark": "#f41616",
341
+ "light": "#f41616"
342
+ },
343
+ "surface/form-red-weak-a": {
344
+ "dark": "#f4161626",
345
+ "light": "#f4161626"
346
+ },
347
+ "surface/form-strong-a": {
348
+ "dark": "#34537033",
349
+ "light": "#34537033"
350
+ },
351
+ "surface/form-toggle": {
352
+ "dark": "#3453704d",
353
+ "light": "#3453704d"
354
+ },
355
+ "surface/form-weak-a": {
356
+ "dark": "#3453700d",
357
+ "light": "#3453700d"
358
+ },
359
+ "surface/form-yellow-weak-a": {
360
+ "dark": "#f299001a",
361
+ "light": "#f299001a"
362
+ },
363
+ "text/blue": {
364
+ "dark": "#397af6",
365
+ "light": "#397af6"
366
+ },
367
+ "text/green": {
368
+ "dark": "#32b27c",
369
+ "light": "#32b27c"
370
+ },
371
+ "text/indigo": {
372
+ "dark": "#5754f5",
373
+ "light": "#5754f5"
374
+ },
375
+ "text/primary": {
376
+ "dark": "#2a2b2f",
377
+ "light": "#2a2b2f"
378
+ },
379
+ "text/purple": {
380
+ "dark": "#8346e7",
381
+ "light": "#8346e7"
382
+ },
383
+ "text/red": {
384
+ "dark": "#f41616",
385
+ "light": "#f41616"
386
+ },
387
+ "text/secondary": {
388
+ "dark": "#676d72",
389
+ "light": "#676d72"
390
+ },
391
+ "text/sub-a": {
392
+ "dark": "#596672b3",
393
+ "light": "#596672b3"
394
+ },
395
+ "text/tertiary-a": {
396
+ "dark": "#596672b3",
397
+ "light": "#596672b3"
398
+ },
399
+ "text/yellow": {
400
+ "dark": "#f29900",
401
+ "light": "#f29900"
402
+ }
403
+ };
404
+ var flatColors = {
405
+ "always/black005-a": "#0000000d",
406
+ "always/black010-a": "#0000001a",
407
+ "always/black030-a": "#0000004d",
408
+ "always/black050-a": "#00000080",
409
+ "always/black060-a": "#00000099",
410
+ "always/black100-a": "#000000",
411
+ "always/green100": "#32b27c",
412
+ "always/grey135": "#243a4e",
413
+ "always/indigo100": "#5754f5",
414
+ "always/overlay-hover-white010-a": "#ffffff1a",
415
+ "always/purple100": "#8346e7",
416
+ "always/red085": "#f74444",
417
+ "always/service-rankingpoll-thumb-a": "#ffadddcc",
418
+ "always/white010-a": "#ffffff1a",
419
+ "always/white015-a": "#ffffff26",
420
+ "always/white025-a": "#ffffff40",
421
+ "always/white050-a": "#ffffff80",
422
+ "always/white060-a": "#ffffff99",
423
+ "always/white070-a": "#ffffffb3",
424
+ "always/white080-a": "#ffffffcc",
425
+ "always/white100": "#ffffff",
426
+ "always/yellow100": "#ff9900",
427
+ "auto/border-divider-on-dark": "#ffffff26",
428
+ "auto/border-divider-on-light": "#0000000f",
429
+ "auto/icon-primary-on-dark": "#ffffff",
430
+ "auto/icon-primary-on-light": "#00000099",
431
+ "auto/icon-secondary-on-dark": "#ffffff80",
432
+ "auto/icon-secondary-on-light": "#0000004d",
433
+ "auto/overlay-hover-on-dark": "#ffffff1a",
434
+ "auto/overlay-hover-on-light": "#0000001a",
435
+ "auto/text-primary-on-dark": "#ffffff",
436
+ "auto/text-primary-on-light": "#000000",
437
+ "auto/text-secondary-on-dark": "#ffffff80",
438
+ "auto/text-secondary-on-light": "#00000080"
439
+ };
440
+ var shadowTokens = {
441
+ "shadow/default-large": {
442
+ "dark": "0px 16px 36px -4px #1a1a1a33, 0px 0px 1px 0px #1a1a1a2e",
443
+ "light": "0px 16px 36px -4px #1a1a1a33, 0px 0px 1px 0px #1a1a1a2e"
444
+ },
445
+ "shadow/default-medium": {
446
+ "dark": "0px 8px 32px -2px #1a1a1a29, 0px 0px 1px 0px #00000026",
447
+ "light": "0px 8px 32px -2px #1a1a1a29, 0px 0px 1px 0px #00000026"
448
+ },
449
+ "shadow/default-small": {
450
+ "dark": "0px 4px 8px -1px #1a1a1a1f, 0px 0px 1px 0px #1a1a1a1f",
451
+ "light": "0px 4px 8px -1px #1a1a1a1f, 0px 0px 1px 0px #1a1a1a1f"
452
+ },
453
+ "shadow/default-xsmall": {
454
+ "dark": "0px 1px 1px 0px #1a1a1a1a, 0px 0px 1px 0px #1a1a1a1a",
455
+ "light": "0px 1px 1px 0px #1a1a1a1a, 0px 0px 1px 0px #1a1a1a1a"
456
+ }
457
+ };
458
+ var typographyTokens = {
459
+ "11/title/med": {
460
+ "fontSize": "11px",
461
+ "letterSpacing": "0%",
462
+ "lineHeight": "12px"
463
+ },
464
+ "11/title/reg": {
465
+ "fontSize": "11px",
466
+ "letterSpacing": "0%",
467
+ "lineHeight": "12px"
468
+ },
469
+ "11/title/reg-strike": {
470
+ "fontSize": "11px",
471
+ "letterSpacing": "0%",
472
+ "lineHeight": "12px"
473
+ },
474
+ "12/body/bold": {
475
+ "fontSize": "12px",
476
+ "letterSpacing": "0%",
477
+ "lineHeight": "16px"
478
+ },
479
+ "12/body/med": {
480
+ "fontSize": "12px",
481
+ "letterSpacing": "0%",
482
+ "lineHeight": "16px"
483
+ },
484
+ "12/body/med-link": {
485
+ "fontSize": "12px",
486
+ "letterSpacing": "0%",
487
+ "lineHeight": "16px"
488
+ },
489
+ "12/body/reg": {
490
+ "fontSize": "12px",
491
+ "letterSpacing": "0%",
492
+ "lineHeight": "16px"
493
+ },
494
+ "12/body/reg-strike": {
495
+ "fontSize": "12px",
496
+ "letterSpacing": "0%",
497
+ "lineHeight": "16px"
498
+ },
499
+ "13/body/bold": {
500
+ "fontSize": "13px",
501
+ "letterSpacing": "0%",
502
+ "lineHeight": "18px"
503
+ },
504
+ "13/body/med": {
505
+ "fontSize": "13px",
506
+ "letterSpacing": "0%",
507
+ "lineHeight": "18px"
508
+ },
509
+ "13/body/med-link": {
510
+ "fontSize": "13px",
511
+ "letterSpacing": "0%",
512
+ "lineHeight": "18px"
513
+ },
514
+ "13/body/reg": {
515
+ "fontSize": "13px",
516
+ "letterSpacing": "0%",
517
+ "lineHeight": "18px"
518
+ },
519
+ "13/body/reg-strike": {
520
+ "fontSize": "13px",
521
+ "letterSpacing": "0%",
522
+ "lineHeight": "18px"
523
+ },
524
+ "14/title/bold": {
525
+ "fontSize": "14px",
526
+ "letterSpacing": "0%",
527
+ "lineHeight": "18px"
528
+ },
529
+ "14/title/med": {
530
+ "fontSize": "14px",
531
+ "letterSpacing": "0%",
532
+ "lineHeight": "18px"
533
+ },
534
+ "15/body/reg": {
535
+ "fontSize": "15px",
536
+ "letterSpacing": "0%",
537
+ "lineHeight": "24px"
538
+ },
539
+ "16/title/bold": {
540
+ "fontSize": "16px",
541
+ "letterSpacing": "0%",
542
+ "lineHeight": "22px"
543
+ },
544
+ "16/title/med": {
545
+ "fontSize": "16px",
546
+ "letterSpacing": "0%",
547
+ "lineHeight": "22px"
548
+ },
549
+ "16/title/reg": {
550
+ "fontSize": "16px",
551
+ "letterSpacing": "0%",
552
+ "lineHeight": "22px"
553
+ },
554
+ "20/title/bold": {
555
+ "fontSize": "20px",
556
+ "letterSpacing": "0%",
557
+ "lineHeight": "26px"
558
+ },
559
+ "20/title/med": {
560
+ "fontSize": "20px",
561
+ "letterSpacing": "0%",
562
+ "lineHeight": "26px"
563
+ },
564
+ "24/title/med": {
565
+ "fontSize": "24px",
566
+ "letterSpacing": "0%",
567
+ "lineHeight": "34px"
568
+ },
569
+ "26title/me/med": {
570
+ "fontSize": "26px",
571
+ "letterSpacing": "0%",
572
+ "lineHeight": "36px"
573
+ },
574
+ "28/title/bold": {
575
+ "fontSize": "28px",
576
+ "letterSpacing": "0%",
577
+ "lineHeight": "36px"
578
+ },
579
+ "28/title/reg": {
580
+ "fontSize": "28px",
581
+ "letterSpacing": "0%",
582
+ "lineHeight": "36px"
583
+ },
584
+ "32/title/bold": {
585
+ "fontSize": "32px",
586
+ "letterSpacing": "0%",
587
+ "lineHeight": "44px"
588
+ },
589
+ "32/title/med": {
590
+ "fontSize": "32px",
591
+ "letterSpacing": "0%",
592
+ "lineHeight": "44px"
593
+ },
594
+ "40/body/bold": {
595
+ "fontSize": "40px",
596
+ "letterSpacing": "0%",
597
+ "lineHeight": "56px"
598
+ },
599
+ "40/title/bold": {
600
+ "fontSize": "40px",
601
+ "letterSpacing": "0%",
602
+ "lineHeight": "48px"
603
+ },
604
+ "64/title/bold": {
605
+ "fontSize": "64px",
606
+ "letterSpacing": "0%",
607
+ "lineHeight": "78px"
608
+ }
609
+ };
610
+ var fontWeightMap = {
611
+ "bold": 700,
612
+ "med": 500,
613
+ "reg": 400
614
+ };
615
+ var fontFamily = "'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";
616
+
617
+ // src/shared/generator.ts
618
+ function cssVarName(slug, prefix, kind) {
619
+ const s = slug.replace(/\//g, "-");
620
+ return kind === "mode" ? `--${prefix}-mode-${s}` : `--${prefix}-${s}`;
621
+ }
622
+ function cssVarRef(slug, prefix, kind) {
623
+ return `var(${cssVarName(slug, prefix, kind)})`;
624
+ }
625
+ function buildColorTree(modeColors2, flatColors2, prefix) {
626
+ const tree = {};
627
+ const add = (slug, kind) => {
628
+ const [cat, ...rest] = slug.split("/");
629
+ const leaf = rest.join("/").replace(/\//g, "-") || cat;
630
+ (tree[cat] ?? (tree[cat] = {}))[leaf] = cssVarRef(slug, prefix, kind);
631
+ };
632
+ for (const slug of Object.keys(modeColors2)) add(slug, "mode");
633
+ for (const slug of Object.keys(flatColors2)) add(slug, "flat");
634
+ return tree;
635
+ }
636
+ function buildShadowRefs(shadowTokens2, prefix) {
637
+ const out = {};
638
+ for (const slug of Object.keys(shadowTokens2)) {
639
+ const leaf = slug.replace(/^shadow\//, "");
640
+ out[leaf] = cssVarRef(slug, prefix, "mode");
641
+ }
642
+ return out;
643
+ }
644
+ function colorLines(t, prefix, mode) {
645
+ return [
646
+ ...Object.entries(t.modeColors).map(
647
+ ([slug, pair]) => ` ${cssVarName(slug, prefix, "mode")}: ${pair[mode]};`
648
+ ),
649
+ ...Object.entries(t.shadowTokens).map(
650
+ ([slug, pair]) => ` ${cssVarName(slug, prefix, "mode")}: ${pair[mode]};`
651
+ )
652
+ ].join("\n");
653
+ }
654
+ function renderFallbackCss(t, opts) {
655
+ const p = opts.prefix;
656
+ const flat = Object.entries(t.flatColors).map(([slug, v]) => ` ${cssVarName(slug, p, "flat")}: ${v};`).join("\n");
657
+ const lightColors = colorLines(t, p, "light");
658
+ let css = `/* ================================================================
659
+ * bstage \uB514\uC790\uC778 \uD1A0\uD070 \u2014 dev fallback (${p})
660
+ * @bstage-sdk/design \uC0DD\uC131\uBB3C. \uAC1C\uBC1C/\uBBF8\uB9AC\uBCF4\uAE30 \uC804\uC6A9(:root fallback).
661
+ * \uBC30\uD3EC \uC2DC\uC5D4 \uD50C\uB7AB\uD3FC :root \uAC12\uC744 \uC0C1\uC18D\uD558\uBA70 \uC774 \uD30C\uC77C\uC740 \uBC88\uB4E4\uB418\uC9C0 \uC54A\uB294\uB2E4.
662
+ * ================================================================ */
663
+
664
+ :root {
665
+ ${lightColors}
666
+
667
+ ${flat}
668
+
669
+ --${p}-font-family: ${t.fontFamily};
670
+ }
671
+ `;
672
+ if (opts.dark) {
673
+ const darkColors = colorLines(t, p, "dark");
674
+ css += `
675
+ @media (prefers-color-scheme: dark) {
676
+ :root:not([data-bspoke="light"]) {
677
+ ${darkColors.replace(/^ {2}/gm, " ")}
678
+ }
679
+ }
680
+
681
+ :root[data-bspoke="dark"],
682
+ :root.dark {
683
+ ${darkColors}
684
+ }
685
+ `;
686
+ }
687
+ return css;
688
+ }
689
+
690
+ // src/shared/devWarn.ts
691
+ var warned = /* @__PURE__ */ new Set();
692
+ function devWarnOnce(dedupeKey, message) {
693
+ if (warned.has(dedupeKey)) return;
694
+ warned.add(dedupeKey);
695
+ console.warn(`[bstage-design] ${message}`);
696
+ }
697
+
698
+ // src/shared/text-style.ts
699
+ function resolveTextStyle(typographyTokens2, fontWeightMap2, token) {
700
+ const lastSlash = token.lastIndexOf("/");
701
+ const base = token.slice(0, lastSlash);
702
+ const weight = token.slice(lastSlash + 1);
703
+ const typo = typographyTokens2[token] ?? typographyTokens2[base];
704
+ if (!typo) {
705
+ throw new Error(
706
+ `[bstage-design] \uC54C \uC218 \uC5C6\uB294 \uD0C0\uC774\uD3EC\uADF8\uB798\uD53C \uD1A0\uD070: "${token}". \uC0AC\uC6A9 \uAC00\uB2A5: ${Object.keys(typographyTokens2).join(", ")}`
707
+ );
708
+ }
709
+ const weightBase = weight.split("-")[0];
710
+ const resolvedWeight = fontWeightMap2[weight] ?? fontWeightMap2[weightBase];
711
+ if (resolvedWeight === void 0 && process.env.NODE_ENV !== "production") {
712
+ devWarnOnce(
713
+ `textStyle:weight:${weight}`,
714
+ `\uC54C \uC218 \uC5C6\uB294 font weight: "${weight}" (\uD1A0\uD070 "${token}"). 400\uC73C\uB85C \uB300\uCCB4\uD569\uB2C8\uB2E4. \uC0AC\uC6A9 \uAC00\uB2A5: ${Object.keys(fontWeightMap2).join(", ")}`
715
+ );
716
+ }
717
+ return {
718
+ fontSize: typo.fontSize,
719
+ lineHeight: typo.lineHeight,
720
+ fontWeight: resolvedWeight ?? 400,
721
+ letterSpacing: typo.letterSpacing
722
+ };
723
+ }
724
+
725
+ // src/admin/index.ts
726
+ var PREFIX = "admin";
727
+ var color = buildColorTree(modeColors, flatColors, PREFIX);
728
+ var shadow = buildShadowRefs(shadowTokens, PREFIX);
729
+ function cssVar(slug) {
730
+ return slug in modeColors ? cssVarRef(slug, PREFIX, "mode") : cssVarRef(slug, PREFIX, "flat");
731
+ }
732
+ function textStyle(token) {
733
+ return resolveTextStyle(typographyTokens, fontWeightMap, token);
734
+ }
735
+ function renderCss() {
736
+ return renderFallbackCss(
737
+ { modeColors, flatColors, shadowTokens, fontFamily },
738
+ { prefix: PREFIX, dark: false }
739
+ );
740
+ }
741
+ export {
742
+ color,
743
+ cssVar,
744
+ flatColors,
745
+ fontFamily,
746
+ fontWeightMap,
747
+ modeColors,
748
+ renderCss,
749
+ shadow,
750
+ shadowTokens,
751
+ textStyle,
752
+ typographyTokens
753
+ };