@griffel/react 1.5.21 → 1.5.22

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
@@ -20,19 +20,9 @@ A package with wrappers and APIs to be used with React.js.
20
20
  - [styleElementAttributes](#styleelementattributes)
21
21
  - [`TextDirectionProvider`](#textdirectionprovider)
22
22
  - [Shorthands](#shorthands)
23
- - [`shorthands.border`](#shorthandsborder)
24
- - [`shorthands.borderBottom`, `shorthands.borderTop`, `shorthands.borderLeft`, `shorthands.borderRight`](#shorthandsborderbottom-shorthandsbordertop-shorthandsborderleft-shorthandsborderright)
25
23
  - [`shorthands.borderColor`](#shorthandsbordercolor)
26
24
  - [`shorthands.borderStyle`](#shorthandsborderstyle)
27
25
  - [`shorthands.borderWidth`](#shorthandsborderwidth)
28
- - [`shorthands.flex`](#shorthandsflex)
29
- - [`shorthands.gap`](#shorthandsgap)
30
- - [`shorthands.gridArea`](#shorthandsgridarea)
31
- - [`shorthands.inset`](#shorthandsinset)
32
- - [`shorthands.margin`](#shorthandsmargin)
33
- - [`shorthands.overflow`](#shorthandsoverflow)
34
- - [`shorthands.padding`](#shorthandspadding)
35
- - [`shorthands.transition`](#shorthandstransition)
36
26
 
37
27
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
38
28
 
@@ -311,10 +301,8 @@ Rules generated by `makeResetStyles()` are inserted into the CSS style sheet bef
311
301
 
312
302
  `makeResetStyles` returns a React hook that should be called inside a component:
313
303
 
314
- > 💡`makeResetStyles` supports all features from `makeStyles()` and allows to use [CSS shorthands](https://griffel.js.org/react/guides/limitations#css-shorthands-are-not-supported).
315
-
316
304
  ```jsx
317
- import { makeStyles, makeResetStyles, shorthands } from '@griffel/react';
305
+ import { makeStyles, makeResetStyles } from '@griffel/react';
318
306
  import { mergeClasses } from './mergeClasses';
319
307
 
320
308
  const useBaseClass = makeResetStyles({
@@ -326,8 +314,8 @@ const useBaseClass = makeResetStyles({
326
314
  const useClasses = makeStyles({
327
315
  primary: { color: 'blue' },
328
316
  circular: {
329
- ...shorthands.padding('5px'),
330
- ...shorthands.borderRadius('5px'),
317
+ padding: '5px',
318
+ borderRadius: '5px',
331
319
  },
332
320
  });
333
321
 
@@ -497,36 +485,7 @@ function App() {
497
485
 
498
486
  ## Shorthands
499
487
 
500
- `shorthands` provides a set of functions to mimic [CSS shorthands](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) and improve developer experience as [CSS shorthands are not supported](https://griffel.js.org/react/guides/limitations#css-shorthands-are-not-supported) by Griffel.
501
-
502
- ### `shorthands.border`
503
-
504
- ```js
505
- import { makeStyles, shorthands } from '@griffel/react';
506
-
507
- const useClasses = makeStyles({
508
- root: {
509
- ...shorthands.border('2px'),
510
- ...shorthands.border('2px', 'solid'),
511
- ...shorthands.border('2px', 'solid', 'red'),
512
- },
513
- });
514
- ```
515
-
516
- ### `shorthands.borderBottom`, `shorthands.borderTop`, `shorthands.borderLeft`, `shorthands.borderRight`
517
-
518
- ```js
519
- import { makeStyles, shorthands } from '@griffel/react';
520
-
521
- const useClasses = makeStyles({
522
- root: {
523
- // The same is true for "borderTop", "borderLeft" & "borderRight"
524
- ...shorthands.borderBottom('2px'),
525
- ...shorthands.borderBottom('2px', 'solid'),
526
- ...shorthands.borderBottom('2px', 'solid', 'red'),
527
- },
528
- });
529
- ```
488
+ `shorthands` provides a set of functions to mimic [CSS shorthands](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) and improve developer experience as [some of CSS shorthands are not supported](https://griffel.js.org/react/guides/limitations#css-shorthands-are-not-supported) by Griffel.
530
489
 
531
490
  ### `shorthands.borderColor`
532
491
 
@@ -572,122 +531,3 @@ const useClasses = makeStyles({
572
531
  },
573
532
  });
574
533
  ```
575
-
576
- ### `shorthands.flex`
577
-
578
- ```js
579
- import { makeStyles, shorthands } from '@griffel/react';
580
-
581
- const useClasses = makeStyles({
582
- root: {
583
- ...shorthands.flex('auto'),
584
- ...shorthands.flex(1, '2.5rem'),
585
- ...shorthands.flex(0, 0, 'auto'),
586
- },
587
- });
588
- ```
589
-
590
- ### `shorthands.gap`
591
-
592
- ```js
593
- import { makeStyles, shorthands } from '@griffel/react';
594
-
595
- const useClasses = makeStyles({
596
- root: {
597
- ...shorthands.gap('12px'),
598
- ...shorthands.gap('12px', '24px'),
599
- },
600
- });
601
- ```
602
-
603
- ### `shorthands.gridArea`
604
-
605
- ```js
606
- import { makeStyles, shorthands } from '@griffel/react';
607
-
608
- const useClasses = makeStyles({
609
- root: {
610
- ...shorthands.gridArea('auto'),
611
- ...shorthands.gridArea('first', 'second'),
612
- ...shorthands.gridArea(2, 4, 'span footer'),
613
- ...shorthands.gridArea(2, 4, 1, 3),
614
- },
615
- });
616
- ```
617
-
618
- ### `shorthands.inset`
619
-
620
- ```js
621
- import { makeStyles, shorthands } from '@griffel/react';
622
-
623
- const useClasses = makeStyles({
624
- root: {
625
- ...shorthands.inset('10px'),
626
- ...shorthands.inset('10px', '5px'),
627
- ...shorthands.inset('2px', '4px', '8px'),
628
- ...shorthands.inset('1px', 0, '3px', '4px'),
629
- },
630
- });
631
- ```
632
-
633
- ### `shorthands.margin`
634
-
635
- ```js
636
- import { makeStyles, shorthands } from '@griffel/react';
637
-
638
- const useClasses = makeStyles({
639
- root: {
640
- ...shorthands.margin('12px'),
641
- ...shorthands.margin('12px', '24px'),
642
- ...shorthands.margin('12px', '24px', '36px'),
643
- ...shorthands.margin('12px', '24px', '36px', '48px'),
644
- },
645
- });
646
- ```
647
-
648
- ### `shorthands.overflow`
649
-
650
- ```js
651
- import { makeStyles, shorthands } from '@griffel/react';
652
-
653
- const useClasses = makeStyles({
654
- root: {
655
- ...shorthands.overflow('visible'),
656
- ...shorthands.overflow('visible', 'hidden'),
657
- },
658
- });
659
- ```
660
-
661
- ### `shorthands.padding`
662
-
663
- ```js
664
- import { makeStyles, shorthands } from '@griffel/react';
665
-
666
- const useClasses = makeStyles({
667
- root: {
668
- ...shorthands.padding('12px'),
669
- ...shorthands.padding('12px', '24px'),
670
- ...shorthands.padding('12px', '24px', '36px'),
671
- ...shorthands.padding('12px', '24px', '36px', '48px'),
672
- },
673
- });
674
- ```
675
-
676
- ### `shorthands.transition`
677
-
678
- ```js
679
- import { makeStyles, shorthands } from '@griffel/react';
680
-
681
- const useClasses = makeStyles({
682
- root: {
683
- ...shorthands.transition('inherit'),
684
- ...shorthands.transition('margin-right', '2s'),
685
- ...shorthands.transition('margin-right', '4s', '1s'),
686
- ...shorthands.transition('margin-right', '4s', '1s', 'ease-in'),
687
- ...shorthands.transition([
688
- ['margin-right', '4s', '1s', 'ease-in'],
689
- ['margin-left', '2s', '0s', 'ease-in-out'],
690
- ]),
691
- },
692
- });
693
- ```
package/index.cjs.js CHANGED
@@ -16,6 +16,10 @@ var __resetStyles = require('./__resetStyles.cjs.js');
16
16
 
17
17
 
18
18
 
19
+ Object.defineProperty(exports, 'RESET', {
20
+ enumerable: true,
21
+ get: function () { return core.RESET; }
22
+ });
19
23
  Object.defineProperty(exports, 'createDOMRenderer', {
20
24
  enumerable: true,
21
25
  get: function () { return core.createDOMRenderer; }
package/index.cjs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { createDOMRenderer, mergeClasses, shorthands } from '@griffel/core';
1
+ export { RESET, createDOMRenderer, mergeClasses, shorthands } from '@griffel/core';
2
2
  export { makeStyles } from './makeStyles.esm.js';
3
3
  export { makeResetStyles } from './makeResetStyles.esm.js';
4
4
  export { makeStaticStyles } from './makeStaticStyles.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@griffel/react",
3
- "version": "1.5.21",
3
+ "version": "1.5.22",
4
4
  "description": "React implementation of Atomic CSS-in-JS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "@griffel/core": "^1.15.3",
18
+ "@griffel/core": "^1.16.0",
19
19
  "tslib": "^2.1.0"
20
20
  },
21
21
  "peerDependencies": {
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { shorthands, mergeClasses, createDOMRenderer } from '@griffel/core';
1
+ export { RESET, shorthands, mergeClasses, createDOMRenderer } from '@griffel/core';
2
2
  export type { GriffelStyle, GriffelResetStyle, CreateDOMRendererOptions, GriffelRenderer } from '@griffel/core';
3
3
  export { makeStyles } from './makeStyles';
4
4
  export { makeResetStyles } from './makeResetStyles';