@expo/styleguide 8.0.0-alpha.3 → 8.0.0-alpha.4

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/README.md CHANGED
@@ -11,21 +11,19 @@ Expo's styleguide and components for use on the web.
11
11
  2. Import global CSS files from the package in your JS(X)/TS(X) code:
12
12
  ```jsx
13
13
  import "@expo/styleguide/dist/expo-theme.css";
14
- import "@expo/styleguide/dist/global.css";
15
14
  ```
16
15
  or import it the main stylesheet file:
17
16
  ```css
18
17
  @import "@expo/styleguide/dist/expo-theme.css";
19
- @import "@expo/styleguide/dist/global.css";
20
18
  ```
21
19
 
22
20
  ### Tailwind theme
23
21
 
24
22
  For the Styleguide we use our custom Tailwind theme, which is based on the default TW theme, with the following differences:
25
- * only valid media screen scopes are: `small:`, `medium:` and `large:`
23
+ * only valid media screen scopes are: `xs:`, `sm:`, `md:`, `lg:` and `xl:`
26
24
  * there is a custom `hocus:` scope which is a shorthand for hover and focus states
27
25
  * typography elements are predefined as a `heading-[size]` styles sets
28
- * `icon-[size]` are custom classes defined for icons sizing
26
+ * `icon-[size]` are custom component classes defined for icons sizing
29
27
 
30
28
  ## Development
31
29
 
package/dist/tailwind.js CHANGED
@@ -330,9 +330,15 @@ const expoTailwindConfig = {
330
330
  },
331
331
  },
332
332
  screens: {
333
- small: '400px',
334
- medium: '900px',
335
- large: '1200px',
333
+ xs: '340px',
334
+ sm: '420px',
335
+ 'sm-gutters': '468px',
336
+ md: '740px',
337
+ 'md-gutters': '788px',
338
+ lg: '960px',
339
+ 'lg-gutters': '1008px',
340
+ xl: '1200px',
341
+ 'xl-gutters': '1248px',
336
342
  },
337
343
  extend: {
338
344
  height: {
@@ -344,15 +350,59 @@ const expoTailwindConfig = {
344
350
  scale: {
345
351
  98: '.98',
346
352
  },
353
+ gridTemplateColumns: {
354
+ 'auto-min-1': 'auto',
355
+ 'auto-min-2': 'minmax(min-content, auto) min-content',
356
+ 'auto-min-3': 'minmax(min-content, auto) repeat(2, min-content)',
357
+ 'auto-min-4': 'minmax(min-content, auto) repeat(3, min-content)',
358
+ 'auto-min-5': 'minmax(min-content, auto) repeat(4, min-content)',
359
+ 'auto-min-6': 'minmax(min-content, auto) repeat(5, min-content)',
360
+ 'auto-min-7': 'minmax(min-content, auto) repeat(6, min-content)',
361
+ 'auto-min-8': 'minmax(min-content, auto) repeat(7, min-content)',
362
+ },
363
+ transitionDuration: {
364
+ default: '150ms',
365
+ },
347
366
  },
348
367
  },
349
368
  corePlugins: {
350
369
  fontFamily: false,
351
370
  },
352
371
  plugins: [
353
- plugin(({ addVariant, matchUtilities, theme }) => {
372
+ plugin(({ addComponents, addVariant, matchUtilities, theme }) => {
354
373
  addVariant('hocus', ['&:hover', '&:focus-visible']);
355
374
  matchUtilities({ heading: (value) => value }, { values: theme('heading') });
375
+ addComponents({
376
+ '.icon-2xs': {
377
+ height: theme('height.3'),
378
+ width: theme('width.3'),
379
+ },
380
+ '.icon-xs': {
381
+ // note(simek): figure out how to access `h-3.5` using path
382
+ height: '0.875rem',
383
+ width: '0.875rem',
384
+ },
385
+ '.icon-sm': {
386
+ height: theme('height.4'),
387
+ width: theme('width.4'),
388
+ },
389
+ '.icon-md': {
390
+ height: theme('height.5'),
391
+ width: theme('width.5'),
392
+ },
393
+ '.icon-lg': {
394
+ height: theme('height.6'),
395
+ width: theme('width.6'),
396
+ },
397
+ '.icon-xl': {
398
+ height: theme('height.8'),
399
+ width: theme('width.8'),
400
+ },
401
+ '.icon-2xl': {
402
+ height: theme('height.10'),
403
+ width: theme('width.10'),
404
+ },
405
+ });
356
406
  }),
357
407
  ],
358
408
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide",
3
- "version": "8.0.0-alpha.3",
3
+ "version": "8.0.0-alpha.4",
4
4
  "description": "Expo's styleguide components for use on the web.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,5 +49,5 @@
49
49
  "eslintConfig": {
50
50
  "extends": "universe/web"
51
51
  },
52
- "gitHead": "041dfc2e45eb0f1cc48df36c04f46b0870537859"
52
+ "gitHead": "35422c5d87d78da56ab4097c05b620c0bdaecd8e"
53
53
  }
package/tailwind.js CHANGED
@@ -330,9 +330,15 @@ const expoTailwindConfig = {
330
330
  },
331
331
  },
332
332
  screens: {
333
- small: '400px',
334
- medium: '900px',
335
- large: '1200px',
333
+ xs: '340px',
334
+ sm: '420px',
335
+ 'sm-gutters': '468px',
336
+ md: '740px',
337
+ 'md-gutters': '788px',
338
+ lg: '960px',
339
+ 'lg-gutters': '1008px',
340
+ xl: '1200px',
341
+ 'xl-gutters': '1248px',
336
342
  },
337
343
  extend: {
338
344
  height: {
@@ -344,15 +350,59 @@ const expoTailwindConfig = {
344
350
  scale: {
345
351
  98: '.98',
346
352
  },
353
+ gridTemplateColumns: {
354
+ 'auto-min-1': 'auto',
355
+ 'auto-min-2': 'minmax(min-content, auto) min-content',
356
+ 'auto-min-3': 'minmax(min-content, auto) repeat(2, min-content)',
357
+ 'auto-min-4': 'minmax(min-content, auto) repeat(3, min-content)',
358
+ 'auto-min-5': 'minmax(min-content, auto) repeat(4, min-content)',
359
+ 'auto-min-6': 'minmax(min-content, auto) repeat(5, min-content)',
360
+ 'auto-min-7': 'minmax(min-content, auto) repeat(6, min-content)',
361
+ 'auto-min-8': 'minmax(min-content, auto) repeat(7, min-content)',
362
+ },
363
+ transitionDuration: {
364
+ default: '150ms',
365
+ },
347
366
  },
348
367
  },
349
368
  corePlugins: {
350
369
  fontFamily: false,
351
370
  },
352
371
  plugins: [
353
- plugin(({ addVariant, matchUtilities, theme }) => {
372
+ plugin(({ addComponents, addVariant, matchUtilities, theme }) => {
354
373
  addVariant('hocus', ['&:hover', '&:focus-visible']);
355
374
  matchUtilities({ heading: (value) => value }, { values: theme('heading') });
375
+ addComponents({
376
+ '.icon-2xs': {
377
+ height: theme('height.3'),
378
+ width: theme('width.3'),
379
+ },
380
+ '.icon-xs': {
381
+ // note(simek): figure out how to access `h-3.5` using path
382
+ height: '0.875rem',
383
+ width: '0.875rem',
384
+ },
385
+ '.icon-sm': {
386
+ height: theme('height.4'),
387
+ width: theme('width.4'),
388
+ },
389
+ '.icon-md': {
390
+ height: theme('height.5'),
391
+ width: theme('width.5'),
392
+ },
393
+ '.icon-lg': {
394
+ height: theme('height.6'),
395
+ width: theme('width.6'),
396
+ },
397
+ '.icon-xl': {
398
+ height: theme('height.8'),
399
+ width: theme('width.8'),
400
+ },
401
+ '.icon-2xl': {
402
+ height: theme('height.10'),
403
+ width: theme('width.10'),
404
+ },
405
+ });
356
406
  }),
357
407
  ],
358
408
  };
package/dist/global.css DELETED
@@ -1,13 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @layer components {
6
- .icon-md { @apply h-5 w-5; }
7
- .icon-2xs { @apply h-3 w-3; }
8
- .icon-xs { @apply h-3.5 w-3.5; }
9
- .icon-sm { @apply h-4 w-4; }
10
- .icon-lg { @apply h-6 w-6; }
11
- .icon-xl { @apply h-8 w-8; }
12
- .icon-2xl { @apply h-10 w-10; }
13
- }