@codecademy/gamut-patterns 1.0.0-alpha.c3e36a.0 → 1.0.0-alpha.d04966.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/.svgo.yml +11 -0
- package/CHANGELOG.md +316 -2
- package/babel.config.js +0 -10
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -10
- package/dist/patterns/CheckerDense.d.ts +3 -0
- package/dist/patterns/CheckerDense.js +47 -0
- package/dist/patterns/CheckerLoose.d.ts +3 -0
- package/dist/patterns/CheckerLoose.js +47 -0
- package/dist/patterns/CheckerRegular.d.ts +3 -0
- package/dist/patterns/CheckerRegular.js +47 -0
- package/dist/patterns/DiagonalADense.d.ts +3 -0
- package/dist/patterns/DiagonalADense.js +81 -0
- package/dist/patterns/DiagonalALoose.d.ts +3 -0
- package/dist/patterns/DiagonalALoose.js +225 -0
- package/dist/patterns/DiagonalARegular.d.ts +3 -0
- package/dist/patterns/DiagonalARegular.js +129 -0
- package/dist/patterns/DiagonalBDense.d.ts +3 -0
- package/dist/patterns/DiagonalBDense.js +63 -0
- package/dist/patterns/DiagonalBLoose.d.ts +3 -0
- package/dist/patterns/DiagonalBLoose.js +131 -0
- package/dist/patterns/DiagonalBRegular.d.ts +3 -0
- package/dist/patterns/DiagonalBRegular.js +87 -0
- package/dist/patterns/DotDense.d.ts +3 -0
- package/dist/patterns/DotDense.js +42 -0
- package/dist/patterns/DotLoose.d.ts +3 -0
- package/dist/patterns/DotLoose.js +85 -0
- package/dist/patterns/DotRegular.d.ts +3 -0
- package/dist/patterns/DotRegular.js +42 -0
- package/dist/patterns/ExDense.d.ts +3 -0
- package/dist/patterns/ExDense.js +64 -0
- package/dist/patterns/ExLoose.d.ts +3 -0
- package/dist/patterns/ExLoose.js +64 -0
- package/dist/patterns/ExRegular.d.ts +3 -0
- package/dist/patterns/ExRegular.js +64 -0
- package/dist/patterns/FlowerDense.d.ts +3 -0
- package/dist/patterns/FlowerDense.js +58 -0
- package/dist/patterns/FlowerLoose.d.ts +3 -0
- package/dist/patterns/FlowerLoose.js +58 -0
- package/dist/patterns/FlowerRegular.d.ts +3 -0
- package/dist/patterns/FlowerRegular.js +58 -0
- package/dist/patterns/GridDense.d.ts +3 -0
- package/dist/patterns/GridDense.js +57 -0
- package/dist/patterns/GridLoose.d.ts +3 -0
- package/dist/patterns/GridLoose.js +57 -0
- package/dist/patterns/GridRegular.d.ts +3 -0
- package/dist/patterns/GridRegular.js +57 -0
- package/dist/patterns/Herringbone.d.ts +3 -0
- package/dist/patterns/Herringbone.js +75 -0
- package/dist/patterns/RainDense.d.ts +3 -0
- package/dist/patterns/RainDense.js +47 -0
- package/dist/patterns/RainLoose.d.ts +3 -0
- package/dist/patterns/RainLoose.js +47 -0
- package/dist/patterns/RainRegular.d.ts +3 -0
- package/dist/patterns/RainRegular.js +47 -0
- package/dist/patterns/StripeDense.d.ts +3 -0
- package/dist/patterns/StripeDense.js +79 -0
- package/dist/patterns/StripeLoose.d.ts +3 -0
- package/dist/patterns/StripeLoose.js +211 -0
- package/dist/patterns/StripeRegular.d.ts +3 -0
- package/dist/patterns/StripeRegular.js +123 -0
- package/dist/patterns/index.d.ts +28 -0
- package/dist/patterns/index.js +28 -0
- package/dist/props.d.ts +193 -0
- package/dist/props.js +9 -0
- package/dist/svg/CheckerDense.svg +14 -0
- package/dist/svg/CheckerLoose.svg +14 -0
- package/dist/svg/CheckerRegular.svg +14 -0
- package/dist/svg/DiagonalADense.svg +20 -0
- package/dist/svg/DiagonalALoose.svg +44 -0
- package/dist/svg/DiagonalARegular.svg +28 -0
- package/dist/svg/DiagonalBDense.svg +24 -0
- package/dist/svg/DiagonalBLoose.svg +28 -0
- package/dist/svg/DiagonalBRegular.svg +28 -0
- package/dist/svg/DotDense.svg +13 -0
- package/dist/svg/DotLoose.svg +40 -0
- package/dist/svg/DotRegular.svg +13 -0
- package/dist/svg/ExDense.svg +17 -0
- package/dist/svg/ExLoose.svg +17 -0
- package/dist/svg/ExRegular.svg +17 -0
- package/dist/svg/FlowerDense.svg +16 -0
- package/dist/svg/FlowerLoose.svg +16 -0
- package/dist/svg/FlowerRegular.svg +16 -0
- package/dist/svg/GridDense.svg +16 -0
- package/dist/svg/GridLoose.svg +16 -0
- package/dist/svg/GridRegular.svg +16 -0
- package/dist/svg/Herringbone.svg +19 -0
- package/dist/svg/RainDense.svg +14 -0
- package/dist/svg/RainLoose.svg +14 -0
- package/dist/svg/RainRegular.svg +14 -0
- package/dist/svg/StripeDense.svg +20 -0
- package/dist/svg/StripeLoose.svg +44 -0
- package/dist/svg/StripeRegular.svg +28 -0
- package/dist/types.d.ts +1 -282
- package/dist/types.js +0 -11
- package/dist/usePatternId.d.ts +1 -0
- package/dist/usePatternId.js +10 -0
- package/emotion-plugin.js +46 -0
- package/icon-template.js +28 -0
- package/index-template.js +10 -0
- package/jest.config.js +1 -0
- package/package.json +20 -14
- package/svgr.config.js +29 -0
- package/tsconfig.json +6 -1
- package/dist/patterns/checker/CheckerDense.d.ts +0 -3
- package/dist/patterns/checker/CheckerDense.js +0 -37
- package/dist/patterns/checker/CheckerLoose.d.ts +0 -3
- package/dist/patterns/checker/CheckerLoose.js +0 -37
- package/dist/patterns/checker/CheckerRegular.d.ts +0 -3
- package/dist/patterns/checker/CheckerRegular.js +0 -37
- package/dist/patterns/checker/index.d.ts +0 -3
- package/dist/patterns/checker/index.js +0 -3
- package/dist/patterns/diagonalA/DiagonalADense.d.ts +0 -3
- package/dist/patterns/diagonalA/DiagonalADense.js +0 -71
- package/dist/patterns/diagonalA/DiagonalALoose.d.ts +0 -3
- package/dist/patterns/diagonalA/DiagonalALoose.js +0 -215
- package/dist/patterns/diagonalA/DiagonalARegular.d.ts +0 -3
- package/dist/patterns/diagonalA/DiagonalARegular.js +0 -119
- package/dist/patterns/diagonalA/index.d.ts +0 -3
- package/dist/patterns/diagonalA/index.js +0 -3
- package/dist/patterns/diagonalB/DiagonalBDense.d.ts +0 -3
- package/dist/patterns/diagonalB/DiagonalBDense.js +0 -61
- package/dist/patterns/diagonalB/DiagonalBLoose.d.ts +0 -3
- package/dist/patterns/diagonalB/DiagonalBLoose.js +0 -121
- package/dist/patterns/diagonalB/DiagonalBRegular.d.ts +0 -3
- package/dist/patterns/diagonalB/DiagonalBRegular.js +0 -85
- package/dist/patterns/diagonalB/index.d.ts +0 -3
- package/dist/patterns/diagonalB/index.js +0 -3
- package/dist/patterns/dot/DotDense.d.ts +0 -3
- package/dist/patterns/dot/DotDense.js +0 -32
- package/dist/patterns/dot/DotLoose.d.ts +0 -3
- package/dist/patterns/dot/DotLoose.js +0 -79
- package/dist/patterns/dot/DotRegular.d.ts +0 -3
- package/dist/patterns/dot/DotRegular.js +0 -32
- package/dist/patterns/dot/index.d.ts +0 -3
- package/dist/patterns/dot/index.js +0 -3
- package/dist/patterns/ex/ExDense.d.ts +0 -3
- package/dist/patterns/ex/ExDense.js +0 -54
- package/dist/patterns/ex/ExLoose.d.ts +0 -3
- package/dist/patterns/ex/ExLoose.js +0 -54
- package/dist/patterns/ex/ExRegular.d.ts +0 -3
- package/dist/patterns/ex/ExRegular.js +0 -54
- package/dist/patterns/ex/index.d.ts +0 -3
- package/dist/patterns/ex/index.js +0 -3
- package/dist/patterns/flower/FlowerDense.d.ts +0 -3
- package/dist/patterns/flower/FlowerDense.js +0 -48
- package/dist/patterns/flower/FlowerLoose.d.ts +0 -3
- package/dist/patterns/flower/FlowerLoose.js +0 -48
- package/dist/patterns/flower/FlowerRegular.d.ts +0 -3
- package/dist/patterns/flower/FlowerRegular.js +0 -48
- package/dist/patterns/flower/index.d.ts +0 -3
- package/dist/patterns/flower/index.js +0 -3
- package/dist/patterns/grid/GridDense.d.ts +0 -3
- package/dist/patterns/grid/GridDense.js +0 -47
- package/dist/patterns/grid/GridLoose.d.ts +0 -3
- package/dist/patterns/grid/GridLoose.js +0 -47
- package/dist/patterns/grid/GridRegular.d.ts +0 -3
- package/dist/patterns/grid/GridRegular.js +0 -47
- package/dist/patterns/grid/index.d.ts +0 -3
- package/dist/patterns/grid/index.js +0 -3
- package/dist/patterns/herringbone/Herringbone.d.ts +0 -3
- package/dist/patterns/herringbone/Herringbone.js +0 -65
- package/dist/patterns/herringbone/index.d.ts +0 -1
- package/dist/patterns/herringbone/index.js +0 -1
- package/dist/patterns/rain/RainDense.d.ts +0 -3
- package/dist/patterns/rain/RainDense.js +0 -37
- package/dist/patterns/rain/RainLoose.d.ts +0 -3
- package/dist/patterns/rain/RainLoose.js +0 -37
- package/dist/patterns/rain/RainRegular.d.ts +0 -3
- package/dist/patterns/rain/RainRegular.js +0 -37
- package/dist/patterns/rain/index.d.ts +0 -3
- package/dist/patterns/rain/index.js +0 -3
- package/dist/patterns/stripe/StripeDense.d.ts +0 -3
- package/dist/patterns/stripe/StripeDense.js +0 -69
- package/dist/patterns/stripe/StripeLoose.d.ts +0 -3
- package/dist/patterns/stripe/StripeLoose.js +0 -201
- package/dist/patterns/stripe/StripeRegular.d.ts +0 -3
- package/dist/patterns/stripe/StripeRegular.js +0 -113
- package/dist/patterns/stripe/index.d.ts +0 -3
- package/dist/patterns/stripe/index.js +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="gridDense"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="4"
|
|
7
|
+
height="4"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect y="2" width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="2" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="2" y="2" width="1" height="1" fill="currentColor" />
|
|
14
|
+
</pattern>
|
|
15
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#gridDense)" />
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="gridLoose"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect y="8" width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="8" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="8" y="8" width="1" height="1" fill="currentColor" />
|
|
14
|
+
</pattern>
|
|
15
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#gridLoose)" />
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="gridRegular"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="8"
|
|
7
|
+
height="8"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect y="4" width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="4" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="4" y="4" width="1" height="1" fill="currentColor" />
|
|
14
|
+
</pattern>
|
|
15
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#gridRegular)" />
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="herringbone"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="4"
|
|
7
|
+
height="4"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect y="1" width="1" height="1" fill="herringbone" />
|
|
11
|
+
<rect x="1" y="2" width="1" height="1" fill="herringbone" />
|
|
12
|
+
<rect x="3" width="1" height="1" fill="herringbone" />
|
|
13
|
+
<rect x="2" width="1" height="1" fill="herringbone" />
|
|
14
|
+
<rect x="3" y="1" width="1" height="1" fill="herringbone" />
|
|
15
|
+
<rect x="3" y="3" width="1" height="1" fill="herringbone" />
|
|
16
|
+
<rect y="3" width="1" height="1" fill="herringbone" />
|
|
17
|
+
</pattern>
|
|
18
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#herringbone)" />
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="rainDense"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="4"
|
|
7
|
+
height="4"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect x="1" y="1" width="1" height="1" fill="currentColor" />
|
|
12
|
+
</pattern>
|
|
13
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#rainDense)" />
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="rainLoose"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect x="1" y="1" width="1" height="1" fill="currentColor" />
|
|
12
|
+
</pattern>
|
|
13
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#rainLoose)" />
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="rainRegular"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="8"
|
|
7
|
+
height="8"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect x="1" y="1" width="1" height="1" fill="currentColor" />
|
|
12
|
+
</pattern>
|
|
13
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#rainRegular)" />
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="stripeDense"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="4"
|
|
7
|
+
height="4"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect x="1" width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="2" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="3" width="1" height="1" fill="currentColor" />
|
|
14
|
+
<rect x="1" y="2" width="1" height="1" fill="currentColor" />
|
|
15
|
+
<rect y="2" width="1" height="1" fill="currentColor" />
|
|
16
|
+
<rect x="2" y="2" width="1" height="1" fill="currentColor" />
|
|
17
|
+
<rect x="3" y="2" width="1" height="1" fill="currentColor" />
|
|
18
|
+
</pattern>
|
|
19
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#stripeDense)" />
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="stripeLoose"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect x="1" width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="2" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="3" width="1" height="1" fill="currentColor" />
|
|
14
|
+
<rect x="1" y="8" width="1" height="1" fill="currentColor" />
|
|
15
|
+
<rect y="8" width="1" height="1" fill="currentColor" />
|
|
16
|
+
<rect x="2" y="8" width="1" height="1" fill="currentColor" />
|
|
17
|
+
<rect x="3" y="8" width="1" height="1" fill="currentColor" />
|
|
18
|
+
<rect x="5" width="1" height="1" fill="currentColor" />
|
|
19
|
+
<rect x="4" width="1" height="1" fill="currentColor" />
|
|
20
|
+
<rect x="6" width="1" height="1" fill="currentColor" />
|
|
21
|
+
<rect x="7" width="1" height="1" fill="currentColor" />
|
|
22
|
+
<rect x="5" y="8" width="1" height="1" fill="currentColor" />
|
|
23
|
+
<rect x="4" y="8" width="1" height="1" fill="currentColor" />
|
|
24
|
+
<rect x="6" y="8" width="1" height="1" fill="currentColor" />
|
|
25
|
+
<rect x="7" y="8" width="1" height="1" fill="currentColor" />
|
|
26
|
+
<rect x="9" width="1" height="1" fill="currentColor" />
|
|
27
|
+
<rect x="8" width="1" height="1" fill="currentColor" />
|
|
28
|
+
<rect x="10" width="1" height="1" fill="currentColor" />
|
|
29
|
+
<rect x="11" width="1" height="1" fill="currentColor" />
|
|
30
|
+
<rect x="9" y="8" width="1" height="1" fill="currentColor" />
|
|
31
|
+
<rect x="8" y="8" width="1" height="1" fill="currentColor" />
|
|
32
|
+
<rect x="10" y="8" width="1" height="1" fill="currentColor" />
|
|
33
|
+
<rect x="11" y="8" width="1" height="1" fill="currentColor" />
|
|
34
|
+
<rect x="13" width="1" height="1" fill="currentColor" />
|
|
35
|
+
<rect x="12" width="1" height="1" fill="currentColor" />
|
|
36
|
+
<rect x="14" width="1" height="1" fill="currentColor" />
|
|
37
|
+
<rect x="15" width="1" height="1" fill="currentColor" />
|
|
38
|
+
<rect x="13" y="8" width="1" height="1" fill="currentColor" />
|
|
39
|
+
<rect x="12" y="8" width="1" height="1" fill="currentColor" />
|
|
40
|
+
<rect x="14" y="8" width="1" height="1" fill="currentColor" />
|
|
41
|
+
<rect x="15" y="8" width="1" height="1" fill="currentColor" />
|
|
42
|
+
</pattern>
|
|
43
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#stripeLoose)" />
|
|
44
|
+
</svg>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<pattern
|
|
3
|
+
id="stripeRegular"
|
|
4
|
+
x="0"
|
|
5
|
+
y="0"
|
|
6
|
+
width="8"
|
|
7
|
+
height="8"
|
|
8
|
+
patternUnits="userSpaceOnUse"
|
|
9
|
+
>
|
|
10
|
+
<rect x="1" width="1" height="1" fill="currentColor" />
|
|
11
|
+
<rect width="1" height="1" fill="currentColor" />
|
|
12
|
+
<rect x="2" width="1" height="1" fill="currentColor" />
|
|
13
|
+
<rect x="3" width="1" height="1" fill="currentColor" />
|
|
14
|
+
<rect x="1" y="4" width="1" height="1" fill="currentColor" />
|
|
15
|
+
<rect y="4" width="1" height="1" fill="currentColor" />
|
|
16
|
+
<rect x="2" y="4" width="1" height="1" fill="currentColor" />
|
|
17
|
+
<rect x="3" y="4" width="1" height="1" fill="currentColor" />
|
|
18
|
+
<rect x="5" width="1" height="1" fill="currentColor" />
|
|
19
|
+
<rect x="4" width="1" height="1" fill="currentColor" />
|
|
20
|
+
<rect x="6" width="1" height="1" fill="currentColor" />
|
|
21
|
+
<rect x="7" width="1" height="1" fill="currentColor" />
|
|
22
|
+
<rect x="5" y="4" width="1" height="1" fill="currentColor" />
|
|
23
|
+
<rect x="4" y="4" width="1" height="1" fill="currentColor" />
|
|
24
|
+
<rect x="6" y="4" width="1" height="1" fill="currentColor" />
|
|
25
|
+
<rect x="7" y="4" width="1" height="1" fill="currentColor" />
|
|
26
|
+
</pattern>
|
|
27
|
+
<rect x="0" y="0" width="100%" height="100%" fill="url(#stripeRegular)" />
|
|
28
|
+
</svg>
|
package/dist/types.d.ts
CHANGED
|
@@ -1,282 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { SVGProps } from 'react';
|
|
3
|
-
declare const patternStyles: import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").Compose<[import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
4
|
-
readonly display: {
|
|
5
|
-
readonly property: "display";
|
|
6
|
-
};
|
|
7
|
-
readonly overflow: {
|
|
8
|
-
readonly property: "overflow";
|
|
9
|
-
};
|
|
10
|
-
readonly overflowX: {
|
|
11
|
-
readonly property: "overflowX";
|
|
12
|
-
};
|
|
13
|
-
readonly overflowY: {
|
|
14
|
-
readonly property: "overflowY";
|
|
15
|
-
};
|
|
16
|
-
readonly width: {
|
|
17
|
-
readonly property: "width";
|
|
18
|
-
readonly transform: (value: string | number) => string | 0;
|
|
19
|
-
};
|
|
20
|
-
readonly minWidth: {
|
|
21
|
-
readonly property: "minWidth";
|
|
22
|
-
readonly transform: (value: string | number) => string | 0;
|
|
23
|
-
};
|
|
24
|
-
readonly maxWidth: {
|
|
25
|
-
readonly property: "maxWidth";
|
|
26
|
-
readonly transform: (value: string | number) => string | 0;
|
|
27
|
-
};
|
|
28
|
-
readonly height: {
|
|
29
|
-
readonly property: "height";
|
|
30
|
-
readonly transform: (value: string | number) => string | 0;
|
|
31
|
-
};
|
|
32
|
-
readonly minHeight: {
|
|
33
|
-
readonly property: "minHeight";
|
|
34
|
-
readonly transform: (value: string | number) => string | 0;
|
|
35
|
-
};
|
|
36
|
-
readonly maxHeight: {
|
|
37
|
-
readonly property: "maxHeight";
|
|
38
|
-
readonly transform: (value: string | number) => string | 0;
|
|
39
|
-
};
|
|
40
|
-
readonly verticalAlign: {
|
|
41
|
-
readonly property: "verticalAlign";
|
|
42
|
-
};
|
|
43
|
-
readonly justifySelf: {
|
|
44
|
-
readonly property: "justifySelf";
|
|
45
|
-
};
|
|
46
|
-
readonly alignSelf: {
|
|
47
|
-
readonly property: "alignSelf";
|
|
48
|
-
};
|
|
49
|
-
readonly gridArea: {
|
|
50
|
-
readonly property: "gridArea";
|
|
51
|
-
};
|
|
52
|
-
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
53
|
-
readonly position: {
|
|
54
|
-
readonly property: "position";
|
|
55
|
-
};
|
|
56
|
-
readonly top: {
|
|
57
|
-
readonly property: "top";
|
|
58
|
-
readonly transform: (value: string | number) => string | 0;
|
|
59
|
-
};
|
|
60
|
-
readonly right: {
|
|
61
|
-
readonly property: "right";
|
|
62
|
-
readonly transform: (value: string | number) => string | 0;
|
|
63
|
-
};
|
|
64
|
-
readonly bottom: {
|
|
65
|
-
readonly property: "bottom";
|
|
66
|
-
readonly transform: (value: string | number) => string | 0;
|
|
67
|
-
};
|
|
68
|
-
readonly left: {
|
|
69
|
-
readonly property: "left";
|
|
70
|
-
readonly transform: (value: string | number) => string | 0;
|
|
71
|
-
};
|
|
72
|
-
readonly zIndex: {
|
|
73
|
-
readonly property: "zIndex";
|
|
74
|
-
};
|
|
75
|
-
readonly opacity: {
|
|
76
|
-
readonly property: "opacity";
|
|
77
|
-
};
|
|
78
|
-
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
79
|
-
readonly p: {
|
|
80
|
-
readonly property: "padding";
|
|
81
|
-
readonly scale: "spacing";
|
|
82
|
-
};
|
|
83
|
-
readonly px: {
|
|
84
|
-
readonly property: "padding";
|
|
85
|
-
readonly properties: readonly ["paddingLeft", "paddingRight"];
|
|
86
|
-
readonly scale: "spacing";
|
|
87
|
-
};
|
|
88
|
-
readonly py: {
|
|
89
|
-
readonly property: "padding";
|
|
90
|
-
readonly properties: readonly ["paddingTop", "paddingBottom"];
|
|
91
|
-
readonly scale: "spacing";
|
|
92
|
-
};
|
|
93
|
-
readonly pt: {
|
|
94
|
-
readonly property: "paddingTop";
|
|
95
|
-
readonly scale: "spacing";
|
|
96
|
-
};
|
|
97
|
-
readonly pb: {
|
|
98
|
-
readonly property: "paddingBottom";
|
|
99
|
-
readonly scale: "spacing";
|
|
100
|
-
};
|
|
101
|
-
readonly pr: {
|
|
102
|
-
readonly property: "paddingRight";
|
|
103
|
-
readonly scale: "spacing";
|
|
104
|
-
};
|
|
105
|
-
readonly pl: {
|
|
106
|
-
readonly property: "paddingLeft";
|
|
107
|
-
readonly scale: "spacing";
|
|
108
|
-
};
|
|
109
|
-
readonly m: {
|
|
110
|
-
readonly property: "margin";
|
|
111
|
-
readonly scale: "spacing";
|
|
112
|
-
};
|
|
113
|
-
readonly mx: {
|
|
114
|
-
readonly property: "margin";
|
|
115
|
-
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
116
|
-
readonly scale: "spacing";
|
|
117
|
-
};
|
|
118
|
-
readonly my: {
|
|
119
|
-
readonly property: "margin";
|
|
120
|
-
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
121
|
-
readonly scale: "spacing";
|
|
122
|
-
};
|
|
123
|
-
readonly mt: {
|
|
124
|
-
readonly property: "marginTop";
|
|
125
|
-
readonly scale: "spacing";
|
|
126
|
-
};
|
|
127
|
-
readonly mb: {
|
|
128
|
-
readonly property: "marginBottom";
|
|
129
|
-
readonly scale: "spacing";
|
|
130
|
-
};
|
|
131
|
-
readonly mr: {
|
|
132
|
-
readonly property: "marginRight";
|
|
133
|
-
readonly scale: "spacing";
|
|
134
|
-
};
|
|
135
|
-
readonly ml: {
|
|
136
|
-
readonly property: "marginLeft";
|
|
137
|
-
readonly scale: "spacing";
|
|
138
|
-
};
|
|
139
|
-
}>>]>>;
|
|
140
|
-
export declare type PatternProps = SVGProps<SVGSVGElement> & StyleProps<typeof patternStyles>;
|
|
141
|
-
export declare const PatternSvg: import("@emotion/styled").StyledComponent<{
|
|
142
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
143
|
-
as?: import("react").ElementType<any> | undefined;
|
|
144
|
-
} & SVGProps<SVGSVGElement> & {
|
|
145
|
-
display?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
146
|
-
readonly property: "display";
|
|
147
|
-
}>;
|
|
148
|
-
overflow?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
149
|
-
readonly property: "overflow";
|
|
150
|
-
}>;
|
|
151
|
-
overflowX?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
152
|
-
readonly property: "overflowX";
|
|
153
|
-
}>;
|
|
154
|
-
overflowY?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
155
|
-
readonly property: "overflowY";
|
|
156
|
-
}>;
|
|
157
|
-
width?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
158
|
-
readonly property: "width";
|
|
159
|
-
readonly transform: (value: string | number) => string | 0;
|
|
160
|
-
}>;
|
|
161
|
-
minWidth?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
162
|
-
readonly property: "minWidth";
|
|
163
|
-
readonly transform: (value: string | number) => string | 0;
|
|
164
|
-
}>;
|
|
165
|
-
maxWidth?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
166
|
-
readonly property: "maxWidth";
|
|
167
|
-
readonly transform: (value: string | number) => string | 0;
|
|
168
|
-
}>;
|
|
169
|
-
height?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
170
|
-
readonly property: "height";
|
|
171
|
-
readonly transform: (value: string | number) => string | 0;
|
|
172
|
-
}>;
|
|
173
|
-
minHeight?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
174
|
-
readonly property: "minHeight";
|
|
175
|
-
readonly transform: (value: string | number) => string | 0;
|
|
176
|
-
}>;
|
|
177
|
-
maxHeight?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
178
|
-
readonly property: "maxHeight";
|
|
179
|
-
readonly transform: (value: string | number) => string | 0;
|
|
180
|
-
}>;
|
|
181
|
-
verticalAlign?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
182
|
-
readonly property: "verticalAlign";
|
|
183
|
-
}>;
|
|
184
|
-
justifySelf?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
185
|
-
readonly property: "justifySelf";
|
|
186
|
-
}>;
|
|
187
|
-
alignSelf?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
188
|
-
readonly property: "alignSelf";
|
|
189
|
-
}>;
|
|
190
|
-
gridArea?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
191
|
-
readonly property: "gridArea";
|
|
192
|
-
}>;
|
|
193
|
-
position?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
194
|
-
readonly property: "position";
|
|
195
|
-
}>;
|
|
196
|
-
top?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
197
|
-
readonly property: "top";
|
|
198
|
-
readonly transform: (value: string | number) => string | 0;
|
|
199
|
-
}>;
|
|
200
|
-
right?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
201
|
-
readonly property: "right";
|
|
202
|
-
readonly transform: (value: string | number) => string | 0;
|
|
203
|
-
}>;
|
|
204
|
-
bottom?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
205
|
-
readonly property: "bottom";
|
|
206
|
-
readonly transform: (value: string | number) => string | 0;
|
|
207
|
-
}>;
|
|
208
|
-
left?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
209
|
-
readonly property: "left";
|
|
210
|
-
readonly transform: (value: string | number) => string | 0;
|
|
211
|
-
}>;
|
|
212
|
-
zIndex?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
213
|
-
readonly property: "zIndex";
|
|
214
|
-
}>;
|
|
215
|
-
opacity?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
216
|
-
readonly property: "opacity";
|
|
217
|
-
}>;
|
|
218
|
-
p?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
219
|
-
readonly property: "padding";
|
|
220
|
-
readonly scale: "spacing";
|
|
221
|
-
}>;
|
|
222
|
-
px?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
223
|
-
readonly property: "padding";
|
|
224
|
-
readonly properties: readonly ["paddingLeft", "paddingRight"];
|
|
225
|
-
readonly scale: "spacing";
|
|
226
|
-
}>;
|
|
227
|
-
py?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
228
|
-
readonly property: "padding";
|
|
229
|
-
readonly properties: readonly ["paddingTop", "paddingBottom"];
|
|
230
|
-
readonly scale: "spacing";
|
|
231
|
-
}>;
|
|
232
|
-
pt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
233
|
-
readonly property: "paddingTop";
|
|
234
|
-
readonly scale: "spacing";
|
|
235
|
-
}>;
|
|
236
|
-
pb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
237
|
-
readonly property: "paddingBottom";
|
|
238
|
-
readonly scale: "spacing";
|
|
239
|
-
}>;
|
|
240
|
-
pr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
241
|
-
readonly property: "paddingRight";
|
|
242
|
-
readonly scale: "spacing";
|
|
243
|
-
}>;
|
|
244
|
-
pl?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
245
|
-
readonly property: "paddingLeft";
|
|
246
|
-
readonly scale: "spacing";
|
|
247
|
-
}>;
|
|
248
|
-
m?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
249
|
-
readonly property: "margin";
|
|
250
|
-
readonly scale: "spacing";
|
|
251
|
-
}>;
|
|
252
|
-
mx?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
253
|
-
readonly property: "margin";
|
|
254
|
-
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
255
|
-
readonly scale: "spacing";
|
|
256
|
-
}>;
|
|
257
|
-
my?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
258
|
-
readonly property: "margin";
|
|
259
|
-
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
260
|
-
readonly scale: "spacing";
|
|
261
|
-
}>;
|
|
262
|
-
mt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
263
|
-
readonly property: "marginTop";
|
|
264
|
-
readonly scale: "spacing";
|
|
265
|
-
}>;
|
|
266
|
-
mb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
267
|
-
readonly property: "marginBottom";
|
|
268
|
-
readonly scale: "spacing";
|
|
269
|
-
}>;
|
|
270
|
-
mr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
271
|
-
readonly property: "marginRight";
|
|
272
|
-
readonly scale: "spacing";
|
|
273
|
-
}>;
|
|
274
|
-
ml?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
275
|
-
readonly property: "marginLeft";
|
|
276
|
-
readonly scale: "spacing";
|
|
277
|
-
}>;
|
|
278
|
-
} & {
|
|
279
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
280
|
-
}, SVGProps<SVGSVGElement>, {}>;
|
|
281
|
-
export declare type PatternComponent = React.ComponentProps<typeof PatternSvg>;
|
|
282
|
-
export {};
|
|
1
|
+
export type { PatternProps } from './props';
|
package/dist/types.js
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
|
-
import { styledConfig, system } from '@codecademy/gamut-styles';
|
|
6
|
-
import { variance } from '@codecademy/variance';
|
|
7
|
-
var patternStyles = variance.compose(system.layout, system.positioning, system.space);
|
|
8
|
-
export var PatternSvg = /*#__PURE__*/_styled('svg', _extends({}, {
|
|
9
|
-
target: "e1w0gaod0",
|
|
10
|
-
label: "PatternSvg"
|
|
11
|
-
}, styledConfig))(patternStyles, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjMEIiLCJmaWxlIjoiLi4vc3JjL3R5cGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc3R5bGVkQ29uZmlnLCBzeXN0ZW0gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHsgU3R5bGVQcm9wcywgdmFyaWFuY2UgfSBmcm9tICdAY29kZWNhZGVteS92YXJpYW5jZSc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBTVkdQcm9wcyB9IGZyb20gJ3JlYWN0JztcblxuY29uc3QgcGF0dGVyblN0eWxlcyA9IHZhcmlhbmNlLmNvbXBvc2UoXG4gIHN5c3RlbS5sYXlvdXQsXG4gIHN5c3RlbS5wb3NpdGlvbmluZyxcbiAgc3lzdGVtLnNwYWNlXG4pO1xuXG5leHBvcnQgdHlwZSBQYXR0ZXJuUHJvcHMgPSBTVkdQcm9wczxTVkdTVkdFbGVtZW50PiAmXG4gIFN0eWxlUHJvcHM8dHlwZW9mIHBhdHRlcm5TdHlsZXM+O1xuXG5leHBvcnQgY29uc3QgUGF0dGVyblN2ZyA9IHN0eWxlZChcbiAgJ3N2ZycsXG4gIHN0eWxlZENvbmZpZ1xuKTxQYXR0ZXJuUHJvcHM+KHBhdHRlcm5TdHlsZXMpO1xuXG4vLyBUeXBlZm9yd2FyZCB2YWxpZCBTVkcgYXR0cnMuXG5leHBvcnQgdHlwZSBQYXR0ZXJuQ29tcG9uZW50ID0gUmVhY3QuQ29tcG9uZW50UHJvcHM8dHlwZW9mIFBhdHRlcm5Tdmc+O1xuIl19 */"); // Typeforward valid SVG attrs.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePatternId(id: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
var counter = {};
|
|
3
|
+
export function usePatternId(id) {
|
|
4
|
+
return useMemo(function () {
|
|
5
|
+
var key = id.toLowerCase();
|
|
6
|
+
var idCounter = (counter === null || counter === void 0 ? void 0 : counter[key]) || 0;
|
|
7
|
+
counter[key] = idCounter;
|
|
8
|
+
return "".concat(id, "-pattern-").concat(counter[key] += 1);
|
|
9
|
+
}, [id]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const plugin = (api) => {
|
|
2
|
+
const vistor = {
|
|
3
|
+
JSXElement(path) {
|
|
4
|
+
// We only want to find SVG element
|
|
5
|
+
if (path.get('openingElement.name').isJSXIdentifier({ name: 'svg' })) {
|
|
6
|
+
// Update the opening and closing tags to the styled component identifier
|
|
7
|
+
const emotionTag = api.types.jsxIdentifier('Svg');
|
|
8
|
+
path.get('openingElement.name').replaceWith(emotionTag);
|
|
9
|
+
path.get('closingElement.name').replaceWith(emotionTag);
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
JSXAttribute(path) {
|
|
13
|
+
const valuePath = path.get('value');
|
|
14
|
+
const attrName = path.get('name').toString();
|
|
15
|
+
if (attrName === 'id' && valuePath.isStringLiteral()) {
|
|
16
|
+
valuePath.replaceWith(
|
|
17
|
+
api.types.jsxExpressionContainer(
|
|
18
|
+
api.template.ast('patternId').expression
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (
|
|
24
|
+
attrName === 'fill' &&
|
|
25
|
+
valuePath.isStringLiteral() &&
|
|
26
|
+
valuePath.toString().includes('url')
|
|
27
|
+
) {
|
|
28
|
+
valuePath.replaceWith(
|
|
29
|
+
api.types.jsxExpressionContainer(
|
|
30
|
+
api.template.ast('`url(#${patternId})`').expression
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
visitor: {
|
|
39
|
+
Program(path) {
|
|
40
|
+
path.traverse(vistor);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
module.exports = plugin;
|
package/icon-template.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { startCase } = require('lodash');
|
|
3
|
+
|
|
4
|
+
function iconTemplate(api, opts, { jsx }) {
|
|
5
|
+
const template = api.template.smart({ plugins: ['jsx', 'typescript'] });
|
|
6
|
+
const { componentName, filePath } = opts.state;
|
|
7
|
+
const exportName = componentName.replace('Svg', '');
|
|
8
|
+
const title = startCase(path.basename(filePath, '.svg'));
|
|
9
|
+
|
|
10
|
+
return template.ast`
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { Svg, PatternProps } from '../props';
|
|
13
|
+
import { usePatternId } from '../usePatternId';
|
|
14
|
+
|
|
15
|
+
export const ${exportName} = React.forwardRef<SVGSVGElement, PatternProps>(({
|
|
16
|
+
title = "${title}",
|
|
17
|
+
titleId,
|
|
18
|
+
...props
|
|
19
|
+
},
|
|
20
|
+
svgRef
|
|
21
|
+
) => {
|
|
22
|
+
const patternId = usePatternId('${exportName}');
|
|
23
|
+
|
|
24
|
+
return ${jsx};
|
|
25
|
+
});
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
module.exports = iconTemplate;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
function indexTemplate(files) {
|
|
4
|
+
const exportEntries = files.map((file) => {
|
|
5
|
+
const basename = path.basename(file, path.extname(file));
|
|
6
|
+
return `export * from './${basename}';`;
|
|
7
|
+
});
|
|
8
|
+
return exportEntries.join('\n');
|
|
9
|
+
}
|
|
10
|
+
module.exports = indexTemplate;
|
package/jest.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../jest.config.base')('gamut-patterns');
|