@xds/tokens 1.0.1 → 1.1.0

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 (2) hide show
  1. package/dist/index.d.ts +8 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -7,11 +7,17 @@ export type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
7
7
  /**
8
8
  * A type with the shape of `T` that takes any value where `T` has a particular one. A list of
9
9
  * names, such as font families, takes any number of them; a tuple of numbers, such as an
10
- * easing curve's, stays that long; a font weight is one of the weights a font has.
10
+ * easing curve's, stays that long; a font weight is one of the weights a font has. A type role
11
+ * may also name the family it is drawn in, which React Native's `XdsTheme` sets from the fonts
12
+ * the app gives it.
11
13
  */
12
14
  type Widen<T> = T extends string ? string : T extends number ? number : T extends readonly string[] ? readonly string[] : {
13
15
  readonly [Key in keyof T]: Key extends "fontWeight" ? FontWeight : Widen<T[Key]>;
14
- };
16
+ } & (T extends {
17
+ fontWeight: number;
18
+ } ? {
19
+ readonly fontFamily?: string;
20
+ } : unknown);
15
21
  /**
16
22
  * A full set of token values: the colors of both modes, the sizes of both input devices and the
17
23
  * shared values, in the shape of `defaultTheme`. `xds export-theme --format react-native` writes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xds/tokens",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "The design tokens of xds as CSS custom properties and TypeScript constants, with its preset themes.",
5
5
  "keywords": [
6
6
  "design-system",