@sanity/ui 4.0.0-static.2 → 4.0.0-static.21

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 (74) hide show
  1. package/dist/css/index.css +2 -1
  2. package/dist/css/index.css.map +1 -0
  3. package/dist/css/index.d.ts +29 -1
  4. package/dist/css/index.js +17965 -50
  5. package/dist/css/index.js.map +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +14 -16
  8. package/dist/index.js.map +1 -1
  9. package/package.json +38 -48
  10. package/src/core/components/autocomplete/__workshop__/custom.tsx +14 -1
  11. package/src/core/components/autocomplete/__workshop__/example.tsx +12 -1
  12. package/src/core/components/dialog/__workshop__/position.tsx +9 -1
  13. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  14. package/src/core/components/menu/__workshop__/menuButton.tsx +6 -1
  15. package/src/core/components/menu/__workshop__/tones.tsx +7 -1
  16. package/src/core/components/menu/menu.tsx +1 -1
  17. package/src/core/components/menu/menuButton.tsx +10 -5
  18. package/src/core/components/menu/menuContext.ts +1 -1
  19. package/src/core/components/menu/menuGroup.tsx +7 -4
  20. package/src/core/components/menu/menuItem.tsx +1 -1
  21. package/src/core/components/toast/__workshop__/toast.tsx +2 -0
  22. package/src/core/primitives/avatar/__workshop__/asButton.tsx +8 -1
  23. package/src/core/primitives/avatar/__workshop__/stack.tsx +5 -1
  24. package/src/core/primitives/badge/__workshop__/props.tsx +12 -1
  25. package/src/core/primitives/box/__workshop__/props.tsx +6 -1
  26. package/src/core/primitives/button/__workshop__/props.tsx +22 -0
  27. package/src/core/primitives/button/__workshop__/stacked.tsx +16 -0
  28. package/src/core/primitives/card/__workshop__/props.tsx +10 -0
  29. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  30. package/src/core/primitives/card/card.tsx +2 -2
  31. package/src/core/primitives/code/__workshop__/props.tsx +6 -1
  32. package/src/core/primitives/container/__workshop__/example.tsx +6 -1
  33. package/src/core/primitives/flex/__workshop__/example.tsx +7 -1
  34. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -1
  35. package/src/core/primitives/inline/__workshop__/plain.tsx +5 -1
  36. package/src/core/primitives/label/__workshop__/plain.tsx +15 -1
  37. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +13 -1
  38. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +2 -0
  39. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +8 -0
  40. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +7 -1
  41. package/src/core/primitives/popover/__workshop__/TestStory.tsx +6 -0
  42. package/src/core/primitives/popover/popover.tsx +0 -1
  43. package/src/core/primitives/select/__workshop__/plain.tsx +4 -0
  44. package/src/core/primitives/skeleton/__workshop__/delay.tsx +9 -1
  45. package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +9 -1
  46. package/src/core/primitives/spinner/__workshop__/Props.tsx +6 -1
  47. package/src/core/primitives/stack/__workshop__/plain.tsx +4 -1
  48. package/src/core/primitives/text/__workshop__/colored.tsx +8 -1
  49. package/src/core/primitives/text/__workshop__/example.tsx +15 -1
  50. package/src/core/primitives/textArea/__workshop__/plain.tsx +8 -0
  51. package/src/core/primitives/textInput/__workshop__/plain.tsx +34 -4
  52. package/src/core/primitives/textInput/__workshop__/typed.tsx +7 -1
  53. package/src/core/primitives/textInput/textInput.tsx +1 -1
  54. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +2 -0
  55. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -0
  56. package/src/core/primitives/tooltip/__workshop__/props.tsx +12 -0
  57. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +5 -0
  58. package/src/css/primitives/avatar/avatar.css.ts +9 -5
  59. package/src/css/primitives/card/__workshop__/color.tsx +9 -1
  60. package/src/css/primitives/card/card.css.ts +10 -0
  61. package/src/css/theme/buildCSSTheme.ts +4 -0
  62. package/src/css/types.ts +4 -0
  63. package/src/css/vars.css.ts +4 -0
  64. package/dist/_chunks-cjs/refractor.cjs +0 -22
  65. package/dist/_chunks-cjs/refractor.cjs.map +0 -1
  66. package/dist/css/index.cjs +0 -966
  67. package/dist/css/index.cjs.map +0 -1
  68. package/dist/css/index.d.cts +0 -1370
  69. package/dist/index.cjs +0 -4515
  70. package/dist/index.cjs.map +0 -1
  71. package/dist/index.d.cts +0 -2521
  72. package/dist/theme.cjs +0 -870
  73. package/dist/theme.cjs.map +0 -1
  74. package/dist/theme.d.cts +0 -499
@@ -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'
@@ -293,6 +292,10 @@ export declare type CoreThemeTokens = {
293
292
  border: {
294
293
  width: string
295
294
  }
295
+ focusRing: {
296
+ offset: string
297
+ width: string
298
+ }
296
299
  shadow: {
297
300
  outline: string
298
301
  }
@@ -360,6 +363,10 @@ export declare type CoreThemeTokens = {
360
363
  space: Record<Space, string>
361
364
  }
362
365
 
366
+ declare function createThemeContract<ThemeTokens extends NullableTokens_2>(
367
+ tokens: ThemeTokens,
368
+ ): ThemeVars_2<ThemeTokens>
369
+
363
370
  /** @public */
364
371
  export declare type CSSCardColorTokens = {
365
372
  avatar: Record<
@@ -440,6 +447,8 @@ export declare type CSSThemeOptions = {
440
447
  /** @public */
441
448
  export declare type CSSVarFunction = `var(${CSSVarName})`
442
449
 
450
+ declare type CSSVarFunction_2 = `var(--${string})`
451
+
443
452
  /** @public */
444
453
  export declare type CSSVarName = `--${string}`
445
454
 
@@ -840,6 +849,14 @@ export declare interface LabelStyleProps extends FlexStyleProps, FontStyleProps
840
849
  /** @public */
841
850
  export declare const layers: Record<CSSLayer, string>
842
851
 
852
+ declare type MapLeafNodes<Obj, LeafType> = {
853
+ [Prop in keyof Obj]: Obj[Prop] extends Primitive
854
+ ? LeafType
855
+ : Obj[Prop] extends Record<string | number, any>
856
+ ? MapLeafNodes<Obj[Prop], LeafType>
857
+ : never
858
+ }
859
+
843
860
  /** @public */
844
861
  export declare type Margin = Space | 'auto'
845
862
 
@@ -901,6 +918,10 @@ export declare type NullableTokens = {
901
918
  [key: string]: string | NullableTokens
902
919
  }
903
920
 
921
+ declare type NullableTokens_2 = {
922
+ [key: string]: string | NullableTokens_2 | null
923
+ }
924
+
904
925
  /** @public */
905
926
  export declare type Outline = 'none'
906
927
 
@@ -973,6 +994,8 @@ export declare interface PositionStyleProps {
973
994
  position?: ResponsiveProp<Position>
974
995
  }
975
996
 
997
+ declare type Primitive = string | boolean | number | null | undefined
998
+
976
999
  /** @public */
977
1000
  export declare function radio(props: {className?: string}): string | undefined
978
1001
 
@@ -1329,6 +1352,11 @@ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1329
1352
  * @internal */
1330
1353
  export declare const themeVars: ThemeContract<ThemeTokens>
1331
1354
 
1355
+ declare type ThemeVars_2<ThemeContract extends NullableTokens_2> = MapLeafNodes<
1356
+ ThemeContract,
1357
+ CSSVarFunction_2
1358
+ >
1359
+
1332
1360
  /** @public */
1333
1361
  export declare function toast(): string
1334
1362