@sanity/ui 4.0.0-static.1 → 4.0.0-static.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.
@@ -7,7 +7,6 @@ import {ColorTokens as ColorTokens_2} from '@sanity/ui/theme'
7
7
  import type {ColorVariant} from '@sanity/ui/theme'
8
8
  import type {ContainerScale} from '@sanity/ui/theme'
9
9
  import type {ContainerWidth} from '@sanity/ui/theme'
10
- import type {createThemeContract} from '@vanilla-extract/css'
11
10
  import type {ElementTone} from '@sanity/ui/theme'
12
11
  import type {FontCodeSize} from '@sanity/ui/theme'
13
12
  import type {FontHeadingSize} from '@sanity/ui/theme'
@@ -360,6 +359,10 @@ export declare type CoreThemeTokens = {
360
359
  space: Record<Space, string>
361
360
  }
362
361
 
362
+ declare function createThemeContract<ThemeTokens extends NullableTokens_2>(
363
+ tokens: ThemeTokens,
364
+ ): ThemeVars_2<ThemeTokens>
365
+
363
366
  /** @public */
364
367
  export declare type CSSCardColorTokens = {
365
368
  avatar: Record<
@@ -440,6 +443,8 @@ export declare type CSSThemeOptions = {
440
443
  /** @public */
441
444
  export declare type CSSVarFunction = `var(${CSSVarName})`
442
445
 
446
+ declare type CSSVarFunction_2 = `var(--${string})`
447
+
443
448
  /** @public */
444
449
  export declare type CSSVarName = `--${string}`
445
450
 
@@ -840,6 +845,14 @@ export declare interface LabelStyleProps extends FlexStyleProps, FontStyleProps
840
845
  /** @public */
841
846
  export declare const layers: Record<CSSLayer, string>
842
847
 
848
+ declare type MapLeafNodes<Obj, LeafType> = {
849
+ [Prop in keyof Obj]: Obj[Prop] extends Primitive
850
+ ? LeafType
851
+ : Obj[Prop] extends Record<string | number, any>
852
+ ? MapLeafNodes<Obj[Prop], LeafType>
853
+ : never
854
+ }
855
+
843
856
  /** @public */
844
857
  export declare type Margin = Space | 'auto'
845
858
 
@@ -901,6 +914,10 @@ export declare type NullableTokens = {
901
914
  [key: string]: string | NullableTokens
902
915
  }
903
916
 
917
+ declare type NullableTokens_2 = {
918
+ [key: string]: string | NullableTokens_2 | null
919
+ }
920
+
904
921
  /** @public */
905
922
  export declare type Outline = 'none'
906
923
 
@@ -973,6 +990,8 @@ export declare interface PositionStyleProps {
973
990
  position?: ResponsiveProp<Position>
974
991
  }
975
992
 
993
+ declare type Primitive = string | boolean | number | null | undefined
994
+
976
995
  /** @public */
977
996
  export declare function radio(props: {className?: string}): string | undefined
978
997
 
@@ -1329,6 +1348,11 @@ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1329
1348
  * @internal */
1330
1349
  export declare const themeVars: ThemeContract<ThemeTokens>
1331
1350
 
1351
+ declare type ThemeVars_2<ThemeContract extends NullableTokens_2> = MapLeafNodes<
1352
+ ThemeContract,
1353
+ CSSVarFunction_2
1354
+ >
1355
+
1332
1356
  /** @public */
1333
1357
  export declare function toast(): string
1334
1358
 
@@ -7,7 +7,6 @@ import {ColorTokens as ColorTokens_2} from '@sanity/ui/theme'
7
7
  import type {ColorVariant} from '@sanity/ui/theme'
8
8
  import type {ContainerScale} from '@sanity/ui/theme'
9
9
  import type {ContainerWidth} from '@sanity/ui/theme'
10
- import type {createThemeContract} from '@vanilla-extract/css'
11
10
  import type {ElementTone} from '@sanity/ui/theme'
12
11
  import type {FontCodeSize} from '@sanity/ui/theme'
13
12
  import type {FontHeadingSize} from '@sanity/ui/theme'
@@ -360,6 +359,10 @@ export declare type CoreThemeTokens = {
360
359
  space: Record<Space, string>
361
360
  }
362
361
 
362
+ declare function createThemeContract<ThemeTokens extends NullableTokens_2>(
363
+ tokens: ThemeTokens,
364
+ ): ThemeVars_2<ThemeTokens>
365
+
363
366
  /** @public */
364
367
  export declare type CSSCardColorTokens = {
365
368
  avatar: Record<
@@ -440,6 +443,8 @@ export declare type CSSThemeOptions = {
440
443
  /** @public */
441
444
  export declare type CSSVarFunction = `var(${CSSVarName})`
442
445
 
446
+ declare type CSSVarFunction_2 = `var(--${string})`
447
+
443
448
  /** @public */
444
449
  export declare type CSSVarName = `--${string}`
445
450
 
@@ -840,6 +845,14 @@ export declare interface LabelStyleProps extends FlexStyleProps, FontStyleProps
840
845
  /** @public */
841
846
  export declare const layers: Record<CSSLayer, string>
842
847
 
848
+ declare type MapLeafNodes<Obj, LeafType> = {
849
+ [Prop in keyof Obj]: Obj[Prop] extends Primitive
850
+ ? LeafType
851
+ : Obj[Prop] extends Record<string | number, any>
852
+ ? MapLeafNodes<Obj[Prop], LeafType>
853
+ : never
854
+ }
855
+
843
856
  /** @public */
844
857
  export declare type Margin = Space | 'auto'
845
858
 
@@ -901,6 +914,10 @@ export declare type NullableTokens = {
901
914
  [key: string]: string | NullableTokens
902
915
  }
903
916
 
917
+ declare type NullableTokens_2 = {
918
+ [key: string]: string | NullableTokens_2 | null
919
+ }
920
+
904
921
  /** @public */
905
922
  export declare type Outline = 'none'
906
923
 
@@ -973,6 +990,8 @@ export declare interface PositionStyleProps {
973
990
  position?: ResponsiveProp<Position>
974
991
  }
975
992
 
993
+ declare type Primitive = string | boolean | number | null | undefined
994
+
976
995
  /** @public */
977
996
  export declare function radio(props: {className?: string}): string | undefined
978
997
 
@@ -1329,6 +1348,11 @@ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1329
1348
  * @internal */
1330
1349
  export declare const themeVars: ThemeContract<ThemeTokens>
1331
1350
 
1351
+ declare type ThemeVars_2<ThemeContract extends NullableTokens_2> = MapLeafNodes<
1352
+ ThemeContract,
1353
+ CSSVarFunction_2
1354
+ >
1355
+
1332
1356
  /** @public */
1333
1357
  export declare function toast(): string
1334
1358
 
package/dist/index.cjs CHANGED
@@ -1040,7 +1040,6 @@ function Popover(props) {
1040
1040
  matchReferenceWidth,
1041
1041
  floatingBoundary = boundaryElementContext.element,
1042
1042
  modal,
1043
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1044
1043
  onActivate,
1045
1044
  open,
1046
1045
  overflow = "hidden",