@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.
@@ -0,0 +1,484 @@
1
+ import {black, hues, white} from '@sanity/color'
2
+ import {
3
+ _parseColorToken,
4
+ AVATAR_COLORS,
5
+ AVATAR_SIZE,
6
+ type BoxShadow,
7
+ buildTheme,
8
+ CARD_TONES,
9
+ type CardColorTokens,
10
+ type CardTone,
11
+ COLOR_VARIANTS,
12
+ type ColorScheme,
13
+ type ColorTokens,
14
+ type ColorValue,
15
+ type ColorVariant,
16
+ CONTAINER_SCALE,
17
+ ELEMENT_TONES,
18
+ type ElementTone,
19
+ FONT_CODE_SIZE,
20
+ FONT_HEADING_SIZE,
21
+ FONT_LABEL_SIZE,
22
+ FONT_TEXT_SIZE,
23
+ type Hue,
24
+ HUES,
25
+ RADIUS,
26
+ SHADOW,
27
+ SPACE,
28
+ type Theme,
29
+ TINTS,
30
+ } from '@sanity/ui/theme'
31
+
32
+ import {_fromEntries} from '../_fromEntries'
33
+ import type {
34
+ ColorPaletteTokens,
35
+ CSSCardColorTokens,
36
+ ElementColorTokens,
37
+ SchemeColorTokens,
38
+ ThemeTokens,
39
+ VariantColorTokens,
40
+ } from '../types'
41
+ import {paletteVars} from '../vars.css'
42
+
43
+ /** @public */
44
+ export type CSSThemeOptions = {color?: ColorTokens; palette?: ColorPaletteTokens}
45
+
46
+ /** @public */
47
+ export function buildCSSTheme(options?: CSSThemeOptions): ThemeTokens {
48
+ const theme = buildTheme(options)
49
+
50
+ return {
51
+ avatar: {
52
+ focusRing: {
53
+ offset: px(theme.avatar.focusRing.offset),
54
+ width: px(theme.avatar.focusRing.width),
55
+ },
56
+ scale: {
57
+ ..._fromEntries(
58
+ AVATAR_SIZE.map((s) => [
59
+ s,
60
+ {
61
+ distance: px(theme.avatar.sizes[s].distance),
62
+ size: px(theme.avatar.sizes[s].size),
63
+ },
64
+ ]),
65
+ ),
66
+ },
67
+ },
68
+ button: {
69
+ border: {
70
+ width: px(theme.button.border.width),
71
+ },
72
+ focusRing: {
73
+ offset: px(theme.button.focusRing.offset),
74
+ width: px(theme.button.focusRing.width),
75
+ },
76
+ },
77
+ card: {
78
+ shadow: {
79
+ outline: px(theme.card.shadow.outline),
80
+ },
81
+ },
82
+ container: {
83
+ ..._fromEntries(CONTAINER_SCALE.map((s) => [s, rem(theme.container[s])])),
84
+ },
85
+ color: {
86
+ palette: options?.palette ?? {
87
+ black: black.hex,
88
+ white: white.hex,
89
+ ..._fromEntries(
90
+ HUES.map((h) => [h, {..._fromEntries(TINTS.map((t) => [t, hues[h][t].hex]))}]),
91
+ ),
92
+ },
93
+ light: renderColorScheme({theme, scheme: 'light'}),
94
+ dark: renderColorScheme({theme, scheme: 'dark'}),
95
+ },
96
+ font: {
97
+ code: {
98
+ family: theme.font.code.family,
99
+ featureSettings: theme.font.code.featureSettings || 'normal',
100
+ weight: {
101
+ regular: theme.font.code.weight.regular.toString(),
102
+ medium: theme.font.code.weight.medium.toString(),
103
+ semibold: theme.font.code.weight.semibold.toString(),
104
+ bold: theme.font.code.weight.bold.toString(),
105
+ },
106
+ scale: {
107
+ ..._fromEntries(
108
+ FONT_CODE_SIZE.map((s) => [
109
+ s,
110
+ {
111
+ fontSize: rem(theme.font.code.scale[s].fontSize),
112
+ lineHeight: rem(theme.font.code.scale[s].lineHeight),
113
+ letterSpacing: rem(theme.font.code.scale[s].letterSpacing),
114
+ ascenderHeight: rem(theme.font.code.scale[s].ascenderHeight),
115
+ descenderHeight: rem(theme.font.code.scale[s].descenderHeight),
116
+ iconSize: rem(theme.font.code.scale[s].iconSize),
117
+ customIconSize: rem(theme.font.code.scale[s].customIconSize),
118
+ },
119
+ ]),
120
+ ),
121
+ },
122
+ },
123
+
124
+ heading: {
125
+ family: theme.font.heading.family,
126
+ featureSettings: theme.font.heading.featureSettings || 'normal',
127
+ weight: {
128
+ regular: theme.font.heading.weight.regular.toString(),
129
+ medium: theme.font.heading.weight.medium.toString(),
130
+ semibold: theme.font.heading.weight.semibold.toString(),
131
+ bold: theme.font.heading.weight.bold.toString(),
132
+ },
133
+ scale: {
134
+ ..._fromEntries(
135
+ FONT_HEADING_SIZE.map((s) => [
136
+ s,
137
+ {
138
+ fontSize: rem(theme.font.heading.scale[s].fontSize),
139
+ lineHeight: rem(theme.font.heading.scale[s].lineHeight),
140
+ letterSpacing: rem(theme.font.heading.scale[s].letterSpacing),
141
+ ascenderHeight: rem(theme.font.heading.scale[s].ascenderHeight),
142
+ descenderHeight: rem(theme.font.heading.scale[s].descenderHeight),
143
+ iconSize: rem(theme.font.heading.scale[s].iconSize),
144
+ customIconSize: rem(theme.font.heading.scale[s].customIconSize),
145
+ },
146
+ ]),
147
+ ),
148
+ },
149
+ },
150
+
151
+ label: {
152
+ family: theme.font.label.family,
153
+ featureSettings: theme.font.label.featureSettings || 'normal',
154
+ weight: {
155
+ regular: theme.font.label.weight.regular.toString(),
156
+ medium: theme.font.label.weight.medium.toString(),
157
+ semibold: theme.font.label.weight.semibold.toString(),
158
+ bold: theme.font.label.weight.bold.toString(),
159
+ },
160
+ scale: {
161
+ ..._fromEntries(
162
+ FONT_LABEL_SIZE.map((s) => [
163
+ s,
164
+ {
165
+ fontSize: rem(theme.font.label.scale[s].fontSize),
166
+ lineHeight: rem(theme.font.label.scale[s].lineHeight),
167
+ letterSpacing: rem(theme.font.label.scale[s].letterSpacing),
168
+ ascenderHeight: rem(theme.font.label.scale[s].ascenderHeight),
169
+ descenderHeight: rem(theme.font.label.scale[s].descenderHeight),
170
+ iconSize: rem(theme.font.label.scale[s].iconSize),
171
+ customIconSize: rem(theme.font.label.scale[s].customIconSize),
172
+ },
173
+ ]),
174
+ ),
175
+ },
176
+ },
177
+
178
+ text: {
179
+ family: theme.font.text.family,
180
+ featureSettings: theme.font.text.featureSettings || 'normal',
181
+ weight: {
182
+ regular: theme.font.text.weight.regular.toString(),
183
+ medium: theme.font.text.weight.medium.toString(),
184
+ semibold: theme.font.text.weight.semibold.toString(),
185
+ bold: theme.font.text.weight.bold.toString(),
186
+ },
187
+ scale: {
188
+ ..._fromEntries(
189
+ FONT_TEXT_SIZE.map((s) => [
190
+ s,
191
+ {
192
+ fontSize: rem(theme.font.text.scale[s].fontSize),
193
+ lineHeight: rem(theme.font.text.scale[s].lineHeight),
194
+ letterSpacing: rem(theme.font.text.scale[s].letterSpacing),
195
+ ascenderHeight: rem(theme.font.text.scale[s].ascenderHeight),
196
+ descenderHeight: rem(theme.font.text.scale[s].descenderHeight),
197
+ iconSize: rem(theme.font.text.scale[s].iconSize),
198
+ customIconSize: rem(theme.font.text.scale[s].customIconSize),
199
+ },
200
+ ]),
201
+ ),
202
+ },
203
+ },
204
+ },
205
+ input: {
206
+ border: {
207
+ width: px(theme.input.border.width),
208
+ },
209
+ checkbox: {
210
+ size: rem(theme.input.checkbox.size),
211
+ focusRing: {
212
+ offset: px(theme.input.checkbox.focusRing.offset),
213
+ width: px(theme.input.checkbox.focusRing.width),
214
+ },
215
+ },
216
+ radio: {
217
+ size: rem(theme.input.radio.size),
218
+ markSize: rem(theme.input.radio.markSize),
219
+ focusRing: {
220
+ offset: px(theme.input.radio.focusRing.offset),
221
+ width: px(theme.input.radio.focusRing.width),
222
+ },
223
+ },
224
+ select: {
225
+ focusRing: {
226
+ offset: px(theme.input.select.focusRing.offset),
227
+ width: px(theme.input.select.focusRing.width),
228
+ },
229
+ },
230
+ switch: {
231
+ width: rem(theme.input.switch.width),
232
+ height: rem(theme.input.switch.height),
233
+ focusRing: {
234
+ offset: px(theme.input.switch.focusRing.offset),
235
+ width: px(theme.input.switch.focusRing.width),
236
+ },
237
+ padding: rem(theme.input.switch.padding),
238
+ transitionDurationMs: `${theme.input.switch.transitionDurationMs}ms`,
239
+ transitionTimingFunction: theme.input.switch.transitionTimingFunction,
240
+ },
241
+ text: {
242
+ focusRing: {
243
+ offset: px(theme.input.text.focusRing.offset),
244
+ width: px(theme.input.text.focusRing.width),
245
+ },
246
+ },
247
+ },
248
+ radius: _fromEntries(RADIUS.map((key) => [key, `${theme.radius[key]}px`])),
249
+ shadow: _fromEntries(
250
+ SHADOW.map((s) => [
251
+ s,
252
+ {
253
+ umbra: toBoxShadow(theme.shadow[s]?.umbra),
254
+ penumbra: toBoxShadow(theme.shadow[s]?.penumbra),
255
+ ambient: toBoxShadow(theme.shadow[s]?.ambient),
256
+ },
257
+ ]),
258
+ ),
259
+ space: _fromEntries(SPACE.map((key) => [key, `${theme.space[key]}px`])),
260
+ } as const
261
+ }
262
+
263
+ function renderColorScheme(options: {theme: Theme; scheme: ColorScheme}): SchemeColorTokens {
264
+ const {theme, scheme} = options
265
+
266
+ const defaultCardColor = renderCardColor({
267
+ theme,
268
+ tone: 'default',
269
+ scheme,
270
+ })
271
+
272
+ return {
273
+ ..._fromEntries(
274
+ CARD_TONES.map((key) => {
275
+ if (key === 'default') {
276
+ return [key, defaultCardColor]
277
+ }
278
+
279
+ return [
280
+ key,
281
+ renderCardColor({
282
+ bgValue: defaultCardColor.tinted.default.bg[0],
283
+ theme,
284
+ tone: key,
285
+ scheme,
286
+ }),
287
+ ]
288
+ }),
289
+ ),
290
+ }
291
+ }
292
+
293
+ function renderCardColor(options: {
294
+ bgValue?: string
295
+ theme: Theme
296
+ tone: CardTone
297
+ scheme: 'light' | 'dark'
298
+ }): CSSCardColorTokens {
299
+ const {bgValue, theme, tone: t, scheme} = options
300
+
301
+ const tokens = theme.color[t]
302
+
303
+ const tintedDefaultVariant = renderColorElement(tokens, {
304
+ bgValue,
305
+ variant: 'tinted',
306
+ scheme,
307
+ tone: 'default',
308
+ })
309
+
310
+ const colorOptions = {
311
+ bgValue: tintedDefaultVariant.bg[0],
312
+ defaultHue: tokens._hue ?? 'gray',
313
+ scheme,
314
+ } as const
315
+
316
+ return {
317
+ avatar: {
318
+ ..._fromEntries(
319
+ AVATAR_COLORS.map((c) => [
320
+ c,
321
+ {
322
+ bg: renderColor(tokens.avatar[c].bg, {...colorOptions, defaultHue: c}),
323
+ fg: renderColor(tokens.avatar[c].fg, {...colorOptions, defaultHue: c}),
324
+ },
325
+ ]),
326
+ ),
327
+ },
328
+ backdrop: renderColor(tokens.backdrop, colorOptions),
329
+ code: {
330
+ bg: renderColor(tokens.code.bg, colorOptions),
331
+ fg: renderColor(tokens.code.fg, colorOptions),
332
+
333
+ token: {
334
+ atrule: renderColor(tokens.code.token.atrule, colorOptions),
335
+ attrName: renderColor(tokens.code.token.attrName, colorOptions),
336
+ attrValue: renderColor(tokens.code.token.attrValue, colorOptions),
337
+ attribute: renderColor(tokens.code.token.attribute, colorOptions),
338
+ boolean: renderColor(tokens.code.token.boolean, colorOptions),
339
+ builtin: renderColor(tokens.code.token.builtin, colorOptions),
340
+ cdata: renderColor(tokens.code.token.cdata, colorOptions),
341
+ char: renderColor(tokens.code.token.char, colorOptions),
342
+ class: renderColor(tokens.code.token.class, colorOptions),
343
+ className: renderColor(tokens.code.token.className, colorOptions),
344
+ comment: renderColor(tokens.code.token.comment, colorOptions),
345
+ constant: renderColor(tokens.code.token.constant, colorOptions),
346
+ deleted: renderColor(tokens.code.token.deleted, colorOptions),
347
+ doctype: renderColor(tokens.code.token.doctype, colorOptions),
348
+ entity: renderColor(tokens.code.token.entity, colorOptions),
349
+ function: renderColor(tokens.code.token.function, colorOptions),
350
+ hexcode: renderColor(tokens.code.token.hexcode, colorOptions),
351
+ id: renderColor(tokens.code.token.id, colorOptions),
352
+ important: renderColor(tokens.code.token.important, colorOptions),
353
+ inserted: renderColor(tokens.code.token.inserted, colorOptions),
354
+ keyword: renderColor(tokens.code.token.keyword, colorOptions),
355
+ number: renderColor(tokens.code.token.number, colorOptions),
356
+ operator: renderColor(tokens.code.token.operator, colorOptions),
357
+ prolog: renderColor(tokens.code.token.prolog, colorOptions),
358
+ property: renderColor(tokens.code.token.property, colorOptions),
359
+ pseudoClass: renderColor(tokens.code.token.pseudoClass, colorOptions),
360
+ pseudoElement: renderColor(tokens.code.token.pseudoElement, colorOptions),
361
+ punctuation: renderColor(tokens.code.token.punctuation, colorOptions),
362
+ regex: renderColor(tokens.code.token.regex, colorOptions),
363
+ selector: renderColor(tokens.code.token.selector, colorOptions),
364
+ string: renderColor(tokens.code.token.string, colorOptions),
365
+ symbol: renderColor(tokens.code.token.symbol, colorOptions),
366
+ tag: renderColor(tokens.code.token.tag, colorOptions),
367
+ unit: renderColor(tokens.code.token.unit, colorOptions),
368
+ url: renderColor(tokens.code.token.url, colorOptions),
369
+ variable: renderColor(tokens.code.token.variable, colorOptions),
370
+ },
371
+ },
372
+ focusRing: renderColor(tokens.focusRing, colorOptions),
373
+ link: {
374
+ fg: renderColor(tokens.link.fg, colorOptions),
375
+ },
376
+ shadow: {
377
+ outline: renderColor(tokens.shadow.outline, colorOptions),
378
+ umbra: renderColor(tokens.shadow.umbra, colorOptions),
379
+ penumbra: renderColor(tokens.shadow.penumbra, colorOptions),
380
+ ambient: renderColor(tokens.shadow.ambient, colorOptions),
381
+ },
382
+ skeleton: {
383
+ from: renderColor(tokens.skeleton.from, colorOptions),
384
+ to: renderColor(tokens.skeleton.to, colorOptions),
385
+ },
386
+ // variants
387
+ ..._fromEntries(
388
+ COLOR_VARIANTS.map((v) => [
389
+ v,
390
+ {
391
+ ..._fromEntries(
392
+ ELEMENT_TONES.map((t) => {
393
+ if (v === 'tinted' && t === 'default') {
394
+ return [t, tintedDefaultVariant]
395
+ }
396
+
397
+ return [t, renderColorElement(tokens, {scheme, variant: v, tone: t})]
398
+ }),
399
+ ),
400
+ } satisfies VariantColorTokens,
401
+ ]),
402
+ ),
403
+ }
404
+ }
405
+
406
+ function renderColorElement(
407
+ tokens: CardColorTokens,
408
+ options: {
409
+ bgValue?: string
410
+ scheme: ColorScheme
411
+ variant: ColorVariant
412
+ tone: ElementTone
413
+ },
414
+ ): ElementColorTokens {
415
+ const {bgValue, scheme, variant: v, tone: t} = options
416
+
417
+ const elementColorOptions = {bgValue, defaultHue: tokens.variant[v][t]._hue, scheme}
418
+
419
+ return {
420
+ bg: {
421
+ 0: renderColor(tokens.variant[v][t].bg[0], elementColorOptions),
422
+ 4: renderColor(tokens.variant[v][t].bg[4], elementColorOptions),
423
+ },
424
+ border: {
425
+ 0: renderColor(tokens.variant[v][t].border[0], elementColorOptions),
426
+ 4: renderColor(tokens.variant[v][t].border[4], elementColorOptions),
427
+ },
428
+ fg: {
429
+ 0: renderColor(tokens.variant[v][t].fg[0], elementColorOptions),
430
+ 4: renderColor(tokens.variant[v][t].fg[4], elementColorOptions),
431
+ },
432
+ }
433
+ }
434
+
435
+ function renderColor(
436
+ value: ColorValue,
437
+ context: {bgValue?: string; defaultHue: Hue; scheme: 'light' | 'dark'},
438
+ ): string {
439
+ const {bgValue = 'transparent', defaultHue, scheme} = context
440
+
441
+ const expr = _parseColorToken(value[scheme === 'light' ? 0 : 1], {defaultHue})
442
+
443
+ if (expr.type === 'inherit') {
444
+ return bgValue
445
+ }
446
+
447
+ let v = bgValue
448
+
449
+ if (expr.type === 'color') {
450
+ v = paletteVars[expr.name]
451
+ }
452
+
453
+ if (expr.type === 'tint') {
454
+ v = paletteVars[expr.hue][expr.tint]
455
+ }
456
+
457
+ if (expr.mix < 1) {
458
+ v = `color-mix(in srgb, ${bgValue}, ${v} ${expr.mix * 100}%)`
459
+ }
460
+
461
+ if (expr.opacity < 1) {
462
+ v = `color-mix(in srgb, transparent, ${v} ${expr.opacity * 100}%)`
463
+ }
464
+
465
+ return v
466
+ }
467
+
468
+ function rem(value: number): string {
469
+ if (value === 0) return '0'
470
+
471
+ return `${value / 16}rem`
472
+ }
473
+
474
+ function px(value: number): string {
475
+ if (value === 0) return '0'
476
+
477
+ return `${value}px`
478
+ }
479
+
480
+ function toBoxShadow(value: BoxShadow | undefined): string {
481
+ if (!value) return 'none'
482
+
483
+ return value.map((n) => px(n)).join(' ')
484
+ }
@@ -0,0 +1,64 @@
1
+ import {createTheme, globalFontFace} from '@vanilla-extract/css'
2
+
3
+ import {layers} from '../layers.css'
4
+ import {themeVars} from '../vars.css'
5
+ import {buildCSSTheme} from './buildCSSTheme'
6
+
7
+ const fontDisplay: FontDisplay = 'swap'
8
+
9
+ globalFontFace('Inter', [
10
+ {
11
+ src: `url('https://studio-static.sanity.io/Inter-Regular.woff2') format('woff2')`,
12
+ fontDisplay,
13
+ fontStyle: 'normal',
14
+ fontWeight: '400',
15
+ },
16
+ {
17
+ src: `url('https://studio-static.sanity.io/Inter-Italic.woff2') format('woff2')`,
18
+ fontDisplay,
19
+ fontStyle: 'italic',
20
+ fontWeight: '400',
21
+ },
22
+ {
23
+ src: `url('https://studio-static.sanity.io/Inter-Medium.woff2') format('woff2')`,
24
+ fontDisplay,
25
+ fontStyle: 'normal',
26
+ fontWeight: '500',
27
+ },
28
+ {
29
+ src: `url('https://studio-static.sanity.io/Inter-MediumItalic.woff2') format('woff2')`,
30
+ fontDisplay,
31
+ fontStyle: 'italic',
32
+ fontWeight: '500',
33
+ },
34
+ {
35
+ src: `url('https://studio-static.sanity.io/Inter-SemiBold.woff2') format('woff2')`,
36
+ fontDisplay,
37
+ fontStyle: 'normal',
38
+ fontWeight: '600',
39
+ },
40
+ {
41
+ src: `url('https://studio-static.sanity.io/Inter-SemiBoldItalic.woff2') format('woff2')`,
42
+ fontDisplay,
43
+ fontStyle: 'italic',
44
+ fontWeight: '600',
45
+ },
46
+ {
47
+ src: `url('https://studio-static.sanity.io/Inter-Bold.woff2') format('woff2')`,
48
+ fontDisplay,
49
+ fontStyle: 'normal',
50
+ fontWeight: '700',
51
+ },
52
+ {
53
+ src: `url('https://studio-static.sanity.io/Inter-BoldItalic.woff2') format('woff2')`,
54
+ fontDisplay,
55
+ fontStyle: 'italic',
56
+ fontWeight: '700',
57
+ },
58
+ ])
59
+
60
+ /** @public */
61
+ export const themeClassName: string = createTheme(themeVars, {
62
+ '@layer': layers.theme,
63
+ ...buildCSSTheme(),
64
+ })
package/src/css/types.ts CHANGED
@@ -153,7 +153,7 @@ export type FontTokens<FontScaleIndex extends number> = {
153
153
  }
154
154
 
155
155
  /** @public */
156
- export type ThemeTokens = {
156
+ export type CoreThemeTokens = {
157
157
  avatar: {
158
158
  focusRing: {
159
159
  offset: string
@@ -245,7 +245,7 @@ export type ThemeTokens = {
245
245
  }
246
246
 
247
247
  /** @public */
248
- export type RootThemeTokens = ThemeTokens & {
248
+ export type ThemeTokens = CoreThemeTokens & {
249
249
  color: {palette: ColorPaletteTokens}
250
250
  }
251
251
 
@@ -418,4 +418,4 @@ export type ColorPaletteVars = ThemeContract<ColorPaletteTokens>
418
418
  export type ScopedVars = ThemeContract<ScopedTokens>
419
419
 
420
420
  /** @public */
421
- export type ThemeVars = ThemeContract<RootThemeTokens & ScopedTokens> // _CSSThemeWithoutPaletteTokens & ScopedVars
421
+ export type ThemeVars = ThemeContract<ThemeTokens & ScopedTokens> // _CSSThemeWithoutPaletteTokens & ScopedVars
@@ -21,7 +21,7 @@ import {_fromEntries} from './_fromEntries'
21
21
  import type {
22
22
  ColorPaletteTokens,
23
23
  ColorPaletteVars,
24
- RootThemeTokens,
24
+ CoreThemeTokens,
25
25
  ThemeContract,
26
26
  ThemeTokens,
27
27
  ThemeVars,
@@ -40,10 +40,10 @@ const paletteTokens: ColorPaletteTokens = {
40
40
  ),
41
41
  }
42
42
 
43
- /** @public */
43
+ /** @internal */
44
44
  export const paletteVars: ColorPaletteVars = createThemeContract(paletteTokens)
45
45
 
46
- const themeTokens: ThemeTokens = {
46
+ const themeTokens: CoreThemeTokens = {
47
47
  avatar: {
48
48
  focusRing: {
49
49
  offset: '',
@@ -350,13 +350,13 @@ const themeTokens: ThemeTokens = {
350
350
  },
351
351
  }
352
352
 
353
- const _themeVars: ThemeContract<ThemeTokens> = createThemeContract(themeTokens)
353
+ const _themeVars: ThemeContract<CoreThemeTokens> = createThemeContract(themeTokens)
354
354
 
355
355
  /**
356
356
  * Variables to be defined in a theme.
357
357
  *
358
- * @public */
359
- export const themeVars: ThemeContract<RootThemeTokens> = {
358
+ * @internal */
359
+ export const themeVars: ThemeContract<ThemeTokens> = {
360
360
  ..._themeVars,
361
361
  color: {
362
362
  ..._themeVars.color,
@@ -4,13 +4,12 @@ import {defaultColor} from './defaults/color'
4
4
  import {defaultTheme} from './defaults/common'
5
5
  import {defaultFonts} from './defaults/fonts'
6
6
  import {resolveTokens} from './resolveTokens'
7
- import type {Options, Theme} from './types'
7
+ import type {Theme, ThemeOptions} from './types'
8
8
 
9
9
  /** @public */
10
- export function buildTheme(options?: Options): Theme {
10
+ export function buildTheme(options?: ThemeOptions): Theme {
11
11
  const tokens = resolveTokens({
12
- ...options?.tokens,
13
- color: options?.tokens?.color ?? defaultColor,
12
+ color: options?.color ?? defaultColor,
14
13
  })
15
14
 
16
15
  return {
@@ -302,9 +302,7 @@ export type FontTextSize = (typeof FONT_TEXT_SIZE)[number]
302
302
  export type Shadow = (typeof SHADOW)[number]
303
303
 
304
304
  /** @public */
305
- export interface Options {
306
- tokens?: PartialTokens<Tokens>
307
- }
305
+ export type ThemeOptions = PartialTokens<Tokens>
308
306
 
309
307
  /** @public */
310
308
  export interface Palette {