@khanacademy/wonder-blocks-tokens 4.2.1 → 5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @khanacademy/wonder-blocks-tokens
2
2
 
3
+ ## 5.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 507cf2f: Adds `fadedOffBlack72` color primitive token and sets the `semanticColor.text.secondary` token to this primitive. The slightly darker gray has better color contrast on a variety of backgrounds, including the fadedBlue8 background
8
+
9
+ ## 5.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 5655b9f: Rename `semanticColor.border.focus` to `semanticColor.focus.outer`, and add `focus.inner`.
14
+ - 8f53293: Rename action tokens: `filled` -> `primary`, `outlined` -> `secondary`.
15
+ - 051f0f8: Remove `action.disabled` object in favor of `action.primary.disabled` and `action.secondary.disabled`
16
+
17
+ ### Minor Changes
18
+
19
+ - e1b78db: Add sizing primitive tokens to support the new tokens with rem units that will be used by the thunderblocks/classroom theme
20
+
21
+ ### Patch Changes
22
+
23
+ - 5655b9f: Switch to use `focus.outer` semanticColor token
24
+ - 051f0f8: Rework action.disabled tokens to include properties per kind (border, background, foreground).
25
+
3
26
  ## 4.2.1
4
27
 
5
28
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -141,6 +141,7 @@ const color = _extends({}, baseColors, {
141
141
  fadedPurple8: fadedColorWithWhite(baseColors.purple, 0.08),
142
142
  eggplant: eggplant,
143
143
  fadedEggplant8: fadedColorWithWhite(eggplant, 0.08),
144
+ fadedOffBlack72: fadedColorWithWhite(offBlack, 0.72),
144
145
  fadedOffBlack64: fadedColorWithWhite(offBlack, 0.64),
145
146
  fadedOffBlack50: fadedColorWithWhite(offBlack, 0.5),
146
147
  fadedOffBlack32: fadedColorWithWhite(offBlack, 0.32),
@@ -179,6 +180,34 @@ const font = {
179
180
  }
180
181
  };
181
182
 
183
+ const baseline = 8;
184
+ function pxToRem(value) {
185
+ return `${value / baseline}rem`;
186
+ }
187
+ const sizing = {
188
+ size_0: pxToRem(0),
189
+ size_0125: pxToRem(1),
190
+ size_025: pxToRem(2),
191
+ size_050: pxToRem(4),
192
+ size_075: pxToRem(6),
193
+ size_100: pxToRem(8),
194
+ size_125: pxToRem(10),
195
+ size_150: pxToRem(12),
196
+ size_200: pxToRem(16),
197
+ size_225: pxToRem(18),
198
+ size_250: pxToRem(20),
199
+ size_300: pxToRem(24),
200
+ size_400: pxToRem(32),
201
+ size_500: pxToRem(40),
202
+ size_600: pxToRem(48),
203
+ size_700: pxToRem(56),
204
+ size_800: pxToRem(64),
205
+ size_900: pxToRem(72),
206
+ size_1000: pxToRem(80),
207
+ size_1100: pxToRem(88),
208
+ size_1200: pxToRem(96)
209
+ };
210
+
182
211
  const spacing = {
183
212
  xxxxSmall_2: 2,
184
213
  xxxSmall_4: 4,
@@ -223,12 +252,11 @@ const border = {
223
252
  primary: color.fadedOffBlack16,
224
253
  subtle: color.fadedOffBlack8,
225
254
  strong: color.fadedOffBlack50,
226
- focus: color.blue,
227
255
  inverse: color.white
228
256
  };
229
257
  const semanticColor = {
230
258
  action: {
231
- filled: {
259
+ primary: {
232
260
  progressive: {
233
261
  default: {
234
262
  border: "transparent",
@@ -262,9 +290,14 @@ const semanticColor = {
262
290
  background: color.activeRed,
263
291
  foreground: color.white
264
292
  }
293
+ },
294
+ disabled: {
295
+ border: color.fadedOffBlack32,
296
+ background: color.fadedOffBlack32,
297
+ foreground: color.offWhite
265
298
  }
266
299
  },
267
- outlined: {
300
+ secondary: {
268
301
  progressive: {
269
302
  default: {
270
303
  border: border.strong,
@@ -298,11 +331,12 @@ const semanticColor = {
298
331
  background: color.fadedRed,
299
332
  foreground: color.activeRed
300
333
  }
334
+ },
335
+ disabled: {
336
+ border: border.primary,
337
+ background: color.offWhite,
338
+ foreground: color.fadedOffBlack32
301
339
  }
302
- },
303
- disabled: {
304
- default: color.fadedOffBlack32,
305
- secondary: color.offWhite
306
340
  }
307
341
  },
308
342
  status: {
@@ -336,11 +370,15 @@ const semanticColor = {
336
370
  },
337
371
  text: {
338
372
  primary: color.offBlack,
339
- secondary: color.fadedOffBlack64,
373
+ secondary: color.fadedOffBlack72,
340
374
  disabled: color.fadedOffBlack32,
341
375
  inverse: color.white
342
376
  },
343
377
  border: border,
378
+ focus: {
379
+ outer: color.blue,
380
+ inner: color.white
381
+ },
344
382
  icon: {
345
383
  primary: color.fadedOffBlack64,
346
384
  secondary: color.offBlack,
@@ -358,4 +396,4 @@ const semanticColor = {
358
396
  }
359
397
  };
360
398
 
361
- export { border$1 as border, breakpoint, color, fade, font, mix, semanticColor, spacing };
399
+ export { border$1 as border, breakpoint, color, fade, font, mix, semanticColor, sizing, spacing };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { border } from "./tokens/border";
2
2
  import { color } from "./tokens/color";
3
3
  import { font } from "./tokens/font";
4
+ import { sizing } from "./tokens/sizing";
4
5
  import { spacing } from "./tokens/spacing";
5
6
  import { breakpoint } from "./tokens/media-queries";
6
7
  import { semanticColor } from "./tokens/semantic-color";
@@ -9,7 +10,7 @@ export {
9
10
  /**
10
11
  * Primitive tokens for the Wonder Blocks design system.
11
12
  */
12
- border, color, font, spacing,
13
+ border, color, font, sizing, spacing,
13
14
  /**
14
15
  * Media query breakpoints.
15
16
  */
package/dist/index.js CHANGED
@@ -145,6 +145,7 @@ const color = _extends({}, baseColors, {
145
145
  fadedPurple8: fadedColorWithWhite(baseColors.purple, 0.08),
146
146
  eggplant: eggplant,
147
147
  fadedEggplant8: fadedColorWithWhite(eggplant, 0.08),
148
+ fadedOffBlack72: fadedColorWithWhite(offBlack, 0.72),
148
149
  fadedOffBlack64: fadedColorWithWhite(offBlack, 0.64),
149
150
  fadedOffBlack50: fadedColorWithWhite(offBlack, 0.5),
150
151
  fadedOffBlack32: fadedColorWithWhite(offBlack, 0.32),
@@ -183,6 +184,34 @@ const font = {
183
184
  }
184
185
  };
185
186
 
187
+ const baseline = 8;
188
+ function pxToRem(value) {
189
+ return `${value / baseline}rem`;
190
+ }
191
+ const sizing = {
192
+ size_0: pxToRem(0),
193
+ size_0125: pxToRem(1),
194
+ size_025: pxToRem(2),
195
+ size_050: pxToRem(4),
196
+ size_075: pxToRem(6),
197
+ size_100: pxToRem(8),
198
+ size_125: pxToRem(10),
199
+ size_150: pxToRem(12),
200
+ size_200: pxToRem(16),
201
+ size_225: pxToRem(18),
202
+ size_250: pxToRem(20),
203
+ size_300: pxToRem(24),
204
+ size_400: pxToRem(32),
205
+ size_500: pxToRem(40),
206
+ size_600: pxToRem(48),
207
+ size_700: pxToRem(56),
208
+ size_800: pxToRem(64),
209
+ size_900: pxToRem(72),
210
+ size_1000: pxToRem(80),
211
+ size_1100: pxToRem(88),
212
+ size_1200: pxToRem(96)
213
+ };
214
+
186
215
  const spacing = {
187
216
  xxxxSmall_2: 2,
188
217
  xxxSmall_4: 4,
@@ -227,12 +256,11 @@ const border = {
227
256
  primary: color.fadedOffBlack16,
228
257
  subtle: color.fadedOffBlack8,
229
258
  strong: color.fadedOffBlack50,
230
- focus: color.blue,
231
259
  inverse: color.white
232
260
  };
233
261
  const semanticColor = {
234
262
  action: {
235
- filled: {
263
+ primary: {
236
264
  progressive: {
237
265
  default: {
238
266
  border: "transparent",
@@ -266,9 +294,14 @@ const semanticColor = {
266
294
  background: color.activeRed,
267
295
  foreground: color.white
268
296
  }
297
+ },
298
+ disabled: {
299
+ border: color.fadedOffBlack32,
300
+ background: color.fadedOffBlack32,
301
+ foreground: color.offWhite
269
302
  }
270
303
  },
271
- outlined: {
304
+ secondary: {
272
305
  progressive: {
273
306
  default: {
274
307
  border: border.strong,
@@ -302,11 +335,12 @@ const semanticColor = {
302
335
  background: color.fadedRed,
303
336
  foreground: color.activeRed
304
337
  }
338
+ },
339
+ disabled: {
340
+ border: border.primary,
341
+ background: color.offWhite,
342
+ foreground: color.fadedOffBlack32
305
343
  }
306
- },
307
- disabled: {
308
- default: color.fadedOffBlack32,
309
- secondary: color.offWhite
310
344
  }
311
345
  },
312
346
  status: {
@@ -340,11 +374,15 @@ const semanticColor = {
340
374
  },
341
375
  text: {
342
376
  primary: color.offBlack,
343
- secondary: color.fadedOffBlack64,
377
+ secondary: color.fadedOffBlack72,
344
378
  disabled: color.fadedOffBlack32,
345
379
  inverse: color.white
346
380
  },
347
381
  border: border,
382
+ focus: {
383
+ outer: color.blue,
384
+ inner: color.white
385
+ },
348
386
  icon: {
349
387
  primary: color.fadedOffBlack64,
350
388
  secondary: color.offBlack,
@@ -369,4 +407,5 @@ exports.fade = fade;
369
407
  exports.font = font;
370
408
  exports.mix = mix;
371
409
  exports.semanticColor = semanticColor;
410
+ exports.sizing = sizing;
372
411
  exports.spacing = spacing;
@@ -20,6 +20,7 @@ export declare const color: {
20
20
  fadedPurple8: string;
21
21
  eggplant: string;
22
22
  fadedEggplant8: string;
23
+ fadedOffBlack72: string;
23
24
  fadedOffBlack64: string;
24
25
  fadedOffBlack50: string;
25
26
  fadedOffBlack32: string;
@@ -4,7 +4,7 @@ export declare const semanticColor: {
4
4
  * of interaction.
5
5
  */
6
6
  action: {
7
- filled: {
7
+ primary: {
8
8
  progressive: {
9
9
  default: {
10
10
  border: string;
@@ -39,8 +39,13 @@ export declare const semanticColor: {
39
39
  foreground: string;
40
40
  };
41
41
  };
42
+ disabled: {
43
+ border: string;
44
+ background: string;
45
+ foreground: string;
46
+ };
42
47
  };
43
- outlined: {
48
+ secondary: {
44
49
  progressive: {
45
50
  default: {
46
51
  border: string;
@@ -75,10 +80,11 @@ export declare const semanticColor: {
75
80
  foreground: string;
76
81
  };
77
82
  };
78
- };
79
- disabled: {
80
- default: string;
81
- secondary: string;
83
+ disabled: {
84
+ border: string;
85
+ background: string;
86
+ foreground: string;
87
+ };
82
88
  };
83
89
  };
84
90
  /**
@@ -137,9 +143,12 @@ export declare const semanticColor: {
137
143
  primary: string;
138
144
  subtle: string;
139
145
  strong: string;
140
- focus: string;
141
146
  inverse: string;
142
147
  };
148
+ focus: {
149
+ outer: string;
150
+ inner: string;
151
+ };
143
152
  /**
144
153
  * Default icon colors that change in context (like actions).
145
154
  */
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Tokens that define the sizing of elements. These values are expressed in
3
+ * `rem` units.
4
+ *
5
+ * These tokens are multiples of 8px, the baseline for the design system.
6
+ *
7
+ * These tokens can be used for:
8
+ * - Margin and padding
9
+ * - Component sizes
10
+ * - Typography
11
+ */
12
+ export declare const sizing: {
13
+ readonly size_0: string;
14
+ readonly size_0125: string;
15
+ readonly size_025: string;
16
+ readonly size_050: string;
17
+ readonly size_075: string;
18
+ readonly size_100: string;
19
+ readonly size_125: string;
20
+ readonly size_150: string;
21
+ readonly size_200: string;
22
+ readonly size_225: string;
23
+ readonly size_250: string;
24
+ readonly size_300: string;
25
+ readonly size_400: string;
26
+ readonly size_500: string;
27
+ readonly size_600: string;
28
+ readonly size_700: string;
29
+ readonly size_800: string;
30
+ readonly size_900: string;
31
+ readonly size_1000: string;
32
+ readonly size_1100: string;
33
+ readonly size_1200: string;
34
+ };
@@ -1,3 +1,7 @@
1
+ /**
2
+ * NOTE: These tokens are going to be deprecated in favor of the new `sizing`
3
+ * tokens.
4
+ */
1
5
  export declare const spacing: {
2
6
  readonly xxxxSmall_2: 2;
3
7
  readonly xxxSmall_4: 4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-tokens",
3
- "version": "4.2.1",
3
+ "version": "5.1.0",
4
4
  "description": "Core primitive design tokens for Web Wonder Blocks",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/es/index.js",