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