@qasa/qds-ui 0.26.0 → 0.27.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.
package/dist/index.d.mts DELETED
@@ -1,2245 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as _emotion_react from '@emotion/react';
3
- import { EmotionCache, CSSObject } from '@emotion/react';
4
- import * as react from 'react';
5
- import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, ReactElement, useLayoutEffect } from 'react';
6
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
- import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
8
- import * as _emotion_styled from '@emotion/styled';
9
- import { LucideIcon } from 'lucide-react';
10
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
- import * as RadixSwitch from '@radix-ui/react-switch';
12
- import * as ToastPrimitive from '@radix-ui/react-toast';
13
-
14
- declare const theme: {
15
- mediaQueries: {
16
- readonly smUp: "@media(min-width: 480px)";
17
- readonly mdUp: "@media(min-width: 768px)";
18
- readonly lgUp: "@media(min-width: 1024px)";
19
- readonly xlUp: "@media(min-width: 1280px)";
20
- readonly '2xlUp': "@media(min-width: 1536px)";
21
- };
22
- spacing: {
23
- '0x': string;
24
- '1x': string;
25
- '2x': string;
26
- '3x': string;
27
- '4x': string;
28
- '5x': string;
29
- '6x': string;
30
- '8x': string;
31
- '10x': string;
32
- '12x': string;
33
- '14x': string;
34
- '16x': string;
35
- '20x': string;
36
- '24x': string;
37
- };
38
- breakpoints: {
39
- readonly base: 0;
40
- readonly sm: 480;
41
- readonly md: 768;
42
- readonly lg: 1024;
43
- readonly xl: 1280;
44
- readonly '2xl': 1536;
45
- };
46
- zIndices: {
47
- hide: number;
48
- auto: string;
49
- base: number;
50
- docked: number;
51
- dropdown: number;
52
- sticky: number;
53
- banner: number;
54
- overlay: number;
55
- modal: number;
56
- popover: number;
57
- skipLink: number;
58
- toast: number;
59
- tooltip: number;
60
- };
61
- colors: {
62
- core: {
63
- black: string;
64
- white: string;
65
- gray90: string;
66
- gray80: string;
67
- gray70: string;
68
- gray60: string;
69
- gray50: string;
70
- gray40: string;
71
- gray30: string;
72
- gray20: string;
73
- gray10: string;
74
- pink: string;
75
- uiPink: string;
76
- uiPinkDark: string;
77
- uiPinkLight: string;
78
- brown: string;
79
- brownDark: string;
80
- brownLight: string;
81
- offWhite: string;
82
- offWhiteDark: string;
83
- offWhiteLight: string;
84
- softPink: string;
85
- warmYellow: string;
86
- softYellow: string;
87
- red90: string;
88
- red80: string;
89
- red70: string;
90
- red60: string;
91
- red50: string;
92
- red40: string;
93
- red30: string;
94
- red20: string;
95
- red10: string;
96
- green90: string;
97
- green80: string;
98
- green70: string;
99
- green60: string;
100
- green50: string;
101
- green40: string;
102
- green30: string;
103
- green20: string;
104
- green10: string;
105
- blue90: string;
106
- blue80: string;
107
- blue70: string;
108
- blue60: string;
109
- blue50: string;
110
- blue40: string;
111
- blue30: string;
112
- blue20: string;
113
- blue10: string;
114
- yellow90: string;
115
- yellow80: string;
116
- yellow70: string;
117
- yellow60: string;
118
- yellow50: string;
119
- yellow40: string;
120
- yellow30: string;
121
- yellow20: string;
122
- yellow10: string;
123
- blackAlpha5: string;
124
- blackAlpha10: string;
125
- blackAlpha20: string;
126
- };
127
- bg: {
128
- default: string;
129
- brandPrimary: string;
130
- brandPrimaryHover: string;
131
- brandPrimaryActive: string;
132
- brandSecondary: string;
133
- brandSecondaryHover: string;
134
- brandSecondaryActive: string;
135
- brandTertiary: string;
136
- brandTertiaryHover: string;
137
- brandTertiaryActive: string;
138
- negative: string;
139
- warning: string;
140
- positive: string;
141
- inset: string;
142
- backdrop: string;
143
- };
144
- text: {
145
- strong: string;
146
- default: string;
147
- subtle: string;
148
- disabled: string;
149
- negative: string;
150
- warning: string;
151
- positive: string;
152
- onBrandPrimary: string;
153
- onBrandSecondary: string;
154
- onBrandTertiary: string;
155
- };
156
- icon: {
157
- default: string;
158
- strong: string;
159
- subtle: string;
160
- disabled: string;
161
- negative: string;
162
- warning: string;
163
- positive: string;
164
- onBrandPrimary: string;
165
- onBrandSecondary: string;
166
- onBrandTertiary: string;
167
- };
168
- border: {
169
- default: string;
170
- defaultHover: string;
171
- defaultSelected: string;
172
- strong: string;
173
- subtle: string;
174
- negative: string;
175
- warning: string;
176
- positive: string;
177
- };
178
- };
179
- sizes: {
180
- 112: string;
181
- 128: string;
182
- 144: string;
183
- 160: string;
184
- 176: string;
185
- 192: string;
186
- 224: string;
187
- 256: string;
188
- 288: string;
189
- 320: string;
190
- 384: string;
191
- 448: string;
192
- 512: string;
193
- 576: string;
194
- 672: string;
195
- 768: string;
196
- 896: string;
197
- 1024: string;
198
- '0x': string;
199
- '1x': string;
200
- '2x': string;
201
- '3x': string;
202
- '4x': string;
203
- '5x': string;
204
- '6x': string;
205
- '8x': string;
206
- '10x': string;
207
- '12x': string;
208
- '14x': string;
209
- '16x': string;
210
- '20x': string;
211
- '24x': string;
212
- };
213
- radii: {
214
- none: string;
215
- '2xs': string;
216
- xs: string;
217
- sm: string;
218
- md: string;
219
- lg: string;
220
- xl: string;
221
- '2xl': string;
222
- full: string;
223
- };
224
- shadows: {
225
- none: string;
226
- sm: string;
227
- md: string;
228
- lg: string;
229
- xl: string;
230
- };
231
- typography: {
232
- display: {
233
- '3xl': {
234
- fontFamily: string;
235
- fontWeight: string;
236
- fontSize: string;
237
- lineHeight: string;
238
- letterSpacing: string;
239
- fontFeatureSettings: string;
240
- };
241
- '2xl': {
242
- fontFamily: string;
243
- fontWeight: string;
244
- fontSize: string;
245
- lineHeight: string;
246
- letterSpacing: string;
247
- fontFeatureSettings: string;
248
- };
249
- xl: {
250
- fontFamily: string;
251
- fontWeight: string;
252
- fontSize: string;
253
- lineHeight: string;
254
- letterSpacing: string;
255
- fontFeatureSettings: string;
256
- };
257
- lg: {
258
- fontFamily: string;
259
- fontWeight: string;
260
- fontSize: string;
261
- lineHeight: string;
262
- letterSpacing: string;
263
- fontFeatureSettings: string;
264
- };
265
- md: {
266
- fontFamily: string;
267
- fontWeight: string;
268
- fontSize: string;
269
- lineHeight: string;
270
- letterSpacing: string;
271
- fontFeatureSettings: string;
272
- };
273
- sm: {
274
- fontFamily: string;
275
- fontWeight: string;
276
- fontSize: string;
277
- lineHeight: string;
278
- letterSpacing: string;
279
- fontFeatureSettings: string;
280
- };
281
- xs: {
282
- fontFamily: string;
283
- fontWeight: string;
284
- fontSize: string;
285
- lineHeight: string;
286
- letterSpacing: string;
287
- fontFeatureSettings: string;
288
- };
289
- '2xs': {
290
- fontFamily: string;
291
- fontWeight: string;
292
- fontSize: string;
293
- lineHeight: string;
294
- letterSpacing: string;
295
- fontFeatureSettings: string;
296
- };
297
- };
298
- title: {
299
- lg: {
300
- fontFamily: string;
301
- fontWeight: string;
302
- fontSize: string;
303
- lineHeight: string;
304
- letterSpacing: string;
305
- };
306
- md: {
307
- fontFamily: string;
308
- fontWeight: string;
309
- fontSize: string;
310
- lineHeight: string;
311
- letterSpacing: string;
312
- };
313
- sm: {
314
- fontFamily: string;
315
- fontWeight: string;
316
- fontSize: string;
317
- lineHeight: string;
318
- letterSpacing: string;
319
- };
320
- xs: {
321
- fontFamily: string;
322
- fontWeight: string;
323
- fontSize: string;
324
- lineHeight: string;
325
- letterSpacing: string;
326
- };
327
- '2xs': {
328
- fontFamily: string;
329
- fontWeight: string;
330
- fontSize: string;
331
- lineHeight: string;
332
- letterSpacing: string;
333
- };
334
- '3xs': {
335
- fontFamily: string;
336
- fontWeight: string;
337
- fontSize: string;
338
- lineHeight: string;
339
- letterSpacing: string;
340
- };
341
- };
342
- body: {
343
- xl: {
344
- fontFamily: string;
345
- fontWeight: string;
346
- fontSize: string;
347
- lineHeight: string;
348
- letterSpacing: string;
349
- };
350
- lg: {
351
- fontFamily: string;
352
- fontWeight: string;
353
- fontSize: string;
354
- lineHeight: string;
355
- letterSpacing: string;
356
- };
357
- md: {
358
- fontFamily: string;
359
- fontWeight: string;
360
- fontSize: string;
361
- lineHeight: string;
362
- letterSpacing: string;
363
- };
364
- sm: {
365
- fontFamily: string;
366
- fontWeight: string;
367
- fontSize: string;
368
- lineHeight: string;
369
- letterSpacing: string;
370
- };
371
- xs: {
372
- fontFamily: string;
373
- fontWeight: string;
374
- fontSize: string;
375
- lineHeight: string;
376
- letterSpacing: string;
377
- };
378
- };
379
- label: {
380
- md: {
381
- fontFamily: string;
382
- fontWeight: string;
383
- fontSize: string;
384
- lineHeight: string;
385
- letterSpacing: string;
386
- };
387
- sm: {
388
- fontFamily: string;
389
- fontWeight: string;
390
- fontSize: string;
391
- lineHeight: string;
392
- letterSpacing: string;
393
- };
394
- };
395
- button: {
396
- md: {
397
- fontFamily: string;
398
- fontWeight: string;
399
- fontSize: string;
400
- lineHeight: string;
401
- letterSpacing: string;
402
- };
403
- sm: {
404
- fontFamily: string;
405
- fontWeight: string;
406
- fontSize: string;
407
- lineHeight: string;
408
- letterSpacing: string;
409
- };
410
- };
411
- caption: {
412
- md: {
413
- fontFamily: string;
414
- fontWeight: string;
415
- fontSize: string;
416
- lineHeight: string;
417
- letterSpacing: string;
418
- };
419
- sm: {
420
- fontFamily: string;
421
- fontWeight: string;
422
- fontSize: string;
423
- lineHeight: string;
424
- letterSpacing: string;
425
- };
426
- };
427
- };
428
- };
429
- type Theme = typeof theme;
430
-
431
- type LegitimateAny = any;
432
- type PartialRecord<K extends string | number | symbol, T> = Partial<Record<K, T>>;
433
- type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
434
- type HTMLQdsProps<T extends ElementType> = ComponentPropsWithoutRef<T>;
435
-
436
- type DeepPartial<T> = {
437
- [P in keyof T]?: DeepPartial<T[P]>;
438
- };
439
- interface TypographyOverride {
440
- fontFamily?: string;
441
- fontWeight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
442
- }
443
- type TypographyOverrides = PartialRecord<keyof Theme['typography'], TypographyOverride>;
444
- interface ThemeOverrides {
445
- colors?: DeepPartial<Theme['colors']>;
446
- typography?: TypographyOverrides;
447
- }
448
- declare const overrideTheme: (overrides: ThemeOverrides) => {
449
- typography: {
450
- display: {
451
- '3xl': {
452
- fontFamily: string;
453
- fontWeight: string;
454
- fontSize: string;
455
- lineHeight: string;
456
- letterSpacing: string;
457
- fontFeatureSettings: string;
458
- };
459
- '2xl': {
460
- fontFamily: string;
461
- fontWeight: string;
462
- fontSize: string;
463
- lineHeight: string;
464
- letterSpacing: string;
465
- fontFeatureSettings: string;
466
- };
467
- xl: {
468
- fontFamily: string;
469
- fontWeight: string;
470
- fontSize: string;
471
- lineHeight: string;
472
- letterSpacing: string;
473
- fontFeatureSettings: string;
474
- };
475
- lg: {
476
- fontFamily: string;
477
- fontWeight: string;
478
- fontSize: string;
479
- lineHeight: string;
480
- letterSpacing: string;
481
- fontFeatureSettings: string;
482
- };
483
- md: {
484
- fontFamily: string;
485
- fontWeight: string;
486
- fontSize: string;
487
- lineHeight: string;
488
- letterSpacing: string;
489
- fontFeatureSettings: string;
490
- };
491
- sm: {
492
- fontFamily: string;
493
- fontWeight: string;
494
- fontSize: string;
495
- lineHeight: string;
496
- letterSpacing: string;
497
- fontFeatureSettings: string;
498
- };
499
- xs: {
500
- fontFamily: string;
501
- fontWeight: string;
502
- fontSize: string;
503
- lineHeight: string;
504
- letterSpacing: string;
505
- fontFeatureSettings: string;
506
- };
507
- '2xs': {
508
- fontFamily: string;
509
- fontWeight: string;
510
- fontSize: string;
511
- lineHeight: string;
512
- letterSpacing: string;
513
- fontFeatureSettings: string;
514
- };
515
- };
516
- title: {
517
- lg: {
518
- fontFamily: string;
519
- fontWeight: string;
520
- fontSize: string;
521
- lineHeight: string;
522
- letterSpacing: string;
523
- };
524
- md: {
525
- fontFamily: string;
526
- fontWeight: string;
527
- fontSize: string;
528
- lineHeight: string;
529
- letterSpacing: string;
530
- };
531
- sm: {
532
- fontFamily: string;
533
- fontWeight: string;
534
- fontSize: string;
535
- lineHeight: string;
536
- letterSpacing: string;
537
- };
538
- xs: {
539
- fontFamily: string;
540
- fontWeight: string;
541
- fontSize: string;
542
- lineHeight: string;
543
- letterSpacing: string;
544
- };
545
- '2xs': {
546
- fontFamily: string;
547
- fontWeight: string;
548
- fontSize: string;
549
- lineHeight: string;
550
- letterSpacing: string;
551
- };
552
- '3xs': {
553
- fontFamily: string;
554
- fontWeight: string;
555
- fontSize: string;
556
- lineHeight: string;
557
- letterSpacing: string;
558
- };
559
- };
560
- body: {
561
- xl: {
562
- fontFamily: string;
563
- fontWeight: string;
564
- fontSize: string;
565
- lineHeight: string;
566
- letterSpacing: string;
567
- };
568
- lg: {
569
- fontFamily: string;
570
- fontWeight: string;
571
- fontSize: string;
572
- lineHeight: string;
573
- letterSpacing: string;
574
- };
575
- md: {
576
- fontFamily: string;
577
- fontWeight: string;
578
- fontSize: string;
579
- lineHeight: string;
580
- letterSpacing: string;
581
- };
582
- sm: {
583
- fontFamily: string;
584
- fontWeight: string;
585
- fontSize: string;
586
- lineHeight: string;
587
- letterSpacing: string;
588
- };
589
- xs: {
590
- fontFamily: string;
591
- fontWeight: string;
592
- fontSize: string;
593
- lineHeight: string;
594
- letterSpacing: string;
595
- };
596
- };
597
- label: {
598
- md: {
599
- fontFamily: string;
600
- fontWeight: string;
601
- fontSize: string;
602
- lineHeight: string;
603
- letterSpacing: string;
604
- };
605
- sm: {
606
- fontFamily: string;
607
- fontWeight: string;
608
- fontSize: string;
609
- lineHeight: string;
610
- letterSpacing: string;
611
- };
612
- };
613
- button: {
614
- md: {
615
- fontFamily: string;
616
- fontWeight: string;
617
- fontSize: string;
618
- lineHeight: string;
619
- letterSpacing: string;
620
- };
621
- sm: {
622
- fontFamily: string;
623
- fontWeight: string;
624
- fontSize: string;
625
- lineHeight: string;
626
- letterSpacing: string;
627
- };
628
- };
629
- caption: {
630
- md: {
631
- fontFamily: string;
632
- fontWeight: string;
633
- fontSize: string;
634
- lineHeight: string;
635
- letterSpacing: string;
636
- };
637
- sm: {
638
- fontFamily: string;
639
- fontWeight: string;
640
- fontSize: string;
641
- lineHeight: string;
642
- letterSpacing: string;
643
- };
644
- };
645
- };
646
- colors: {
647
- core: {
648
- black: string;
649
- white: string;
650
- gray90: string;
651
- gray80: string;
652
- gray70: string;
653
- gray60: string;
654
- gray50: string;
655
- gray40: string;
656
- gray30: string;
657
- gray20: string;
658
- gray10: string;
659
- pink: string;
660
- uiPink: string;
661
- uiPinkDark: string;
662
- uiPinkLight: string;
663
- brown: string;
664
- brownDark: string;
665
- brownLight: string;
666
- offWhite: string;
667
- offWhiteDark: string;
668
- offWhiteLight: string;
669
- softPink: string;
670
- warmYellow: string;
671
- softYellow: string;
672
- red90: string;
673
- red80: string;
674
- red70: string;
675
- red60: string;
676
- red50: string;
677
- red40: string;
678
- red30: string;
679
- red20: string;
680
- red10: string;
681
- green90: string;
682
- green80: string;
683
- green70: string;
684
- green60: string;
685
- green50: string;
686
- green40: string;
687
- green30: string;
688
- green20: string;
689
- green10: string;
690
- blue90: string;
691
- blue80: string;
692
- blue70: string;
693
- blue60: string;
694
- blue50: string;
695
- blue40: string;
696
- blue30: string;
697
- blue20: string;
698
- blue10: string;
699
- yellow90: string;
700
- yellow80: string;
701
- yellow70: string;
702
- yellow60: string;
703
- yellow50: string;
704
- yellow40: string;
705
- yellow30: string;
706
- yellow20: string;
707
- yellow10: string;
708
- blackAlpha5: string;
709
- blackAlpha10: string;
710
- blackAlpha20: string;
711
- };
712
- bg: {
713
- default: string;
714
- brandPrimary: string;
715
- brandPrimaryHover: string;
716
- brandPrimaryActive: string;
717
- brandSecondary: string;
718
- brandSecondaryHover: string;
719
- brandSecondaryActive: string;
720
- brandTertiary: string;
721
- brandTertiaryHover: string;
722
- brandTertiaryActive: string;
723
- negative: string;
724
- warning: string;
725
- positive: string;
726
- inset: string;
727
- backdrop: string;
728
- };
729
- text: {
730
- strong: string;
731
- default: string;
732
- subtle: string;
733
- disabled: string;
734
- negative: string;
735
- warning: string;
736
- positive: string;
737
- onBrandPrimary: string;
738
- onBrandSecondary: string;
739
- onBrandTertiary: string;
740
- };
741
- icon: {
742
- default: string;
743
- strong: string;
744
- subtle: string;
745
- disabled: string;
746
- negative: string;
747
- warning: string;
748
- positive: string;
749
- onBrandPrimary: string;
750
- onBrandSecondary: string;
751
- onBrandTertiary: string;
752
- };
753
- border: {
754
- default: string;
755
- defaultHover: string;
756
- defaultSelected: string;
757
- strong: string;
758
- subtle: string;
759
- negative: string;
760
- warning: string;
761
- positive: string;
762
- };
763
- };
764
- mediaQueries: {
765
- readonly smUp: "@media(min-width: 480px)";
766
- readonly mdUp: "@media(min-width: 768px)";
767
- readonly lgUp: "@media(min-width: 1024px)";
768
- readonly xlUp: "@media(min-width: 1280px)";
769
- readonly '2xlUp': "@media(min-width: 1536px)";
770
- };
771
- spacing: {
772
- '0x': string;
773
- '1x': string;
774
- '2x': string;
775
- '3x': string;
776
- '4x': string;
777
- '5x': string;
778
- '6x': string;
779
- '8x': string;
780
- '10x': string;
781
- '12x': string;
782
- '14x': string;
783
- '16x': string;
784
- '20x': string;
785
- '24x': string;
786
- };
787
- breakpoints: {
788
- readonly base: 0;
789
- readonly sm: 480;
790
- readonly md: 768;
791
- readonly lg: 1024;
792
- readonly xl: 1280;
793
- readonly '2xl': 1536;
794
- };
795
- zIndices: {
796
- hide: number;
797
- auto: string;
798
- base: number;
799
- docked: number;
800
- dropdown: number;
801
- sticky: number;
802
- banner: number;
803
- overlay: number;
804
- modal: number;
805
- popover: number;
806
- skipLink: number;
807
- toast: number;
808
- tooltip: number;
809
- };
810
- sizes: {
811
- 112: string;
812
- 128: string;
813
- 144: string;
814
- 160: string;
815
- 176: string;
816
- 192: string;
817
- 224: string;
818
- 256: string;
819
- 288: string;
820
- 320: string;
821
- 384: string;
822
- 448: string;
823
- 512: string;
824
- 576: string;
825
- 672: string;
826
- 768: string;
827
- 896: string;
828
- 1024: string;
829
- '0x': string;
830
- '1x': string;
831
- '2x': string;
832
- '3x': string;
833
- '4x': string;
834
- '5x': string;
835
- '6x': string;
836
- '8x': string;
837
- '10x': string;
838
- '12x': string;
839
- '14x': string;
840
- '16x': string;
841
- '20x': string;
842
- '24x': string;
843
- };
844
- radii: {
845
- none: string;
846
- '2xs': string;
847
- xs: string;
848
- sm: string;
849
- md: string;
850
- lg: string;
851
- xl: string;
852
- '2xl': string;
853
- full: string;
854
- };
855
- shadows: {
856
- none: string;
857
- sm: string;
858
- md: string;
859
- lg: string;
860
- xl: string;
861
- };
862
- };
863
-
864
- declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "sv", "fi", "fr", "nb"];
865
- type LanguageCode = (typeof SUPPORTED_LANGUAGE_CODES)[number];
866
-
867
- interface QdsProviderProps {
868
- children: ReactNode;
869
- themeOverrides?: ThemeOverrides;
870
- emotionCache?: EmotionCache;
871
- locale: LanguageCode;
872
- }
873
- declare function QdsProvider({ children, themeOverrides, emotionCache, locale }: QdsProviderProps): react_jsx_runtime.JSX.Element;
874
-
875
- type BreakpointsConfig$1<T> = PartialRecord<keyof Theme['breakpoints'], T> & {
876
- base: T;
877
- };
878
- type ResponsiveProp<T> = T | BreakpointsConfig$1<T>;
879
-
880
- declare const SIZE_MAP: {
881
- xs: number;
882
- sm: number;
883
- md: number;
884
- lg: number;
885
- xl: number;
886
- '2xl': number;
887
- };
888
- type AvatarSize = keyof typeof SIZE_MAP;
889
- interface AvatarOptions {
890
- /**
891
- * Source url of the image to display. If not passed
892
- * it will display a fallback icon.
893
- */
894
- src?: string;
895
- /**
896
- * Name of the user. Used to generate the initials
897
- * if no image is provided, but also for accessibility.
898
- */
899
- name?: string;
900
- /**
901
- * Size of the avatar
902
- * @default 'md'
903
- */
904
- size?: ResponsiveProp<AvatarSize>;
905
- }
906
- interface AvatarProps extends HTMLQdsProps<'span'>, AvatarOptions {
907
- }
908
- declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
909
-
910
- /**
911
- * This file is originally from `@radix-ui/react-polymorphic` before the package
912
- * was deprecated. The original source for this lived in the URL below.
913
- *
914
- * @see https://github.com/radix-ui/primitives/blob/17ffcb7aaa42cbd36b3c210ba86d7d73d218e5be/packages/react/polymorphic/src/polymorphic.ts
915
- */
916
-
917
- /**
918
- * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
919
- */
920
- type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
921
- /**
922
- * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
923
- */
924
- type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
925
- type ForwardRefExoticComponent<E, OwnProps> = react.ForwardRefExoticComponent<Merge<E extends react.ElementType ? react.ComponentPropsWithRef<E> : never, OwnProps & {
926
- as?: E;
927
- }>>;
928
- interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}> extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
929
- /**
930
- * When `as` prop is passed, use this overload.
931
- * Merges original own props (without DOM props) and the inferred props
932
- * from `as` element with the own props taking precendence.
933
- *
934
- * We explicitly avoid `React.ElementType` and manually narrow the prop types
935
- * so that events are typed when using JSX.IntrinsicElements.
936
- */
937
- <As = IntrinsicElementString>(props: As extends '' ? {
938
- as: keyof react.JSX.IntrinsicElements;
939
- } : As extends react.ComponentType<infer P> ? Merge<P, OwnProps & {
940
- as: As;
941
- }> : As extends keyof react.JSX.IntrinsicElements ? Merge<react.JSX.IntrinsicElements[As], OwnProps & {
942
- as: As;
943
- }> : never): react.ReactElement | null;
944
- }
945
- /**
946
- * Infers the props of a React component
947
- */
948
- type PropsOf<E> = E extends react.ComponentType<infer P> ? P : never;
949
-
950
- type IconSize = 16 | 20 | 24 | 32;
951
- type IconColor = keyof Theme['colors']['icon'] | 'currentColor';
952
- interface IconOptions {
953
- /**
954
- * The size of the icon.
955
- *
956
- * @default 24
957
- */
958
- size?: IconSize;
959
- /**
960
- * The color of the icon.
961
- *
962
- * @default 'default'
963
- */
964
- color?: IconColor;
965
- }
966
- type OmittedProps$9 = 'color' | 'onClick' | 'width' | 'height' | 'fontSize';
967
- interface IconProps extends Omit<SVGAttributes<SVGElement>, OmittedProps$9>, IconOptions {
968
- }
969
-
970
- interface CreateIconOptions {
971
- /**
972
- * The `svg`'s `viewBox` attribute
973
- */
974
- viewBox: string;
975
- /**
976
- * If the `svg` has a single path, simply copy the path's `d` attribute
977
- */
978
- d?: string;
979
- /**
980
- * The `svg` path or group element
981
- *
982
- * @example
983
- * ```jsx
984
- * createIcon({
985
- * viewBox: '0 0 512 512',
986
- * path: [
987
- * <circle cx="50" cy="50" r="50" />,
988
- * <path d="M10 10" />,
989
- * ],
990
- * displayName: 'ExampleIcon',
991
- * })
992
- * ```
993
- */
994
- path?: React.ReactElement | React.ReactElement[];
995
- /**
996
- * The display name of the icon. Useful for debugging
997
- * and internal use.
998
- */
999
- displayName?: string;
1000
- }
1001
- /**
1002
- * Helper function to create an icon component.
1003
- */
1004
- declare const createIcon: (options: CreateIconOptions) => react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1005
-
1006
- declare const createLucideIcon: (Icon: LucideIcon) => react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1007
-
1008
- declare const AlertCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1009
- declare const AlertTriangleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1010
- declare const ArrowDownIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1011
- declare const ArrowLeftIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1012
- declare const ArrowRightIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1013
- declare const ArrowUpIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1014
- declare const BellIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1015
- declare const BellOffIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1016
- declare const BookmarkIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1017
- declare const CalendarIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1018
- declare const CameraIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1019
- declare const CheckCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1020
- declare const CheckIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1021
- declare const ChevronDownIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1022
- declare const ChevronLeftIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1023
- declare const ChevronRightIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1024
- declare const ChevronUpIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1025
- declare const GlobeIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1026
- declare const HeartFilledIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1027
- declare const HeartIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1028
- declare const HelpCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1029
- declare const HistoryIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1030
- declare const HomeIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1031
- declare const ImageIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1032
- declare const InfoIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1033
- declare const ListIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1034
- declare const ListFilterIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1035
- declare const LogOutIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1036
- declare const MapIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1037
- declare const MapPinIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1038
- declare const MenuIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1039
- declare const MessageCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1040
- declare const MinusIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1041
- declare const MoreHorizontalIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1042
- declare const MoreVerticalIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1043
- declare const PenIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1044
- declare const PlusIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1045
- declare const SearchIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1046
- declare const SettingsIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1047
- declare const ShareIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1048
- declare const SlidersIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1049
- declare const StarFilledIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1050
- declare const StarIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1051
- declare const TrashIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1052
- declare const UserIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1053
- declare const XCircleIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1054
- declare const XIcon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<SVGSVGElement>>;
1055
-
1056
- type NamedStyles = Record<string, CSSObject>;
1057
- type StyleInterpolation<T> = (theme: Theme) => T;
1058
- /**
1059
- * Creates a collection of named style rules.
1060
- */
1061
- declare function createStyleVariants<T extends NamedStyles>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1062
- /**
1063
- * Create a style object. Useful for creating styles that depend on the theme.
1064
- */
1065
- declare function createStyle<T extends CSSObject>(styles: StyleInterpolation<T>): (theme: Theme) => T;
1066
- type VariantProps<T extends ReturnType<typeof createStyle | typeof createStyleVariants>> = keyof ReturnType<T>;
1067
- /**
1068
- * Converts css `px` unit to `rem`.
1069
- * Assumes the root font size is 16px.
1070
- */
1071
- declare const pxToRem: (px: number) => string;
1072
-
1073
- declare const getFormFieldBaseStyles: (theme: Theme) => {
1074
- '&::placeholder': {
1075
- color: string;
1076
- };
1077
- '&:hover': {
1078
- borderColor: string;
1079
- };
1080
- '&:focus': {
1081
- outline: number;
1082
- borderColor: string;
1083
- boxShadow: `0 0 0 1px ${string}`;
1084
- };
1085
- '&[aria-invalid="true"]': {
1086
- borderColor: string;
1087
- '&:focus': {
1088
- boxShadow: `0 0 0 1px ${string}`;
1089
- };
1090
- };
1091
- '&[disabled], &:disabled, &[data-disabled]': {
1092
- opacity: number;
1093
- borderColor: string;
1094
- };
1095
- transitionProperty: "opacity, border-color, box-shadow";
1096
- transitionDuration: "120ms";
1097
- transitionTimingFunction: "ease";
1098
- fontFamily: string;
1099
- fontWeight: string;
1100
- fontSize: string;
1101
- lineHeight: string;
1102
- letterSpacing: string;
1103
- width: string;
1104
- minWidth: number;
1105
- appearance: "none";
1106
- paddingLeft: string;
1107
- paddingRight: string;
1108
- border: string;
1109
- borderRadius: string;
1110
- backgroundColor: string;
1111
- color: string;
1112
- WebkitTouchCallout: "none";
1113
- WebkitTapHighlightColor: "transparent";
1114
- '&::-webkit-date-and-time-value': {
1115
- textAlign: "left";
1116
- };
1117
- alignItems: "center";
1118
- };
1119
-
1120
- declare const getSizeStyles$4: (theme: Theme) => {
1121
- xs: {
1122
- fontFamily: string;
1123
- fontWeight: string;
1124
- fontSize: string;
1125
- lineHeight: string;
1126
- letterSpacing: string;
1127
- height: string;
1128
- paddingLeft: string;
1129
- paddingRight: string;
1130
- };
1131
- sm: {
1132
- fontFamily: string;
1133
- fontWeight: string;
1134
- fontSize: string;
1135
- lineHeight: string;
1136
- letterSpacing: string;
1137
- height: string;
1138
- paddingLeft: string;
1139
- paddingRight: string;
1140
- };
1141
- md: {
1142
- fontFamily: string;
1143
- fontWeight: string;
1144
- fontSize: string;
1145
- lineHeight: string;
1146
- letterSpacing: string;
1147
- height: string;
1148
- paddingLeft: string;
1149
- paddingRight: string;
1150
- };
1151
- lg: {
1152
- fontFamily: string;
1153
- fontWeight: string;
1154
- fontSize: string;
1155
- lineHeight: string;
1156
- letterSpacing: string;
1157
- height: string;
1158
- paddingLeft: string;
1159
- paddingRight: string;
1160
- };
1161
- xl: {
1162
- fontFamily: string;
1163
- fontWeight: string;
1164
- fontSize: string;
1165
- lineHeight: string;
1166
- letterSpacing: string;
1167
- height: string;
1168
- paddingLeft: string;
1169
- paddingRight: string;
1170
- };
1171
- };
1172
- type ButtonSize = VariantProps<typeof getSizeStyles$4>;
1173
- declare const getVariantStyles$2: (theme: Theme) => {
1174
- primary: {
1175
- background: string;
1176
- color: string;
1177
- ":not([disabled])": {
1178
- '@media(hover: hover)': {
1179
- ':hover': {
1180
- background: string;
1181
- };
1182
- };
1183
- ':active': {
1184
- background: string;
1185
- };
1186
- };
1187
- };
1188
- secondary: {
1189
- background: string;
1190
- color: string;
1191
- ":not([disabled])": {
1192
- '@media(hover: hover)': {
1193
- ':hover': {
1194
- background: string;
1195
- };
1196
- };
1197
- ':active': {
1198
- background: string;
1199
- };
1200
- };
1201
- };
1202
- tertiary: {
1203
- background: string;
1204
- color: string;
1205
- ":not([disabled])": {
1206
- '@media(hover: hover)': {
1207
- ':hover': {
1208
- background: string;
1209
- };
1210
- };
1211
- ':active': {
1212
- background: string;
1213
- };
1214
- };
1215
- };
1216
- };
1217
- type ButtonVariant = VariantProps<typeof getVariantStyles$2>;
1218
-
1219
- interface ButtonOptions {
1220
- /**
1221
- * Sets the size of the button
1222
- * @default 'md'
1223
- */
1224
- size?: ResponsiveProp<ButtonSize>;
1225
- /**
1226
- * Sets the style variant of the button
1227
- * @default 'secondary'
1228
- */
1229
- variant?: ButtonVariant;
1230
- /**
1231
- * If `true` the button will fill its container
1232
- * @default false
1233
- */
1234
- isFullWidth?: boolean;
1235
- /**
1236
- * If `true` the button will show a spinner
1237
- * @default false
1238
- */
1239
- isLoading?: boolean;
1240
- /**
1241
- * If `true` the button will be disabled
1242
- * @default false
1243
- */
1244
- isDisabled?: boolean;
1245
- /**
1246
- * Icon to display before the button label
1247
- */
1248
- iconLeft?: ElementType<IconProps>;
1249
- /**
1250
- * Icon to display after the button label
1251
- */
1252
- iconRight?: ElementType<IconProps>;
1253
- /**
1254
- * The HTML `type` attribute
1255
- * @default 'button'
1256
- */
1257
- type?: 'button' | 'submit' | 'reset';
1258
- }
1259
-
1260
- type PolymorphicButton = ForwardRefComponent<'button', ButtonOptions>;
1261
- type ButtonProps = PropsOf<PolymorphicButton>;
1262
- declare const Button: PolymorphicButton;
1263
-
1264
- type DisplaySize = keyof Theme['typography']['display'];
1265
- type DisplayTextAlign = 'left' | 'center' | 'right';
1266
- type DisplayTextWrap = 'pretty' | 'balance' | 'wrap' | 'nowrap' | 'stable';
1267
- interface DisplayTextOptions {
1268
- /**
1269
- * Sets the visual size of the display text.
1270
- * To override the rendered tag, use the `as` prop.
1271
- *
1272
- * @default 'md'
1273
- */
1274
- size?: ResponsiveProp<DisplaySize>;
1275
- /**
1276
- * Sets the text alignment
1277
- *
1278
- * @default 'left'
1279
- */
1280
- textAlign?: DisplayTextAlign;
1281
- /**
1282
- * Sets the text wrapping
1283
- *
1284
- * See [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap)
1285
- *
1286
- * @default 'pretty'
1287
- */
1288
- textWrap?: DisplayTextWrap;
1289
- }
1290
- type DisplayTextComponent = ForwardRefComponent<'h2', DisplayTextOptions>;
1291
- type DisplayTextProps = PropsOf<DisplayTextComponent>;
1292
- declare const DisplayText: DisplayTextComponent;
1293
-
1294
- interface CheckboxOptions {
1295
- /**
1296
- * The label for the checkbox. Accepts a string, or a React component for rendering links within the label.
1297
- *
1298
- * @example
1299
- * ```jsx
1300
- * <Checkbox label="I agree to the terms and conditions" />
1301
- * ```
1302
- *
1303
- * @example
1304
- * ```jsx
1305
- * <Checkbox
1306
- * label={
1307
- * <>
1308
- * I agree to <Link href="/terms">the terms and conditions</Link>
1309
- * </>
1310
- * }
1311
- * />
1312
- * ```
1313
- */
1314
- label: string | ReactElement<unknown>;
1315
- /**
1316
- * Text that provides additional guidance to the user
1317
- */
1318
- helperText?: string;
1319
- /**
1320
- * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
1321
- */
1322
- isDefaultChecked?: boolean;
1323
- /**
1324
- * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
1325
- */
1326
- defaultChecked?: boolean;
1327
- /**
1328
- * The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
1329
- */
1330
- isChecked?: boolean;
1331
- /**
1332
- * The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
1333
- */
1334
- checked?: boolean;
1335
- /**
1336
- * Event handler called when the checked state of the checkbox changes.
1337
- */
1338
- onCheckedChange?: (checked: boolean) => void;
1339
- /**
1340
- * If `true` the checkbox will render in its invalid state.
1341
- * @default false
1342
- */
1343
- isInvalid?: boolean;
1344
- /**
1345
- * The error message to display if `isInvalid` is `true`
1346
- */
1347
- errorMessage?: string;
1348
- /**
1349
- * If `true` it prevents the user from interacting with the checkbox.
1350
- * @default false
1351
- */
1352
- isDisabled?: boolean;
1353
- /**
1354
- * If `true` the user must check the checkbox before the owning form can be submitted.
1355
- * @default false
1356
- */
1357
- isRequired?: boolean;
1358
- /**
1359
- * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
1360
- */
1361
- name?: string;
1362
- /**
1363
- * The value given as data when submitted with a `name`.
1364
- */
1365
- value?: string;
1366
- }
1367
- type CheckboxProps = Omit<CheckboxPrimitive.CheckboxProps, 'asChild' | 'children' | 'checked' | 'defaultChecked' | keyof CheckboxOptions> & CheckboxOptions;
1368
- declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps, "children" | "asChild" | keyof CheckboxOptions> & CheckboxOptions & react.RefAttributes<HTMLButtonElement>>;
1369
-
1370
- interface DividerOptions {
1371
- /**
1372
- * The orientation of the divider.
1373
- *
1374
- * @default 'horizontal'
1375
- */
1376
- orientation?: 'horizontal' | 'vertical';
1377
- }
1378
- interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
1379
- }
1380
- declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
1381
-
1382
- type PrimitiveContentProps = DropdownPrimitive.DropdownMenuContentProps;
1383
- interface DropdownMenuContentOptions {
1384
- /**
1385
- * Event handler called when focus moves to the trigger after closing.
1386
- * It can be prevented by calling `event.preventDefault`.
1387
- */
1388
- onCloseAutofocus?: PrimitiveContentProps['onCloseAutoFocus'];
1389
- /**
1390
- * Event handler called when the escape key is down.
1391
- * It can be prevented by calling `event.preventDefault`.
1392
- */
1393
- onEscapeKeyDown?: PrimitiveContentProps['onEscapeKeyDown'];
1394
- /**
1395
- * Event handler called when a pointer event occurs outside the bounds of the component.
1396
- * It can be prevented by calling `event.preventDefault`.
1397
- */
1398
- onPointerDownOutside?: PrimitiveContentProps['onPointerDownOutside'];
1399
- /**
1400
- * Event handler called when focus moves outside the bounds of the component.
1401
- * It can be prevented by calling `event.preventDefault`.
1402
- */
1403
- onFocusOutside?: PrimitiveContentProps['onFocusOutside'];
1404
- /**
1405
- * Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component.
1406
- * It can be prevented by calling `event.preventDefault`.
1407
- */
1408
- onInteractOutside?: PrimitiveContentProps['onInteractOutside'];
1409
- /**
1410
- * The preferred side of the trigger to render against when open.
1411
- * Will be reversed when collisions occur and `avoidCollisions` is enabled.
1412
- *
1413
- * @default "bottom"
1414
- */
1415
- side?: PrimitiveContentProps['side'];
1416
- /**
1417
- * The distance in pixels from the trigger.
1418
- *
1419
- * @default 8
1420
- */
1421
- sideOffset?: PrimitiveContentProps['sideOffset'];
1422
- /**
1423
- * The preferred alignment against the trigger. May change when collisions occur.
1424
- *
1425
- * @default "center"
1426
- */
1427
- align?: PrimitiveContentProps['align'];
1428
- /**
1429
- * The element used as the collision boundary.
1430
- * By default this is the viewport, though you can provide additional element(s) to be included in this check.
1431
- *
1432
- * @default []
1433
- */
1434
- collisionBoundary?: PrimitiveContentProps['collisionBoundary'];
1435
- /**
1436
- * Whether to hide the content when the trigger becomes fully occluded.
1437
- *
1438
- * @default false
1439
- */
1440
- hideWhenDetached?: PrimitiveContentProps['hideWhenDetached'];
1441
- }
1442
- interface DropdownMenuContentProps extends HTMLQdsProps<'div'>, DropdownMenuContentOptions {
1443
- }
1444
-
1445
- type DropdownMenuDividerProps = HTMLQdsProps<'div'>;
1446
-
1447
- interface DropdownMenuItemOptions {
1448
- /**
1449
- * If `true`, the item will be disabled
1450
- */
1451
- isDisabled?: boolean;
1452
- /**
1453
- * Event handler called when the user selects an item (via mouse or keyboard).
1454
- * Calling `event.preventDefault` in this handler will prevent the dropdown from closing when selecting that item.
1455
- */
1456
- onSelect?: (event: Event) => void;
1457
- /**
1458
- * Optional text used for typeahead purposes.
1459
- * By default the typeahead behavior will use the `.textContent` of the item.
1460
- * Use this when the content is complex, or you have non-textual content inside.
1461
- */
1462
- textValue?: string;
1463
- /**
1464
- * Optional icon to display on the left side of the item content.
1465
- */
1466
- icon?: ElementType<IconProps>;
1467
- }
1468
- interface DropdownMenuItemProps extends Omit<DropdownPrimitive.DropdownMenuItemProps, 'asChild' | keyof DropdownMenuItemOptions>, DropdownMenuItemOptions {
1469
- }
1470
-
1471
- type DropdownTriggerComponent = ForwardRefComponent<'button'>;
1472
- type DropdownMenuTriggerProps = PropsOf<DropdownTriggerComponent>;
1473
-
1474
- interface DropdownMenuRootProps {
1475
- children: ReactNode;
1476
- /**
1477
- * If `true` the dropdown menu will be open
1478
- */
1479
- isOpen?: boolean;
1480
- /**
1481
- * The open state of the submenu when it is initially rendered.
1482
- * Use when you do not need to control its open state.
1483
- */
1484
- defaultOpen?: boolean;
1485
- /**
1486
- * Callback invoked open state changes
1487
- */
1488
- onOpenChange?: (isOpen: boolean) => void;
1489
- }
1490
- declare function DropdownMenuRoot(props: DropdownMenuRootProps): react_jsx_runtime.JSX.Element;
1491
- declare const DropdownMenu: typeof DropdownMenuRoot & {
1492
- Trigger: ForwardRefComponent<"button", {}>;
1493
- Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
1494
- Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
1495
- Divider: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
1496
- };
1497
-
1498
- type HeadingSize = keyof Theme['typography']['title'];
1499
- type HeadingColor = keyof Theme['colors']['text'];
1500
- interface HeadingOptions {
1501
- /**
1502
- * Sets the visual size of the heading.
1503
- * To override the rendered tag, use the `as` prop.
1504
- *
1505
- * @default 'md'
1506
- */
1507
- size?: ResponsiveProp<HeadingSize>;
1508
- /**
1509
- * Sets the color of the heading
1510
- * @default 'default'
1511
- */
1512
- color?: HeadingColor;
1513
- /**
1514
- * Truncates the heading after a specific number of lines
1515
- */
1516
- numberOfLines?: number;
1517
- /**
1518
- * Alignment of the heading
1519
- * @default 'left'
1520
- */
1521
- textAlign?: 'left' | 'center' | 'right';
1522
- }
1523
- type HeadingComponent = ForwardRefComponent<'h2', HeadingOptions>;
1524
- type HeadingProps = PropsOf<HeadingComponent>;
1525
- declare const Heading: HeadingComponent;
1526
-
1527
- type HintBoxTitleProps = HTMLQdsProps<'span'>;
1528
- type HintBoxProps = HTMLQdsProps<'aside'>;
1529
- declare const HintBox: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>> & {
1530
- Title: _emotion_styled.StyledComponent<{
1531
- theme?: _emotion_react.Theme;
1532
- as?: React.ElementType;
1533
- }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
1534
- };
1535
-
1536
- declare const getSizeStyles$3: (theme: Theme) => {
1537
- xs: {
1538
- width: string;
1539
- height: string;
1540
- };
1541
- sm: {
1542
- width: string;
1543
- height: string;
1544
- };
1545
- md: {
1546
- width: string;
1547
- height: string;
1548
- };
1549
- };
1550
- declare const getVariantStyles$1: (theme: Theme) => {
1551
- primary: {
1552
- background: string;
1553
- color: string;
1554
- ":not([disabled])": {
1555
- '@media(hover: hover)': {
1556
- ':hover': {
1557
- background: string;
1558
- };
1559
- };
1560
- ':active': {
1561
- background: string;
1562
- };
1563
- };
1564
- };
1565
- secondary: {
1566
- background: string;
1567
- color: string;
1568
- ":not([disabled])": {
1569
- '@media(hover: hover)': {
1570
- ':hover': {
1571
- background: string;
1572
- };
1573
- };
1574
- ':active': {
1575
- background: string;
1576
- };
1577
- };
1578
- };
1579
- tertiary: {
1580
- background: string;
1581
- color: string;
1582
- ":not([disabled])": {
1583
- '@media(hover: hover)': {
1584
- ':hover': {
1585
- background: string;
1586
- };
1587
- };
1588
- ':active': {
1589
- background: string;
1590
- };
1591
- };
1592
- };
1593
- ghost: {
1594
- color: string;
1595
- ":not([disabled])": {
1596
- '@media(hover: hover)': {
1597
- ':hover': {
1598
- background: string;
1599
- };
1600
- };
1601
- ':active': {
1602
- background: string;
1603
- };
1604
- };
1605
- };
1606
- white: {
1607
- background: string;
1608
- color: string;
1609
- ":not([disabled])": {
1610
- '@media(hover: hover)': {
1611
- ':hover': {
1612
- background: string;
1613
- };
1614
- };
1615
- ':active': {
1616
- background: string;
1617
- };
1618
- };
1619
- };
1620
- };
1621
-
1622
- type IconButtonSize = VariantProps<typeof getSizeStyles$3>;
1623
- type IconButtonVariant = VariantProps<typeof getVariantStyles$1>;
1624
- interface IconButtonOptions {
1625
- icon: ElementType<IconProps>;
1626
- /**
1627
- * A visually hidden label read by screen readers.
1628
- *
1629
- */
1630
- label: string;
1631
- /**
1632
- * Defines the size of the button
1633
- */
1634
- size?: ResponsiveProp<IconButtonSize>;
1635
- /**
1636
- * Sets the style variant of the button
1637
- */
1638
- variant?: IconButtonVariant;
1639
- /**
1640
- * If `true` the button will be disabled
1641
- */
1642
- isDisabled?: boolean;
1643
- }
1644
- type IconButtonComponent = ForwardRefComponent<'button', IconButtonOptions>;
1645
- type IconButtonProps = PropsOf<IconButtonComponent>;
1646
- declare const IconButton: IconButtonComponent;
1647
-
1648
- interface InputBaseOptions {
1649
- /**
1650
- * If `true`, the input will be invalid
1651
- */
1652
- isInvalid?: boolean;
1653
- /**
1654
- * If `true`, the input will be disabled
1655
- */
1656
- isDisabled?: boolean;
1657
- /**
1658
- * If `true` the input will be required
1659
- */
1660
- isRequired?: boolean;
1661
- }
1662
- type OmittedProps$8 = 'children' | 'readOnly' | 'size' | 'disabled' | 'required';
1663
- interface InputBaseProps extends Omit<HTMLQdsProps<'input'>, OmittedProps$8>, InputBaseOptions {
1664
- }
1665
- declare const InputBase: react.ForwardRefExoticComponent<InputBaseProps & react.RefAttributes<HTMLInputElement>>;
1666
-
1667
- interface TextFieldOptions extends InputBaseOptions {
1668
- /**
1669
- * The label for the input
1670
- */
1671
- label: string;
1672
- /**
1673
- * The error message to display if `isInvalid` is `true`
1674
- */
1675
- errorMessage?: string;
1676
- /**
1677
- * If `true`, the input will display an optional indicator.
1678
- * If the `isRequired` prop is also `true`, this prop will be ignored.
1679
- */
1680
- isOptional?: boolean;
1681
- /**
1682
- * Text that provides additional guidance to the user
1683
- */
1684
- helperText?: string;
1685
- /**
1686
- * Suffixed text to display after the input.
1687
- * This is useful for e.g. displaying units of measurement.
1688
- */
1689
- suffix?: string;
1690
- }
1691
- type OmittedProps$7 = 'children' | 'readOnly' | 'size';
1692
- interface TextFieldProps extends Omit<HTMLQdsProps<'input'>, OmittedProps$7>, TextFieldOptions {
1693
- }
1694
- declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
1695
-
1696
- declare const getSizeStyles$2: (theme: Theme) => {
1697
- sm: {
1698
- fontFamily: string;
1699
- fontWeight: string;
1700
- fontSize: string;
1701
- lineHeight: string;
1702
- letterSpacing: string;
1703
- };
1704
- md: {
1705
- fontFamily: string;
1706
- fontWeight: string;
1707
- fontSize: string;
1708
- lineHeight: string;
1709
- letterSpacing: string;
1710
- };
1711
- };
1712
- type LabelSize = VariantProps<typeof getSizeStyles$2>;
1713
- type LabelColor = keyof Theme['colors']['text'];
1714
- interface LabelOptions {
1715
- /**
1716
- * Size of the label
1717
- */
1718
- size?: ResponsiveProp<LabelSize>;
1719
- /**
1720
- * Sets the color of the label
1721
- * @default 'default'
1722
- */
1723
- color?: LabelColor;
1724
- }
1725
- type LabelComponent = ForwardRefComponent<'label', LabelOptions>;
1726
- type LabelProps = PropsOf<LabelComponent>;
1727
- declare const Label: LabelComponent;
1728
-
1729
- interface LinkOptions {
1730
- /**
1731
- * The URL to link to.
1732
- */
1733
- href?: string;
1734
- /**
1735
- * If `true`, the link will open in new tab
1736
- */
1737
- isExternal?: boolean;
1738
- }
1739
- type LinkComponent = ForwardRefComponent<'a', LinkOptions>;
1740
- type LinkProps = PropsOf<LinkComponent>;
1741
- declare const Link: LinkComponent;
1742
-
1743
- declare const getSizeStyles$1: (theme: Theme) => {
1744
- sm: {
1745
- fontSize: string;
1746
- };
1747
- md: {
1748
- fontSize: string;
1749
- };
1750
- };
1751
- type LoadingDotsSize = VariantProps<typeof getSizeStyles$1>;
1752
- interface LoadingDotsOptions {
1753
- size?: ResponsiveProp<LoadingDotsSize>;
1754
- }
1755
- interface LoadingDotsProps extends HTMLQdsProps<'span'>, LoadingDotsOptions {
1756
- }
1757
- declare const LoadingDots: react.ForwardRefExoticComponent<LoadingDotsProps & react.RefAttributes<HTMLSpanElement>>;
1758
-
1759
- declare const getSizeStyles: (theme: Theme) => {
1760
- xs: {
1761
- fontFamily: string;
1762
- fontWeight: string;
1763
- fontSize: string;
1764
- lineHeight: string;
1765
- letterSpacing: string;
1766
- };
1767
- sm: {
1768
- fontFamily: string;
1769
- fontWeight: string;
1770
- fontSize: string;
1771
- lineHeight: string;
1772
- letterSpacing: string;
1773
- };
1774
- md: {
1775
- fontFamily: string;
1776
- fontWeight: string;
1777
- fontSize: string;
1778
- lineHeight: string;
1779
- letterSpacing: string;
1780
- };
1781
- lg: {
1782
- fontFamily: string;
1783
- fontWeight: string;
1784
- fontSize: string;
1785
- lineHeight: string;
1786
- letterSpacing: string;
1787
- };
1788
- xl: {
1789
- fontFamily: string;
1790
- fontWeight: string;
1791
- fontSize: string;
1792
- lineHeight: string;
1793
- letterSpacing: string;
1794
- };
1795
- };
1796
- type ParagraphSize = VariantProps<typeof getSizeStyles>;
1797
- type ParagraphColor = keyof Theme['colors']['text'];
1798
- interface ParagraphOptions {
1799
- /**
1800
- * Sets the visual size of the text
1801
- * @default 'md'
1802
- */
1803
- size?: ResponsiveProp<ParagraphSize>;
1804
- /**
1805
- * Sets the color of the text
1806
- * @default 'normal'
1807
- */
1808
- color?: ParagraphColor;
1809
- /**
1810
- * Truncates the text after a specific number of lines
1811
- */
1812
- numberOfLines?: number;
1813
- /**
1814
- * Alignment of the paragraph
1815
- * @default 'left'
1816
- */
1817
- textAlign?: 'left' | 'center' | 'right';
1818
- }
1819
- type ParagraphComponent = ForwardRefComponent<'p', ParagraphOptions>;
1820
- type ParagraphProps = PropsOf<ParagraphComponent>;
1821
- declare const Paragraph: ParagraphComponent;
1822
-
1823
- interface SelectBaseOptions {
1824
- /**
1825
- * The placeholder for the select. We render an `<option/>` element that has
1826
- * empty value.
1827
- *
1828
- * ```jsx
1829
- * <option value="">{placeholder}</option>
1830
- * ```
1831
- */
1832
- placeholder?: string;
1833
- /**
1834
- * If `true`, the select will be invalid
1835
- */
1836
- isInvalid?: boolean;
1837
- /**
1838
- * If `true`, the select will be disabled
1839
- */
1840
- isDisabled?: boolean;
1841
- /**
1842
- * If `true` the select will be required
1843
- */
1844
- isRequired?: boolean;
1845
- }
1846
- type OmittedProps$6 = 'readOnly' | 'size' | 'multiple' | 'disabled' | 'required';
1847
- interface SelectBaseProps extends Omit<HTMLQdsProps<'select'>, OmittedProps$6>, SelectBaseOptions {
1848
- }
1849
- declare const SelectBase: react.ForwardRefExoticComponent<SelectBaseProps & react.RefAttributes<HTMLSelectElement>>;
1850
-
1851
- type ResizeProp = 'none' | 'both' | 'horizontal' | 'vertical';
1852
- type MinRowsProp = number;
1853
- interface TextareaBaseOptions {
1854
- /**
1855
- * If `true`, the textarea will be invalid
1856
- */
1857
- isInvalid?: boolean;
1858
- /**
1859
- * If `true`, the textarea will be disabled
1860
- */
1861
- isDisabled?: boolean;
1862
- /**
1863
- * If `true` the textarea will be required
1864
- */
1865
- isRequired?: boolean;
1866
- /**
1867
- * The resize behavior of the textarea
1868
- *
1869
- * @default 'vertical'
1870
- */
1871
- resize?: ResizeProp;
1872
- /**
1873
- * The minimum number of rows to display without requiring scrolling or resizing.
1874
- * To disabled resizing use the `resize` prop.
1875
- *
1876
- * @default 3
1877
- */
1878
- minRows?: MinRowsProp;
1879
- }
1880
- type OmittedProps$5 = 'children' | 'readOnly' | 'size' | 'disabled' | 'required' | 'rows' | 'cols';
1881
- interface TextareaBaseProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$5>, TextareaBaseOptions {
1882
- }
1883
- declare const TextareaBase: react.ForwardRefExoticComponent<TextareaBaseProps & react.RefAttributes<HTMLTextAreaElement>>;
1884
-
1885
- interface RadioCardOptions {
1886
- /**
1887
- * The label for the radio card
1888
- */
1889
- label: string;
1890
- /**
1891
- * Text that provides additional guidance to the user
1892
- */
1893
- helperText?: string;
1894
- /**
1895
- * If `true` the user must check the radio item before the owning form can be submitted.
1896
- * @default false
1897
- */
1898
- isRequired?: boolean;
1899
- /**
1900
- * If `true` it prevents the user from interacting with the radio item.
1901
- * @default false
1902
- */
1903
- isDisabled?: boolean;
1904
- }
1905
- interface RadioCardProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, 'asChild' | keyof RadioCardOptions>, RadioCardOptions {
1906
- }
1907
-
1908
- interface RadioButtonOptions {
1909
- /**
1910
- * The label for the radio button
1911
- */
1912
- label: string;
1913
- /**
1914
- * If `true` the user must check the radio item before the owning form can be submitted.
1915
- * @default false
1916
- */
1917
- isRequired?: boolean;
1918
- /**
1919
- * If `true` it prevents the user from interacting with the radio item.
1920
- * @default false
1921
- */
1922
- isDisabled?: boolean;
1923
- }
1924
- interface RadioButtonProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, 'asChild' | keyof RadioButtonOptions>, RadioButtonOptions {
1925
- }
1926
-
1927
- type RadioGroupLabelProps = HTMLQdsProps<'span'>;
1928
-
1929
- interface RadioGroupOptions {
1930
- /**
1931
- * The value of the radio item that should be checked when initially rendered.
1932
- * Use when you do not need to control the state of the radio items.
1933
- */
1934
- defaultValue?: string;
1935
- /**
1936
- * The controlled value of the radio item to check.
1937
- * Should be used in conjunction with `onValueChange`.
1938
- */
1939
- value?: string;
1940
- /**
1941
- * Event handler called when the value changes.
1942
- */
1943
- onValueChange?: (value: string) => void;
1944
- /**
1945
- * The name of the group. Submitted with its owning form as part of a name/value pair.
1946
- */
1947
- name?: string;
1948
- /**
1949
- * If `true` all child radio items will be disabled.
1950
- * @default false
1951
- */
1952
- isDisabled?: boolean;
1953
- /**
1954
- * If `true` the user must check a radio item before the owning form can be submitted.
1955
- * @default false
1956
- */
1957
- isRequired?: boolean;
1958
- /**
1959
- * If `true` the radio group will be invalid.
1960
- * @default false
1961
- */
1962
- isInvalid?: boolean;
1963
- /**
1964
- * The error message to display if `isInvalid` is `true`
1965
- */
1966
- errorMessage?: string;
1967
- }
1968
- interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, 'asChild' | keyof RadioGroupOptions>, RadioGroupOptions {
1969
- }
1970
- declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>> & {
1971
- Card: react.ForwardRefExoticComponent<RadioCardProps & react.RefAttributes<HTMLButtonElement>>;
1972
- Button: react.ForwardRefExoticComponent<RadioButtonProps & react.RefAttributes<HTMLButtonElement>>;
1973
- Label: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & react.RefAttributes<HTMLSpanElement>>;
1974
- };
1975
-
1976
- interface SelectOptionOptions {
1977
- isDisabled?: boolean;
1978
- }
1979
- type OmittedProps$4 = 'disabled' | 'label';
1980
- interface SelectOptionProps extends Omit<HTMLQdsProps<'option'>, OmittedProps$4>, SelectOptionOptions {
1981
- }
1982
-
1983
- interface SelectOptions extends SelectBaseOptions {
1984
- /**
1985
- * The label for the select field
1986
- */
1987
- label: string;
1988
- /**
1989
- * The error message to display if `isInvalid` is `true`
1990
- */
1991
- errorMessage?: string;
1992
- /**
1993
- * Text that provides additional guidance to the user
1994
- */
1995
- helperText?: string;
1996
- /**
1997
- * If `true`, the select field will display an optional indicator.
1998
- * If the `isRequired` prop is also `true`, this prop will be ignored.
1999
- */
2000
- isOptional?: boolean;
2001
- }
2002
- type OmittedProps$3 = 'readOnly' | 'size';
2003
- interface SelectProps extends Omit<HTMLQdsProps<'select'>, OmittedProps$3>, SelectOptions {
2004
- }
2005
- declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>> & {
2006
- Option: react.ForwardRefExoticComponent<SelectOptionProps & react.RefAttributes<HTMLOptionElement>>;
2007
- };
2008
-
2009
- type Spacing = keyof Theme['spacing'];
2010
- interface SpacerOptions {
2011
- axis?: 'x' | 'y';
2012
- size: ResponsiveProp<Spacing>;
2013
- }
2014
- interface SpacerProps extends HTMLQdsProps<'span'>, SpacerOptions {
2015
- }
2016
- declare const Spacer: react.ForwardRefExoticComponent<SpacerProps & react.RefAttributes<HTMLSpanElement>>;
2017
-
2018
- type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
2019
- type JustifyContent = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
2020
- type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
2021
- type FlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
2022
-
2023
- type GapProp = keyof Theme['spacing'];
2024
- interface StackOptions {
2025
- /**
2026
- * The direction of the stack.
2027
- * @default 'column'
2028
- */
2029
- direction?: ResponsiveProp<FlexDirection>;
2030
- /**
2031
- * The CSS `justify-content` property.
2032
- * Controls the alignment of items on the main axis.
2033
- */
2034
- justifyContent?: ResponsiveProp<JustifyContent>;
2035
- /**
2036
- * The CSS `align-items` property.
2037
- * Controls the alignment of items on the cross axis.
2038
- */
2039
- alignItems?: ResponsiveProp<AlignItems>;
2040
- /**
2041
- * The CSS `flex-wrap` property.
2042
- * Controls whether children can wrap onto multiple lines.
2043
- * @default 'nowrap'
2044
- */
2045
- wrap?: FlexWrap;
2046
- /**
2047
- * The gap between each child element.
2048
- */
2049
- gap?: ResponsiveProp<GapProp>;
2050
- /**
2051
- * A divider element to be rendered between each child element.
2052
- *
2053
- * _Note: For the divider to be rendered, the child elements can't be loose strings or numbers.
2054
- * Wrap them in a `div` or other element._
2055
- */
2056
- divider?: ReactNode;
2057
- }
2058
- type StackComponent = ForwardRefComponent<'div', StackOptions>;
2059
- type StackProps = PropsOf<StackComponent>;
2060
- declare const Stack: StackComponent;
2061
-
2062
- interface SwitchOptions {
2063
- /**
2064
- * The label for the switch
2065
- */
2066
- label: string;
2067
- /**
2068
- * The text that appears below the label
2069
- * to provide additional guidance to the user
2070
- */
2071
- helperText?: string;
2072
- /**
2073
- * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
2074
- */
2075
- isDefaultChecked?: boolean;
2076
- /**
2077
- * If `true`, the switch will be checked
2078
- */
2079
- isChecked?: boolean;
2080
- /**
2081
- * If `true`, the switch will be disabled and
2082
- * cannot be interacted with
2083
- */
2084
- isDisabled?: boolean;
2085
- /**
2086
- * If `true`, indicates that the switch is required
2087
- */
2088
- isRequired?: boolean;
2089
- onCheckedChange?: (isChecked: boolean) => void;
2090
- }
2091
- interface SwitchProps extends Omit<RadixSwitch.SwitchProps, 'asChild' | keyof SwitchOptions>, SwitchOptions {
2092
- }
2093
- declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
2094
-
2095
- interface TextareaOptions extends TextareaBaseOptions {
2096
- /**
2097
- * The label for the textarea field
2098
- */
2099
- label: string;
2100
- /**
2101
- * The error message to display if `isInvalid` is `true`
2102
- */
2103
- errorMessage?: string;
2104
- /**
2105
- * Text that provides additional guidance to the user
2106
- */
2107
- helperText?: string;
2108
- /**
2109
- * If `true`, the input will display an optional indicator.
2110
- * If the `isRequired` prop is also `true`, this prop will be ignored.
2111
- */
2112
- isOptional?: boolean;
2113
- }
2114
- type OmittedProps$2 = 'children' | 'readOnly' | 'size';
2115
- interface TextareaProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$2>, TextareaOptions {
2116
- }
2117
- declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
2118
-
2119
- declare const getVariantStyles: (theme: Theme) => {
2120
- neutral: {
2121
- background: string;
2122
- color: string;
2123
- };
2124
- error: {
2125
- background: string;
2126
- color: string;
2127
- };
2128
- };
2129
- type ToastVariant = VariantProps<typeof getVariantStyles>;
2130
-
2131
- type Id = number | string;
2132
- interface ToastOptions$1 {
2133
- /**
2134
- * Unique identifier for the toast (can be used for removing it prematurely). If a toast with this
2135
- * identifier already exists it will be removed before the new toast is added.
2136
- * @default a random unique id will be set and returned
2137
- */
2138
- id?: Id;
2139
- }
2140
- declare const toast: ((text: string, options?: ToastOptions$1) => Id) & {
2141
- error: (text: string, options?: ToastOptions$1) => Id;
2142
- remove: (id: Id) => void;
2143
- removeAll: () => void;
2144
- };
2145
-
2146
- interface ToastOptions {
2147
- text: string;
2148
- variant?: ToastVariant;
2149
- }
2150
- type OmittedProps$1 = 'children';
2151
- interface ToastProps extends Omit<HTMLQdsProps<'div'>, OmittedProps$1>, ToastOptions {
2152
- }
2153
- declare function Toast(props: ToastProps & ToastPrimitive.ToastProps): react_jsx_runtime.JSX.Element;
2154
-
2155
- interface UseBreakpointOptions {
2156
- /**
2157
- * If `true` the initial value will be `base` instead of the current breakpoint.
2158
- * This is to support hydration when using server side rendering.
2159
- *
2160
- * @default false
2161
- */
2162
- ssr?: boolean;
2163
- }
2164
- /**
2165
- * Hook for getting the current breakpoint.
2166
- */
2167
- declare function useBreakpoint(params?: UseBreakpointOptions): {
2168
- currentBreakpoint: "2xl" | "base" | "xl" | "lg" | "md" | "sm";
2169
- };
2170
-
2171
- type Breakpoints = Theme['breakpoints'];
2172
- type BreakpointsConfig<T> = PartialRecord<keyof Breakpoints, T> & {
2173
- base: T;
2174
- };
2175
- type UseBreakpointValueProps<T> = BreakpointsConfig<T>;
2176
- /**
2177
- * Hook for getting a value based on the current breakpoint.
2178
- *
2179
- * @example
2180
- * const width = useBreakpointValue({ base: '150px', md: '250px' })
2181
- */
2182
- declare function useBreakpointValue<T>(values: UseBreakpointValueProps<T>, options?: UseBreakpointOptions): T;
2183
-
2184
- type FormFieldElement = 'input' | 'select' | 'textarea';
2185
- type PropGetter<T extends ElementType = LegitimateAny> = (props?: HTMLQdsProps<T>) => Record<string, unknown>;
2186
- interface FormFieldOptions {
2187
- /**
2188
- * The label for the form field
2189
- */
2190
- label: string;
2191
- /**
2192
- * The error message to display if `isInvalid` is `true`
2193
- */
2194
- errorMessage?: string;
2195
- /**
2196
- * Text that provides additional guidance to the user
2197
- */
2198
- helperText?: string;
2199
- /**
2200
- * If `true`, the form field will be invalid
2201
- */
2202
- isInvalid?: boolean;
2203
- /**
2204
- * If `true`, the form field will be disabled
2205
- */
2206
- isDisabled?: boolean;
2207
- /**
2208
- * If `true` the form field will be required
2209
- */
2210
- isRequired?: boolean;
2211
- }
2212
- type OmittedProps = 'children' | 'readOnly' | 'size';
2213
- type UseFormFieldProps<T extends FormFieldElement> = Omit<HTMLQdsProps<T>, OmittedProps> & FormFieldOptions;
2214
- /**
2215
- * Custom hook that returns props for a form field's label, input, helper text and error message.
2216
- * Meant to be used in conjunction with the `Input`, `Select` or `Textarea` component.
2217
- *
2218
- * Used internally by `TextField`, `Select` and `Textarea`.
2219
- */
2220
- declare const useFormField: <T extends FormFieldElement>(props: UseFormFieldProps<T>) => {
2221
- getLabelProps: PropGetter<"label">;
2222
- /**
2223
- * Props to be spread on the input, select or textarea element.
2224
- * Function accepts an optional object of props to be merged with the returned props.
2225
- */
2226
- getFieldProps: PropGetter<T>;
2227
- getHelperTextProps: PropGetter<"div">;
2228
- getErrorMessageProps: PropGetter<"div">;
2229
- };
2230
-
2231
- /**
2232
- * Returns a stable ID that is unique to the component instance.
2233
- */
2234
- declare function useStableId(fixedId?: string | null): string;
2235
-
2236
- /**
2237
- * On the server, React emits a warning when calling `useLayoutEffect`.
2238
- * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
2239
- * We use this safe version which suppresses the warning by replacing it with a noop on the server.
2240
- *
2241
- * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
2242
- */
2243
- declare const useSafeLayoutEffect: typeof useLayoutEffect;
2244
-
2245
- export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, type AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, type ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, type CreateIconOptions, DisplayText, type DisplayTextProps, Divider, type DividerProps, DropdownMenu, type DropdownMenuContentProps, type DropdownMenuDividerProps, type DropdownMenuItemProps, type DropdownMenuRootProps, type DropdownMenuTriggerProps, type ForwardRefComponent, GlobeIcon, Heading, type HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, type HintBoxProps, type HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, type IconButtonProps, type IconProps, ImageIcon, InfoIcon, InputBase, type InputBaseOptions, type InputBaseProps, type IntrinsicElement, Label, type LabelProps, Link, type LinkProps, ListFilterIcon, ListIcon, LoadingDots, type LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, type OwnProps, Paragraph, type ParagraphProps, PenIcon, PlusIcon, type PropsOf, QdsProvider, type RadioButtonProps, type RadioCardProps, RadioGroup, type RadioGroupLabelProps, type RadioGroupProps, SearchIcon, Select, SelectBase, type SelectBaseOptions, type SelectOptionProps, type SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, type SpacerProps, Stack, type StackProps, StarFilledIcon, StarIcon, Switch, type SwitchProps, TextField, type TextFieldProps, Textarea, TextareaBase, type TextareaBaseOptions, type TextareaBaseProps, type TextareaProps, type Theme, type ThemeOverrides, Toast, TrashIcon, type UseBreakpointOptions, type UseBreakpointValueProps, type UseFormFieldProps, UserIcon, type VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, toast, useBreakpoint, useBreakpointValue, useFormField, useSafeLayoutEffect, useStableId };