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

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,6 +1,5 @@
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'
@@ -18,6 +17,7 @@ import type {Hue} from '@sanity/ui/theme'
18
17
  import type {Radius} from '@sanity/ui/theme'
19
18
  import type {Shadow} from '@sanity/ui/theme'
20
19
  import type {Space} from '@sanity/ui/theme'
20
+ import {ThemeOptions} from '@sanity/ui/theme'
21
21
  import type {Tint} from '@sanity/ui/theme'
22
22
 
23
23
  /** @public */
@@ -186,6 +186,9 @@ export declare const BREAKPOINTS: {
186
186
  6: number
187
187
  }
188
188
 
189
+ /** @public */
190
+ export declare function buildCSSThemeTokens(options?: ThemeOptions): 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<
@@ -822,7 +917,7 @@ export declare interface PaddingStyleProps {
822
917
  paddingY?: ResponsiveProp<Padding>
823
918
  }
824
919
 
825
- /** @public */
920
+ /** @internal */
826
921
  export declare const paletteVars: ColorPaletteVars
827
922
 
828
923
  /** @public */
@@ -853,9 +948,6 @@ export declare interface PositionStyleProps {
853
948
  position?: ResponsiveProp<Position>
854
949
  }
855
950
 
856
- /** @internal */
857
- export declare function px(value: number): string
858
-
859
951
  /** @public */
860
952
  export declare function radio(props: {className?: string}): string | undefined
861
953
 
@@ -873,9 +965,6 @@ export declare interface RadiusStyleProps {
873
965
  radius?: ResponsiveProp<Radius | 'full'>
874
966
  }
875
967
 
876
- /** @internal */
877
- export declare function rem(value: number): string
878
-
879
968
  /** @public */
880
969
  export declare type ResponsiveProp<T> = T | Partial<Record<Breakpoint, T>>
881
970
 
@@ -895,13 +984,6 @@ export declare interface RootStyleProps extends HeightStyleProps {
895
984
  tone?: CardTone
896
985
  }
897
986
 
898
- /** @public */
899
- export declare type RootThemeTokens = ThemeTokens & {
900
- color: {
901
- palette: ColorPaletteTokens
902
- }
903
- }
904
-
905
987
  /** @public */
906
988
  export declare type SchemeColorTokens = Record<CardTone, CSSCardColorTokens>
907
989
 
@@ -1207,105 +1289,20 @@ export declare type ThemeContract<T extends NullableTokens> = ReturnType<
1207
1289
  >
1208
1290
 
1209
1291
  /** @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
- }
1292
+ export declare type ThemeTokens = CoreThemeTokens & {
1293
+ color: {
1294
+ palette: ColorPaletteTokens
1288
1295
  }
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
1296
  }
1300
1297
 
1301
1298
  /** @public */
1302
- export declare type ThemeVars = ThemeContract<RootThemeTokens & ScopedTokens>
1299
+ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1303
1300
 
1304
1301
  /**
1305
1302
  * Variables to be defined in a theme.
1306
1303
  *
1307
- * @public */
1308
- export declare const themeVars: ThemeContract<RootThemeTokens>
1304
+ * @internal */
1305
+ export declare const themeVars: ThemeContract<ThemeTokens>
1309
1306
 
1310
1307
  /** @public */
1311
1308
  export declare function toast(): string
@@ -1313,9 +1310,6 @@ export declare function toast(): string
1313
1310
  /** @public */
1314
1311
  export declare function toastLayer(): string
1315
1312
 
1316
- /** @internal */
1317
- export declare function toBoxShadow(value: BoxShadow | undefined): string
1318
-
1319
1313
  /** @public */
1320
1314
  export declare function tooltip(props: TooltipStyleProps): string | undefined
1321
1315
 
@@ -1,6 +1,5 @@
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'
@@ -18,6 +17,7 @@ import type {Hue} from '@sanity/ui/theme'
18
17
  import type {Radius} from '@sanity/ui/theme'
19
18
  import type {Shadow} from '@sanity/ui/theme'
20
19
  import type {Space} from '@sanity/ui/theme'
20
+ import {ThemeOptions} from '@sanity/ui/theme'
21
21
  import type {Tint} from '@sanity/ui/theme'
22
22
 
23
23
  /** @public */
@@ -186,6 +186,9 @@ export declare const BREAKPOINTS: {
186
186
  6: number
187
187
  }
188
188
 
189
+ /** @public */
190
+ export declare function buildCSSThemeTokens(options?: ThemeOptions): 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<
@@ -822,7 +917,7 @@ export declare interface PaddingStyleProps {
822
917
  paddingY?: ResponsiveProp<Padding>
823
918
  }
824
919
 
825
- /** @public */
920
+ /** @internal */
826
921
  export declare const paletteVars: ColorPaletteVars
827
922
 
828
923
  /** @public */
@@ -853,9 +948,6 @@ export declare interface PositionStyleProps {
853
948
  position?: ResponsiveProp<Position>
854
949
  }
855
950
 
856
- /** @internal */
857
- export declare function px(value: number): string
858
-
859
951
  /** @public */
860
952
  export declare function radio(props: {className?: string}): string | undefined
861
953
 
@@ -873,9 +965,6 @@ export declare interface RadiusStyleProps {
873
965
  radius?: ResponsiveProp<Radius | 'full'>
874
966
  }
875
967
 
876
- /** @internal */
877
- export declare function rem(value: number): string
878
-
879
968
  /** @public */
880
969
  export declare type ResponsiveProp<T> = T | Partial<Record<Breakpoint, T>>
881
970
 
@@ -895,13 +984,6 @@ export declare interface RootStyleProps extends HeightStyleProps {
895
984
  tone?: CardTone
896
985
  }
897
986
 
898
- /** @public */
899
- export declare type RootThemeTokens = ThemeTokens & {
900
- color: {
901
- palette: ColorPaletteTokens
902
- }
903
- }
904
-
905
987
  /** @public */
906
988
  export declare type SchemeColorTokens = Record<CardTone, CSSCardColorTokens>
907
989
 
@@ -1207,105 +1289,20 @@ export declare type ThemeContract<T extends NullableTokens> = ReturnType<
1207
1289
  >
1208
1290
 
1209
1291
  /** @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
- }
1292
+ export declare type ThemeTokens = CoreThemeTokens & {
1293
+ color: {
1294
+ palette: ColorPaletteTokens
1288
1295
  }
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
1296
  }
1300
1297
 
1301
1298
  /** @public */
1302
- export declare type ThemeVars = ThemeContract<RootThemeTokens & ScopedTokens>
1299
+ export declare type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens>
1303
1300
 
1304
1301
  /**
1305
1302
  * Variables to be defined in a theme.
1306
1303
  *
1307
- * @public */
1308
- export declare const themeVars: ThemeContract<RootThemeTokens>
1304
+ * @internal */
1305
+ export declare const themeVars: ThemeContract<ThemeTokens>
1309
1306
 
1310
1307
  /** @public */
1311
1308
  export declare function toast(): string
@@ -1313,9 +1310,6 @@ export declare function toast(): string
1313
1310
  /** @public */
1314
1311
  export declare function toastLayer(): string
1315
1312
 
1316
- /** @internal */
1317
- export declare function toBoxShadow(value: BoxShadow | undefined): string
1318
-
1319
1313
  /** @public */
1320
1314
  export declare function tooltip(props: TooltipStyleProps): string | undefined
1321
1315