@khanacademy/wonder-blocks-tokens 2.0.1 → 2.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,11 @@
1
1
  # @khanacademy/wonder-blocks-tokens
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6999fd39: Add mediaQuery tokens for viewport sizing
8
+
3
9
  ## 2.0.1
4
10
 
5
11
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -197,6 +197,33 @@ const spacing = {
197
197
  xxxLarge_64: 64
198
198
  };
199
199
 
200
+ const width = {
201
+ xsMax: 567,
202
+ smMin: 568,
203
+ smMax: 681,
204
+ mdMin: 682,
205
+ mdMax: 1023,
206
+ lgMin: 1024
207
+ };
208
+ const mediaQuery = {
209
+ xs: `@media screen and (max-width: ${width.xsMax}px) /* breakpoint.mediaQuery.xs */`,
210
+ sm: `@media screen and (min-width: ${width.smMin}px) and (max-width: ${width.smMax}px) /* breakpoint.mediaQuery.sm */`,
211
+ md: `@media screen and (min-width: ${width.mdMin}px) and (max-width: ${width.mdMax}px) /* breakpoint.mediaQuery.md */`,
212
+ lg: `@media screen and (min-width: ${width.mdMin}px) and (max-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lg */`,
213
+ xl: `@media screen and (min-width: ${width.lgMin}px) /* breakpoint.mediaQuery.xl */`,
214
+ xsOrSmaller: `@media screen and (max-width: ${width.xsMax}px) /* breakpoint.mediaQuery.xsOrSmaller */`,
215
+ smOrSmaller: `@media screen and (max-width: ${width.smMax}px) /* breakpoint.mediaQuery.smOrSmaller */`,
216
+ mdOrSmaller: `@media screen and (max-width: ${width.mdMax}px) /* breakpoint.mediaQuery.mdOrSmaller */`,
217
+ lgOrSmaller: `@media screen and (max-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lgOrSmaller */`,
218
+ smOrLarger: `@media screen and (min-width: ${width.smMin}px) /* breakpoint.mediaQuery.smOrLarger */`,
219
+ mdOrLarger: `@media screen and (min-width: ${width.mdMin}px) /* breakpoint.mediaQuery.mdOrLarger */`,
220
+ lgOrLarger: `@media screen and (min-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lgOrLarger */`
221
+ };
222
+ const breakpoint = {
223
+ width,
224
+ mediaQuery
225
+ };
226
+
200
227
  const semanticColor = {
201
228
  action: {
202
229
  primary: {
@@ -269,4 +296,4 @@ const semanticColor = {
269
296
  }
270
297
  };
271
298
 
272
- export { border, color, fade, font, mix, semanticColor, spacing };
299
+ export { border, breakpoint, color, fade, font, mix, semanticColor, spacing };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { border } from "./tokens/border";
2
2
  import { color } from "./tokens/color";
3
3
  import { font } from "./tokens/font";
4
4
  import { spacing } from "./tokens/spacing";
5
+ import { breakpoint } from "./tokens/media-queries";
5
6
  import { semanticColor } from "./tokens/semantic-color";
6
7
  import { mix, fade } from "./util/utils";
7
8
  export {
@@ -9,6 +10,10 @@ export {
9
10
  * Primitive tokens for the Wonder Blocks design system.
10
11
  */
11
12
  border, color, font, spacing,
13
+ /**
14
+ * Media query breakpoints.
15
+ */
16
+ breakpoint,
12
17
  /**
13
18
  * Semantic tokens.
14
19
  */
package/dist/index.js CHANGED
@@ -201,6 +201,33 @@ const spacing = {
201
201
  xxxLarge_64: 64
202
202
  };
203
203
 
204
+ const width = {
205
+ xsMax: 567,
206
+ smMin: 568,
207
+ smMax: 681,
208
+ mdMin: 682,
209
+ mdMax: 1023,
210
+ lgMin: 1024
211
+ };
212
+ const mediaQuery = {
213
+ xs: `@media screen and (max-width: ${width.xsMax}px) /* breakpoint.mediaQuery.xs */`,
214
+ sm: `@media screen and (min-width: ${width.smMin}px) and (max-width: ${width.smMax}px) /* breakpoint.mediaQuery.sm */`,
215
+ md: `@media screen and (min-width: ${width.mdMin}px) and (max-width: ${width.mdMax}px) /* breakpoint.mediaQuery.md */`,
216
+ lg: `@media screen and (min-width: ${width.mdMin}px) and (max-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lg */`,
217
+ xl: `@media screen and (min-width: ${width.lgMin}px) /* breakpoint.mediaQuery.xl */`,
218
+ xsOrSmaller: `@media screen and (max-width: ${width.xsMax}px) /* breakpoint.mediaQuery.xsOrSmaller */`,
219
+ smOrSmaller: `@media screen and (max-width: ${width.smMax}px) /* breakpoint.mediaQuery.smOrSmaller */`,
220
+ mdOrSmaller: `@media screen and (max-width: ${width.mdMax}px) /* breakpoint.mediaQuery.mdOrSmaller */`,
221
+ lgOrSmaller: `@media screen and (max-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lgOrSmaller */`,
222
+ smOrLarger: `@media screen and (min-width: ${width.smMin}px) /* breakpoint.mediaQuery.smOrLarger */`,
223
+ mdOrLarger: `@media screen and (min-width: ${width.mdMin}px) /* breakpoint.mediaQuery.mdOrLarger */`,
224
+ lgOrLarger: `@media screen and (min-width: ${width.lgMin}px) /* breakpoint.mediaQuery.lgOrLarger */`
225
+ };
226
+ const breakpoint = {
227
+ width,
228
+ mediaQuery
229
+ };
230
+
204
231
  const semanticColor = {
205
232
  action: {
206
233
  primary: {
@@ -274,6 +301,7 @@ const semanticColor = {
274
301
  };
275
302
 
276
303
  exports.border = border;
304
+ exports.breakpoint = breakpoint;
277
305
  exports.color = color;
278
306
  exports.fade = fade;
279
307
  exports.font = font;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * A default set of media queries to use for different screen sizes.
3
+ *
4
+ * Breakpoint documentation: https://khanacademy.atlassian.net/wiki/spaces/WB/pages/2099970518/Layout+Breakpoints
5
+ *
6
+ */
7
+ export declare const breakpoint: {
8
+ width: {
9
+ readonly xsMax: 567;
10
+ readonly smMin: 568;
11
+ readonly smMax: 681;
12
+ readonly mdMin: 682;
13
+ readonly mdMax: 1023;
14
+ readonly lgMin: 1024;
15
+ };
16
+ mediaQuery: {
17
+ readonly xs: "@media screen and (max-width: 567px) /* breakpoint.mediaQuery.xs */";
18
+ readonly sm: "@media screen and (min-width: 568px) and (max-width: 681px) /* breakpoint.mediaQuery.sm */";
19
+ readonly md: "@media screen and (min-width: 682px) and (max-width: 1023px) /* breakpoint.mediaQuery.md */";
20
+ readonly lg: "@media screen and (min-width: 682px) and (max-width: 1024px) /* breakpoint.mediaQuery.lg */";
21
+ readonly xl: "@media screen and (min-width: 1024px) /* breakpoint.mediaQuery.xl */";
22
+ readonly xsOrSmaller: "@media screen and (max-width: 567px) /* breakpoint.mediaQuery.xsOrSmaller */";
23
+ readonly smOrSmaller: "@media screen and (max-width: 681px) /* breakpoint.mediaQuery.smOrSmaller */";
24
+ readonly mdOrSmaller: "@media screen and (max-width: 1023px) /* breakpoint.mediaQuery.mdOrSmaller */";
25
+ readonly lgOrSmaller: "@media screen and (max-width: 1024px) /* breakpoint.mediaQuery.lgOrSmaller */";
26
+ readonly smOrLarger: "@media screen and (min-width: 568px) /* breakpoint.mediaQuery.smOrLarger */";
27
+ readonly mdOrLarger: "@media screen and (min-width: 682px) /* breakpoint.mediaQuery.mdOrLarger */";
28
+ readonly lgOrLarger: "@media screen and (min-width: 1024px) /* breakpoint.mediaQuery.lgOrLarger */";
29
+ };
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-tokens",
3
- "version": "2.0.1",
3
+ "version": "2.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",