@sanity/ui 3.0.0-static.10 → 3.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.
Files changed (71) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +160 -207
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +161 -208
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +1 -3
  6. package/dist/_visual-editing.d.ts +1 -3
  7. package/dist/cli.js +1 -1
  8. package/dist/css.d.mts +115 -2
  9. package/dist/css.d.ts +115 -2
  10. package/dist/css.js +539 -402
  11. package/dist/css.js.map +1 -1
  12. package/dist/css.mjs +541 -404
  13. package/dist/css.mjs.map +1 -1
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +50 -17
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +45 -12
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/sanity-theme.css +1 -1
  21. package/dist/system.css +418 -182
  22. package/dist/theme.js +10 -11
  23. package/dist/theme.js.map +1 -1
  24. package/dist/theme.mjs +10 -11
  25. package/dist/theme.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/src/css/_resp.ts +0 -1
  28. package/src/css/aspects/font/font.style.ts +7 -66
  29. package/src/css/aspects/shadow/shadow.style.ts +16 -41
  30. package/src/css/compile/compilePalette.ts +4 -3
  31. package/src/css/compile/compileSystem.ts +0 -3
  32. package/src/css/compile/compileTheme_v3.ts +233 -219
  33. package/src/css/components/skeleton/skeleton.style.ts +8 -4
  34. package/src/css/constants.ts +9 -0
  35. package/src/css/index.ts +1 -0
  36. package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
  37. package/src/css/primitives/_arrow/_arrow.ts +4 -0
  38. package/src/css/primitives/_selectable/_selectable.style.ts +23 -23
  39. package/src/css/primitives/button/button.style.ts +48 -15
  40. package/src/css/primitives/card/card.style.ts +1 -1
  41. package/src/css/primitives/token/token.style.ts +37 -36
  42. package/src/css/responsiveRules.ts +12 -19
  43. package/src/css/types.ts +106 -3
  44. package/src/css/varNames.ts +101 -4
  45. package/src/css/vars.ts +52 -16
  46. package/src/theme/v3/buildTheme_v3.ts +1 -1
  47. package/src/theme/v3/{defaults.ts → defaultTokens.ts} +1 -2
  48. package/src/theme/v3/index.ts +1 -1
  49. package/src/theme/v3/resolveTokens.ts +9 -9
  50. package/src/ui/RootClassNames.tsx +41 -0
  51. package/src/ui/_compat/helpers.ts +72 -0
  52. package/src/ui/_compat/index.ts +2 -6
  53. package/src/ui/_compat/studioTheme.ts +7 -0
  54. package/src/ui/_compat/types.ts +0 -83
  55. package/src/ui/index.ts +1 -0
  56. package/src/ui/primitives/button/button.tsx +5 -6
  57. package/src/ui/primitives/popover/popover.tsx +25 -7
  58. package/src/ui/primitives/popover/popoverCard.tsx +46 -45
  59. package/src/ui/primitives/tooltip/tooltip.tsx +9 -2
  60. package/src/ui/primitives/tooltip/tooltipCard.tsx +1 -1
  61. package/src/ui/utils/arrow/arrow.tsx +3 -11
  62. package/src/ui/utils/elementQuery/elementQuery.tsx +10 -8
  63. package/src/ui/utils/virtualList/virtualList.tsx +37 -32
  64. package/src/css/components/breadcrumbs/rules.ts +0 -25
  65. package/src/css/components/dialog/rules.ts +0 -78
  66. package/src/css/components/skeleton/rules.ts +0 -113
  67. package/src/css/components/toast/rules.ts +0 -18
  68. package/src/css/components/tree/rules.ts +0 -168
  69. package/src/css/primitives/popover/rules.ts +0 -5
  70. package/src/css/primitives/spinner/rules.ts +0 -21
  71. package/src/css/primitives/token/rules.ts +0 -45
@@ -585,9 +585,7 @@ export declare interface StackProps
585
585
  * @public
586
586
  * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
587
587
  */
588
- export declare const studioTheme: {
589
- readonly value: RootTheme
590
- }
588
+ export declare const studioTheme: RootTheme
591
589
 
592
590
  /**
593
591
  * @public
@@ -585,9 +585,7 @@ export declare interface StackProps
585
585
  * @public
586
586
  * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
587
587
  */
588
- export declare const studioTheme: {
589
- readonly value: RootTheme
590
- }
588
+ export declare const studioTheme: RootTheme
591
589
 
592
590
  /**
593
591
  * @public
package/dist/cli.js CHANGED
@@ -335,7 +335,7 @@ class CAC extends events.EventEmitter {
335
335
  }
336
336
  }
337
337
  const cac = (name = "") => new CAC(name);
338
- var version = "3.0.0-static.10";
338
+ var version = "3.0.0-static.11";
339
339
  const cli = cac("ui");
340
340
  cli.command("build").option("--cwd [cwd]", "Working directory").option("--outDir [outDir]", "Output directory").action(async (options) => {
341
341
  const {
package/dist/css.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {AvatarSize} from '@sanity/ui/theme'
2
+ import {ColorTintKey} from '@sanity/color'
2
3
  import {ContainerWidth} from '@sanity/ui/theme'
3
4
  import {default as CSS_2} from 'csstype'
4
5
  import {FontCodeSize} from '@sanity/ui/theme'
@@ -28,6 +29,8 @@ export declare function _arrowShape(): string | undefined
28
29
 
29
30
  export declare function _arrowStroke(): string | undefined
30
31
 
32
+ export declare function _arrowStrokeMask(): string | undefined
33
+
31
34
  export declare function avatar(props: AvatarStyleProps): string | undefined
32
35
 
33
36
  export declare function avatarArrow(): string | undefined
@@ -114,6 +117,15 @@ export declare interface BoxStyleProps
114
117
 
115
118
  export declare function breadcrumbs(): string | undefined
116
119
 
120
+ export declare const BREAKPOINTS: {
121
+ 1: number
122
+ 2: number
123
+ 3: number
124
+ 4: number
125
+ 5: number
126
+ 6: number
127
+ }
128
+
117
129
  export declare function button(props: ButtonStyleProps): string | undefined
118
130
 
119
131
  export declare function buttonLoadingBox(): string | undefined
@@ -777,8 +789,9 @@ export declare interface FontStyleProps {
777
789
 
778
790
  export declare interface FontVarNames<Size extends number> {
779
791
  family: VarName
792
+ featureSettings: VarName
780
793
  sizes: Record<Size, FontSizeVarNames>
781
- weight: Record<FontWeight, VarName>
794
+ weights: Record<FontWeight, VarName>
782
795
  }
783
796
 
784
797
  /** @public */
@@ -1078,6 +1091,8 @@ export declare interface PositionStyleProps {
1078
1091
  position?: ResponsiveProp<Position>
1079
1092
  }
1080
1093
 
1094
+ export declare const PREFIX = 's-'
1095
+
1081
1096
  /** @public */
1082
1097
  export declare type Properties = PropertiesWithVarsAndNested & {
1083
1098
  '@media'?: Record<string, PropertiesWithVarsAndNested>
@@ -1277,7 +1292,7 @@ export declare type ThemeVarName =
1277
1292
  | `--card-border-width`
1278
1293
  | `--card-focus-ring-offset`
1279
1294
  | `--card-focus-ring-width`
1280
- | `--shadow-outline`
1295
+ | `--card-shadow-outline`
1281
1296
  | `--container-${ContainerWidth}`
1282
1297
  | `--font-code-family`
1283
1298
  | `--font-code-feature-settings`
@@ -1376,6 +1391,20 @@ export declare type VarName =
1376
1391
 
1377
1392
  /** @public */
1378
1393
  export declare interface VarNames {
1394
+ button: {
1395
+ border: {
1396
+ width: VarName
1397
+ }
1398
+ focusRing: {
1399
+ offset: VarName
1400
+ width: VarName
1401
+ }
1402
+ }
1403
+ card: {
1404
+ shadow: {
1405
+ outline: VarName
1406
+ }
1407
+ }
1379
1408
  color: Record<ThemeColorSchemeKey, ColorSchemeVarNames> &
1380
1409
  ScopedColorVarNames &
1381
1410
  Record<ThemeColorCardToneKey, ColorCardVarNames>
@@ -1402,6 +1431,47 @@ export declare interface VarNames {
1402
1431
  text: FontVarNames<FontTextSize>
1403
1432
  }
1404
1433
  input: {
1434
+ border: {
1435
+ width: VarName
1436
+ }
1437
+ checkbox: {
1438
+ focusRing: {
1439
+ offset: VarName
1440
+ width: VarName
1441
+ }
1442
+ size: VarName
1443
+ }
1444
+ radio: {
1445
+ focusRing: {
1446
+ offset: VarName
1447
+ width: VarName
1448
+ }
1449
+ markSize: VarName
1450
+ size: VarName
1451
+ }
1452
+ select: {
1453
+ focusRing: {
1454
+ offset: VarName
1455
+ width: VarName
1456
+ }
1457
+ }
1458
+ switch: {
1459
+ focusRing: {
1460
+ offset: VarName
1461
+ width: VarName
1462
+ }
1463
+ height: VarName
1464
+ padding: VarName
1465
+ transitionDurationMs: VarName
1466
+ transitionTimingFunction: VarName
1467
+ width: VarName
1468
+ }
1469
+ text: {
1470
+ focusRing: {
1471
+ offset: VarName
1472
+ width: VarName
1473
+ }
1474
+ }
1405
1475
  fontSize: VarName
1406
1476
  lineHeight: VarName
1407
1477
  letterSpacing: VarName
@@ -1411,7 +1481,26 @@ export declare interface VarNames {
1411
1481
  padding: VarName
1412
1482
  }
1413
1483
  radius: Record<Radius, VarName>
1484
+ shadow: Record<
1485
+ Shadow,
1486
+ {
1487
+ umbra: VarName
1488
+ penumbra: VarName
1489
+ ambient: VarName
1490
+ }
1491
+ >
1414
1492
  space: Record<Space, VarName>
1493
+ black: VarName
1494
+ white: VarName
1495
+ gray: Record<ColorTintKey, VarName>
1496
+ blue: Record<ColorTintKey, VarName>
1497
+ purple: Record<ColorTintKey, VarName>
1498
+ magenta: Record<ColorTintKey, VarName>
1499
+ red: Record<ColorTintKey, VarName>
1500
+ orange: Record<ColorTintKey, VarName>
1501
+ yellow: Record<ColorTintKey, VarName>
1502
+ green: Record<ColorTintKey, VarName>
1503
+ cyan: Record<ColorTintKey, VarName>
1415
1504
  }
1416
1505
 
1417
1506
  export declare const varNames: VarNames
@@ -1429,6 +1518,11 @@ export declare interface Vars {
1429
1518
  }
1430
1519
  >
1431
1520
  }
1521
+ card: {
1522
+ shadow: {
1523
+ outline: CSSVar
1524
+ }
1525
+ }
1432
1526
  color: {
1433
1527
  dark: ColorSchemeVars
1434
1528
  light: ColorSchemeVars
@@ -1457,7 +1551,26 @@ export declare interface Vars {
1457
1551
  }
1458
1552
  }
1459
1553
  radius: Record<Radius, CSSVar>
1554
+ shadow: Record<
1555
+ Shadow,
1556
+ {
1557
+ umbra: CSSVar
1558
+ penumbra: CSSVar
1559
+ ambient: CSSVar
1560
+ }
1561
+ >
1460
1562
  space: Record<Space, CSSVar>
1563
+ black: CSSVar
1564
+ white: CSSVar
1565
+ gray: Record<ColorTintKey, CSSVar>
1566
+ blue: Record<ColorTintKey, CSSVar>
1567
+ purple: Record<ColorTintKey, CSSVar>
1568
+ magenta: Record<ColorTintKey, CSSVar>
1569
+ red: Record<ColorTintKey, CSSVar>
1570
+ orange: Record<ColorTintKey, CSSVar>
1571
+ yellow: Record<ColorTintKey, CSSVar>
1572
+ green: Record<ColorTintKey, CSSVar>
1573
+ cyan: Record<ColorTintKey, CSSVar>
1461
1574
  }
1462
1575
 
1463
1576
  export declare const vars: Vars
package/dist/css.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {AvatarSize} from '@sanity/ui/theme'
2
+ import {ColorTintKey} from '@sanity/color'
2
3
  import {ContainerWidth} from '@sanity/ui/theme'
3
4
  import {default as CSS_2} from 'csstype'
4
5
  import {FontCodeSize} from '@sanity/ui/theme'
@@ -28,6 +29,8 @@ export declare function _arrowShape(): string | undefined
28
29
 
29
30
  export declare function _arrowStroke(): string | undefined
30
31
 
32
+ export declare function _arrowStrokeMask(): string | undefined
33
+
31
34
  export declare function avatar(props: AvatarStyleProps): string | undefined
32
35
 
33
36
  export declare function avatarArrow(): string | undefined
@@ -114,6 +117,15 @@ export declare interface BoxStyleProps
114
117
 
115
118
  export declare function breadcrumbs(): string | undefined
116
119
 
120
+ export declare const BREAKPOINTS: {
121
+ 1: number
122
+ 2: number
123
+ 3: number
124
+ 4: number
125
+ 5: number
126
+ 6: number
127
+ }
128
+
117
129
  export declare function button(props: ButtonStyleProps): string | undefined
118
130
 
119
131
  export declare function buttonLoadingBox(): string | undefined
@@ -777,8 +789,9 @@ export declare interface FontStyleProps {
777
789
 
778
790
  export declare interface FontVarNames<Size extends number> {
779
791
  family: VarName
792
+ featureSettings: VarName
780
793
  sizes: Record<Size, FontSizeVarNames>
781
- weight: Record<FontWeight, VarName>
794
+ weights: Record<FontWeight, VarName>
782
795
  }
783
796
 
784
797
  /** @public */
@@ -1078,6 +1091,8 @@ export declare interface PositionStyleProps {
1078
1091
  position?: ResponsiveProp<Position>
1079
1092
  }
1080
1093
 
1094
+ export declare const PREFIX = 's-'
1095
+
1081
1096
  /** @public */
1082
1097
  export declare type Properties = PropertiesWithVarsAndNested & {
1083
1098
  '@media'?: Record<string, PropertiesWithVarsAndNested>
@@ -1277,7 +1292,7 @@ export declare type ThemeVarName =
1277
1292
  | `--card-border-width`
1278
1293
  | `--card-focus-ring-offset`
1279
1294
  | `--card-focus-ring-width`
1280
- | `--shadow-outline`
1295
+ | `--card-shadow-outline`
1281
1296
  | `--container-${ContainerWidth}`
1282
1297
  | `--font-code-family`
1283
1298
  | `--font-code-feature-settings`
@@ -1376,6 +1391,20 @@ export declare type VarName =
1376
1391
 
1377
1392
  /** @public */
1378
1393
  export declare interface VarNames {
1394
+ button: {
1395
+ border: {
1396
+ width: VarName
1397
+ }
1398
+ focusRing: {
1399
+ offset: VarName
1400
+ width: VarName
1401
+ }
1402
+ }
1403
+ card: {
1404
+ shadow: {
1405
+ outline: VarName
1406
+ }
1407
+ }
1379
1408
  color: Record<ThemeColorSchemeKey, ColorSchemeVarNames> &
1380
1409
  ScopedColorVarNames &
1381
1410
  Record<ThemeColorCardToneKey, ColorCardVarNames>
@@ -1402,6 +1431,47 @@ export declare interface VarNames {
1402
1431
  text: FontVarNames<FontTextSize>
1403
1432
  }
1404
1433
  input: {
1434
+ border: {
1435
+ width: VarName
1436
+ }
1437
+ checkbox: {
1438
+ focusRing: {
1439
+ offset: VarName
1440
+ width: VarName
1441
+ }
1442
+ size: VarName
1443
+ }
1444
+ radio: {
1445
+ focusRing: {
1446
+ offset: VarName
1447
+ width: VarName
1448
+ }
1449
+ markSize: VarName
1450
+ size: VarName
1451
+ }
1452
+ select: {
1453
+ focusRing: {
1454
+ offset: VarName
1455
+ width: VarName
1456
+ }
1457
+ }
1458
+ switch: {
1459
+ focusRing: {
1460
+ offset: VarName
1461
+ width: VarName
1462
+ }
1463
+ height: VarName
1464
+ padding: VarName
1465
+ transitionDurationMs: VarName
1466
+ transitionTimingFunction: VarName
1467
+ width: VarName
1468
+ }
1469
+ text: {
1470
+ focusRing: {
1471
+ offset: VarName
1472
+ width: VarName
1473
+ }
1474
+ }
1405
1475
  fontSize: VarName
1406
1476
  lineHeight: VarName
1407
1477
  letterSpacing: VarName
@@ -1411,7 +1481,26 @@ export declare interface VarNames {
1411
1481
  padding: VarName
1412
1482
  }
1413
1483
  radius: Record<Radius, VarName>
1484
+ shadow: Record<
1485
+ Shadow,
1486
+ {
1487
+ umbra: VarName
1488
+ penumbra: VarName
1489
+ ambient: VarName
1490
+ }
1491
+ >
1414
1492
  space: Record<Space, VarName>
1493
+ black: VarName
1494
+ white: VarName
1495
+ gray: Record<ColorTintKey, VarName>
1496
+ blue: Record<ColorTintKey, VarName>
1497
+ purple: Record<ColorTintKey, VarName>
1498
+ magenta: Record<ColorTintKey, VarName>
1499
+ red: Record<ColorTintKey, VarName>
1500
+ orange: Record<ColorTintKey, VarName>
1501
+ yellow: Record<ColorTintKey, VarName>
1502
+ green: Record<ColorTintKey, VarName>
1503
+ cyan: Record<ColorTintKey, VarName>
1415
1504
  }
1416
1505
 
1417
1506
  export declare const varNames: VarNames
@@ -1429,6 +1518,11 @@ export declare interface Vars {
1429
1518
  }
1430
1519
  >
1431
1520
  }
1521
+ card: {
1522
+ shadow: {
1523
+ outline: CSSVar
1524
+ }
1525
+ }
1432
1526
  color: {
1433
1527
  dark: ColorSchemeVars
1434
1528
  light: ColorSchemeVars
@@ -1457,7 +1551,26 @@ export declare interface Vars {
1457
1551
  }
1458
1552
  }
1459
1553
  radius: Record<Radius, CSSVar>
1554
+ shadow: Record<
1555
+ Shadow,
1556
+ {
1557
+ umbra: CSSVar
1558
+ penumbra: CSSVar
1559
+ ambient: CSSVar
1560
+ }
1561
+ >
1460
1562
  space: Record<Space, CSSVar>
1563
+ black: CSSVar
1564
+ white: CSSVar
1565
+ gray: Record<ColorTintKey, CSSVar>
1566
+ blue: Record<ColorTintKey, CSSVar>
1567
+ purple: Record<ColorTintKey, CSSVar>
1568
+ magenta: Record<ColorTintKey, CSSVar>
1569
+ red: Record<ColorTintKey, CSSVar>
1570
+ orange: Record<ColorTintKey, CSSVar>
1571
+ yellow: Record<ColorTintKey, CSSVar>
1572
+ green: Record<ColorTintKey, CSSVar>
1573
+ cyan: Record<ColorTintKey, CSSVar>
1461
1574
  }
1462
1575
 
1463
1576
  export declare const vars: Vars