@sanity/ui 3.0.0-static.35 → 3.0.0-static.37

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.
@@ -1,9 +1,9 @@
1
1
  import type {AvatarColor} from '@sanity/ui/theme'
2
2
  import type {AvatarSize} from '@sanity/ui/theme'
3
- import type {BoxShadow} from '@sanity/ui/theme'
4
3
  import type {ButtonMode} from '@sanity/ui/theme'
5
4
  import type {CardTone} from '@sanity/ui/theme'
6
5
  import type {ColorScheme} from '@sanity/ui/theme'
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'
@@ -186,6 +186,9 @@ export declare const BREAKPOINTS: {
186
186
  6: number
187
187
  }
188
188
 
189
+ /** @public */
190
+ export declare function buildCSSTheme(options?: CSSThemeOptions): ThemeTokens
191
+
189
192
  /** @public */
190
193
  export declare function button(props: ButtonStyleProps): string | undefined
191
194
 
@@ -261,6 +264,98 @@ export declare interface ContainerStyleProps {
261
264
  width?: ResponsiveProp<ContainerWidth>
262
265
  }
263
266
 
267
+ /** @public */
268
+ export declare type CoreThemeTokens = {
269
+ avatar: {
270
+ focusRing: {
271
+ offset: string
272
+ width: string
273
+ }
274
+ scale: Record<
275
+ AvatarSize,
276
+ {
277
+ distance: string
278
+ size: string
279
+ }
280
+ >
281
+ }
282
+ button: {
283
+ border: {
284
+ width: string
285
+ }
286
+ focusRing: {
287
+ offset: string
288
+ width: string
289
+ }
290
+ }
291
+ card: {
292
+ shadow: {
293
+ outline: string
294
+ }
295
+ }
296
+ color: ColorTokens
297
+ container: Record<ContainerScale, string>
298
+ font: {
299
+ code: FontTokens<FontCodeSize>
300
+ heading: FontTokens<FontHeadingSize>
301
+ label: FontTokens<FontLabelSize>
302
+ text: FontTokens<FontTextSize>
303
+ }
304
+ input: {
305
+ border: {
306
+ width: string
307
+ }
308
+ checkbox: {
309
+ size: string
310
+ focusRing: {
311
+ offset: string
312
+ width: string
313
+ }
314
+ }
315
+ radio: {
316
+ size: string
317
+ markSize: string
318
+ focusRing: {
319
+ offset: string
320
+ width: string
321
+ }
322
+ }
323
+ select: {
324
+ focusRing: {
325
+ offset: string
326
+ width: string
327
+ }
328
+ }
329
+ switch: {
330
+ focusRing: {
331
+ width: string
332
+ offset: string
333
+ }
334
+ height: string
335
+ width: string
336
+ padding: string
337
+ transitionDurationMs: string
338
+ transitionTimingFunction: string
339
+ }
340
+ text: {
341
+ focusRing: {
342
+ offset: string
343
+ width: string
344
+ }
345
+ }
346
+ }
347
+ radius: Record<Radius, string>
348
+ shadow: Record<
349
+ Shadow,
350
+ {
351
+ umbra: string
352
+ penumbra: string
353
+ ambient: string
354
+ }
355
+ >
356
+ space: Record<Space, string>
357
+ }
358
+
264
359
  /** @public */
265
360
  export declare type CSSCardColorTokens = {
266
361
  avatar: Record<
@@ -332,6 +427,12 @@ export declare type CSSCardColorTokens = {
332
427
  /** @public */
333
428
  export declare type CSSLayer = 'theme' | 'props' | 'primitives' | 'components'
334
429
 
430
+ /** @public */
431
+ export declare type CSSThemeOptions = {
432
+ color?: ColorTokens_2
433
+ palette?: ColorPaletteTokens
434
+ }
435
+
335
436
  /** @public */
336
437
  export declare type CSSVarFunction = `var(--${string})`
337
438
 
@@ -822,7 +923,7 @@ export declare interface PaddingStyleProps {
822
923
  paddingY?: ResponsiveProp<Padding>
823
924
  }
824
925
 
825
- /** @public */
926
+ /** @internal */
826
927
  export declare const paletteVars: ColorPaletteVars
827
928
 
828
929
  /** @public */
@@ -853,9 +954,6 @@ export declare interface PositionStyleProps {
853
954
  position?: ResponsiveProp<Position>
854
955
  }
855
956
 
856
- /** @internal */
857
- export declare function px(value: number): string
858
-
859
957
  /** @public */
860
958
  export declare function radio(props: {className?: string}): string | undefined
861
959
 
@@ -873,9 +971,6 @@ export declare interface RadiusStyleProps {
873
971
  radius?: ResponsiveProp<Radius | 'full'>
874
972
  }
875
973
 
876
- /** @internal */
877
- export declare function rem(value: number): string
878
-
879
974
  /** @public */
880
975
  export declare type ResponsiveProp<T> = T | Partial<Record<Breakpoint, T>>
881
976
 
@@ -895,13 +990,6 @@ export declare interface RootStyleProps extends HeightStyleProps {
895
990
  tone?: CardTone
896
991
  }
897
992
 
898
- /** @public */
899
- export declare type RootThemeTokens = ThemeTokens & {
900
- color: {
901
- palette: ColorPaletteTokens
902
- }
903
- }
904
-
905
993
  /** @public */
906
994
  export declare type SchemeColorTokens = Record<CardTone, CSSCardColorTokens>
907
995
 
@@ -1207,105 +1295,20 @@ export declare type ThemeContract<T extends NullableTokens> = ReturnType<
1207
1295
  >
1208
1296
 
1209
1297
  /** @public */
1210
- export declare type ThemeTokens = {
1211
- avatar: {
1212
- focusRing: {
1213
- offset: string
1214
- width: string
1215
- }
1216
- scale: Record<
1217
- AvatarSize,
1218
- {
1219
- distance: string
1220
- size: string
1221
- }
1222
- >
1223
- }
1224
- button: {
1225
- border: {
1226
- width: string
1227
- }
1228
- focusRing: {
1229
- offset: string
1230
- width: string
1231
- }
1232
- }
1233
- card: {
1234
- shadow: {
1235
- outline: string
1236
- }
1237
- }
1238
- color: ColorTokens
1239
- container: Record<ContainerScale, string>
1240
- font: {
1241
- code: FontTokens<FontCodeSize>
1242
- heading: FontTokens<FontHeadingSize>
1243
- label: FontTokens<FontLabelSize>
1244
- text: FontTokens<FontTextSize>
1245
- }
1246
- input: {
1247
- border: {
1248
- width: string
1249
- }
1250
- checkbox: {
1251
- size: string
1252
- focusRing: {
1253
- offset: string
1254
- width: string
1255
- }
1256
- }
1257
- radio: {
1258
- size: string
1259
- markSize: string
1260
- focusRing: {
1261
- offset: string
1262
- width: string
1263
- }
1264
- }
1265
- select: {
1266
- focusRing: {
1267
- offset: string
1268
- width: string
1269
- }
1270
- }
1271
- switch: {
1272
- focusRing: {
1273
- width: string
1274
- offset: string
1275
- }
1276
- height: string
1277
- width: string
1278
- padding: string
1279
- transitionDurationMs: string
1280
- transitionTimingFunction: string
1281
- }
1282
- text: {
1283
- focusRing: {
1284
- offset: string
1285
- width: string
1286
- }
1287
- }
1298
+ export declare type ThemeTokens = CoreThemeTokens & {
1299
+ color: {
1300
+ palette: ColorPaletteTokens
1288
1301
  }
1289
- radius: Record<Radius, string>
1290
- shadow: Record<
1291
- Shadow,
1292
- {
1293
- umbra: string
1294
- penumbra: string
1295
- ambient: string
1296
- }
1297
- >
1298
- space: Record<Space, string>
1299
1302
  }
1300
1303
 
1301
1304
  /** @public */
1302
- export declare type ThemeVars = ThemeContract<RootThemeTokens & ScopedTokens>
1305
+ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1303
1306
 
1304
1307
  /**
1305
1308
  * Variables to be defined in a theme.
1306
1309
  *
1307
- * @public */
1308
- export declare const themeVars: ThemeContract<RootThemeTokens>
1310
+ * @internal */
1311
+ export declare const themeVars: ThemeContract<ThemeTokens>
1309
1312
 
1310
1313
  /** @public */
1311
1314
  export declare function toast(): string
@@ -1313,9 +1316,6 @@ export declare function toast(): string
1313
1316
  /** @public */
1314
1317
  export declare function toastLayer(): string
1315
1318
 
1316
- /** @internal */
1317
- export declare function toBoxShadow(value: BoxShadow | undefined): string
1318
-
1319
1319
  /** @public */
1320
1320
  export declare function tooltip(props: TooltipStyleProps): string | undefined
1321
1321
 
@@ -1,9 +1,9 @@
1
1
  import type {AvatarColor} from '@sanity/ui/theme'
2
2
  import type {AvatarSize} from '@sanity/ui/theme'
3
- import type {BoxShadow} from '@sanity/ui/theme'
4
3
  import type {ButtonMode} from '@sanity/ui/theme'
5
4
  import type {CardTone} from '@sanity/ui/theme'
6
5
  import type {ColorScheme} from '@sanity/ui/theme'
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'
@@ -186,6 +186,9 @@ export declare const BREAKPOINTS: {
186
186
  6: number
187
187
  }
188
188
 
189
+ /** @public */
190
+ export declare function buildCSSTheme(options?: CSSThemeOptions): ThemeTokens
191
+
189
192
  /** @public */
190
193
  export declare function button(props: ButtonStyleProps): string | undefined
191
194
 
@@ -261,6 +264,98 @@ export declare interface ContainerStyleProps {
261
264
  width?: ResponsiveProp<ContainerWidth>
262
265
  }
263
266
 
267
+ /** @public */
268
+ export declare type CoreThemeTokens = {
269
+ avatar: {
270
+ focusRing: {
271
+ offset: string
272
+ width: string
273
+ }
274
+ scale: Record<
275
+ AvatarSize,
276
+ {
277
+ distance: string
278
+ size: string
279
+ }
280
+ >
281
+ }
282
+ button: {
283
+ border: {
284
+ width: string
285
+ }
286
+ focusRing: {
287
+ offset: string
288
+ width: string
289
+ }
290
+ }
291
+ card: {
292
+ shadow: {
293
+ outline: string
294
+ }
295
+ }
296
+ color: ColorTokens
297
+ container: Record<ContainerScale, string>
298
+ font: {
299
+ code: FontTokens<FontCodeSize>
300
+ heading: FontTokens<FontHeadingSize>
301
+ label: FontTokens<FontLabelSize>
302
+ text: FontTokens<FontTextSize>
303
+ }
304
+ input: {
305
+ border: {
306
+ width: string
307
+ }
308
+ checkbox: {
309
+ size: string
310
+ focusRing: {
311
+ offset: string
312
+ width: string
313
+ }
314
+ }
315
+ radio: {
316
+ size: string
317
+ markSize: string
318
+ focusRing: {
319
+ offset: string
320
+ width: string
321
+ }
322
+ }
323
+ select: {
324
+ focusRing: {
325
+ offset: string
326
+ width: string
327
+ }
328
+ }
329
+ switch: {
330
+ focusRing: {
331
+ width: string
332
+ offset: string
333
+ }
334
+ height: string
335
+ width: string
336
+ padding: string
337
+ transitionDurationMs: string
338
+ transitionTimingFunction: string
339
+ }
340
+ text: {
341
+ focusRing: {
342
+ offset: string
343
+ width: string
344
+ }
345
+ }
346
+ }
347
+ radius: Record<Radius, string>
348
+ shadow: Record<
349
+ Shadow,
350
+ {
351
+ umbra: string
352
+ penumbra: string
353
+ ambient: string
354
+ }
355
+ >
356
+ space: Record<Space, string>
357
+ }
358
+
264
359
  /** @public */
265
360
  export declare type CSSCardColorTokens = {
266
361
  avatar: Record<
@@ -332,6 +427,12 @@ export declare type CSSCardColorTokens = {
332
427
  /** @public */
333
428
  export declare type CSSLayer = 'theme' | 'props' | 'primitives' | 'components'
334
429
 
430
+ /** @public */
431
+ export declare type CSSThemeOptions = {
432
+ color?: ColorTokens_2
433
+ palette?: ColorPaletteTokens
434
+ }
435
+
335
436
  /** @public */
336
437
  export declare type CSSVarFunction = `var(--${string})`
337
438
 
@@ -822,7 +923,7 @@ export declare interface PaddingStyleProps {
822
923
  paddingY?: ResponsiveProp<Padding>
823
924
  }
824
925
 
825
- /** @public */
926
+ /** @internal */
826
927
  export declare const paletteVars: ColorPaletteVars
827
928
 
828
929
  /** @public */
@@ -853,9 +954,6 @@ export declare interface PositionStyleProps {
853
954
  position?: ResponsiveProp<Position>
854
955
  }
855
956
 
856
- /** @internal */
857
- export declare function px(value: number): string
858
-
859
957
  /** @public */
860
958
  export declare function radio(props: {className?: string}): string | undefined
861
959
 
@@ -873,9 +971,6 @@ export declare interface RadiusStyleProps {
873
971
  radius?: ResponsiveProp<Radius | 'full'>
874
972
  }
875
973
 
876
- /** @internal */
877
- export declare function rem(value: number): string
878
-
879
974
  /** @public */
880
975
  export declare type ResponsiveProp<T> = T | Partial<Record<Breakpoint, T>>
881
976
 
@@ -895,13 +990,6 @@ export declare interface RootStyleProps extends HeightStyleProps {
895
990
  tone?: CardTone
896
991
  }
897
992
 
898
- /** @public */
899
- export declare type RootThemeTokens = ThemeTokens & {
900
- color: {
901
- palette: ColorPaletteTokens
902
- }
903
- }
904
-
905
993
  /** @public */
906
994
  export declare type SchemeColorTokens = Record<CardTone, CSSCardColorTokens>
907
995
 
@@ -1207,105 +1295,20 @@ export declare type ThemeContract<T extends NullableTokens> = ReturnType<
1207
1295
  >
1208
1296
 
1209
1297
  /** @public */
1210
- export declare type ThemeTokens = {
1211
- avatar: {
1212
- focusRing: {
1213
- offset: string
1214
- width: string
1215
- }
1216
- scale: Record<
1217
- AvatarSize,
1218
- {
1219
- distance: string
1220
- size: string
1221
- }
1222
- >
1223
- }
1224
- button: {
1225
- border: {
1226
- width: string
1227
- }
1228
- focusRing: {
1229
- offset: string
1230
- width: string
1231
- }
1232
- }
1233
- card: {
1234
- shadow: {
1235
- outline: string
1236
- }
1237
- }
1238
- color: ColorTokens
1239
- container: Record<ContainerScale, string>
1240
- font: {
1241
- code: FontTokens<FontCodeSize>
1242
- heading: FontTokens<FontHeadingSize>
1243
- label: FontTokens<FontLabelSize>
1244
- text: FontTokens<FontTextSize>
1245
- }
1246
- input: {
1247
- border: {
1248
- width: string
1249
- }
1250
- checkbox: {
1251
- size: string
1252
- focusRing: {
1253
- offset: string
1254
- width: string
1255
- }
1256
- }
1257
- radio: {
1258
- size: string
1259
- markSize: string
1260
- focusRing: {
1261
- offset: string
1262
- width: string
1263
- }
1264
- }
1265
- select: {
1266
- focusRing: {
1267
- offset: string
1268
- width: string
1269
- }
1270
- }
1271
- switch: {
1272
- focusRing: {
1273
- width: string
1274
- offset: string
1275
- }
1276
- height: string
1277
- width: string
1278
- padding: string
1279
- transitionDurationMs: string
1280
- transitionTimingFunction: string
1281
- }
1282
- text: {
1283
- focusRing: {
1284
- offset: string
1285
- width: string
1286
- }
1287
- }
1298
+ export declare type ThemeTokens = CoreThemeTokens & {
1299
+ color: {
1300
+ palette: ColorPaletteTokens
1288
1301
  }
1289
- radius: Record<Radius, string>
1290
- shadow: Record<
1291
- Shadow,
1292
- {
1293
- umbra: string
1294
- penumbra: string
1295
- ambient: string
1296
- }
1297
- >
1298
- space: Record<Space, string>
1299
1302
  }
1300
1303
 
1301
1304
  /** @public */
1302
- export declare type ThemeVars = ThemeContract<RootThemeTokens & ScopedTokens>
1305
+ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1303
1306
 
1304
1307
  /**
1305
1308
  * Variables to be defined in a theme.
1306
1309
  *
1307
- * @public */
1308
- export declare const themeVars: ThemeContract<RootThemeTokens>
1310
+ * @internal */
1311
+ export declare const themeVars: ThemeContract<ThemeTokens>
1309
1312
 
1310
1313
  /** @public */
1311
1314
  export declare function toast(): string
@@ -1313,9 +1316,6 @@ export declare function toast(): string
1313
1316
  /** @public */
1314
1317
  export declare function toastLayer(): string
1315
1318
 
1316
- /** @internal */
1317
- export declare function toBoxShadow(value: BoxShadow | undefined): string
1318
-
1319
1319
  /** @public */
1320
1320
  export declare function tooltip(props: TooltipStyleProps): string | undefined
1321
1321