@sanity/ui 3.0.0-static.16 → 3.0.0-static.18

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 (98) hide show
  1. package/README.md +2 -4
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +6 -6
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
  6. package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
  7. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
  8. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  9. package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +7 -7
  10. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  11. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
  12. package/dist/_chunks-es/refractor.js.map +1 -0
  13. package/dist/_visual-editing.cjs +30 -0
  14. package/dist/_visual-editing.cjs.map +1 -0
  15. package/dist/_visual-editing.js +29 -29
  16. package/dist/_visual-editing.js.map +1 -1
  17. package/dist/{cli.js → cli.cjs} +4 -4
  18. package/dist/cli.cjs.map +1 -0
  19. package/dist/{css.mjs → css.cjs} +491 -499
  20. package/dist/css.cjs.map +1 -0
  21. package/dist/{css.d.mts → css.d.cts} +26 -26
  22. package/dist/css.d.ts +26 -26
  23. package/dist/css.js +491 -497
  24. package/dist/css.js.map +1 -1
  25. package/dist/{index.mjs → index.cjs} +368 -367
  26. package/dist/{index.mjs.map → index.cjs.map} +1 -1
  27. package/dist/{index.d.mts → index.d.cts} +3 -2
  28. package/dist/index.d.ts +3 -2
  29. package/dist/index.js +366 -367
  30. package/dist/index.js.map +1 -1
  31. package/dist/{theme.mjs → theme.cjs} +219 -196
  32. package/dist/theme.cjs.map +1 -0
  33. package/dist/{theme.d.mts → theme.d.cts} +2 -0
  34. package/dist/theme.d.ts +2 -0
  35. package/dist/theme.js +218 -195
  36. package/dist/theme.js.map +1 -1
  37. package/dist/{sanity-palette.css → ui-palette.css} +1 -1
  38. package/dist/ui-palette.min.css +1 -0
  39. package/dist/{system.css → ui-system.css} +258 -140
  40. package/dist/ui-system.min.css +1 -0
  41. package/dist/{sanity-theme.css → ui-theme.css} +199 -199
  42. package/dist/ui-theme.min.css +1 -0
  43. package/dist/ui.css +29152 -0
  44. package/dist/ui.min.css +1 -0
  45. package/package.json +20 -20
  46. package/src/cli/buildCommand.ts +55 -20
  47. package/src/cli/index.ts +1 -1
  48. package/src/core/StyleTags.tsx +4 -4
  49. package/src/core/components/autocomplete/__workshop__/async.tsx +2 -2
  50. package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
  51. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
  52. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -18
  53. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +9 -9
  54. package/src/core/primitives/button/__workshop__/custom.tsx +18 -41
  55. package/src/core/primitives/button/button.tsx +3 -1
  56. package/src/core/primitives/card/__workshop__/asButton.tsx +0 -9
  57. package/src/core/primitives/card/__workshop__/interactive.tsx +0 -1
  58. package/src/core/primitives/card/__workshop__/props.tsx +0 -3
  59. package/src/core/primitives/card/__workshop__/selected.tsx +6 -37
  60. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
  61. package/src/core/primitives/heading/__workshop__/plain.tsx +1 -8
  62. package/src/core/primitives/label/__workshop__/plain.tsx +1 -9
  63. package/src/core/primitives/text/__workshop__/example.tsx +1 -9
  64. package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
  65. package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
  66. package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
  67. package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
  68. package/src/css/_system.style.ts +1 -0
  69. package/src/css/constants.ts +1 -0
  70. package/src/css/index.ts +3 -3
  71. package/src/css/primitives/button/button.style.ts +23 -9
  72. package/src/css/primitives/button/button.ts +1 -12
  73. package/src/css/primitives/button/types.ts +1 -6
  74. package/src/css/primitives/card/card.style.ts +12 -21
  75. package/src/css/primitives/kbd/kbd.style.ts +3 -6
  76. package/src/css/types.ts +32 -27
  77. package/src/theme/v3/color/buildColor_v3.ts +53 -25
  78. package/src/theme/v3/color/card.ts +0 -42
  79. package/src/theme/v3/color/renderColor.test.ts +1 -0
  80. package/src/theme/v3/color/renderColor.ts +9 -2
  81. package/src/theme/v3/color/token.ts +1 -0
  82. package/src/theme/v3/defaultTokens.ts +7 -2
  83. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  84. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  85. package/dist/_chunks-cjs/refractor.js.map +0 -1
  86. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  87. package/dist/_chunks-es/refractor.mjs.map +0 -1
  88. package/dist/_visual-editing.mjs +0 -30
  89. package/dist/_visual-editing.mjs.map +0 -1
  90. package/dist/cli.js.map +0 -1
  91. package/dist/css.mjs.map +0 -1
  92. package/dist/sanity-palette.min.css +0 -1
  93. package/dist/sanity-theme.min.css +0 -1
  94. package/dist/system.min.css +0 -1
  95. package/dist/theme.mjs.map +0 -1
  96. package/src/css/primitives/button/_constants.ts +0 -17
  97. /package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +0 -0
  98. /package/dist/{cli.d.ts → cli.d.cts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import {AvatarSize} from '@sanity/ui/theme'
2
- import {ColorTintKey} from '@sanity/color'
2
+ import type {ColorTintKey} from '@sanity/color'
3
3
  import {ContainerWidth} from '@sanity/ui/theme'
4
4
  import {default as CSS_2} from 'csstype'
5
5
  import {FontCodeSize} from '@sanity/ui/theme'
@@ -7,18 +7,17 @@ import {FontHeadingSize} from '@sanity/ui/theme'
7
7
  import {FontLabelSize} from '@sanity/ui/theme'
8
8
  import {FontTextSize} from '@sanity/ui/theme'
9
9
  import {FontWeight} from '@sanity/ui/theme'
10
- import {Hue} from '@sanity/ui/theme'
10
+ import type {Hue} from '@sanity/ui/theme'
11
11
  import {Radius} from '@sanity/ui/theme'
12
12
  import {RootTheme} from '@sanity/ui/theme'
13
13
  import {Shadow} from '@sanity/ui/theme'
14
14
  import {Space} from '@sanity/ui/theme'
15
15
  import {ThemeBoxShadow} from '@sanity/ui/theme'
16
16
  import {ThemeColorAvatarColorKey} from '@sanity/ui/theme'
17
- import {ThemeColorButtonModeKey} from '@sanity/ui/theme'
18
17
  import {ThemeColorCardToneKey} from '@sanity/ui/theme'
19
18
  import {ThemeColorSchemeKey} from '@sanity/ui/theme'
20
19
  import {ThemeColorStateToneKey} from '@sanity/ui/theme'
21
- import {Tint} from '@sanity/ui/theme'
20
+ import type {Tint} from '@sanity/ui/theme'
22
21
 
23
22
  /** @public */
24
23
  export declare function animatedSpinnerIcon(): string | undefined
@@ -127,8 +126,12 @@ export declare interface BoxStyleProps
127
126
  /** @public */
128
127
  export declare function breadcrumbs(): string | undefined
129
128
 
129
+ /** @public */
130
+ export declare type Breakpoint = keyof typeof BREAKPOINTS
131
+
130
132
  /** @public */
131
133
  export declare const BREAKPOINTS: {
134
+ 0: number
132
135
  1: number
133
136
  2: number
134
137
  3: number
@@ -151,10 +154,7 @@ export declare interface ButtonStyleProps
151
154
  extends DisplayStyleProps,
152
155
  FlexItemStyleProps,
153
156
  RadiusStyleProps,
154
- WidthStyleProps {
155
- mode?: ThemeColorButtonModeKey
156
- tone?: ThemeColorStateToneKey
157
- }
157
+ WidthStyleProps {}
158
158
 
159
159
  /** @public */
160
160
  export declare function card(props: CardStyleProps): string | undefined
@@ -629,13 +629,13 @@ export declare interface ColorVariantVars
629
629
  export declare type Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
630
630
 
631
631
  /** @internal */
632
- export declare function compilePalette(): string
632
+ export declare function _compilePalette(): string
633
633
 
634
634
  /** @internal */
635
- export declare function compileSystem(): string
635
+ export declare function _compileSystem(): string
636
636
 
637
637
  /** @internal */
638
- export declare function compileTheme(theme: RootTheme): string
638
+ export declare function _compileTheme(theme: RootTheme): string
639
639
 
640
640
  /** @public */
641
641
  export declare function composeClassNames(
@@ -1467,6 +1467,21 @@ export declare type VarName =
1467
1467
 
1468
1468
  /** @public */
1469
1469
  export declare interface VarNames {
1470
+ avatar: {
1471
+ distance: VarName
1472
+ focusRing: {
1473
+ offset: VarName
1474
+ width: VarName
1475
+ }
1476
+ size: VarName
1477
+ sizes: Record<
1478
+ AvatarSize,
1479
+ {
1480
+ distance: VarName
1481
+ size: VarName
1482
+ }
1483
+ >
1484
+ }
1470
1485
  button: {
1471
1486
  border: {
1472
1487
  width: VarName
@@ -1485,21 +1500,6 @@ export declare interface VarNames {
1485
1500
  ScopedColorVarNames &
1486
1501
  Record<ThemeColorCardToneKey, ColorCardVarNames>
1487
1502
  container: Record<Exclude<ContainerWidth, 'auto'>, VarName>
1488
- avatar: {
1489
- distance: VarName
1490
- focusRing: {
1491
- offset: VarName
1492
- width: VarName
1493
- }
1494
- size: VarName
1495
- sizes: Record<
1496
- AvatarSize,
1497
- {
1498
- distance: VarName
1499
- size: VarName
1500
- }
1501
- >
1502
- }
1503
1503
  font: {
1504
1504
  code: FontVarNames<FontCodeSize>
1505
1505
  heading: FontVarNames<FontHeadingSize>
package/dist/css.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import {AvatarSize} from '@sanity/ui/theme'
2
- import {ColorTintKey} from '@sanity/color'
2
+ import type {ColorTintKey} from '@sanity/color'
3
3
  import {ContainerWidth} from '@sanity/ui/theme'
4
4
  import {default as CSS_2} from 'csstype'
5
5
  import {FontCodeSize} from '@sanity/ui/theme'
@@ -7,18 +7,17 @@ import {FontHeadingSize} from '@sanity/ui/theme'
7
7
  import {FontLabelSize} from '@sanity/ui/theme'
8
8
  import {FontTextSize} from '@sanity/ui/theme'
9
9
  import {FontWeight} from '@sanity/ui/theme'
10
- import {Hue} from '@sanity/ui/theme'
10
+ import type {Hue} from '@sanity/ui/theme'
11
11
  import {Radius} from '@sanity/ui/theme'
12
12
  import {RootTheme} from '@sanity/ui/theme'
13
13
  import {Shadow} from '@sanity/ui/theme'
14
14
  import {Space} from '@sanity/ui/theme'
15
15
  import {ThemeBoxShadow} from '@sanity/ui/theme'
16
16
  import {ThemeColorAvatarColorKey} from '@sanity/ui/theme'
17
- import {ThemeColorButtonModeKey} from '@sanity/ui/theme'
18
17
  import {ThemeColorCardToneKey} from '@sanity/ui/theme'
19
18
  import {ThemeColorSchemeKey} from '@sanity/ui/theme'
20
19
  import {ThemeColorStateToneKey} from '@sanity/ui/theme'
21
- import {Tint} from '@sanity/ui/theme'
20
+ import type {Tint} from '@sanity/ui/theme'
22
21
 
23
22
  /** @public */
24
23
  export declare function animatedSpinnerIcon(): string | undefined
@@ -127,8 +126,12 @@ export declare interface BoxStyleProps
127
126
  /** @public */
128
127
  export declare function breadcrumbs(): string | undefined
129
128
 
129
+ /** @public */
130
+ export declare type Breakpoint = keyof typeof BREAKPOINTS
131
+
130
132
  /** @public */
131
133
  export declare const BREAKPOINTS: {
134
+ 0: number
132
135
  1: number
133
136
  2: number
134
137
  3: number
@@ -151,10 +154,7 @@ export declare interface ButtonStyleProps
151
154
  extends DisplayStyleProps,
152
155
  FlexItemStyleProps,
153
156
  RadiusStyleProps,
154
- WidthStyleProps {
155
- mode?: ThemeColorButtonModeKey
156
- tone?: ThemeColorStateToneKey
157
- }
157
+ WidthStyleProps {}
158
158
 
159
159
  /** @public */
160
160
  export declare function card(props: CardStyleProps): string | undefined
@@ -629,13 +629,13 @@ export declare interface ColorVariantVars
629
629
  export declare type Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
630
630
 
631
631
  /** @internal */
632
- export declare function compilePalette(): string
632
+ export declare function _compilePalette(): string
633
633
 
634
634
  /** @internal */
635
- export declare function compileSystem(): string
635
+ export declare function _compileSystem(): string
636
636
 
637
637
  /** @internal */
638
- export declare function compileTheme(theme: RootTheme): string
638
+ export declare function _compileTheme(theme: RootTheme): string
639
639
 
640
640
  /** @public */
641
641
  export declare function composeClassNames(
@@ -1467,6 +1467,21 @@ export declare type VarName =
1467
1467
 
1468
1468
  /** @public */
1469
1469
  export declare interface VarNames {
1470
+ avatar: {
1471
+ distance: VarName
1472
+ focusRing: {
1473
+ offset: VarName
1474
+ width: VarName
1475
+ }
1476
+ size: VarName
1477
+ sizes: Record<
1478
+ AvatarSize,
1479
+ {
1480
+ distance: VarName
1481
+ size: VarName
1482
+ }
1483
+ >
1484
+ }
1470
1485
  button: {
1471
1486
  border: {
1472
1487
  width: VarName
@@ -1485,21 +1500,6 @@ export declare interface VarNames {
1485
1500
  ScopedColorVarNames &
1486
1501
  Record<ThemeColorCardToneKey, ColorCardVarNames>
1487
1502
  container: Record<Exclude<ContainerWidth, 'auto'>, VarName>
1488
- avatar: {
1489
- distance: VarName
1490
- focusRing: {
1491
- offset: VarName
1492
- width: VarName
1493
- }
1494
- size: VarName
1495
- sizes: Record<
1496
- AvatarSize,
1497
- {
1498
- distance: VarName
1499
- size: VarName
1500
- }
1501
- >
1502
- }
1503
1503
  font: {
1504
1504
  code: FontVarNames<FontCodeSize>
1505
1505
  heading: FontVarNames<FontHeadingSize>