@bigstack-oss/cube-ui 0.0.2

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,765 @@
1
+ import * as react from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+ import * as tailwindcss_types_config from 'tailwindcss/types/config';
4
+
5
+ /**
6
+ * Brand palettes shipped as `themes/*.css`. Add a new entry here, a matching
7
+ * `your-theme.css` file in `themes/`, and an `@import` for it in
8
+ * `themes/index.css`, for each additional product palette.
9
+ */
10
+ type CubeThemeName = 'cubeCOS' | 'cubeEMP';
11
+
12
+ type CubeThemeProviderProps = PropsWithChildren<{
13
+ /** Which brand palette's CSS variables (see `theme/tokens/themes/*.css`) to apply. */
14
+ theme: CubeThemeName;
15
+ }>;
16
+ /**
17
+ * Selects which brand palette @bigstack-oss/cube-ui's colors resolve to by
18
+ * setting `data-cube-theme` on the document root.
19
+ *
20
+ * **Optional** — omitting this provider falls back to the `cubeCOS` palette,
21
+ * which is applied at `:root` in `cubeCOS.css` by default.
22
+ */
23
+ declare const CubeThemeProvider: (props: CubeThemeProviderProps) => react.ReactNode;
24
+
25
+ declare const cubePreset: {
26
+ theme: {
27
+ extend: {
28
+ screens: {
29
+ 'height-sm': {
30
+ raw: string;
31
+ };
32
+ 'height-md': {
33
+ raw: string;
34
+ };
35
+ 'height-lg': {
36
+ raw: string;
37
+ };
38
+ 'height-xl': {
39
+ raw: string;
40
+ };
41
+ };
42
+ colors: {
43
+ primary: {
44
+ DEFAULT: string;
45
+ 0: string;
46
+ 50: string;
47
+ 100: string;
48
+ 150: string;
49
+ 200: string;
50
+ 300: string;
51
+ 400: string;
52
+ 500: string;
53
+ 600: string;
54
+ 700: string;
55
+ 800: string;
56
+ 850: string;
57
+ };
58
+ secondary: {
59
+ DEFAULT: string;
60
+ 0: string;
61
+ 50: string;
62
+ 100: string;
63
+ 150: string;
64
+ 200: string;
65
+ 300: string;
66
+ 400: string;
67
+ 500: string;
68
+ 600: string;
69
+ 700: string;
70
+ 800: string;
71
+ 850: string;
72
+ };
73
+ dark: {
74
+ 0: string;
75
+ 50: string;
76
+ 100: string;
77
+ 150: string;
78
+ 200: string;
79
+ 300: string;
80
+ 400: string;
81
+ 500: string;
82
+ 600: string;
83
+ 700: string;
84
+ 800: string;
85
+ 850: string;
86
+ };
87
+ grey: {
88
+ 0: string;
89
+ 50: string;
90
+ 100: string;
91
+ 150: string;
92
+ 200: string;
93
+ 300: string;
94
+ 400: string;
95
+ 500: string;
96
+ 600: string;
97
+ 700: string;
98
+ 800: string;
99
+ 850: string;
100
+ };
101
+ blue: {
102
+ 0: string;
103
+ 50: string;
104
+ 100: string;
105
+ 150: string;
106
+ 200: string;
107
+ 300: string;
108
+ 400: string;
109
+ 500: string;
110
+ 600: string;
111
+ 700: string;
112
+ 800: string;
113
+ 850: string;
114
+ };
115
+ green: {
116
+ 0: string;
117
+ 50: string;
118
+ 100: string;
119
+ 150: string;
120
+ 200: string;
121
+ 300: string;
122
+ 400: string;
123
+ 500: string;
124
+ 600: string;
125
+ 700: string;
126
+ 800: string;
127
+ 850: string;
128
+ };
129
+ yellow: {
130
+ 0: string;
131
+ 50: string;
132
+ 100: string;
133
+ 150: string;
134
+ 200: string;
135
+ 300: string;
136
+ 400: string;
137
+ 500: string;
138
+ 600: string;
139
+ 700: string;
140
+ 800: string;
141
+ 850: string;
142
+ };
143
+ red: {
144
+ 0: string;
145
+ 50: string;
146
+ 100: string;
147
+ 150: string;
148
+ 200: string;
149
+ 300: string;
150
+ 400: string;
151
+ 500: string;
152
+ 600: string;
153
+ 700: string;
154
+ 800: string;
155
+ 850: string;
156
+ };
157
+ cosmos: {
158
+ primary: string;
159
+ secondary: string;
160
+ };
161
+ scene: {
162
+ gradient: string;
163
+ background: string;
164
+ };
165
+ functional: {
166
+ title: string;
167
+ text: string;
168
+ 'text-light': string;
169
+ 'hover-primary': string;
170
+ 'hover-secondary': string;
171
+ 'hover-grey': string;
172
+ 'hover-grey-darker': string;
173
+ 'border-divider': string;
174
+ 'border-darker': string;
175
+ disable: string;
176
+ 'disable-text': string;
177
+ 'disable-light': string;
178
+ skeleton: string;
179
+ };
180
+ status: {
181
+ positive: string;
182
+ 'positive-text': string;
183
+ negative: string;
184
+ warning: string;
185
+ paused: string;
186
+ neutral: string;
187
+ 'over-limit': string;
188
+ };
189
+ chart: {
190
+ 1: string;
191
+ 2: string;
192
+ 3: string;
193
+ 4: string;
194
+ 5: string;
195
+ 6: string;
196
+ 7: string;
197
+ 8: string;
198
+ 9: string;
199
+ 10: string;
200
+ 11: string;
201
+ 12: string;
202
+ 13: string;
203
+ 14: string;
204
+ 15: string;
205
+ 16: string;
206
+ 17: string;
207
+ 18: string;
208
+ 19: string;
209
+ 20: string;
210
+ 21: string;
211
+ 22: string;
212
+ 23: string;
213
+ 24: string;
214
+ 25: string;
215
+ 26: string;
216
+ 27: string;
217
+ 28: string;
218
+ 29: string;
219
+ 30: string;
220
+ 31: string;
221
+ 32: string;
222
+ };
223
+ };
224
+ fontFamily: {
225
+ urbanist: [string, string, ...string[]];
226
+ inter: [string, string, ...string[]];
227
+ "noto-sans-tc": [string, ...string[]];
228
+ sans: [string, string, ...string[]];
229
+ };
230
+ fontWeight: {
231
+ regular: string;
232
+ medium: string;
233
+ semibold: string;
234
+ };
235
+ keyframes: {
236
+ 'cube-spinner-vector-0': {
237
+ '0%, 100%': {
238
+ opacity: string;
239
+ };
240
+ '33.3%, 66.6%': {
241
+ opacity: string;
242
+ };
243
+ };
244
+ 'cube-spinner-vector-1': {
245
+ '0%, 66.6%, 100%': {
246
+ opacity: string;
247
+ };
248
+ '33.3%': {
249
+ opacity: string;
250
+ };
251
+ };
252
+ 'cube-spinner-vector-2': {
253
+ '0%, 33.3%, 100%': {
254
+ opacity: string;
255
+ };
256
+ '66.6%': {
257
+ opacity: string;
258
+ };
259
+ };
260
+ 'cube-dot-spinner-120-vector-0': {
261
+ '0%, 100%': {
262
+ opacity: string;
263
+ };
264
+ '33.3%, 66.6%': {
265
+ opacity: string;
266
+ };
267
+ };
268
+ 'cube-dot-spinner-120-vector-1': {
269
+ '0%, 66.6%, 100%': {
270
+ opacity: string;
271
+ };
272
+ '33.3%': {
273
+ opacity: string;
274
+ };
275
+ };
276
+ 'cube-dot-spinner-120-vector-2': {
277
+ '0%, 33.3%, 100%': {
278
+ opacity: string;
279
+ };
280
+ '66.6%': {
281
+ opacity: string;
282
+ };
283
+ };
284
+ 'cube-dot-spinner-45-vector-0': {
285
+ '0%, 100%': {
286
+ opacity: string;
287
+ };
288
+ '12.5%, 87.5%': {
289
+ opacity: string;
290
+ };
291
+ };
292
+ 'cube-dot-spinner-45-vector-1': {
293
+ '0%, 25%, 100%': {
294
+ opacity: string;
295
+ };
296
+ '12.5%': {
297
+ opacity: string;
298
+ };
299
+ };
300
+ 'cube-dot-spinner-45-vector-2': {
301
+ '0%, 12.5%, 37.5%, 100%': {
302
+ opacity: string;
303
+ };
304
+ '25%': {
305
+ opacity: string;
306
+ };
307
+ };
308
+ 'cube-dot-spinner-45-vector-3': {
309
+ '0%, 25%, 50%, 100%': {
310
+ opacity: string;
311
+ };
312
+ '37.5%': {
313
+ opacity: string;
314
+ };
315
+ };
316
+ 'cube-dot-spinner-45-vector-4': {
317
+ '0%, 37.5%, 62.5%, 100%': {
318
+ opacity: string;
319
+ };
320
+ '50%': {
321
+ opacity: string;
322
+ };
323
+ };
324
+ 'cube-dot-spinner-45-vector-5': {
325
+ '0%, 50%, 75%, 100%': {
326
+ opacity: string;
327
+ };
328
+ '62.5%': {
329
+ opacity: string;
330
+ };
331
+ };
332
+ 'cube-dot-spinner-45-vector-6': {
333
+ '0%, 62.5%, 87.5%, 100%': {
334
+ opacity: string;
335
+ };
336
+ '75%': {
337
+ opacity: string;
338
+ };
339
+ };
340
+ 'cube-dot-spinner-45-vector-7': {
341
+ '0%, 75%, 100%': {
342
+ opacity: string;
343
+ };
344
+ '87.5%': {
345
+ opacity: string;
346
+ };
347
+ };
348
+ 'cube-skeleton': {
349
+ '100%': {
350
+ backgroundPositionX: string;
351
+ };
352
+ };
353
+ };
354
+ animation: {
355
+ 'cube-spinner-vector-0': string;
356
+ 'cube-spinner-vector-1': string;
357
+ 'cube-spinner-vector-2': string;
358
+ 'cube-dot-spinner-120-vector-0': string;
359
+ 'cube-dot-spinner-120-vector-1': string;
360
+ 'cube-dot-spinner-120-vector-2': string;
361
+ 'cube-dot-spinner-45-vector-0': string;
362
+ 'cube-dot-spinner-45-vector-1': string;
363
+ 'cube-dot-spinner-45-vector-2': string;
364
+ 'cube-dot-spinner-45-vector-3': string;
365
+ 'cube-dot-spinner-45-vector-4': string;
366
+ 'cube-dot-spinner-45-vector-5': string;
367
+ 'cube-dot-spinner-45-vector-6': string;
368
+ 'cube-dot-spinner-45-vector-7': string;
369
+ 'cube-skeleton': string;
370
+ };
371
+ };
372
+ };
373
+ plugins: tailwindcss_types_config.PluginCreator[];
374
+ };
375
+
376
+ type FlattenObjectKeysInternal<T extends Record<string | number, unknown>, Separator extends string = '.', ExcludedKeys extends string | number = '', Key = keyof T> = Key extends string | number ? Key extends ExcludedKeys ? never : T[Key] extends Record<string | number, unknown> ? `${Key}${Separator}${FlattenObjectKeysInternal<T[Key], Separator, ExcludedKeys>}` : `${Key}` : never;
377
+ type FlattenedObjectKeys<T extends Record<string | number, unknown>, Separator extends string = '.', ExcludedKeys extends string | number = ''> = FlattenObjectKeysInternal<T, Separator, ExcludedKeys>;
378
+
379
+ declare const cubeTheme: {
380
+ screens: {
381
+ 'height-sm': {
382
+ raw: string;
383
+ };
384
+ 'height-md': {
385
+ raw: string;
386
+ };
387
+ 'height-lg': {
388
+ raw: string;
389
+ };
390
+ 'height-xl': {
391
+ raw: string;
392
+ };
393
+ };
394
+ colors: {
395
+ primary: {
396
+ DEFAULT: string;
397
+ 0: string;
398
+ 50: string;
399
+ 100: string;
400
+ 150: string;
401
+ 200: string;
402
+ 300: string;
403
+ 400: string;
404
+ 500: string;
405
+ 600: string;
406
+ 700: string;
407
+ 800: string;
408
+ 850: string;
409
+ };
410
+ secondary: {
411
+ DEFAULT: string;
412
+ 0: string;
413
+ 50: string;
414
+ 100: string;
415
+ 150: string;
416
+ 200: string;
417
+ 300: string;
418
+ 400: string;
419
+ 500: string;
420
+ 600: string;
421
+ 700: string;
422
+ 800: string;
423
+ 850: string;
424
+ };
425
+ dark: {
426
+ 0: string;
427
+ 50: string;
428
+ 100: string;
429
+ 150: string;
430
+ 200: string;
431
+ 300: string;
432
+ 400: string;
433
+ 500: string;
434
+ 600: string;
435
+ 700: string;
436
+ 800: string;
437
+ 850: string;
438
+ };
439
+ grey: {
440
+ 0: string;
441
+ 50: string;
442
+ 100: string;
443
+ 150: string;
444
+ 200: string;
445
+ 300: string;
446
+ 400: string;
447
+ 500: string;
448
+ 600: string;
449
+ 700: string;
450
+ 800: string;
451
+ 850: string;
452
+ };
453
+ blue: {
454
+ 0: string;
455
+ 50: string;
456
+ 100: string;
457
+ 150: string;
458
+ 200: string;
459
+ 300: string;
460
+ 400: string;
461
+ 500: string;
462
+ 600: string;
463
+ 700: string;
464
+ 800: string;
465
+ 850: string;
466
+ };
467
+ green: {
468
+ 0: string;
469
+ 50: string;
470
+ 100: string;
471
+ 150: string;
472
+ 200: string;
473
+ 300: string;
474
+ 400: string;
475
+ 500: string;
476
+ 600: string;
477
+ 700: string;
478
+ 800: string;
479
+ 850: string;
480
+ };
481
+ yellow: {
482
+ 0: string;
483
+ 50: string;
484
+ 100: string;
485
+ 150: string;
486
+ 200: string;
487
+ 300: string;
488
+ 400: string;
489
+ 500: string;
490
+ 600: string;
491
+ 700: string;
492
+ 800: string;
493
+ 850: string;
494
+ };
495
+ red: {
496
+ 0: string;
497
+ 50: string;
498
+ 100: string;
499
+ 150: string;
500
+ 200: string;
501
+ 300: string;
502
+ 400: string;
503
+ 500: string;
504
+ 600: string;
505
+ 700: string;
506
+ 800: string;
507
+ 850: string;
508
+ };
509
+ cosmos: {
510
+ primary: string;
511
+ secondary: string;
512
+ };
513
+ scene: {
514
+ gradient: string;
515
+ background: string;
516
+ };
517
+ functional: {
518
+ title: string;
519
+ text: string;
520
+ 'text-light': string;
521
+ 'hover-primary': string;
522
+ 'hover-secondary': string;
523
+ 'hover-grey': string;
524
+ 'hover-grey-darker': string;
525
+ 'border-divider': string;
526
+ 'border-darker': string;
527
+ disable: string;
528
+ 'disable-text': string;
529
+ 'disable-light': string;
530
+ skeleton: string;
531
+ };
532
+ status: {
533
+ positive: string;
534
+ 'positive-text': string;
535
+ negative: string;
536
+ warning: string;
537
+ paused: string;
538
+ neutral: string;
539
+ 'over-limit': string;
540
+ };
541
+ chart: {
542
+ 1: string;
543
+ 2: string;
544
+ 3: string;
545
+ 4: string;
546
+ 5: string;
547
+ 6: string;
548
+ 7: string;
549
+ 8: string;
550
+ 9: string;
551
+ 10: string;
552
+ 11: string;
553
+ 12: string;
554
+ 13: string;
555
+ 14: string;
556
+ 15: string;
557
+ 16: string;
558
+ 17: string;
559
+ 18: string;
560
+ 19: string;
561
+ 20: string;
562
+ 21: string;
563
+ 22: string;
564
+ 23: string;
565
+ 24: string;
566
+ 25: string;
567
+ 26: string;
568
+ 27: string;
569
+ 28: string;
570
+ 29: string;
571
+ 30: string;
572
+ 31: string;
573
+ 32: string;
574
+ };
575
+ };
576
+ fontFamily: {
577
+ urbanist: [string, string, ...string[]];
578
+ inter: [string, string, ...string[]];
579
+ "noto-sans-tc": [string, ...string[]];
580
+ sans: [string, string, ...string[]];
581
+ };
582
+ fontWeight: {
583
+ regular: string;
584
+ medium: string;
585
+ semibold: string;
586
+ };
587
+ keyframes: {
588
+ 'cube-spinner-vector-0': {
589
+ '0%, 100%': {
590
+ opacity: string;
591
+ };
592
+ '33.3%, 66.6%': {
593
+ opacity: string;
594
+ };
595
+ };
596
+ 'cube-spinner-vector-1': {
597
+ '0%, 66.6%, 100%': {
598
+ opacity: string;
599
+ };
600
+ '33.3%': {
601
+ opacity: string;
602
+ };
603
+ };
604
+ 'cube-spinner-vector-2': {
605
+ '0%, 33.3%, 100%': {
606
+ opacity: string;
607
+ };
608
+ '66.6%': {
609
+ opacity: string;
610
+ };
611
+ };
612
+ 'cube-dot-spinner-120-vector-0': {
613
+ '0%, 100%': {
614
+ opacity: string;
615
+ };
616
+ '33.3%, 66.6%': {
617
+ opacity: string;
618
+ };
619
+ };
620
+ 'cube-dot-spinner-120-vector-1': {
621
+ '0%, 66.6%, 100%': {
622
+ opacity: string;
623
+ };
624
+ '33.3%': {
625
+ opacity: string;
626
+ };
627
+ };
628
+ 'cube-dot-spinner-120-vector-2': {
629
+ '0%, 33.3%, 100%': {
630
+ opacity: string;
631
+ };
632
+ '66.6%': {
633
+ opacity: string;
634
+ };
635
+ };
636
+ 'cube-dot-spinner-45-vector-0': {
637
+ '0%, 100%': {
638
+ opacity: string;
639
+ };
640
+ '12.5%, 87.5%': {
641
+ opacity: string;
642
+ };
643
+ };
644
+ 'cube-dot-spinner-45-vector-1': {
645
+ '0%, 25%, 100%': {
646
+ opacity: string;
647
+ };
648
+ '12.5%': {
649
+ opacity: string;
650
+ };
651
+ };
652
+ 'cube-dot-spinner-45-vector-2': {
653
+ '0%, 12.5%, 37.5%, 100%': {
654
+ opacity: string;
655
+ };
656
+ '25%': {
657
+ opacity: string;
658
+ };
659
+ };
660
+ 'cube-dot-spinner-45-vector-3': {
661
+ '0%, 25%, 50%, 100%': {
662
+ opacity: string;
663
+ };
664
+ '37.5%': {
665
+ opacity: string;
666
+ };
667
+ };
668
+ 'cube-dot-spinner-45-vector-4': {
669
+ '0%, 37.5%, 62.5%, 100%': {
670
+ opacity: string;
671
+ };
672
+ '50%': {
673
+ opacity: string;
674
+ };
675
+ };
676
+ 'cube-dot-spinner-45-vector-5': {
677
+ '0%, 50%, 75%, 100%': {
678
+ opacity: string;
679
+ };
680
+ '62.5%': {
681
+ opacity: string;
682
+ };
683
+ };
684
+ 'cube-dot-spinner-45-vector-6': {
685
+ '0%, 62.5%, 87.5%, 100%': {
686
+ opacity: string;
687
+ };
688
+ '75%': {
689
+ opacity: string;
690
+ };
691
+ };
692
+ 'cube-dot-spinner-45-vector-7': {
693
+ '0%, 75%, 100%': {
694
+ opacity: string;
695
+ };
696
+ '87.5%': {
697
+ opacity: string;
698
+ };
699
+ };
700
+ 'cube-skeleton': {
701
+ '100%': {
702
+ backgroundPositionX: string;
703
+ };
704
+ };
705
+ };
706
+ animation: {
707
+ 'cube-spinner-vector-0': string;
708
+ 'cube-spinner-vector-1': string;
709
+ 'cube-spinner-vector-2': string;
710
+ 'cube-dot-spinner-120-vector-0': string;
711
+ 'cube-dot-spinner-120-vector-1': string;
712
+ 'cube-dot-spinner-120-vector-2': string;
713
+ 'cube-dot-spinner-45-vector-0': string;
714
+ 'cube-dot-spinner-45-vector-1': string;
715
+ 'cube-dot-spinner-45-vector-2': string;
716
+ 'cube-dot-spinner-45-vector-3': string;
717
+ 'cube-dot-spinner-45-vector-4': string;
718
+ 'cube-dot-spinner-45-vector-5': string;
719
+ 'cube-dot-spinner-45-vector-6': string;
720
+ 'cube-dot-spinner-45-vector-7': string;
721
+ 'cube-skeleton': string;
722
+ };
723
+ };
724
+ type BorderColorClass = `border-${FlattenedObjectKeys<typeof cubeTheme.colors, '-', 'DEFAULT'>}`;
725
+ type BackgroundColorClass = `bg-${FlattenedObjectKeys<typeof cubeTheme.colors, '-', 'DEFAULT'>}`;
726
+ type FillColorClass = `fill-${FlattenedObjectKeys<typeof cubeTheme.colors, '-', 'DEFAULT'>}`;
727
+ type StrokeColorClass = `stroke-${FlattenedObjectKeys<typeof cubeTheme.colors, '-', 'DEFAULT'>}`;
728
+ type TextColorClass = `text-${FlattenedObjectKeys<typeof cubeTheme.colors, '-', 'DEFAULT'>}`;
729
+
730
+ type Typography = {
731
+ fontFamily: keyof (typeof cubeTheme)['fontFamily'];
732
+ fontSize: string;
733
+ lineHeight: string;
734
+ letterSpacing: string;
735
+ fontWeight: number;
736
+ };
737
+ declare const typographyMap: {
738
+ readonly 'primary-h1': Typography;
739
+ readonly 'primary-h2': Typography;
740
+ readonly 'primary-h3': Typography;
741
+ readonly 'primary-h4': Typography;
742
+ readonly 'primary-h5': Typography;
743
+ readonly 'secondary-h1': Typography;
744
+ readonly 'secondary-h2': Typography;
745
+ readonly 'secondary-h3': Typography;
746
+ readonly 'secondary-h4': Typography;
747
+ readonly 'secondary-h5': Typography;
748
+ readonly 'primary-body1': Typography;
749
+ readonly 'primary-body2': Typography;
750
+ readonly 'primary-body3': Typography;
751
+ readonly 'primary-body4': Typography;
752
+ readonly 'primary-body5': Typography;
753
+ readonly 'primary-body6': Typography;
754
+ readonly 'secondary-body1': Typography;
755
+ readonly 'secondary-body2': Typography;
756
+ readonly 'secondary-body3': Typography;
757
+ readonly 'secondary-body4': Typography;
758
+ readonly 'secondary-body5': Typography;
759
+ readonly 'secondary-body6': Typography;
760
+ readonly 'secondary-body7': Typography;
761
+ };
762
+ type TypographyClassName = keyof typeof typographyMap;
763
+ declare const getTypography: (className: TypographyClassName) => Typography;
764
+
765
+ export { type BackgroundColorClass, type BorderColorClass, type CubeThemeName, CubeThemeProvider, type CubeThemeProviderProps, type FillColorClass, type StrokeColorClass, type TextColorClass, type Typography, type TypographyClassName, cubePreset, cubeTheme, getTypography };