@qasa/qds-ui 0.10.0-next.1 → 0.10.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/cjs/index.js +1322 -1328
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/checkbox/checkbox.d.ts +70 -0
  4. package/dist/cjs/types/components/checkbox/index.d.ts +1 -0
  5. package/dist/cjs/types/components/display-text/display-text.d.ts +29 -0
  6. package/dist/cjs/types/components/display-text/index.d.ts +1 -0
  7. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
  8. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
  9. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
  10. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
  11. package/dist/cjs/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
  12. package/dist/cjs/types/components/dropdown-menu/index.d.ts +1 -0
  13. package/dist/cjs/types/components/heading/heading.d.ts +1 -445
  14. package/dist/cjs/types/components/index.d.ts +5 -1
  15. package/dist/cjs/types/components/radio-group/radio-card.d.ts +5 -2
  16. package/dist/cjs/types/components/radio-group/radio-group-label.d.ts +2 -2
  17. package/dist/cjs/types/components/radio-group/radio-group.d.ts +1 -1
  18. package/dist/cjs/types/components/switch/index.d.ts +1 -0
  19. package/dist/cjs/types/components/switch/switch.d.ts +35 -0
  20. package/dist/cjs/types/components/toast/index.d.ts +1 -0
  21. package/dist/cjs/types/components/toast/toast-provider.d.ts +4 -0
  22. package/dist/cjs/types/components/toast/toast-store.d.ts +44 -0
  23. package/dist/cjs/types/components/toast/toast-styles.d.ts +410 -0
  24. package/dist/cjs/types/components/toast/toast.d.ts +13 -0
  25. package/dist/cjs/types/styles/common-styles.d.ts +1 -1
  26. package/dist/cjs/types/theme/foundations/radius.d.ts +1 -1
  27. package/dist/cjs/types/utils/html-attributes.d.ts +1 -0
  28. package/dist/esm/index.js +1323 -1328
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/types/components/checkbox/checkbox.d.ts +70 -0
  31. package/dist/esm/types/components/checkbox/index.d.ts +1 -0
  32. package/dist/esm/types/components/display-text/display-text.d.ts +29 -0
  33. package/dist/esm/types/components/display-text/index.d.ts +1 -0
  34. package/dist/esm/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
  35. package/dist/esm/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
  36. package/dist/esm/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
  37. package/dist/esm/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
  38. package/dist/esm/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
  39. package/dist/esm/types/components/dropdown-menu/index.d.ts +1 -0
  40. package/dist/esm/types/components/heading/heading.d.ts +1 -445
  41. package/dist/esm/types/components/index.d.ts +5 -1
  42. package/dist/esm/types/components/radio-group/radio-card.d.ts +5 -2
  43. package/dist/esm/types/components/radio-group/radio-group-label.d.ts +2 -2
  44. package/dist/esm/types/components/radio-group/radio-group.d.ts +1 -1
  45. package/dist/esm/types/components/switch/index.d.ts +1 -0
  46. package/dist/esm/types/components/switch/switch.d.ts +35 -0
  47. package/dist/esm/types/components/toast/index.d.ts +1 -0
  48. package/dist/esm/types/components/toast/toast-provider.d.ts +4 -0
  49. package/dist/esm/types/components/toast/toast-store.d.ts +44 -0
  50. package/dist/esm/types/components/toast/toast-styles.d.ts +410 -0
  51. package/dist/esm/types/components/toast/toast.d.ts +13 -0
  52. package/dist/esm/types/styles/common-styles.d.ts +1 -1
  53. package/dist/esm/types/theme/foundations/radius.d.ts +1 -1
  54. package/dist/esm/types/utils/html-attributes.d.ts +1 -0
  55. package/dist/index.d.ts +352 -543
  56. package/package.json +11 -4
  57. package/dist/cjs/types/components/image/image.d.ts +0 -16
  58. package/dist/cjs/types/components/image/index.d.ts +0 -1
  59. package/dist/esm/types/components/image/image.d.ts +0 -16
  60. package/dist/esm/types/components/image/index.d.ts +0 -1
package/dist/index.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  import * as react from 'react';
3
- import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, useLayoutEffect } from 'react';
3
+ import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, ReactElement, useLayoutEffect } from 'react';
4
4
  import { Options } from '@emotion/cache';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { CSSObject } from '@emotion/react';
7
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
8
+ import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
7
9
  import * as _emotion_styled from '@emotion/styled';
8
10
  import { LucideIcon } from 'lucide-react';
9
11
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
+ import * as RadixSwitch from '@radix-ui/react-switch';
10
13
 
11
14
  declare const theme: {
12
15
  mediaQueries: {
@@ -922,8 +925,8 @@ interface IconOptions {
922
925
  */
923
926
  color?: IconColor;
924
927
  }
925
- declare type OmittedProps$9 = 'color' | 'onClick' | 'width' | 'height' | 'fontSize';
926
- interface IconProps extends Omit<SVGAttributes<SVGElement>, OmittedProps$9>, IconOptions {
928
+ declare type OmittedProps$8 = 'color' | 'onClick' | 'width' | 'height' | 'fontSize';
929
+ interface IconProps extends Omit<SVGAttributes<SVGElement>, OmittedProps$8>, IconOptions {
927
930
  }
928
931
 
929
932
  interface CreateIconOptions {
@@ -1443,7 +1446,7 @@ declare const getFormFieldBaseStyles: (theme: {
1443
1446
  borderColor: string;
1444
1447
  boxShadow: `0 0 0 1px ${string}`;
1445
1448
  };
1446
- '&[aria-invalid=true]': {
1449
+ '&[aria-invalid="true"]': {
1447
1450
  borderColor: string;
1448
1451
  '&:focus': {
1449
1452
  boxShadow: `0 0 0 1px ${string}`;
@@ -1478,7 +1481,7 @@ declare const getFormFieldBaseStyles: (theme: {
1478
1481
  alignItems: "center";
1479
1482
  };
1480
1483
 
1481
- declare const getSizeStyles$5: (theme: {
1484
+ declare const getSizeStyles$4: (theme: {
1482
1485
  mediaQueries: {
1483
1486
  readonly smUp: "@media(min-width: 480px)";
1484
1487
  readonly mdUp: "@media(min-width: 768px)";
@@ -1928,7 +1931,7 @@ declare const getSizeStyles$5: (theme: {
1928
1931
  paddingRight: string;
1929
1932
  };
1930
1933
  };
1931
- declare type ButtonSize = VariantProps<typeof getSizeStyles$5>;
1934
+ declare type ButtonSize = VariantProps<typeof getSizeStyles$4>;
1932
1935
  declare const getVariantStyles$1: (theme: {
1933
1936
  mediaQueries: {
1934
1937
  readonly smUp: "@media(min-width: 480px)";
@@ -2349,535 +2352,303 @@ declare const getVariantStyles$1: (theme: {
2349
2352
  '@media(hover: hover)': {
2350
2353
  ':hover': {
2351
2354
  background: string;
2352
- };
2353
- };
2354
- ':active': {
2355
- background: string;
2356
- };
2357
- };
2358
- };
2359
- tertiary: {
2360
- background: string;
2361
- color: string;
2362
- ":not([disabled])": {
2363
- '@media(hover: hover)': {
2364
- ':hover': {
2365
- background: string;
2366
- };
2367
- };
2368
- ':active': {
2369
- background: string;
2370
- };
2371
- };
2372
- };
2373
- };
2374
- declare type ButtonVariant = VariantProps<typeof getVariantStyles$1>;
2375
-
2376
- interface ButtonOptions {
2377
- /**
2378
- * Sets the size of the button
2379
- * @default 'md'
2380
- */
2381
- size?: ButtonSize;
2382
- /**
2383
- * Sets the style variant of the button
2384
- * @default 'secondary'
2385
- */
2386
- variant?: ButtonVariant;
2387
- /**
2388
- * If `true` the button will fill its container
2389
- * @default false
2390
- */
2391
- isFullWidth?: boolean;
2392
- /**
2393
- * If `true` the button will show a spinner
2394
- * @default false
2395
- */
2396
- isLoading?: boolean;
2397
- /**
2398
- * If `true` the button will be disabled
2399
- * @default false
2400
- */
2401
- isDisabled?: boolean;
2402
- /**
2403
- * Icon to display before the button label
2404
- */
2405
- iconLeft?: ElementType<IconProps>;
2406
- /**
2407
- * Icon to display after the button label
2408
- */
2409
- iconRight?: ElementType<IconProps>;
2410
- /**
2411
- * The HTML `type` attribute
2412
- * @default 'button'
2413
- */
2414
- type?: 'button' | 'submit' | 'reset';
2415
- }
2416
-
2417
- declare type PolymorphicButton = ForwardRefComponent<'button', ButtonOptions>;
2418
- declare type ButtonProps = PropsOf<PolymorphicButton>;
2419
- declare const Button: PolymorphicButton;
2420
-
2421
- interface DividerOptions {
2422
- /**
2423
- * The orientation of the divider.
2424
- *
2425
- * @default 'horizontal'
2426
- */
2427
- orientation?: 'horizontal' | 'vertical';
2428
- }
2429
- interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
2430
- }
2431
- declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
2432
-
2433
- declare const getSizeStyles$4: (theme: {
2434
- mediaQueries: {
2435
- readonly smUp: "@media(min-width: 480px)";
2436
- readonly mdUp: "@media(min-width: 768px)";
2437
- readonly lgUp: "@media(min-width: 1024px)";
2438
- readonly xlUp: "@media(min-width: 1280px)";
2439
- readonly '2xlUp': "@media(min-width: 1536px)";
2440
- };
2441
- spacing: {
2442
- '0x': string;
2443
- '1x': string;
2444
- '2x': string;
2445
- '3x': string;
2446
- '4x': string;
2447
- '5x': string;
2448
- '6x': string;
2449
- '8x': string;
2450
- '12x': string;
2451
- '16x': string;
2452
- '20x': string;
2453
- '24x': string;
2454
- };
2455
- breakpoints: {
2456
- readonly base: 0;
2457
- readonly sm: 480;
2458
- readonly md: 768;
2459
- readonly lg: 1024;
2460
- readonly xl: 1280;
2461
- readonly '2xl': 1536;
2462
- };
2463
- zIndices: {
2464
- hide: number;
2465
- auto: string;
2466
- base: number;
2467
- docked: number;
2468
- dropdown: number;
2469
- sticky: number;
2470
- banner: number;
2471
- overlay: number;
2472
- modal: number;
2473
- popover: number;
2474
- skipLink: number;
2475
- toast: number;
2476
- tooltip: number;
2477
- };
2478
- colors: {
2479
- core: {
2480
- black: string;
2481
- white: string;
2482
- gray90: string;
2483
- gray80: string;
2484
- gray70: string;
2485
- gray60: string;
2486
- gray50: string;
2487
- gray40: string;
2488
- gray30: string;
2489
- gray20: string;
2490
- gray10: string;
2491
- uiPink: string;
2492
- uiPinkDark: string;
2493
- uiPinkLight: string;
2494
- brown: string;
2495
- brownDark: string;
2496
- brownLight: string;
2497
- offWhite: string;
2498
- offWhiteDark: string;
2499
- offWhiteLight: string;
2500
- softPink: string;
2501
- warmYellow: string;
2502
- softYellow: string;
2503
- red10: string;
2504
- red20: string;
2505
- red30: string;
2506
- red40: string;
2507
- red50: string;
2508
- red60: string;
2509
- red70: string;
2510
- red80: string;
2511
- red90: string;
2512
- green90: string;
2513
- green80: string;
2514
- green70: string;
2515
- green60: string;
2516
- green50: string;
2517
- green40: string;
2518
- green30: string;
2519
- green20: string;
2520
- green10: string;
2521
- blue90: string;
2522
- blue80: string;
2523
- blue70: string;
2524
- blue60: string;
2525
- blue50: string;
2526
- blue40: string;
2527
- blue30: string;
2528
- blue20: string;
2529
- blue10: string;
2530
- yellow90: string;
2531
- yellow80: string;
2532
- yellow70: string;
2533
- yellow60: string;
2534
- yellow50: string;
2535
- yellow40: string;
2536
- yellow30: string;
2537
- yellow20: string;
2538
- yellow10: string;
2539
- blackAlpha20: string;
2540
- };
2541
- bg: {
2542
- default: string;
2543
- brandPrimary: string;
2544
- brandPrimaryHover: string;
2545
- brandPrimaryActive: string;
2546
- brandSecondary: string;
2547
- brandSecondaryHover: string;
2548
- brandSecondaryActive: string;
2549
- brandTertiary: string;
2550
- brandTertiaryHover: string;
2551
- brandTertiaryActive: string;
2552
- negative: string;
2553
- warning: string;
2554
- positive: string;
2555
- inset: string;
2556
- backdrop: string;
2557
- };
2558
- text: {
2559
- strong: string;
2560
- default: string;
2561
- subtle: string;
2562
- disabled: string;
2563
- negative: string;
2564
- warning: string;
2565
- positive: string;
2566
- onBrandPrimary: string;
2567
- onBrandSecondary: string;
2568
- onBrandTertiary: string;
2569
- };
2570
- icon: {
2571
- default: string;
2572
- strong: string;
2573
- subtle: string;
2574
- disabled: string;
2575
- negative: string;
2576
- warning: string;
2577
- positive: string;
2578
- onBrandPrimary: string;
2579
- onBrandSecondary: string;
2580
- onBrandTertiary: string;
2581
- };
2582
- border: {
2583
- default: string;
2584
- defaultHover: string;
2585
- defaultSelected: string;
2586
- strong: string;
2587
- subtle: string;
2588
- negative: string;
2589
- warning: string;
2590
- positive: string;
2591
- };
2592
- };
2593
- sizes: {
2594
- 112: string;
2595
- 128: string;
2596
- 144: string;
2597
- 160: string;
2598
- 176: string;
2599
- 192: string;
2600
- 224: string;
2601
- 256: string;
2602
- 288: string;
2603
- 320: string;
2604
- 384: string;
2605
- 448: string;
2606
- 512: string;
2607
- 576: string;
2608
- 672: string;
2609
- 768: string;
2610
- 896: string;
2611
- 1024: string;
2612
- '0x': string;
2613
- '1x': string;
2614
- '2x': string;
2615
- '3x': string;
2616
- '4x': string;
2617
- '5x': string;
2618
- '6x': string;
2619
- '8x': string;
2620
- '12x': string;
2621
- '16x': string;
2622
- '20x': string;
2623
- '24x': string;
2624
- };
2625
- radii: {
2626
- none: string;
2627
- '2xs': string;
2628
- xs: string;
2629
- sm: string;
2630
- md: string;
2631
- lg: string;
2632
- xl: string;
2633
- full: string;
2634
- };
2635
- shadows: {
2636
- none: string;
2637
- sm: string;
2638
- md: string;
2639
- lg: string;
2640
- xl: string;
2641
- };
2642
- typography: {
2643
- display: {
2644
- '3xl': {
2645
- fontFamily: string;
2646
- fontWeight: string;
2647
- fontSize: string;
2648
- lineHeight: string;
2649
- letterSpacing: string;
2650
- fontFeatureSettings: string;
2651
- };
2652
- '2xl': {
2653
- fontFamily: string;
2654
- fontWeight: string;
2655
- fontSize: string;
2656
- lineHeight: string;
2657
- letterSpacing: string;
2658
- fontFeatureSettings: string;
2659
- };
2660
- xl: {
2661
- fontFamily: string;
2662
- fontWeight: string;
2663
- fontSize: string;
2664
- lineHeight: string;
2665
- letterSpacing: string;
2666
- fontFeatureSettings: string;
2667
- };
2668
- lg: {
2669
- fontFamily: string;
2670
- fontWeight: string;
2671
- fontSize: string;
2672
- lineHeight: string;
2673
- letterSpacing: string;
2674
- fontFeatureSettings: string;
2675
- };
2676
- md: {
2677
- fontFamily: string;
2678
- fontWeight: string;
2679
- fontSize: string;
2680
- lineHeight: string;
2681
- letterSpacing: string;
2682
- fontFeatureSettings: string;
2683
- };
2684
- sm: {
2685
- fontFamily: string;
2686
- fontWeight: string;
2687
- fontSize: string;
2688
- lineHeight: string;
2689
- letterSpacing: string;
2690
- fontFeatureSettings: string;
2691
- };
2692
- xs: {
2693
- fontFamily: string;
2694
- fontWeight: string;
2695
- fontSize: string;
2696
- lineHeight: string;
2697
- letterSpacing: string;
2698
- fontFeatureSettings: string;
2699
- };
2700
- };
2701
- title: {
2702
- lg: {
2703
- fontFamily: string;
2704
- fontWeight: string;
2705
- fontSize: string;
2706
- lineHeight: string;
2707
- letterSpacing: string;
2708
- };
2709
- md: {
2710
- fontFamily: string;
2711
- fontWeight: string;
2712
- fontSize: string;
2713
- lineHeight: string;
2714
- letterSpacing: string;
2715
- };
2716
- sm: {
2717
- fontFamily: string;
2718
- fontWeight: string;
2719
- fontSize: string;
2720
- lineHeight: string;
2721
- letterSpacing: string;
2722
- };
2723
- xs: {
2724
- fontFamily: string;
2725
- fontWeight: string;
2726
- fontSize: string;
2727
- lineHeight: string;
2728
- letterSpacing: string;
2729
- };
2730
- '2xs': {
2731
- fontFamily: string;
2732
- fontWeight: string;
2733
- fontSize: string;
2734
- lineHeight: string;
2735
- letterSpacing: string;
2736
- };
2737
- '3xs': {
2738
- fontFamily: string;
2739
- fontWeight: string;
2740
- fontSize: string;
2741
- lineHeight: string;
2742
- letterSpacing: string;
2743
- };
2744
- };
2745
- body: {
2746
- xl: {
2747
- fontFamily: string;
2748
- fontWeight: string;
2749
- fontSize: string;
2750
- lineHeight: string;
2751
- letterSpacing: string;
2752
- };
2753
- lg: {
2754
- fontFamily: string;
2755
- fontWeight: string;
2756
- fontSize: string;
2757
- lineHeight: string;
2758
- letterSpacing: string;
2759
- };
2760
- md: {
2761
- fontFamily: string;
2762
- fontWeight: string;
2763
- fontSize: string;
2764
- lineHeight: string;
2765
- letterSpacing: string;
2766
- };
2767
- sm: {
2768
- fontFamily: string;
2769
- fontWeight: string;
2770
- fontSize: string;
2771
- lineHeight: string;
2772
- letterSpacing: string;
2773
- };
2774
- xs: {
2775
- fontFamily: string;
2776
- fontWeight: string;
2777
- fontSize: string;
2778
- lineHeight: string;
2779
- letterSpacing: string;
2780
- };
2781
- };
2782
- label: {
2783
- md: {
2784
- fontFamily: string;
2785
- fontWeight: string;
2786
- fontSize: string;
2787
- lineHeight: string;
2788
- letterSpacing: string;
2789
- };
2790
- sm: {
2791
- fontFamily: string;
2792
- fontWeight: string;
2793
- fontSize: string;
2794
- lineHeight: string;
2795
- letterSpacing: string;
2796
- };
2797
- };
2798
- button: {
2799
- md: {
2800
- fontFamily: string;
2801
- fontWeight: string;
2802
- fontSize: string;
2803
- lineHeight: string;
2804
- letterSpacing: string;
2805
- };
2806
- sm: {
2807
- fontFamily: string;
2808
- fontWeight: string;
2809
- fontSize: string;
2810
- lineHeight: string;
2811
- letterSpacing: string;
2812
- };
2813
- };
2814
- caption: {
2815
- md: {
2816
- fontFamily: string;
2817
- fontWeight: string;
2818
- fontSize: string;
2819
- lineHeight: string;
2820
- letterSpacing: string;
2355
+ };
2821
2356
  };
2822
- sm: {
2823
- fontFamily: string;
2824
- fontWeight: string;
2825
- fontSize: string;
2826
- lineHeight: string;
2827
- letterSpacing: string;
2357
+ ':active': {
2358
+ background: string;
2828
2359
  };
2829
2360
  };
2830
2361
  };
2831
- }) => {
2832
- lg: {
2833
- fontFamily: string;
2834
- fontWeight: string;
2835
- fontSize: string;
2836
- lineHeight: string;
2837
- letterSpacing: string;
2838
- };
2839
- md: {
2840
- fontFamily: string;
2841
- fontWeight: string;
2842
- fontSize: string;
2843
- lineHeight: string;
2844
- letterSpacing: string;
2845
- };
2846
- sm: {
2847
- fontFamily: string;
2848
- fontWeight: string;
2849
- fontSize: string;
2850
- lineHeight: string;
2851
- letterSpacing: string;
2852
- };
2853
- xs: {
2854
- fontFamily: string;
2855
- fontWeight: string;
2856
- fontSize: string;
2857
- lineHeight: string;
2858
- letterSpacing: string;
2859
- };
2860
- '2xs': {
2861
- fontFamily: string;
2862
- fontWeight: string;
2863
- fontSize: string;
2864
- lineHeight: string;
2865
- letterSpacing: string;
2866
- };
2867
- '3xs': {
2868
- fontFamily: string;
2869
- fontWeight: string;
2870
- fontSize: string;
2871
- lineHeight: string;
2872
- letterSpacing: string;
2362
+ tertiary: {
2363
+ background: string;
2364
+ color: string;
2365
+ ":not([disabled])": {
2366
+ '@media(hover: hover)': {
2367
+ ':hover': {
2368
+ background: string;
2369
+ };
2370
+ };
2371
+ ':active': {
2372
+ background: string;
2373
+ };
2374
+ };
2873
2375
  };
2874
2376
  };
2875
- declare type HeadingSize = VariantProps<typeof getSizeStyles$4>;
2377
+ declare type ButtonVariant = VariantProps<typeof getVariantStyles$1>;
2378
+
2379
+ interface ButtonOptions {
2380
+ /**
2381
+ * Sets the size of the button
2382
+ * @default 'md'
2383
+ */
2384
+ size?: ButtonSize;
2385
+ /**
2386
+ * Sets the style variant of the button
2387
+ * @default 'secondary'
2388
+ */
2389
+ variant?: ButtonVariant;
2390
+ /**
2391
+ * If `true` the button will fill its container
2392
+ * @default false
2393
+ */
2394
+ isFullWidth?: boolean;
2395
+ /**
2396
+ * If `true` the button will show a spinner
2397
+ * @default false
2398
+ */
2399
+ isLoading?: boolean;
2400
+ /**
2401
+ * If `true` the button will be disabled
2402
+ * @default false
2403
+ */
2404
+ isDisabled?: boolean;
2405
+ /**
2406
+ * Icon to display before the button label
2407
+ */
2408
+ iconLeft?: ElementType<IconProps>;
2409
+ /**
2410
+ * Icon to display after the button label
2411
+ */
2412
+ iconRight?: ElementType<IconProps>;
2413
+ /**
2414
+ * The HTML `type` attribute
2415
+ * @default 'button'
2416
+ */
2417
+ type?: 'button' | 'submit' | 'reset';
2418
+ }
2419
+
2420
+ declare type PolymorphicButton = ForwardRefComponent<'button', ButtonOptions>;
2421
+ declare type ButtonProps = PropsOf<PolymorphicButton>;
2422
+ declare const Button: PolymorphicButton;
2423
+
2424
+ declare type DisplaySize = keyof Theme['typography']['display'];
2425
+ declare type DisplayTextAlign = 'left' | 'center' | 'right';
2426
+ declare type DisplayTextWrap = 'pretty' | 'balance' | 'wrap' | 'nowrap' | 'stable';
2427
+ interface DisplayTextOptions {
2428
+ /**
2429
+ * Sets the visual size of the display text.
2430
+ * To override the rendered tag, use the `as` prop.
2431
+ *
2432
+ * @default 'md'
2433
+ */
2434
+ size?: DisplaySize;
2435
+ /**
2436
+ * Sets the text alignment
2437
+ * @default 'left'
2438
+ */
2439
+ textAlign?: DisplayTextAlign;
2440
+ /**
2441
+ * Sets the text wrapping
2442
+ * @default 'pretty'
2443
+ * Read more on [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap)
2444
+ */
2445
+ textWrap?: DisplayTextWrap;
2446
+ }
2447
+ declare type DisplayTextComponent = ForwardRefComponent<'h2', DisplayTextOptions>;
2448
+ declare type DisplayTextProps = PropsOf<DisplayTextComponent>;
2449
+ declare const DisplayText: DisplayTextComponent;
2450
+
2451
+ interface CheckboxOptions {
2452
+ /**
2453
+ * The label for the checkbox. Accepts a string, or a React component for rendering links within the label.
2454
+ *
2455
+ * @example
2456
+ * ```jsx
2457
+ * <Checkbox label="I agree to the terms and conditions" />
2458
+ * ```
2459
+ *
2460
+ * @example
2461
+ * ```jsx
2462
+ * <Checkbox
2463
+ * label={
2464
+ * <>
2465
+ * I agree to <Link href="/terms">the terms and conditions</Link>
2466
+ * </>
2467
+ * }
2468
+ * />
2469
+ * ```
2470
+ */
2471
+ label: string | ReactElement<unknown>;
2472
+ /**
2473
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
2474
+ */
2475
+ isDefaultChecked?: boolean;
2476
+ /**
2477
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
2478
+ */
2479
+ defaultChecked?: boolean;
2480
+ /**
2481
+ * The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
2482
+ */
2483
+ isChecked?: boolean;
2484
+ /**
2485
+ * The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
2486
+ */
2487
+ checked?: boolean;
2488
+ /**
2489
+ * Event handler called when the checked state of the checkbox changes.
2490
+ */
2491
+ onCheckedChange?: (checked: boolean) => void;
2492
+ /**
2493
+ * If `true` the checkbox will render in its invalid state.
2494
+ * @default false
2495
+ */
2496
+ isInvalid?: boolean;
2497
+ /**
2498
+ * If `true` it prevents the user from interacting with the checkbox.
2499
+ * @default false
2500
+ */
2501
+ isDisabled?: boolean;
2502
+ /**
2503
+ * If `true` the user must check the checkbox before the owning form can be submitted.
2504
+ * @default false
2505
+ */
2506
+ isRequired?: boolean;
2507
+ /**
2508
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
2509
+ */
2510
+ name?: string;
2511
+ /**
2512
+ * The value given as data when submitted with a `name`.
2513
+ */
2514
+ value?: string;
2515
+ }
2516
+ declare type CheckboxProps = Omit<CheckboxPrimitive.CheckboxProps, 'asChild' | 'children' | 'checked' | 'defaultChecked' | keyof CheckboxOptions> & CheckboxOptions;
2517
+ declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps, "children" | "asChild" | keyof CheckboxOptions> & CheckboxOptions & react.RefAttributes<HTMLButtonElement>>;
2518
+
2519
+ interface DividerOptions {
2520
+ /**
2521
+ * The orientation of the divider.
2522
+ *
2523
+ * @default 'horizontal'
2524
+ */
2525
+ orientation?: 'horizontal' | 'vertical';
2526
+ }
2527
+ interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
2528
+ }
2529
+ declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
2530
+
2531
+ declare type PrimitiveContentProps = DropdownPrimitive.MenuContentProps;
2532
+ interface DropdownMenuContentOptions {
2533
+ /**
2534
+ * Event handler called when focus moves to the trigger after closing.
2535
+ * It can be prevented by calling `event.preventDefault`.
2536
+ */
2537
+ onCloseAutofocus?: PrimitiveContentProps['onCloseAutoFocus'];
2538
+ /**
2539
+ * Event handler called when the escape key is down.
2540
+ * It can be prevented by calling `event.preventDefault`.
2541
+ */
2542
+ onEscapeKeyDown?: PrimitiveContentProps['onEscapeKeyDown'];
2543
+ /**
2544
+ * Event handler called when a pointer event occurs outside the bounds of the component.
2545
+ * It can be prevented by calling `event.preventDefault`.
2546
+ */
2547
+ onPointerDownOutside?: PrimitiveContentProps['onPointerDownOutside'];
2548
+ /**
2549
+ * Event handler called when focus moves outside the bounds of the component.
2550
+ * It can be prevented by calling `event.preventDefault`.
2551
+ */
2552
+ onFocusOutside?: PrimitiveContentProps['onFocusOutside'];
2553
+ /**
2554
+ * Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component.
2555
+ * It can be prevented by calling `event.preventDefault`.
2556
+ */
2557
+ onInteractOutside?: PrimitiveContentProps['onInteractOutside'];
2558
+ /**
2559
+ * The preferred side of the trigger to render against when open.
2560
+ * Will be reversed when collisions occur and `avoidCollisions` is enabled.
2561
+ *
2562
+ * @default "bottom"
2563
+ */
2564
+ side?: PrimitiveContentProps['side'];
2565
+ /**
2566
+ * The distance in pixels from the trigger.
2567
+ *
2568
+ * @default 8
2569
+ */
2570
+ sideOffset?: PrimitiveContentProps['sideOffset'];
2571
+ /**
2572
+ * The preferred alignment against the trigger. May change when collisions occur.
2573
+ *
2574
+ * @default "center"
2575
+ */
2576
+ align?: PrimitiveContentProps['align'];
2577
+ /**
2578
+ * The element used as the collision boundary.
2579
+ * By default this is the viewport, though you can provide additional element(s) to be included in this check.
2580
+ *
2581
+ * @default []
2582
+ */
2583
+ collisionBoundary?: PrimitiveContentProps['collisionBoundary'];
2584
+ /**
2585
+ * Whether to hide the content when the trigger becomes fully occluded.
2586
+ *
2587
+ * @default false
2588
+ */
2589
+ hideWhenDetached?: PrimitiveContentProps['hideWhenDetached'];
2590
+ }
2591
+ interface DropdownMenuContentProps extends HTMLQdsProps<'div'>, DropdownMenuContentOptions {
2592
+ }
2593
+
2594
+ declare type DropdownMenuDividerProps = HTMLQdsProps<'div'>;
2595
+
2596
+ interface DropdownMenuItemOptions {
2597
+ /**
2598
+ * If `true`, the item will be disabled
2599
+ */
2600
+ isDisabled?: boolean;
2601
+ /**
2602
+ * Event handler called when the user selects an item (via mouse or keyboard).
2603
+ * Calling `event.preventDefault` in this handler will prevent the dropdown from closing when selecting that item.
2604
+ */
2605
+ onSelect?: (event: Event) => void;
2606
+ /**
2607
+ * Optional text used for typeahead purposes.
2608
+ * By default the typeahead behavior will use the `.textContent` of the item.
2609
+ * Use this when the content is complex, or you have non-textual content inside.
2610
+ */
2611
+ textValue?: string;
2612
+ /**
2613
+ * Optional icon to display on the left side of the item content.
2614
+ */
2615
+ icon?: ElementType<IconProps>;
2616
+ }
2617
+ interface DropdownMenuItemProps extends Omit<DropdownPrimitive.DropdownMenuItemProps, 'asChild' | keyof DropdownMenuItemOptions>, DropdownMenuItemOptions {
2618
+ }
2619
+
2620
+ declare type DropdownTriggerComponent = ForwardRefComponent<'button'>;
2621
+ declare type DropdownMenuTriggerProps = PropsOf<DropdownTriggerComponent>;
2622
+
2623
+ interface DropdownMenuRootProps {
2624
+ children: ReactNode;
2625
+ /**
2626
+ * If `true` the dropdown menu will be open
2627
+ */
2628
+ isOpen?: boolean;
2629
+ /**
2630
+ * The open state of the submenu when it is initially rendered.
2631
+ * Use when you do not need to control its open state.
2632
+ */
2633
+ defaultOpen?: boolean;
2634
+ /**
2635
+ * Callback invoked open state changes
2636
+ */
2637
+ onOpenChange?: (isOpen: boolean) => void;
2638
+ }
2639
+ declare function DropdownMenuRoot(props: DropdownMenuRootProps): JSX.Element;
2640
+ declare const DropdownMenu: typeof DropdownMenuRoot & {
2641
+ Trigger: ForwardRefComponent<"button", {}>;
2642
+ Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
2643
+ Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
2644
+ Divider: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof react.HTMLAttributes<HTMLDivElement>> & react.RefAttributes<HTMLDivElement>>;
2645
+ };
2646
+
2647
+ declare type HeadingSize = keyof Theme['typography']['title'];
2876
2648
  declare type HeadingColor = keyof Theme['colors']['text'];
2877
2649
  interface HeadingOptions {
2878
2650
  /**
2879
2651
  * Sets the visual size of the heading.
2880
- * Also sets the HTML tag used for the heading.
2881
2652
  * To override the rendered tag, use the `as` prop.
2882
2653
  *
2883
2654
  * @default 'md'
@@ -3806,19 +3577,6 @@ declare type IconButtonComponent = ForwardRefComponent<'button', IconButtonOptio
3806
3577
  declare type IconButtonProps = PropsOf<IconButtonComponent>;
3807
3578
  declare const IconButton: IconButtonComponent;
3808
3579
 
3809
- interface ImageOptions {
3810
- src?: string;
3811
- alt?: string;
3812
- width: string | number;
3813
- height: string | number;
3814
- loading?: 'eager' | 'lazy';
3815
- borderRadius?: keyof Theme['radii'];
3816
- }
3817
- declare type OmittedProps$8 = 'width' | 'height';
3818
- interface ImageProps extends Omit<HTMLQdsProps<'img'>, OmittedProps$8>, ImageOptions {
3819
- }
3820
- declare function Image({ src, loading, width, height, borderRadius, ...restProps }: ImageProps): JSX.Element;
3821
-
3822
3580
  interface InputBaseOptions {
3823
3581
  /**
3824
3582
  * If `true`, the input will be invalid
@@ -5254,18 +5012,21 @@ interface TextareaBaseProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$
5254
5012
  declare const TextareaBase: react.ForwardRefExoticComponent<TextareaBaseProps & react.RefAttributes<HTMLTextAreaElement>>;
5255
5013
 
5256
5014
  interface RadioCardOptions {
5015
+ /**
5016
+ * The label for the radio card
5017
+ */
5257
5018
  label: string;
5258
5019
  /**
5259
5020
  * Text that provides additional guidance to the user
5260
5021
  */
5261
5022
  helperText?: string;
5262
5023
  /**
5263
- * If `true` the radio card will be required using the HTML `required` attribute.
5024
+ * If `true` the user must check the radio item before the owning form can be submitted.
5264
5025
  * @default false
5265
5026
  */
5266
5027
  isRequired?: boolean;
5267
5028
  /**
5268
- * If `true` the radio card will be disabled using the HTML `disabled` attribute.
5029
+ * If `true` it prevents the user from interacting with the radio item.
5269
5030
  * @default false
5270
5031
  */
5271
5032
  isDisabled?: boolean;
@@ -5273,7 +5034,7 @@ interface RadioCardOptions {
5273
5034
  interface RadioCardProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, 'asChild' | keyof RadioCardOptions>, RadioCardOptions {
5274
5035
  }
5275
5036
 
5276
- declare type RadioGroupLabelProps = HTMLQdsProps<'label'>;
5037
+ declare type RadioGroupLabelProps = HTMLQdsProps<'span'>;
5277
5038
 
5278
5039
  interface RadioGroupOptions {
5279
5040
  /**
@@ -5318,7 +5079,7 @@ interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, 'asC
5318
5079
  }
5319
5080
  declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>> & {
5320
5081
  Card: react.ForwardRefExoticComponent<RadioCardProps & react.RefAttributes<HTMLButtonElement>>;
5321
- Label: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof react.LabelHTMLAttributes<HTMLLabelElement>> & react.RefAttributes<HTMLLabelElement>>;
5082
+ Label: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof react.HTMLAttributes<HTMLSpanElement>> & react.RefAttributes<HTMLSpanElement>>;
5322
5083
  };
5323
5084
 
5324
5085
  interface SelectOptionOptions {
@@ -5401,6 +5162,39 @@ declare type StackComponent = ForwardRefComponent<'div', StackOptions>;
5401
5162
  declare type StackProps = PropsOf<StackComponent>;
5402
5163
  declare const Stack: StackComponent;
5403
5164
 
5165
+ interface SwitchOptions {
5166
+ /**
5167
+ * The label for the switch
5168
+ */
5169
+ label: string;
5170
+ /**
5171
+ * The text that appears below the label
5172
+ * to provide additional guidance to the user
5173
+ */
5174
+ helperText?: string;
5175
+ /**
5176
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
5177
+ */
5178
+ isDefaultChecked?: boolean;
5179
+ /**
5180
+ * If `true`, the switch will be checked
5181
+ */
5182
+ isChecked?: boolean;
5183
+ /**
5184
+ * If `true`, the switch will be disabled and
5185
+ * cannot be interacted with
5186
+ */
5187
+ isDisabled?: boolean;
5188
+ /**
5189
+ * If `true`, indicates that the switch is required
5190
+ */
5191
+ isRequired?: boolean;
5192
+ onCheckedChange?: (isChecked: boolean) => void;
5193
+ }
5194
+ interface SwitchProps extends Omit<RadixSwitch.SwitchProps, 'asChild' | keyof SwitchOptions>, SwitchOptions {
5195
+ }
5196
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
5197
+
5404
5198
  interface TextareaOptions extends TextareaBaseOptions {
5405
5199
  /**
5406
5200
  * The label for the textarea field
@@ -5420,6 +5214,21 @@ interface TextareaProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$1>,
5420
5214
  }
5421
5215
  declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
5422
5216
 
5217
+ declare type Id = number | string;
5218
+ interface ToastOptions {
5219
+ /**
5220
+ * Unique identifier for the toast (can be used for removing it prematurely). If a toast with this
5221
+ * identifier already exists it will be removed before the new toast is added.
5222
+ * @default a random unique id will be set and returned
5223
+ */
5224
+ id?: Id;
5225
+ }
5226
+ declare const toast: ((text: string, options?: ToastOptions) => Id) & {
5227
+ error: (text: string, options?: ToastOptions) => Id;
5228
+ remove: (id: Id) => void;
5229
+ removeAll: () => void;
5230
+ };
5231
+
5423
5232
  interface UseBreakpointOptions {
5424
5233
  /**
5425
5234
  * If `true` the initial value will be `base` instead of the current breakpoint.
@@ -5519,4 +5328,4 @@ declare function useStableId(fixedId?: string | null): string;
5519
5328
  */
5520
5329
  declare const useSafeLayoutEffect: typeof useLayoutEffect;
5521
5330
 
5522
- export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, Image, ImageIcon, ImageProps, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
5331
+ export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, Checkbox, CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, DisplayText, DisplayTextProps, Divider, DividerProps, DropdownMenu, DropdownMenuContentProps, DropdownMenuDividerProps, DropdownMenuItemProps, DropdownMenuRootProps, DropdownMenuTriggerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, ImageIcon, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, Switch, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, toast, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };