@atlaskit/tokens 1.27.0 → 1.28.1

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 (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/artifacts/themes/atlassian-typography-minor3.js +2 -2
  3. package/dist/cjs/artifacts/tokens-raw/atlassian-typography-adg3.js +17 -9
  4. package/dist/cjs/artifacts/tokens-raw/atlassian-typography-minor3.js +17 -9
  5. package/dist/cjs/artifacts/tokens-raw/atlassian-typography.js +17 -9
  6. package/dist/cjs/get-token-value.js +1 -1
  7. package/dist/cjs/get-token.js +1 -1
  8. package/dist/es2019/artifacts/themes/atlassian-typography-minor3.js +7 -1
  9. package/dist/es2019/artifacts/tokens-raw/atlassian-typography-adg3.js +17 -9
  10. package/dist/es2019/artifacts/tokens-raw/atlassian-typography-minor3.js +17 -9
  11. package/dist/es2019/artifacts/tokens-raw/atlassian-typography.js +17 -9
  12. package/dist/es2019/get-token-value.js +1 -1
  13. package/dist/es2019/get-token.js +1 -1
  14. package/dist/esm/artifacts/themes/atlassian-typography-minor3.js +2 -2
  15. package/dist/esm/artifacts/tokens-raw/atlassian-typography-adg3.js +17 -9
  16. package/dist/esm/artifacts/tokens-raw/atlassian-typography-minor3.js +17 -9
  17. package/dist/esm/artifacts/tokens-raw/atlassian-typography.js +17 -9
  18. package/dist/esm/get-token-value.js +1 -1
  19. package/dist/esm/get-token.js +1 -1
  20. package/dist/types/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
  21. package/dist/types/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +36 -1
  22. package/dist/types/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +36 -1
  23. package/dist/types/artifacts/tokens-raw/atlassian-typography.d.ts +36 -1
  24. package/dist/types/types.d.ts +10 -3
  25. package/dist/types-ts4.5/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
  26. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +36 -1
  27. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +36 -1
  28. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography.d.ts +36 -1
  29. package/dist/types-ts4.5/types.d.ts +10 -3
  30. package/package.json +2 -2
  31. package/report.api.md +57 -11
  32. package/tmp/api-report-tmp.d.ts +49 -3
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::4197cb73414458032918015469216944>>
3
+ * @codegen <<SignedSource::1ae3b7bd31e38fb0fcdff9803f28c2f0>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  declare const tokens: ({
@@ -9,6 +9,7 @@ declare const tokens: ({
9
9
  state: string;
10
10
  introduced: string;
11
11
  description: string;
12
+ responsiveSmallerVariant?: undefined;
12
13
  };
13
14
  value: string;
14
15
  filePath: string;
@@ -19,6 +20,7 @@ declare const tokens: ({
19
20
  state: string;
20
21
  introduced: string;
21
22
  description: string;
23
+ responsiveSmallerVariant?: undefined;
22
24
  };
23
25
  value: string;
24
26
  };
@@ -31,6 +33,7 @@ declare const tokens: ({
31
33
  state: string;
32
34
  introduced: string;
33
35
  description: string;
36
+ responsiveSmallerVariant?: undefined;
34
37
  };
35
38
  value: string;
36
39
  filePath: string;
@@ -41,6 +44,38 @@ declare const tokens: ({
41
44
  state: string;
42
45
  introduced: string;
43
46
  description: string;
47
+ responsiveSmallerVariant?: undefined;
48
+ };
49
+ value: {
50
+ fontWeight: string;
51
+ fontSize: string;
52
+ lineHeight: string;
53
+ fontFamily: string;
54
+ fontStyle: string;
55
+ letterSpacing: string;
56
+ };
57
+ };
58
+ name: string;
59
+ path: string[];
60
+ cleanName: string;
61
+ } | {
62
+ attributes: {
63
+ group: string;
64
+ state: string;
65
+ introduced: string;
66
+ description: string;
67
+ responsiveSmallerVariant: string;
68
+ };
69
+ value: string;
70
+ filePath: string;
71
+ isSource: boolean;
72
+ original: {
73
+ attributes: {
74
+ group: string;
75
+ state: string;
76
+ introduced: string;
77
+ description: string;
78
+ responsiveSmallerVariant: string;
44
79
  };
45
80
  value: {
46
81
  fontWeight: string;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::ecd63bab60b9c05c08973d35cc1989df>>
3
+ * @codegen <<SignedSource::e95de29cabce142a19e4a4c6780c2555>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  declare const tokens: ({
@@ -9,6 +9,7 @@ declare const tokens: ({
9
9
  state: string;
10
10
  introduced: string;
11
11
  description: string;
12
+ responsiveSmallerVariant?: undefined;
12
13
  };
13
14
  value: string;
14
15
  filePath: string;
@@ -19,6 +20,7 @@ declare const tokens: ({
19
20
  state: string;
20
21
  introduced: string;
21
22
  description: string;
23
+ responsiveSmallerVariant?: undefined;
22
24
  };
23
25
  value: {
24
26
  fontWeight: string;
@@ -38,6 +40,7 @@ declare const tokens: ({
38
40
  state: string;
39
41
  introduced: string;
40
42
  description: string;
43
+ responsiveSmallerVariant: string;
41
44
  };
42
45
  value: string;
43
46
  filePath: string;
@@ -48,6 +51,38 @@ declare const tokens: ({
48
51
  state: string;
49
52
  introduced: string;
50
53
  description: string;
54
+ responsiveSmallerVariant: string;
55
+ };
56
+ value: {
57
+ fontWeight: string;
58
+ fontSize: string;
59
+ lineHeight: string;
60
+ fontFamily: string;
61
+ fontStyle: string;
62
+ letterSpacing: string;
63
+ };
64
+ };
65
+ name: string;
66
+ path: string[];
67
+ cleanName: string;
68
+ } | {
69
+ attributes: {
70
+ group: string;
71
+ state: string;
72
+ introduced: string;
73
+ description: string;
74
+ responsiveSmallerVariant?: undefined;
75
+ };
76
+ value: string;
77
+ filePath: string;
78
+ isSource: boolean;
79
+ original: {
80
+ attributes: {
81
+ group: string;
82
+ state: string;
83
+ introduced: string;
84
+ description: string;
85
+ responsiveSmallerVariant?: undefined;
51
86
  };
52
87
  value: string;
53
88
  };
@@ -62,6 +62,11 @@ export interface DesignToken<TValue, Group extends Groups> extends Token<TValue,
62
62
  suggest?: string[];
63
63
  };
64
64
  }
65
+ export interface TypographyDesignToken<TValue> extends DesignToken<TValue, 'typography'> {
66
+ attributes: DesignToken<TValue, 'typography'>['attributes'] & {
67
+ responsiveSmallerVariant?: ResponsiveTypographyTokens;
68
+ };
69
+ }
65
70
  /**
66
71
  * @example
67
72
  * ```ts
@@ -71,7 +76,7 @@ export interface DesignToken<TValue, Group extends Groups> extends Token<TValue,
71
76
  */
72
77
  type FlattenKeys<T, Prefix extends string = ''> = {
73
78
  [Key in keyof T]: T[Key] extends object ? T[Key] extends {
74
- value: string;
79
+ value: any;
75
80
  } ? `${Prefix}${Key & string}` : `${Prefix}${Key & string}.${FlattenKeys<T[Key]>}` : `${Prefix}.${Key & string}`;
76
81
  }[keyof T];
77
82
  type OmitDistributive<T, K extends PropertyKey> = T extends any ? T extends object ? Id<DeepOmit<T, K>> : T : never;
@@ -1000,14 +1005,16 @@ export type TypographyToken<TPalette extends {
1000
1005
  lineHeight: string;
1001
1006
  fontFamily: string;
1002
1007
  letterSpacing: string;
1003
- }> = DesignToken<{
1008
+ responsiveToken?: string;
1009
+ }> = TypographyDesignToken<{
1004
1010
  fontStyle: 'normal';
1005
1011
  fontWeight: TPalette['fontWeight'];
1006
1012
  fontFamily: FlattenKeys<FontFamilyTokenSchema<any>>;
1007
1013
  fontSize: TPalette['fontSize'];
1008
1014
  lineHeight: TPalette['lineHeight'];
1009
1015
  letterSpacing: TPalette['letterSpacing'];
1010
- }, 'typography'>;
1016
+ }>;
1017
+ type ResponsiveTypographyTokens = FlattenKeys<TypographyTokenSchema<any>>;
1011
1018
  /**
1012
1019
  * The semantic interface for typography tokens
1013
1020
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.27.0",
3
+ "version": "1.28.1",
4
4
  "description": "Design tokens are the single source of truth to name and store design decisions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/ds-lib": "^2.2.0",
37
37
  "@atlaskit/platform-feature-flags": "^0.2.0",
38
38
  "@babel/runtime": "^7.0.0",
39
- "@babel/traverse": "^7.20.0",
39
+ "@babel/traverse": "^7.23.2",
40
40
  "@babel/types": "^7.20.0",
41
41
  "bind-event-listener": "^2.1.1"
42
42
  },
package/report.api.md CHANGED
@@ -1038,7 +1038,7 @@ type ExtensionThemeId = ThemeIds;
1038
1038
  type FlattenKeys<T, Prefix extends string = ''> = {
1039
1039
  [Key in keyof T]: T[Key] extends object
1040
1040
  ? T[Key] extends {
1041
- value: string;
1041
+ value: any;
1042
1042
  }
1043
1043
  ? `${Prefix}${Key & string}`
1044
1044
  : `${Prefix}${Key & string}.${FlattenKeys<T[Key]>}`
@@ -1582,6 +1582,9 @@ export type RawToken = DesignToken<string, 'raw'>;
1582
1582
  // @public (undocumented)
1583
1583
  type Replacement = InternalTokenIds | InternalTokenIds[];
1584
1584
 
1585
+ // @public (undocumented)
1586
+ type ResponsiveTypographyTokens = FlattenKeys<TypographyTokenSchema<any>>;
1587
+
1585
1588
  // @public
1586
1589
  export const setGlobalTheme: (
1587
1590
  {
@@ -2306,6 +2309,15 @@ type TokenState =
2306
2309
  | DeprecatedTokenState
2307
2310
  | ExperimentalTokenState;
2308
2311
 
2312
+ // @public (undocumented)
2313
+ interface TypographyDesignToken<TValue>
2314
+ extends DesignToken<TValue, 'typography'> {
2315
+ // (undocumented)
2316
+ attributes: DesignToken<TValue, 'typography'>['attributes'] & {
2317
+ responsiveSmallerVariant?: ResponsiveTypographyTokens;
2318
+ };
2319
+ }
2320
+
2309
2321
  // @public
2310
2322
  export type TypographyToken<
2311
2323
  TPalette extends {
@@ -2314,18 +2326,52 @@ export type TypographyToken<
2314
2326
  lineHeight: string;
2315
2327
  fontFamily: string;
2316
2328
  letterSpacing: string;
2329
+ responsiveToken?: string;
2317
2330
  },
2318
- > = DesignToken<
2319
- {
2320
- fontStyle: 'normal';
2321
- fontWeight: TPalette['fontWeight'];
2322
- fontFamily: FlattenKeys<FontFamilyTokenSchema<any>>;
2323
- fontSize: TPalette['fontSize'];
2324
- lineHeight: TPalette['lineHeight'];
2325
- letterSpacing: TPalette['letterSpacing'];
2331
+ > = TypographyDesignToken<{
2332
+ fontStyle: 'normal';
2333
+ fontWeight: TPalette['fontWeight'];
2334
+ fontFamily: FlattenKeys<FontFamilyTokenSchema<any>>;
2335
+ fontSize: TPalette['fontSize'];
2336
+ lineHeight: TPalette['lineHeight'];
2337
+ letterSpacing: TPalette['letterSpacing'];
2338
+ }>;
2339
+
2340
+ // @public
2341
+ interface TypographyTokenSchema<
2342
+ TPalette extends {
2343
+ fontWeight: string;
2344
+ fontSize: string;
2345
+ lineHeight: string;
2346
+ fontFamily: string;
2347
+ letterSpacing: string;
2326
2348
  },
2327
- 'typography'
2328
- >;
2349
+ > {
2350
+ // (undocumented)
2351
+ font: {
2352
+ heading: {
2353
+ xxlarge: TypographyToken<TPalette>;
2354
+ xlarge: TypographyToken<TPalette>;
2355
+ large: TypographyToken<TPalette>;
2356
+ medium: TypographyToken<TPalette>;
2357
+ small: TypographyToken<TPalette>;
2358
+ xsmall: TypographyToken<TPalette>;
2359
+ xxsmall: TypographyToken<TPalette>;
2360
+ };
2361
+ ui: {
2362
+ '[default]': TypographyToken<TPalette>;
2363
+ small: TypographyToken<TPalette>;
2364
+ };
2365
+ body: {
2366
+ '[default]': TypographyToken<TPalette>;
2367
+ small: TypographyToken<TPalette>;
2368
+ large: TypographyToken<TPalette>;
2369
+ };
2370
+ code: {
2371
+ '[default]': TypographyToken<TPalette>;
2372
+ };
2373
+ };
2374
+ }
2329
2375
 
2330
2376
  // @public
2331
2377
  export const useThemeObserver: () => Partial<ActiveThemeState>;
@@ -558,7 +558,7 @@ type ExtensionThemeId = ThemeIds;
558
558
  // @public (undocumented)
559
559
  type FlattenKeys<T, Prefix extends string = ''> = {
560
560
  [Key in keyof T]: T[Key] extends object ? T[Key] extends {
561
- value: string;
561
+ value: any;
562
562
  } ? `${Prefix}${Key & string}` : `${Prefix}${Key & string}.${FlattenKeys<T[Key]>}` : `${Prefix}.${Key & string}`;
563
563
  }[keyof T];
564
564
 
@@ -616,6 +616,9 @@ export type RawToken = DesignToken<string, 'raw'>;
616
616
  // @public (undocumented)
617
617
  type Replacement = InternalTokenIds | InternalTokenIds[];
618
618
 
619
+ // @public (undocumented)
620
+ type ResponsiveTypographyTokens = FlattenKeys<TypographyTokenSchema<any>>;
621
+
619
622
  // @public
620
623
  export const setGlobalTheme: ({ colorMode, contrastMode, dark, light, shape, spacing, typography, UNSAFE_themeOptions, }?: Partial<ThemeState>, themeLoader?: ((id: ThemeIdsWithOverrides) => Promise<void> | void) | undefined) => Promise<UnbindFn>;
621
624
 
@@ -1252,6 +1255,14 @@ type Tokens_2 = typeof tokens;
1252
1255
  // @public (undocumented)
1253
1256
  type TokenState = ActiveTokenState | DeletedTokenState | DeprecatedTokenState | ExperimentalTokenState;
1254
1257
 
1258
+ // @public (undocumented)
1259
+ interface TypographyDesignToken<TValue> extends DesignToken<TValue, 'typography'> {
1260
+ // (undocumented)
1261
+ attributes: DesignToken<TValue, 'typography'>['attributes'] & {
1262
+ responsiveSmallerVariant?: ResponsiveTypographyTokens;
1263
+ };
1264
+ }
1265
+
1255
1266
  // @public
1256
1267
  export type TypographyToken<TPalette extends {
1257
1268
  fontWeight: string;
@@ -1259,14 +1270,49 @@ export type TypographyToken<TPalette extends {
1259
1270
  lineHeight: string;
1260
1271
  fontFamily: string;
1261
1272
  letterSpacing: string;
1262
- }> = DesignToken<{
1273
+ responsiveToken?: string;
1274
+ }> = TypographyDesignToken<{
1263
1275
  fontStyle: 'normal';
1264
1276
  fontWeight: TPalette['fontWeight'];
1265
1277
  fontFamily: FlattenKeys<FontFamilyTokenSchema<any>>;
1266
1278
  fontSize: TPalette['fontSize'];
1267
1279
  lineHeight: TPalette['lineHeight'];
1268
1280
  letterSpacing: TPalette['letterSpacing'];
1269
- }, 'typography'>;
1281
+ }>;
1282
+
1283
+ // @public
1284
+ interface TypographyTokenSchema<TPalette extends {
1285
+ fontWeight: string;
1286
+ fontSize: string;
1287
+ lineHeight: string;
1288
+ fontFamily: string;
1289
+ letterSpacing: string;
1290
+ }> {
1291
+ // (undocumented)
1292
+ font: {
1293
+ heading: {
1294
+ xxlarge: TypographyToken<TPalette>;
1295
+ xlarge: TypographyToken<TPalette>;
1296
+ large: TypographyToken<TPalette>;
1297
+ medium: TypographyToken<TPalette>;
1298
+ small: TypographyToken<TPalette>;
1299
+ xsmall: TypographyToken<TPalette>;
1300
+ xxsmall: TypographyToken<TPalette>;
1301
+ };
1302
+ ui: {
1303
+ '[default]': TypographyToken<TPalette>;
1304
+ small: TypographyToken<TPalette>;
1305
+ };
1306
+ body: {
1307
+ '[default]': TypographyToken<TPalette>;
1308
+ small: TypographyToken<TPalette>;
1309
+ large: TypographyToken<TPalette>;
1310
+ };
1311
+ code: {
1312
+ '[default]': TypographyToken<TPalette>;
1313
+ };
1314
+ };
1315
+ }
1270
1316
 
1271
1317
  // @public
1272
1318
  export const useThemeObserver: () => Partial<ActiveThemeState>;