@sanity/ui 1.8.3 → 2.0.0-alpha.10

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 (137) hide show
  1. package/dist/index.cjs.mjs +3 -0
  2. package/dist/index.d.ts +339 -415
  3. package/dist/index.esm.js +5374 -2489
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +5375 -2487
  6. package/dist/index.js.map +1 -1
  7. package/package.json +21 -3
  8. package/src/components/autocomplete/autocomplete.tsx +2 -1
  9. package/src/components/dialog/constants.ts +4 -0
  10. package/src/components/dialog/dialog.tsx +89 -27
  11. package/src/components/dialog/styles.ts +3 -4
  12. package/src/components/hotkeys/hotkeys.tsx +2 -1
  13. package/src/components/menu/__workshop__/closableMenuButton.tsx +2 -2
  14. package/src/components/menu/menuButton.tsx +2 -2
  15. package/src/components/menu/menuDivider.ts +2 -1
  16. package/src/components/menu/menuGroup.tsx +24 -25
  17. package/src/components/menu/menuItem.tsx +31 -37
  18. package/src/components/skeleton/styles.ts +8 -7
  19. package/src/components/tab/tab.tsx +2 -1
  20. package/src/components/tree/style.ts +19 -20
  21. package/src/primitives/_selectable/style.ts +25 -23
  22. package/src/primitives/avatar/avatar.tsx +8 -3
  23. package/src/primitives/avatar/avatarCounter.tsx +5 -4
  24. package/src/primitives/avatar/spotColors.ts +53 -0
  25. package/src/primitives/avatar/styles.ts +6 -8
  26. package/src/primitives/avatar/types.ts +14 -0
  27. package/src/primitives/badge/badge.tsx +5 -3
  28. package/src/primitives/badge/styles.ts +7 -8
  29. package/src/primitives/box/__workshop__/responsive.tsx +2 -2
  30. package/src/primitives/button/__workshop__/sanityUploadButton.tsx +1 -2
  31. package/src/primitives/button/button.tsx +8 -9
  32. package/src/primitives/button/styles.ts +100 -17
  33. package/src/primitives/card/__workshop__/selected.tsx +8 -9
  34. package/src/primitives/card/card.tsx +43 -7
  35. package/src/primitives/card/styles.ts +31 -24
  36. package/src/primitives/card/types.ts +3 -1
  37. package/src/primitives/checkbox/checkbox.tsx +1 -0
  38. package/src/primitives/checkbox/styles.ts +53 -23
  39. package/src/primitives/code/code.tsx +15 -3
  40. package/src/primitives/code/styles.ts +51 -42
  41. package/src/primitives/heading/styles.ts +6 -5
  42. package/src/primitives/kbd/kbd.tsx +7 -6
  43. package/src/primitives/label/styles.ts +3 -2
  44. package/src/primitives/popover/popoverArrow.tsx +3 -2
  45. package/src/primitives/popover/popoverCard.tsx +8 -4
  46. package/src/primitives/radio/radio.tsx +1 -0
  47. package/src/primitives/radio/styles.ts +26 -13
  48. package/src/primitives/select/select.tsx +3 -2
  49. package/src/primitives/select/styles.ts +22 -24
  50. package/src/primitives/switch/__workshop__/props.tsx +4 -4
  51. package/src/primitives/switch/styles.ts +19 -12
  52. package/src/primitives/text/__workshop__/colored.tsx +10 -11
  53. package/src/primitives/text/styles.ts +10 -8
  54. package/src/primitives/textArea/textArea.tsx +8 -12
  55. package/src/primitives/textInput/textInput.tsx +15 -14
  56. package/src/primitives/tooltip/__workshop__/props.tsx +20 -3
  57. package/src/primitives/tooltip/tooltip.tsx +2 -2
  58. package/src/primitives/tooltip/tooltipArrow.tsx +3 -2
  59. package/src/primitives/types.ts +3 -2
  60. package/src/styles/border/borderStyle.ts +2 -1
  61. package/src/styles/colorVars/colorVarsStyle.ts +73 -30
  62. package/src/styles/focusRing/index.ts +8 -4
  63. package/src/styles/input/textInputStyle.ts +78 -94
  64. package/src/styles/margin/marginsStyle.test.ts +1 -2
  65. package/src/styles/padding/paddingStyle.test.ts +1 -2
  66. package/src/styles/radius/radiusStyle.ts +14 -4
  67. package/src/styles/radius/types.ts +3 -1
  68. package/src/styles/shadow/shadowStyle.ts +5 -5
  69. package/src/theme/__workshop__/color.tsx +2 -2
  70. package/src/theme/__workshop__/index.ts +0 -5
  71. package/src/theme/lib/color-fns/blend/multiply.ts +2 -2
  72. package/src/theme/lib/color-fns/blend/screen.ts +2 -2
  73. package/src/theme/lib/color-fns/convert.ts +15 -1
  74. package/src/theme/lib/color-fns/parse.ts +7 -3
  75. package/src/theme/lib/color-fns/types.ts +11 -0
  76. package/src/theme/lib/theme/avatar.ts +3 -0
  77. package/src/theme/lib/theme/color/_legacy/createColorTheme.ts +7 -0
  78. package/src/theme/lib/theme/color/_legacy/index.ts +1 -0
  79. package/src/theme/lib/theme/color/_legacy/legacyColor.ts +3997 -0
  80. package/src/theme/lib/theme/color/cssVariables/cardVariables.ts +88 -0
  81. package/src/theme/lib/theme/color/cssVariables/createCssVars.ts +31 -0
  82. package/src/theme/lib/theme/color/cssVariables/cssVars.test.ts +262 -0
  83. package/src/theme/lib/theme/color/cssVariables/index.ts +1 -0
  84. package/src/theme/lib/theme/color/cssVariables/tints.ts +312 -0
  85. package/src/theme/lib/theme/color/cssVariables/tones.ts +67 -0
  86. package/src/theme/lib/theme/color/cssVariables/utils.test.ts +15 -0
  87. package/src/theme/lib/theme/color/cssVariables/utils.ts +9 -0
  88. package/src/theme/lib/theme/color/index.ts +3 -12
  89. package/src/theme/lib/theme/color/types.ts +6 -37
  90. package/src/theme/lib/theme/input.ts +11 -0
  91. package/src/theme/lib/theme/theme.ts +7 -1
  92. package/src/theme/studioTheme/color.ts +6 -633
  93. package/src/theme/studioTheme/fonts.ts +3 -3
  94. package/src/theme/studioTheme/helpers.ts +15 -1
  95. package/src/theme/studioTheme/theme.ts +26 -6
  96. package/src/theme/themeColorProvider.tsx +2 -0
  97. package/src/theme/themeProvider.tsx +28 -8
  98. package/src/theme/toneContext/toneContext.ts +12 -0
  99. package/src/theme/toneContext/toneProvider.tsx +31 -0
  100. package/src/theme/toneContext/types.ts +10 -0
  101. package/src/theme/toneContext/useToneContext.tsx +26 -0
  102. package/src/theme/types.ts +10 -4
  103. package/src/types/index.ts +1 -0
  104. package/src/types/radius.ts +4 -0
  105. package/src/utils/elementQuery/__workshop__/customMedia.tsx +4 -3
  106. package/src/theme/__workshop__/canvas.tsx +0 -395
  107. package/src/theme/lib/theme/color/_generic/index.ts +0 -1
  108. package/src/theme/lib/theme/color/_generic/types.ts +0 -29
  109. package/src/theme/lib/theme/color/base/index.ts +0 -1
  110. package/src/theme/lib/theme/color/base/types.ts +0 -19
  111. package/src/theme/lib/theme/color/button/createButtonModes.ts +0 -20
  112. package/src/theme/lib/theme/color/button/createButtonTones.ts +0 -52
  113. package/src/theme/lib/theme/color/button/index.ts +0 -1
  114. package/src/theme/lib/theme/color/button/types.ts +0 -44
  115. package/src/theme/lib/theme/color/card/createCardStates.ts +0 -58
  116. package/src/theme/lib/theme/color/card/index.ts +0 -1
  117. package/src/theme/lib/theme/color/card/types.ts +0 -18
  118. package/src/theme/lib/theme/color/color.test.ts +0 -62
  119. package/src/theme/lib/theme/color/defaults.ts +0 -382
  120. package/src/theme/lib/theme/color/factory.ts +0 -138
  121. package/src/theme/lib/theme/color/input/createInputModes.ts +0 -84
  122. package/src/theme/lib/theme/color/input/index.ts +0 -1
  123. package/src/theme/lib/theme/color/input/types.ts +0 -27
  124. package/src/theme/lib/theme/color/muted/createMuted.ts +0 -56
  125. package/src/theme/lib/theme/color/muted/index.ts +0 -1
  126. package/src/theme/lib/theme/color/muted/types.ts +0 -24
  127. package/src/theme/lib/theme/color/selectable/createSelectableTones.ts +0 -73
  128. package/src/theme/lib/theme/color/selectable/index.ts +0 -1
  129. package/src/theme/lib/theme/color/selectable/types.ts +0 -29
  130. package/src/theme/lib/theme/color/solid/createSolidTones.ts +0 -56
  131. package/src/theme/lib/theme/color/solid/index.ts +0 -1
  132. package/src/theme/lib/theme/color/solid/types.ts +0 -24
  133. package/src/theme/lib/theme/color/spot/createSpot.ts +0 -21
  134. package/src/theme/lib/theme/color/spot/index.ts +0 -1
  135. package/src/theme/lib/theme/color/spot/types.ts +0 -28
  136. package/src/theme/lib/theme/color/syntax/index.ts +0 -1
  137. package/src/theme/lib/theme/color/syntax/types.ts +0 -41
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  import {AnimationEventHandler} from 'react'
4
4
  import {AriaRole} from 'react'
5
5
  import {ClipboardEventHandler} from 'react'
6
+ import {ColorTints} from '@sanity/color'
6
7
  import {Component} from 'react'
7
8
  import {CompositionEventHandler} from 'react'
8
9
  import {CSSProperties} from 'react'
@@ -49,8 +50,10 @@ export declare const Autocomplete: <Option extends BaseAutocompleteOption>(
49
50
  props: AutocompleteProps<Option> &
50
51
  Omit<
51
52
  HTMLProps<HTMLInputElement>,
53
+ | 'type'
52
54
  | 'value'
53
55
  | 'ref'
56
+ | 'as'
54
57
  | 'id'
55
58
  | 'spellCheck'
56
59
  | 'role'
@@ -64,9 +67,7 @@ export declare const Autocomplete: <Option extends BaseAutocompleteOption>(
64
67
  | 'aria-owns'
65
68
  | 'onChange'
66
69
  | 'onSelect'
67
- | 'as'
68
70
  | 'autoComplete'
69
- | 'type'
70
71
  > & {
71
72
  ref?: Ref<HTMLInputElement> | undefined
72
73
  },
@@ -132,7 +133,7 @@ export declare interface AutocompleteProps<
132
133
  popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> &
133
134
  Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>
134
135
  prefix?: ReactNode
135
- radius?: number | number[]
136
+ radius?: Radius | Radius[]
136
137
  /** @beta */
137
138
  relatedElements?: HTMLElement[]
138
139
  renderOption?: (option: Option) => ReactElement
@@ -342,14 +343,20 @@ export declare interface BaseTheme<Styles extends {} = {}> {
342
343
  avatar: ThemeAvatar
343
344
  button: {
344
345
  textWeight: ThemeFontWeightKey
346
+ focusRing: FocusRing
347
+ }
348
+ card: {
349
+ focusRing: FocusRing
345
350
  }
346
351
  color: ThemeColorSchemes
347
352
  container: number[]
353
+ /** @deprecated Use component-specific `focusRing` values instead */
348
354
  focusRing: {
349
355
  offset: number
350
356
  width: number
351
357
  }
352
358
  fonts: ThemeFonts
359
+ input: ThemeInput
353
360
  /**
354
361
  * THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
355
362
  * @beta
@@ -359,7 +366,6 @@ export declare interface BaseTheme<Styles extends {} = {}> {
359
366
  radius: number[]
360
367
  shadows: Array<ThemeShadow | null>
361
368
  space: number[]
362
- input: ThemeInput
363
369
  styles?: Styles
364
370
  }
365
371
 
@@ -390,7 +396,7 @@ export declare interface BoundaryElementProviderProps {
390
396
  * @public
391
397
  */
392
398
  export declare const Box: ForwardRefExoticComponent<
393
- Omit<BoxProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
399
+ Omit<BoxProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height'>, 'ref'> &
394
400
  RefAttributes<HTMLDivElement>
395
401
  >
396
402
 
@@ -438,7 +444,7 @@ export declare type BoxSizing = 'content' | 'border'
438
444
  */
439
445
  export declare const Breadcrumbs: ForwardRefExoticComponent<
440
446
  BreadcrumbsProps &
441
- Omit<HTMLProps<HTMLOListElement>, 'ref' | 'as' | 'type'> &
447
+ Omit<HTMLProps<HTMLOListElement>, 'type' | 'ref' | 'as'> &
442
448
  RefAttributes<HTMLOListElement>
443
449
  >
444
450
 
@@ -481,6 +487,7 @@ export declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveR
481
487
  selected?: boolean
482
488
  space?: number | number[]
483
489
  textAlign?: ButtonTextAlign
490
+ muted?: boolean
484
491
  text?: React.ReactNode
485
492
  tone?: ButtonTone
486
493
  type?: 'button' | 'reset' | 'submit'
@@ -500,7 +507,7 @@ export declare type ButtonTone = 'default' | 'primary' | 'positive' | 'caution'
500
507
  * @public
501
508
  */
502
509
  export declare const Card: ForwardRefExoticComponent<
503
- Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
510
+ Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height'>, 'ref'> &
504
511
  RefAttributes<HTMLDivElement>
505
512
  >
506
513
 
@@ -525,6 +532,12 @@ export declare interface CardProps
525
532
  pressed?: boolean
526
533
  scheme?: ThemeColorSchemeKey
527
534
  tone?: CardTone
535
+ /**
536
+ * @internal
537
+ * Used by the popover, as it creates a new html element that it's ouside of the previous scope of the card.
538
+ * So if it's inheriting styles from the parent, it needs to create a new cars context
539
+ */
540
+ updateCssVars?: boolean
528
541
  }
529
542
 
530
543
  /**
@@ -534,6 +547,8 @@ export declare interface CardStyleProps {
534
547
  $checkered: boolean
535
548
  $focusRing: boolean
536
549
  $tone: ThemeColorToneKey
550
+ $scheme: ThemeColorSchemeKey
551
+ $updateCssVars: boolean
537
552
  }
538
553
 
539
554
  /**
@@ -545,7 +560,7 @@ export declare type CardTone = ThemeColorToneKey | 'inherit'
545
560
  * @public
546
561
  */
547
562
  export declare const Checkbox: ForwardRefExoticComponent<
548
- Omit<Omit<HTMLProps<HTMLInputElement>, 'as' | 'type'> & CheckboxProps, 'ref'> &
563
+ Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & CheckboxProps, 'ref'> &
549
564
  RefAttributes<HTMLInputElement>
550
565
  >
551
566
 
@@ -566,7 +581,7 @@ export declare type ClickOutsideListener = (event: MouseEvent) => void
566
581
  * @public
567
582
  */
568
583
  export declare const Code: ForwardRefExoticComponent<
569
- Omit<CodeProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as'>, 'ref'> & RefAttributes<HTMLElement>
584
+ Omit<CodeProps & Omit<HTMLProps<HTMLElement>, 'as' | 'size'>, 'ref'> & RefAttributes<HTMLElement>
570
585
  >
571
586
 
572
587
  /**
@@ -585,7 +600,7 @@ export declare interface CodeProps {
585
600
  */
586
601
  export declare const CodeSkeleton: ForwardRefExoticComponent<
587
602
  Omit<
588
- CodeSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'size' | 'height' | 'as'>,
603
+ CodeSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'size' | 'height'>,
589
604
  'ref'
590
605
  > &
591
606
  RefAttributes<HTMLDivElement>
@@ -603,7 +618,7 @@ export declare interface CodeSkeletonProps extends SkeletonProps {
603
618
  * @public
604
619
  */
605
620
  export declare const Container: ForwardRefExoticComponent<
606
- Omit<ContainerProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'width' | 'as'>, 'ref'> &
621
+ Omit<ContainerProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'width'>, 'ref'> &
607
622
  RefAttributes<HTMLDivElement>
608
623
  >
609
624
 
@@ -618,11 +633,19 @@ export declare interface ContainerProps extends BoxProps, ResponsiveWidthProps {
618
633
  export declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean
619
634
 
620
635
  /**
621
- * @public
636
+ * @internal
637
+ * @deprecated Use studioTheme instead.
622
638
  */
623
- export declare function createColorTheme(
624
- partialOpts?: PartialThemeColorBuilderOpts,
625
- ): ThemeColorSchemes
639
+ export declare function createColorTheme(): null
640
+
641
+ /**
642
+ * @beta
643
+ */
644
+ export declare const createCssVars: (
645
+ scheme: ThemeColorSchemeKey,
646
+ tones: Record<ThemeColorName, ColorTints>,
647
+ defaultTone?: ThemeColorName,
648
+ ) => Record<string, string>
626
649
 
627
650
  /** @internal */
628
651
  export declare type CSSObject = StyledObject<any>
@@ -630,6 +653,223 @@ export declare type CSSObject = StyledObject<any>
630
653
  /**
631
654
  * @beta
632
655
  */
656
+ export declare type CSSVariableKey = ThemeColorName & ('spot' | 'syntax' | 'mutable')
657
+
658
+ /**
659
+ * @beta
660
+ */
661
+ export declare const cssVars: {
662
+ /**
663
+ * This variables are mutable, they can be updated by other components.
664
+ * The main component that updates them is the card, these are the only ones that should be exposed for use from the cards.
665
+ */
666
+ mutable: Record<
667
+ 'bg-color' | 'muted-fg-color' | 'icon-color' | 'fg-color' | 'bg-image' | 'accent-color',
668
+ string
669
+ >
670
+ default: Record<
671
+ | 'text-primary'
672
+ | 'text-secondary'
673
+ | 'text-inactive'
674
+ | 'text-code'
675
+ | 'text-muted'
676
+ | 'text-link'
677
+ | 'text-accent'
678
+ | 'bg-base'
679
+ | 'bg-base-hover'
680
+ | 'bg-base-active'
681
+ | 'bg-accent'
682
+ | 'bg-accent-hover'
683
+ | 'bg-accent-active'
684
+ | 'bg-tint'
685
+ | 'bg-tint-code'
686
+ | 'icon-default'
687
+ | 'icon-inverted'
688
+ | 'border-base'
689
+ | 'border-base-hover'
690
+ | 'border-accent'
691
+ | 'border-accent-inverted'
692
+ | 'base-bg-card'
693
+ | 'base-bg-raw'
694
+ | 'base-shadow-outline-color'
695
+ | 'base-shadow-umbra-color'
696
+ | 'base-shadow-penumbra-color'
697
+ | 'base-shadow-ambient-color'
698
+ | 'base-text-color'
699
+ | 'skeleton-from'
700
+ | 'skeleton-to',
701
+ string
702
+ >
703
+ transparent: Record<
704
+ | 'text-primary'
705
+ | 'text-secondary'
706
+ | 'text-inactive'
707
+ | 'text-code'
708
+ | 'text-muted'
709
+ | 'text-link'
710
+ | 'text-accent'
711
+ | 'bg-base'
712
+ | 'bg-base-hover'
713
+ | 'bg-base-active'
714
+ | 'bg-accent'
715
+ | 'bg-accent-hover'
716
+ | 'bg-accent-active'
717
+ | 'bg-tint'
718
+ | 'bg-tint-code'
719
+ | 'icon-default'
720
+ | 'icon-inverted'
721
+ | 'border-base'
722
+ | 'border-base-hover'
723
+ | 'border-accent'
724
+ | 'border-accent-inverted'
725
+ | 'base-bg-card'
726
+ | 'base-bg-raw'
727
+ | 'base-shadow-outline-color'
728
+ | 'base-shadow-umbra-color'
729
+ | 'base-shadow-penumbra-color'
730
+ | 'base-shadow-ambient-color'
731
+ | 'base-text-color'
732
+ | 'skeleton-from'
733
+ | 'skeleton-to',
734
+ string
735
+ >
736
+ primary: Record<
737
+ | 'text-primary'
738
+ | 'text-secondary'
739
+ | 'text-inactive'
740
+ | 'text-code'
741
+ | 'text-muted'
742
+ | 'text-link'
743
+ | 'text-accent'
744
+ | 'bg-base'
745
+ | 'bg-base-hover'
746
+ | 'bg-base-active'
747
+ | 'bg-accent'
748
+ | 'bg-accent-hover'
749
+ | 'bg-accent-active'
750
+ | 'bg-tint'
751
+ | 'bg-tint-code'
752
+ | 'icon-default'
753
+ | 'icon-inverted'
754
+ | 'border-base'
755
+ | 'border-base-hover'
756
+ | 'border-accent'
757
+ | 'border-accent-inverted'
758
+ | 'base-bg-card'
759
+ | 'base-bg-raw'
760
+ | 'base-shadow-outline-color'
761
+ | 'base-shadow-umbra-color'
762
+ | 'base-shadow-penumbra-color'
763
+ | 'base-shadow-ambient-color'
764
+ | 'base-text-color'
765
+ | 'skeleton-from'
766
+ | 'skeleton-to',
767
+ string
768
+ >
769
+ positive: Record<
770
+ | 'text-primary'
771
+ | 'text-secondary'
772
+ | 'text-inactive'
773
+ | 'text-code'
774
+ | 'text-muted'
775
+ | 'text-link'
776
+ | 'text-accent'
777
+ | 'bg-base'
778
+ | 'bg-base-hover'
779
+ | 'bg-base-active'
780
+ | 'bg-accent'
781
+ | 'bg-accent-hover'
782
+ | 'bg-accent-active'
783
+ | 'bg-tint'
784
+ | 'bg-tint-code'
785
+ | 'icon-default'
786
+ | 'icon-inverted'
787
+ | 'border-base'
788
+ | 'border-base-hover'
789
+ | 'border-accent'
790
+ | 'border-accent-inverted'
791
+ | 'base-bg-card'
792
+ | 'base-bg-raw'
793
+ | 'base-shadow-outline-color'
794
+ | 'base-shadow-umbra-color'
795
+ | 'base-shadow-penumbra-color'
796
+ | 'base-shadow-ambient-color'
797
+ | 'base-text-color'
798
+ | 'skeleton-from'
799
+ | 'skeleton-to',
800
+ string
801
+ >
802
+ caution: Record<
803
+ | 'text-primary'
804
+ | 'text-secondary'
805
+ | 'text-inactive'
806
+ | 'text-code'
807
+ | 'text-muted'
808
+ | 'text-link'
809
+ | 'text-accent'
810
+ | 'bg-base'
811
+ | 'bg-base-hover'
812
+ | 'bg-base-active'
813
+ | 'bg-accent'
814
+ | 'bg-accent-hover'
815
+ | 'bg-accent-active'
816
+ | 'bg-tint'
817
+ | 'bg-tint-code'
818
+ | 'icon-default'
819
+ | 'icon-inverted'
820
+ | 'border-base'
821
+ | 'border-base-hover'
822
+ | 'border-accent'
823
+ | 'border-accent-inverted'
824
+ | 'base-bg-card'
825
+ | 'base-bg-raw'
826
+ | 'base-shadow-outline-color'
827
+ | 'base-shadow-umbra-color'
828
+ | 'base-shadow-penumbra-color'
829
+ | 'base-shadow-ambient-color'
830
+ | 'base-text-color'
831
+ | 'skeleton-from'
832
+ | 'skeleton-to',
833
+ string
834
+ >
835
+ critical: Record<
836
+ | 'text-primary'
837
+ | 'text-secondary'
838
+ | 'text-inactive'
839
+ | 'text-code'
840
+ | 'text-muted'
841
+ | 'text-link'
842
+ | 'text-accent'
843
+ | 'bg-base'
844
+ | 'bg-base-hover'
845
+ | 'bg-base-active'
846
+ | 'bg-accent'
847
+ | 'bg-accent-hover'
848
+ | 'bg-accent-active'
849
+ | 'bg-tint'
850
+ | 'bg-tint-code'
851
+ | 'icon-default'
852
+ | 'icon-inverted'
853
+ | 'border-base'
854
+ | 'border-base-hover'
855
+ | 'border-accent'
856
+ | 'border-accent-inverted'
857
+ | 'base-bg-card'
858
+ | 'base-bg-raw'
859
+ | 'base-shadow-outline-color'
860
+ | 'base-shadow-umbra-color'
861
+ | 'base-shadow-penumbra-color'
862
+ | 'base-shadow-ambient-color'
863
+ | 'base-text-color'
864
+ | 'skeleton-from'
865
+ | 'skeleton-to',
866
+ string
867
+ >
868
+ }
869
+
870
+ /**
871
+ * @public
872
+ */
633
873
  export declare type Delay =
634
874
  | number
635
875
  | Partial<{
@@ -641,7 +881,7 @@ export declare type Delay =
641
881
  * @public
642
882
  */
643
883
  export declare const Dialog: ForwardRefExoticComponent<
644
- Omit<DialogProps & Omit<HTMLProps<HTMLDivElement>, 'width' | 'id' | 'as'>, 'ref'> &
884
+ Omit<DialogProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'width' | 'id'>, 'ref'> &
645
885
  RefAttributes<HTMLDivElement>
646
886
  >
647
887
 
@@ -677,7 +917,7 @@ export declare interface DialogProps extends ResponsivePaddingProps, ResponsiveW
677
917
  * @beta
678
918
  */
679
919
  __unstable_hideCloseButton?: boolean
680
- cardRadius?: number | number[]
920
+ cardRadius?: Radius | Radius[]
681
921
  cardShadow?: number | number[]
682
922
  contentRef?: React.ForwardedRef<HTMLDivElement>
683
923
  footer?: React.ReactNode
@@ -799,7 +1039,7 @@ export declare function _fillCSSObject(
799
1039
  * @public
800
1040
  */
801
1041
  export declare const Flex: ForwardRefExoticComponent<
802
- Omit<FlexProps & Omit<HTMLProps<HTMLDivElement>, 'wrap' | 'as'>, 'ref'> &
1042
+ Omit<FlexProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'wrap'>, 'ref'> &
803
1043
  RefAttributes<HTMLDivElement>
804
1044
  >
805
1045
 
@@ -854,6 +1094,14 @@ export declare function focusFirstDescendant(element: HTMLElement): boolean
854
1094
  */
855
1095
  export declare function focusLastDescendant(element: HTMLElement): boolean
856
1096
 
1097
+ /**
1098
+ * @public
1099
+ */
1100
+ export declare interface FocusRing {
1101
+ offset: number
1102
+ width: number
1103
+ }
1104
+
857
1105
  /**
858
1106
  * @internal
859
1107
  */
@@ -879,7 +1127,7 @@ export declare function _getResponsiveSpace(
879
1127
  * @public
880
1128
  */
881
1129
  export declare const Grid: ForwardRefExoticComponent<
882
- Omit<GridProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'rows'>, 'ref'> &
1130
+ Omit<GridProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'rows'>, 'ref'> &
883
1131
  RefAttributes<HTMLDivElement>
884
1132
  >
885
1133
 
@@ -942,7 +1190,7 @@ export declare function _hasFocus(element: HTMLElement): boolean
942
1190
  * @public
943
1191
  */
944
1192
  export declare const Heading: ForwardRefExoticComponent<
945
- Omit<HeadingProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as'>, 'ref'> &
1193
+ Omit<HeadingProps & Omit<HTMLProps<HTMLElement>, 'as' | 'size'>, 'ref'> &
946
1194
  RefAttributes<HTMLElement>
947
1195
  >
948
1196
 
@@ -970,7 +1218,7 @@ export declare interface HeadingProps {
970
1218
  */
971
1219
  export declare const HeadingSkeleton: ForwardRefExoticComponent<
972
1220
  Omit<
973
- HeadingSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'size' | 'height' | 'as'>,
1221
+ HeadingSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'size' | 'height'>,
974
1222
  'ref'
975
1223
  > &
976
1224
  RefAttributes<HTMLDivElement>
@@ -993,7 +1241,7 @@ export declare function hexToRgb(hex: string): RGB
993
1241
  * @public
994
1242
  */
995
1243
  export declare const Hotkeys: ForwardRefExoticComponent<
996
- HotkeysProps & Omit<HTMLProps<HTMLElement>, 'ref' | 'size' | 'as'> & RefAttributes<HTMLElement>
1244
+ HotkeysProps & Omit<HTMLProps<HTMLElement>, 'ref' | 'as' | 'size'> & RefAttributes<HTMLElement>
997
1245
  >
998
1246
 
999
1247
  /**
@@ -1002,7 +1250,7 @@ export declare const Hotkeys: ForwardRefExoticComponent<
1002
1250
  export declare interface HotkeysProps {
1003
1251
  fontSize?: number | number[]
1004
1252
  padding?: number | number[]
1005
- radius?: number | number[]
1253
+ radius?: Radius | Radius[]
1006
1254
  space?: number | number[]
1007
1255
  keys?: string[]
1008
1256
  }
@@ -1084,7 +1332,7 @@ export declare function _isScrollable(el: Node): boolean
1084
1332
  * @public
1085
1333
  */
1086
1334
  export declare const KBD: ForwardRefExoticComponent<
1087
- KBDProps & Omit<HTMLProps<HTMLElement>, 'ref' | 'size' | 'as'> & RefAttributes<HTMLDivElement>
1335
+ KBDProps & Omit<HTMLProps<HTMLElement>, 'ref' | 'as' | 'size'> & RefAttributes<HTMLDivElement>
1088
1336
  >
1089
1337
 
1090
1338
  /**
@@ -1094,14 +1342,14 @@ export declare interface KBDProps {
1094
1342
  as?: React.ElementType | keyof JSX.IntrinsicElements
1095
1343
  fontSize?: number | number[]
1096
1344
  padding?: number | number[]
1097
- radius?: number | number[]
1345
+ radius?: Radius | Radius[]
1098
1346
  }
1099
1347
 
1100
1348
  /**
1101
1349
  * @public
1102
1350
  */
1103
1351
  export declare const Label: ForwardRefExoticComponent<
1104
- Omit<LabelProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
1352
+ Omit<LabelProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'size'>, 'ref'> &
1105
1353
  RefAttributes<HTMLDivElement>
1106
1354
  >
1107
1355
 
@@ -1129,7 +1377,7 @@ export declare interface LabelProps {
1129
1377
  */
1130
1378
  export declare const LabelSkeleton: ForwardRefExoticComponent<
1131
1379
  Omit<
1132
- LabelSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'size' | 'height' | 'as'>,
1380
+ LabelSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'size' | 'height'>,
1133
1381
  'ref'
1134
1382
  > &
1135
1383
  RefAttributes<HTMLDivElement>
@@ -1204,7 +1452,7 @@ export declare interface _MediaStore {
1204
1452
  * @public
1205
1453
  */
1206
1454
  export declare const Menu: ForwardRefExoticComponent<
1207
- Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'tabIndex' | 'role' | 'as'>, 'ref'> &
1455
+ Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'tabIndex' | 'role'>, 'ref'> &
1208
1456
  RefAttributes<HTMLDivElement>
1209
1457
  >
1210
1458
 
@@ -1244,7 +1492,7 @@ export declare interface MenuButtonProps {
1244
1492
  /**
1245
1493
  * @deprecated Use `popover={{radius: 2}}` instead.
1246
1494
  */
1247
- popoverRadius?: number | number[]
1495
+ popoverRadius?: Radius | Radius[]
1248
1496
  /**
1249
1497
  * @beta Do not use in production.
1250
1498
  * @deprecated Use `popover={{portal: true}}` instead.
@@ -1312,8 +1560,8 @@ export declare const MenuDivider: IStyledComponent<
1312
1560
  security?: string | undefined
1313
1561
  unselectable?: 'on' | 'off' | undefined
1314
1562
  inputMode?:
1315
- | 'text'
1316
1563
  | 'search'
1564
+ | 'text'
1317
1565
  | 'none'
1318
1566
  | 'tel'
1319
1567
  | 'url'
@@ -1592,7 +1840,7 @@ export declare interface MenuGroupProps {
1592
1840
  icon?: React.ElementType | React.ReactNode
1593
1841
  padding?: number | number[]
1594
1842
  popover?: Omit<PopoverProps, 'content' | 'open'>
1595
- radius?: number | number[]
1843
+ radius?: Radius | Radius[]
1596
1844
  space?: number | number[]
1597
1845
  text: React.ReactNode
1598
1846
  tone?: SelectableTone
@@ -1603,7 +1851,7 @@ export declare interface MenuGroupProps {
1603
1851
  */
1604
1852
  export declare const MenuItem: ForwardRefExoticComponent<
1605
1853
  MenuItemProps &
1606
- Omit<HTMLProps<HTMLDivElement>, 'selected' | 'ref' | 'height' | 'tabIndex' | 'as'> &
1854
+ Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as' | 'height' | 'tabIndex' | 'selected'> &
1607
1855
  RefAttributes<HTMLDivElement>
1608
1856
  >
1609
1857
 
@@ -1620,7 +1868,7 @@ export declare interface MenuItemProps extends ResponsivePaddingProps, Responsiv
1620
1868
  selected?: boolean
1621
1869
  space?: number | number[]
1622
1870
  text?: React.ReactNode
1623
- tone?: SelectableTone
1871
+ tone?: ThemeColorToneKey
1624
1872
  }
1625
1873
 
1626
1874
  /**
@@ -1650,17 +1898,12 @@ export declare interface MenuProps extends ResponsivePaddingProps {
1650
1898
  * Source: https://www.w3.org/TR/compositing-1/#blendingmultiply
1651
1899
  * @internal
1652
1900
  */
1653
- export declare function multiply(b: RGB, s: RGB): RGB
1901
+ export declare function multiply(b: RGB | RGBA, s: RGB | RGBA): RGB
1654
1902
 
1655
1903
  /**
1656
1904
  * @internal
1657
1905
  */
1658
- export declare function parseColor(color: unknown): RGB
1659
-
1660
- /**
1661
- * @public
1662
- */
1663
- export declare type PartialThemeColorBuilderOpts = Partial<ThemeColorBuilderOpts>
1906
+ export declare function parseColor(color: unknown): RGB | RGBA
1664
1907
 
1665
1908
  /**
1666
1909
  * Placement of floating UI elements.
@@ -1685,7 +1928,7 @@ export declare type Placement =
1685
1928
  export declare const Popover: MemoExoticComponent<
1686
1929
  ForwardRefExoticComponent<
1687
1930
  Omit<
1688
- PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'content' | 'width' | 'as'>,
1931
+ PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'content' | 'width'>,
1689
1932
  'ref'
1690
1933
  > &
1691
1934
  RefAttributes<HTMLDivElement>
@@ -1788,7 +2031,7 @@ export declare interface PortalProviderProps {
1788
2031
  * @public
1789
2032
  */
1790
2033
  export declare const Radio: ForwardRefExoticComponent<
1791
- Omit<Omit<HTMLProps<HTMLInputElement>, 'as' | 'type'> & RadioProps, 'ref'> &
2034
+ Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & RadioProps, 'ref'> &
1792
2035
  RefAttributes<HTMLInputElement>
1793
2036
  >
1794
2037
 
@@ -1799,6 +2042,11 @@ export declare interface RadioProps {
1799
2042
  customValidity?: string
1800
2043
  }
1801
2044
 
2045
+ /**
2046
+ * @public
2047
+ */
2048
+ export declare type Radius = number | 'full'
2049
+
1802
2050
  /**
1803
2051
  * @internal
1804
2052
  */
@@ -1971,7 +2219,7 @@ export declare interface ResponsivePaddingProps {
1971
2219
  * @public
1972
2220
  */
1973
2221
  export declare interface ResponsiveRadiusProps {
1974
- radius?: number | number[]
2222
+ radius?: Radius | Radius[]
1975
2223
  }
1976
2224
 
1977
2225
  /**
@@ -2025,6 +2273,17 @@ export declare interface RGB {
2025
2273
  r: number
2026
2274
  g: number
2027
2275
  b: number
2276
+ a?: undefined
2277
+ }
2278
+
2279
+ /**
2280
+ * @internal
2281
+ */
2282
+ export declare interface RGBA {
2283
+ r: number
2284
+ g: number
2285
+ b: number
2286
+ a: number
2028
2287
  }
2029
2288
 
2030
2289
  /**
@@ -2032,6 +2291,11 @@ export declare interface RGB {
2032
2291
  */
2033
2292
  export declare function rgba(color: unknown, a: number): string
2034
2293
 
2294
+ /**
2295
+ * @internal
2296
+ */
2297
+ export declare function rgbaToRGBA(rgba: string): RGBA
2298
+
2035
2299
  /**
2036
2300
  * @internal
2037
2301
  */
@@ -2053,7 +2317,7 @@ export declare type RootTheme = BaseTheme<Styles>
2053
2317
  * Source: https://www.w3.org/TR/compositing-1/#blendingscreen
2054
2318
  * @internal
2055
2319
  */
2056
- declare function screen_2(b: RGB, s: RGB): RGB
2320
+ declare function screen_2(b: RGB | RGBA, s: RGB | RGBA): RGB
2057
2321
  export {screen_2 as screen}
2058
2322
 
2059
2323
  /**
@@ -2075,7 +2339,7 @@ export declare type SelectableTone = 'default' | 'primary' | 'positive' | 'cauti
2075
2339
  export declare interface SelectProps {
2076
2340
  fontSize?: number | number[]
2077
2341
  padding?: number | number[]
2078
- radius?: number | number[]
2342
+ radius?: Radius | Radius[]
2079
2343
  space?: number | number[]
2080
2344
  customValidity?: string
2081
2345
  }
@@ -2101,7 +2365,7 @@ export declare interface SkeletonProps extends ResponsiveRadiusProps, Omit<BoxPr
2101
2365
  * @public
2102
2366
  */
2103
2367
  export declare const Spinner: ForwardRefExoticComponent<
2104
- Omit<SpinnerProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
2368
+ Omit<SpinnerProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'size'>, 'ref'> &
2105
2369
  RefAttributes<HTMLDivElement>
2106
2370
  >
2107
2371
 
@@ -2117,7 +2381,7 @@ export declare interface SpinnerProps {
2117
2381
  * @public
2118
2382
  */
2119
2383
  export declare const SrOnly: ForwardRefExoticComponent<
2120
- Omit<SrOnlyProps & Omit<HTMLProps<HTMLDivElement>, 'aria-hidden' | 'as'>, 'ref'> &
2384
+ Omit<SrOnlyProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'aria-hidden'>, 'ref'> &
2121
2385
  RefAttributes<HTMLDivElement>
2122
2386
  >
2123
2387
 
@@ -2166,7 +2430,7 @@ export declare interface Styles {
2166
2430
  * @public
2167
2431
  */
2168
2432
  export declare const Switch: ForwardRefExoticComponent<
2169
- Omit<Omit<HTMLProps<HTMLInputElement>, 'as' | 'type'> & SwitchProps, 'ref'> &
2433
+ Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & SwitchProps, 'ref'> &
2170
2434
  RefAttributes<HTMLInputElement>
2171
2435
  >
2172
2436
 
@@ -2182,7 +2446,7 @@ export declare interface SwitchProps {
2182
2446
  */
2183
2447
  export declare const Tab: ForwardRefExoticComponent<
2184
2448
  Omit<
2185
- TabProps & Omit<HTMLProps<HTMLButtonElement>, 'label' | 'id' | 'aria-controls' | 'as' | 'type'>,
2449
+ TabProps & Omit<HTMLProps<HTMLButtonElement>, 'type' | 'label' | 'as' | 'id' | 'aria-controls'>,
2186
2450
  'ref'
2187
2451
  > &
2188
2452
  RefAttributes<HTMLButtonElement>
@@ -2192,7 +2456,7 @@ export declare const Tab: ForwardRefExoticComponent<
2192
2456
  * @public
2193
2457
  */
2194
2458
  export declare const TabList: ForwardRefExoticComponent<
2195
- Omit<TabListProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
2459
+ Omit<TabListProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height'>, 'ref'> &
2196
2460
  RefAttributes<unknown>
2197
2461
  >
2198
2462
 
@@ -2208,7 +2472,7 @@ export declare interface TabListProps extends Omit<InlineProps, 'as' | 'height'>
2208
2472
  */
2209
2473
  export declare const TabPanel: ForwardRefExoticComponent<
2210
2474
  Omit<
2211
- TabPanelProps & Omit<HTMLProps<HTMLDivElement>, 'id' | 'role' | 'aria-labelledby' | 'as'>,
2475
+ TabPanelProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'id' | 'role' | 'aria-labelledby'>,
2212
2476
  'ref'
2213
2477
  > &
2214
2478
  RefAttributes<HTMLDivElement>
@@ -2247,7 +2511,7 @@ export declare interface TabProps {
2247
2511
  * @public
2248
2512
  */
2249
2513
  declare const Text_2: ForwardRefExoticComponent<
2250
- Omit<TextProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
2514
+ Omit<TextProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'size'>, 'ref'> &
2251
2515
  RefAttributes<HTMLDivElement>
2252
2516
  >
2253
2517
  export {Text_2 as Text}
@@ -2274,13 +2538,14 @@ export declare interface TextAreaProps extends ResponsiveRadiusProps {
2274
2538
  fontSize?: number | number[]
2275
2539
  padding?: number | number[]
2276
2540
  weight?: ThemeFontWeightKey
2541
+ tone?: ThemeColorToneKey
2277
2542
  }
2278
2543
 
2279
2544
  /**
2280
2545
  * @public
2281
2546
  */
2282
2547
  export declare const TextInput: ForwardRefExoticComponent<
2283
- Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'prefix' | 'as' | 'type'>, 'ref'> &
2548
+ Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | 'as' | 'prefix'>, 'ref'> &
2284
2549
  RefAttributes<HTMLInputElement>
2285
2550
  >
2286
2551
 
@@ -2309,11 +2574,12 @@ export declare interface TextInputProps {
2309
2574
  onClear?: () => void
2310
2575
  padding?: number | number[]
2311
2576
  prefix?: React.ReactNode
2312
- radius?: number | number[]
2577
+ radius?: Radius | Radius[]
2313
2578
  space?: number | number[]
2314
2579
  suffix?: React.ReactNode
2315
2580
  type?: TextInputType
2316
2581
  weight?: ThemeFontWeightKey
2582
+ tone?: ThemeColorToneKey
2317
2583
  }
2318
2584
 
2319
2585
  /**
@@ -2357,7 +2623,7 @@ export declare interface TextProps {
2357
2623
  */
2358
2624
  export declare const TextSkeleton: ForwardRefExoticComponent<
2359
2625
  Omit<
2360
- TextSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'size' | 'height' | 'as'>,
2626
+ TextSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'size' | 'height'>,
2361
2627
  'ref'
2362
2628
  > &
2363
2629
  RefAttributes<HTMLDivElement>
@@ -2375,9 +2641,7 @@ export declare interface TextSkeletonProps extends SkeletonProps {
2375
2641
  * @public
2376
2642
  */
2377
2643
  export declare interface Theme {
2378
- sanity: Omit<RootTheme, 'color'> & {
2379
- color: ThemeColor
2380
- }
2644
+ sanity: RootTheme
2381
2645
  }
2382
2646
 
2383
2647
  /**
@@ -2388,237 +2652,7 @@ export declare interface ThemeAvatar {
2388
2652
  distance: number
2389
2653
  size: number
2390
2654
  }[]
2391
- }
2392
-
2393
- /**
2394
- * @public
2395
- */
2396
- export declare interface ThemeColor {
2397
- dark: boolean
2398
- base: ThemeColorBase
2399
- button: ThemeColorButton
2400
- card: ThemeColorCard
2401
- input: ThemeColorInput
2402
- selectable?: ThemeColorSelectable
2403
- spot: ThemeColorSpot
2404
- syntax: ThemeColorSyntax
2405
- solid: ThemeColorSolid
2406
- muted: ThemeColorMuted
2407
- }
2408
-
2409
- /**
2410
- * @public
2411
- */
2412
- export declare interface ThemeColorBase {
2413
- bg: string
2414
- fg: string
2415
- border: string
2416
- focusRing: string
2417
- shadow: {
2418
- outline: string
2419
- umbra: string
2420
- penumbra: string
2421
- ambient: string
2422
- }
2423
- skeleton?: {
2424
- from: string
2425
- to: string
2426
- }
2427
- }
2428
-
2429
- /**
2430
- * @public
2431
- */
2432
- export declare interface ThemeColorBuilderOpts {
2433
- base: (opts: {dark: boolean; name: ThemeColorName}) => ThemeColorBase
2434
- solid: (opts: {
2435
- base: ThemeColorBase
2436
- dark: boolean
2437
- tone: ThemeColorToneKey
2438
- name: ThemeColorName
2439
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
2440
- }) => ThemeColorGenericState
2441
- muted: (opts: {
2442
- base: ThemeColorBase
2443
- dark: boolean
2444
- tone: ThemeColorToneKey
2445
- name: ThemeColorName
2446
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
2447
- }) => ThemeColorGenericState
2448
- card: (opts: {
2449
- base: ThemeColorBase
2450
- dark: boolean
2451
- muted: ThemeColorMuted
2452
- name: ThemeColorName
2453
- solid: ThemeColorSolid
2454
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
2455
- }) => ThemeColorCardState
2456
- button: (opts: {
2457
- dark: boolean
2458
- mode: ThemeColorButtonModeKey
2459
- base: ThemeColorBase
2460
- solid: ThemeColorSolidTone
2461
- muted: ThemeColorMutedTone
2462
- }) => ThemeColorButtonStates
2463
- input: (opts: {
2464
- base: ThemeColorBase
2465
- solid: ThemeColorSolidTone
2466
- muted: ThemeColorMutedTone
2467
- dark: boolean
2468
- mode: 'default' | 'invalid'
2469
- state: 'enabled' | 'disabled' | 'hovered' | 'readOnly'
2470
- }) => ThemeColorInputState
2471
- selectable: (opts: {
2472
- dark: boolean
2473
- base: ThemeColorBase
2474
- solid: ThemeColorSolid
2475
- muted: ThemeColorMuted
2476
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
2477
- tone: 'default' | 'primary' | 'positive' | 'caution' | 'critical'
2478
- }) => ThemeColorSelectableState
2479
- syntax: (opts: {base: ThemeColorBase; dark: boolean}) => ThemeColorSyntax
2480
- spot: (opts: {base: ThemeColorBase; dark: boolean; key: ThemeColorSpotKey}) => string
2481
- }
2482
-
2483
- /**
2484
- * @public
2485
- */
2486
- export declare interface ThemeColorButton {
2487
- default: ThemeColorButtonTones
2488
- ghost: ThemeColorButtonTones
2489
- bleed: ThemeColorButtonTones
2490
- }
2491
-
2492
- /**
2493
- * @public
2494
- */
2495
- export declare type ThemeColorButtonModeKey = 'default' | 'ghost' | 'bleed'
2496
-
2497
- /**
2498
- * @deprecated Use `ThemeColorGenericState` instead.
2499
- * @public
2500
- */
2501
- export declare type ThemeColorButtonState = ThemeColorGenericState
2502
-
2503
- /**
2504
- * @public
2505
- */
2506
- export declare interface ThemeColorButtonStates {
2507
- enabled: ThemeColorButtonState
2508
- hovered: ThemeColorButtonState
2509
- pressed: ThemeColorButtonState
2510
- selected: ThemeColorButtonState
2511
- disabled: ThemeColorButtonState
2512
- }
2513
-
2514
- /**
2515
- * TODO: Rename to `ThemeColorButtonMode`.
2516
- * @public
2517
- */
2518
- export declare interface ThemeColorButtonTones {
2519
- default: ThemeColorButtonStates
2520
- primary: ThemeColorButtonStates
2521
- positive: ThemeColorButtonStates
2522
- caution: ThemeColorButtonStates
2523
- critical: ThemeColorButtonStates
2524
- }
2525
-
2526
- /**
2527
- * @public
2528
- */
2529
- export declare interface ThemeColorCard {
2530
- enabled: ThemeColorCardState
2531
- hovered: ThemeColorCardState
2532
- pressed: ThemeColorCardState
2533
- selected: ThemeColorCardState
2534
- disabled: ThemeColorCardState
2535
- }
2536
-
2537
- /**
2538
- * @deprecated Use `ThemeColorGenericState` instead.
2539
- * @public
2540
- */
2541
- export declare type ThemeColorCardState = ThemeColorGenericState
2542
-
2543
- /**
2544
- * @public
2545
- */
2546
- export declare interface ThemeColorGenericState {
2547
- bg: string
2548
- /**
2549
- * @beta
2550
- */
2551
- bg2?: string
2552
- border: string
2553
- fg: string
2554
- muted: {
2555
- fg: string
2556
- }
2557
- accent: {
2558
- fg: string
2559
- }
2560
- link: {
2561
- fg: string
2562
- }
2563
- code: {
2564
- bg: string
2565
- fg: string
2566
- }
2567
- skeleton?: {
2568
- from: string
2569
- to: string
2570
- }
2571
- }
2572
-
2573
- /**
2574
- * @public
2575
- */
2576
- export declare interface ThemeColorInput {
2577
- default: ThemeColorInputStates
2578
- invalid: ThemeColorInputStates
2579
- }
2580
-
2581
- /**
2582
- * @public
2583
- */
2584
- export declare interface ThemeColorInputState {
2585
- bg: string
2586
- fg: string
2587
- border: string
2588
- placeholder: string
2589
- }
2590
-
2591
- /**
2592
- * @public
2593
- */
2594
- export declare interface ThemeColorInputStates {
2595
- enabled: ThemeColorInputState
2596
- disabled: ThemeColorInputState
2597
- hovered: ThemeColorInputState
2598
- readOnly: ThemeColorInputState
2599
- }
2600
-
2601
- /**
2602
- * @public
2603
- */
2604
- export declare interface ThemeColorMuted {
2605
- default: ThemeColorMutedTone
2606
- transparent: ThemeColorMutedTone
2607
- primary: ThemeColorMutedTone
2608
- positive: ThemeColorMutedTone
2609
- caution: ThemeColorMutedTone
2610
- critical: ThemeColorMutedTone
2611
- }
2612
-
2613
- /**
2614
- * @public
2615
- */
2616
- export declare interface ThemeColorMutedTone {
2617
- enabled: ThemeColorGenericState
2618
- disabled: ThemeColorGenericState
2619
- hovered: ThemeColorGenericState
2620
- pressed: ThemeColorGenericState
2621
- selected: ThemeColorGenericState
2655
+ focusRing: FocusRing
2622
2656
  }
2623
2657
 
2624
2658
  /**
@@ -2634,11 +2668,13 @@ export declare type ThemeColorName =
2634
2668
 
2635
2669
  /**
2636
2670
  * @public
2671
+ * @deprecated Use `toneContext` instead.
2637
2672
  */
2638
2673
  export declare function ThemeColorProvider(props: ThemeColorProviderProps): React.ReactElement
2639
2674
 
2640
2675
  /**
2641
2676
  * @public
2677
+ * @deprecated
2642
2678
  */
2643
2679
  export declare interface ThemeColorProviderProps {
2644
2680
  children?: React.ReactNode
@@ -2646,18 +2682,6 @@ export declare interface ThemeColorProviderProps {
2646
2682
  tone?: ThemeColorName
2647
2683
  }
2648
2684
 
2649
- /**
2650
- * @public
2651
- */
2652
- export declare interface ThemeColorScheme {
2653
- default: ThemeColor
2654
- transparent: ThemeColor
2655
- primary: ThemeColor
2656
- positive: ThemeColor
2657
- caution: ThemeColor
2658
- critical: ThemeColor
2659
- }
2660
-
2661
2685
  /**
2662
2686
  * @public
2663
2687
  */
@@ -2667,74 +2691,7 @@ export declare type ThemeColorSchemeKey = 'dark' | 'light'
2667
2691
  * @public
2668
2692
  */
2669
2693
  export declare interface ThemeColorSchemes {
2670
- dark: ThemeColorScheme
2671
- light: ThemeColorScheme
2672
- }
2673
-
2674
- /**
2675
- * @public
2676
- */
2677
- export declare interface ThemeColorSelectable {
2678
- default: ThemeColorSelectableStates
2679
- primary: ThemeColorSelectableStates
2680
- positive: ThemeColorSelectableStates
2681
- caution: ThemeColorSelectableStates
2682
- critical: ThemeColorSelectableStates
2683
- }
2684
-
2685
- /**
2686
- * @deprecated Use `ThemeColorGenericState` instead.
2687
- * @public
2688
- */
2689
- export declare type ThemeColorSelectableState = ThemeColorGenericState
2690
-
2691
- /**
2692
- * @public
2693
- */
2694
- export declare interface ThemeColorSelectableStates {
2695
- enabled: ThemeColorSelectableState
2696
- hovered: ThemeColorSelectableState
2697
- pressed: ThemeColorSelectableState
2698
- selected: ThemeColorSelectableState
2699
- disabled: ThemeColorSelectableState
2700
- }
2701
-
2702
- /**
2703
- * @public
2704
- */
2705
- export declare interface ThemeColorSolid {
2706
- default: ThemeColorSolidTone
2707
- transparent: ThemeColorSolidTone
2708
- primary: ThemeColorSolidTone
2709
- positive: ThemeColorSolidTone
2710
- caution: ThemeColorSolidTone
2711
- critical: ThemeColorSolidTone
2712
- }
2713
-
2714
- /**
2715
- * @public
2716
- */
2717
- export declare interface ThemeColorSolidTone {
2718
- enabled: ThemeColorGenericState
2719
- disabled: ThemeColorGenericState
2720
- hovered: ThemeColorGenericState
2721
- pressed: ThemeColorGenericState
2722
- selected: ThemeColorGenericState
2723
- }
2724
-
2725
- /**
2726
- * @public
2727
- */
2728
- export declare interface ThemeColorSpot {
2729
- gray: string
2730
- blue: string
2731
- purple: string
2732
- magenta: string
2733
- red: string
2734
- orange: string
2735
- yellow: string
2736
- green: string
2737
- cyan: string
2694
+ tones: Record<ThemeColorName, ColorTints>
2738
2695
  }
2739
2696
 
2740
2697
  /**
@@ -2751,48 +2708,6 @@ export declare type ThemeColorSpotKey =
2751
2708
  | 'green'
2752
2709
  | 'cyan'
2753
2710
 
2754
- /**
2755
- * @public
2756
- */
2757
- export declare interface ThemeColorSyntax {
2758
- atrule: string
2759
- attrName: string
2760
- attrValue: string
2761
- attribute: string
2762
- boolean: string
2763
- builtin: string
2764
- cdata: string
2765
- char: string
2766
- class: string
2767
- className: string
2768
- comment: string
2769
- constant: string
2770
- deleted: string
2771
- doctype: string
2772
- entity: string
2773
- function: string
2774
- hexcode: string
2775
- id: string
2776
- important: string
2777
- inserted: string
2778
- keyword: string
2779
- number: string
2780
- operator: string
2781
- prolog: string
2782
- property: string
2783
- pseudoClass: string
2784
- pseudoElement: string
2785
- punctuation: string
2786
- regex: string
2787
- selector: string
2788
- string: string
2789
- symbol: string
2790
- tag: string
2791
- unit: string
2792
- url: string
2793
- variable: string
2794
- }
2795
-
2796
2711
  /**
2797
2712
  * @public
2798
2713
  */
@@ -2873,10 +2788,12 @@ export declare type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bo
2873
2788
  export declare interface ThemeInput {
2874
2789
  checkbox: {
2875
2790
  size: number
2791
+ focusRing: FocusRing
2876
2792
  }
2877
2793
  radio: {
2878
2794
  size: number
2879
2795
  markSize: number
2796
+ focusRing: FocusRing
2880
2797
  }
2881
2798
  switch: {
2882
2799
  width: number
@@ -2884,10 +2801,17 @@ export declare interface ThemeInput {
2884
2801
  padding: number
2885
2802
  transitionDurationMs: number
2886
2803
  transitionTimingFunction: string
2804
+ focusRing: FocusRing
2887
2805
  }
2888
2806
  border: {
2889
2807
  width: number
2890
2808
  }
2809
+ select: {
2810
+ focusRing: FocusRing
2811
+ }
2812
+ text: {
2813
+ focusRing: FocusRing
2814
+ }
2891
2815
  }
2892
2816
 
2893
2817
  /**
@@ -2996,7 +2920,7 @@ export declare interface ToastProviderProps {
2996
2920
  * @public
2997
2921
  */
2998
2922
  export declare const Tooltip: ForwardRefExoticComponent<
2999
- Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'content' | 'as'>, 'ref'> &
2923
+ Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'content'>, 'ref'> &
3000
2924
  RefAttributes<HTMLDivElement>
3001
2925
  >
3002
2926
 
@@ -3074,7 +2998,7 @@ export declare interface TooltipProps extends Omit<LayerProps, 'as'> {
3074
2998
  export declare const Tree: MemoExoticComponent<
3075
2999
  ForwardRefExoticComponent<
3076
3000
  TreeProps &
3077
- Omit<HTMLProps<HTMLDivElement>, 'ref' | 'wrap' | 'height' | 'role' | 'as' | 'align'> &
3001
+ Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as' | 'wrap' | 'height' | 'role' | 'align'> &
3078
3002
  RefAttributes<HTMLDivElement>
3079
3003
  >
3080
3004
  >
@@ -3099,7 +3023,7 @@ export declare interface TreeContextValue {
3099
3023
  * @beta
3100
3024
  */
3101
3025
  export declare const TreeItem: NamedExoticComponent<
3102
- TreeItemProps & Omit<HTMLProps<HTMLLIElement>, 'ref' | 'role' | 'as'>
3026
+ TreeItemProps & Omit<HTMLProps<HTMLLIElement>, 'ref' | 'as' | 'role'>
3103
3027
  >
3104
3028
 
3105
3029
  /**
@@ -3264,7 +3188,7 @@ export declare function useTree(): TreeContextValue
3264
3188
  export declare const VirtualList: ForwardRefExoticComponent<
3265
3189
  VirtualListProps<any> &
3266
3190
  StackProps &
3267
- Omit<HTMLProps<HTMLDivElement>, 'children' | 'ref' | 'onChange' | 'as'> &
3191
+ Omit<HTMLProps<HTMLDivElement>, 'children' | 'ref' | 'as' | 'onChange'> &
3268
3192
  RefAttributes<HTMLDivElement>
3269
3193
  >
3270
3194