@codecademy/gamut-patterns 1.0.0-alpha.f6cb5a.0 → 1.0.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/dist/patterns/CheckerDense.js +37 -39
- package/dist/patterns/CheckerLoose.js +37 -39
- package/dist/patterns/CheckerRegular.js +37 -39
- package/dist/patterns/DiagonalADense.js +71 -73
- package/dist/patterns/DiagonalALoose.js +215 -217
- package/dist/patterns/DiagonalARegular.js +119 -121
- package/dist/patterns/DiagonalBDense.js +53 -55
- package/dist/patterns/DiagonalBLoose.js +121 -123
- package/dist/patterns/DiagonalBRegular.js +77 -79
- package/dist/patterns/DotDense.js +32 -34
- package/dist/patterns/DotLoose.js +75 -77
- package/dist/patterns/DotRegular.js +32 -34
- package/dist/patterns/ExDense.js +54 -56
- package/dist/patterns/ExLoose.js +54 -56
- package/dist/patterns/ExRegular.js +54 -56
- package/dist/patterns/FlowerDense.js +48 -50
- package/dist/patterns/FlowerLoose.js +48 -50
- package/dist/patterns/FlowerRegular.js +48 -50
- package/dist/patterns/GridDense.js +47 -49
- package/dist/patterns/GridLoose.js +47 -49
- package/dist/patterns/GridRegular.js +47 -49
- package/dist/patterns/Herringbone.js +65 -67
- package/dist/patterns/RainDense.js +37 -39
- package/dist/patterns/RainLoose.js +37 -39
- package/dist/patterns/RainRegular.js +37 -39
- package/dist/patterns/StripeDense.js +69 -71
- package/dist/patterns/StripeLoose.js +201 -203
- package/dist/patterns/StripeRegular.js +113 -115
- package/dist/props.d.ts +141 -32
- package/dist/props.js +14 -6
- package/dist/types.js +1 -0
- package/dist/usePatternId.js +5 -8
- package/package.json +17 -30
- package/.svgo.yml +0 -11
- package/CHANGELOG.md +0 -329
- package/LICENSE +0 -21
- package/babel.config.js +0 -5
- package/emotion-plugin.js +0 -46
- package/index-template.js +0 -10
- package/jest.config.js +0 -1
- package/pattern-template.js +0 -30
- package/svgr.config.js +0 -29
- package/tsconfig.json +0 -12
package/package.json
CHANGED
|
@@ -1,48 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@codecademy/gamut-patterns",
|
|
3
|
+
"description": "Pattern library for Codecademy",
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
3
|
-
"bugs":
|
|
4
|
-
"url": "https://github.com/Codecademy/gamut/issues"
|
|
5
|
-
},
|
|
6
|
+
"bugs": "https://github.com/Codecademy/gamut/issues",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@codecademy/gamut-styles": "
|
|
8
|
-
"@codecademy/variance": "1.0.0
|
|
8
|
+
"@codecademy/gamut-styles": "21.0.0",
|
|
9
|
+
"@codecademy/variance": "1.0.0",
|
|
9
10
|
"classnames": "^2.2.5"
|
|
10
11
|
},
|
|
11
|
-
"
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
12
15
|
"homepage": "https://github.com/Codecademy/gamut#readme",
|
|
13
|
-
"name": "@codecademy/gamut-patterns",
|
|
14
|
-
"module": "dist/index.js",
|
|
15
|
-
"types": "dist/index.d.ts",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
16
|
"license": "MIT",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"module": "dist/index.js",
|
|
18
19
|
"peerDependencies": {
|
|
19
20
|
"@emotion/react": "^11.4.0",
|
|
20
21
|
"@emotion/styled": "^11.3.0",
|
|
21
|
-
"react": "
|
|
22
|
-
"react-dom": "
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@svgr/cli": "5.5.0",
|
|
26
|
-
"lodash": "^4.17.5",
|
|
27
|
-
"svgo": "^1.3.2"
|
|
22
|
+
"react": "^17.0.2 || ^18.3.0 || ^19.0.0",
|
|
23
|
+
"react-dom": "^17.0.2 || ^18.3.0 || ^19.0.0"
|
|
28
24
|
},
|
|
29
25
|
"publishConfig": {
|
|
30
26
|
"access": "public"
|
|
31
27
|
},
|
|
32
|
-
"repository":
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git+ssh://git@github.com/Codecademy/gamut.git"
|
|
35
|
-
},
|
|
28
|
+
"repository": "Codecademy/gamut.git",
|
|
36
29
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"format": "svgo -f ./src/svg --pretty --config=.svgo.yml"
|
|
39
|
-
"build:icons": "rm -rf ./src/patterns && svgr --out-dir ./src/patterns --ext 'tsx' ./src/svg",
|
|
40
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
41
|
-
"build:compile": "babel ./src --out-dir ./dist --copy-files --extensions \".ts,.tsx\"",
|
|
42
|
-
"build": "yarn build:icons && yarn build:compile && yarn build:types",
|
|
43
|
-
"lernaBuildTask": "yarn build"
|
|
30
|
+
"build": "nx build @codecademy/gamut-patterns",
|
|
31
|
+
"format": "svgo -f ./src/svg --pretty --config=.svgo.yml"
|
|
44
32
|
},
|
|
45
33
|
"sideEffects": false,
|
|
46
|
-
"
|
|
47
|
-
"gitHead": "ff424ba13fc62985621d93a45a2b4296dd2fbe5f"
|
|
34
|
+
"types": "dist/index.d.ts"
|
|
48
35
|
}
|
package/.svgo.yml
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [1.0.0-alpha.f6cb5a.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.7.3...@codecademy/gamut-patterns@1.0.0-alpha.f6cb5a.0) (2022-01-19)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### ⚠ BREAKING CHANGES
|
|
10
|
-
|
|
11
|
-
* bumped React to 17
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* bumped React to 17 ([4d0d029](https://github.com/Codecademy/gamut/commit/4d0d029ce293d3c4a8331c625bcdcdce93235f2d))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Reverts
|
|
19
|
-
|
|
20
|
-
* Revert "Updated svgr and svgo to latest" ([d049662](https://github.com/Codecademy/gamut/commit/d049662334753f113245a04e1cc7f37827fc4f52))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### [0.7.3](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.7.2...@codecademy/gamut-patterns@0.7.3) (2021-12-07)
|
|
25
|
-
|
|
26
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### [0.7.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.7.1...@codecademy/gamut-patterns@0.7.2) (2021-11-23)
|
|
33
|
-
|
|
34
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### [0.7.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.7.0...@codecademy/gamut-patterns@0.7.1) (2021-10-27)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Bug Fixes
|
|
44
|
-
|
|
45
|
-
* **Pattern:** fix white bg on regular and dense diagonal patterns ([2f321c2](https://github.com/Codecademy/gamut/commit/2f321c2446cdc28e4338fa1dae94efa698e4c6ea))
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## 0.7.0 (2021-10-26)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### ⚠ BREAKING CHANGES
|
|
53
|
-
|
|
54
|
-
* add new gamut-patterns package
|
|
55
|
-
|
|
56
|
-
### Features
|
|
57
|
-
|
|
58
|
-
* bump ESLint configs to latest ([4e3cf77](https://github.com/Codecademy/gamut/commit/4e3cf77928bdd69bce3eeca8a7f07439627b4f08))
|
|
59
|
-
* **Patterns:** Add SVGR build process and SVGO settings ([e8433ce](https://github.com/Codecademy/gamut/commit/e8433ceace8b617fcaa45f13a11ce1367cff0e0b))
|
|
60
|
-
* **props:** Support `color` and other HTML attributes as system props without type collision GM-247 ([ff93f0c](https://github.com/Codecademy/gamut/commit/ff93f0c9b7ca64ed9819586709f58436ca4502b9))
|
|
61
|
-
* Migrate final gamut-system docs + functions to variance [WEB-1413] ([f966933](https://github.com/Codecademy/gamut/commit/f966933ac814d228072e781ee2a3d75a33190a85))
|
|
62
|
-
* **theme:** createTheme self containment ([87a203c](https://github.com/Codecademy/gamut/commit/87a203c56df8002406552208b8b5ffc55b228262)), closes [#666666](https://github.com/Codecademy/gamut/issues/666666) [#666666](https://github.com/Codecademy/gamut/issues/666666)
|
|
63
|
-
* add new gamut-patterns package ([3b9785a](https://github.com/Codecademy/gamut/commit/3b9785a20e26767a9531b1f1ce8de5f504f2dd34))
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### [0.6.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.6.1...@codecademy/gamut-patterns@0.6.2) (2021-09-30)
|
|
68
|
-
|
|
69
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### [0.6.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.6.0...@codecademy/gamut-patterns@0.6.1) (2021-09-13)
|
|
76
|
-
|
|
77
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## [0.6.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.8...@codecademy/gamut-patterns@0.6.0) (2021-09-10)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
### Features
|
|
87
|
-
|
|
88
|
-
* bump ESLint configs to latest ([e0a201a](https://github.com/Codecademy/gamut/commit/e0a201abcc5f49718538d3d91af21cb37db4470e))
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### [0.5.8](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.7...@codecademy/gamut-patterns@0.5.8) (2021-08-30)
|
|
93
|
-
|
|
94
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### [0.5.7](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.6...@codecademy/gamut-patterns@0.5.7) (2021-08-16)
|
|
101
|
-
|
|
102
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### [0.5.6](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.5...@codecademy/gamut-patterns@0.5.6) (2021-08-16)
|
|
109
|
-
|
|
110
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
### [0.5.5](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.4...@codecademy/gamut-patterns@0.5.5) (2021-08-13)
|
|
117
|
-
|
|
118
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### [0.5.4](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.3...@codecademy/gamut-patterns@0.5.4) (2021-08-12)
|
|
125
|
-
|
|
126
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### [0.5.3](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.2...@codecademy/gamut-patterns@0.5.3) (2021-08-05)
|
|
133
|
-
|
|
134
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### [0.5.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.1...@codecademy/gamut-patterns@0.5.2) (2021-08-03)
|
|
141
|
-
|
|
142
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
### [0.5.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.5.0...@codecademy/gamut-patterns@0.5.1) (2021-07-29)
|
|
149
|
-
|
|
150
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## [0.5.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.7...@codecademy/gamut-patterns@0.5.0) (2021-07-27)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Features
|
|
160
|
-
|
|
161
|
-
* **Patterns:** Add SVGR build process and SVGO settings ([56e50ff](https://github.com/Codecademy/gamut/commit/56e50ffe021102b84a7f9e5d7bb33ea6de890994))
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
### [0.4.7](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.6...@codecademy/gamut-patterns@0.4.7) (2021-07-19)
|
|
166
|
-
|
|
167
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
### [0.4.6](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.5...@codecademy/gamut-patterns@0.4.6) (2021-07-16)
|
|
174
|
-
|
|
175
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
### [0.4.5](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.4...@codecademy/gamut-patterns@0.4.5) (2021-07-15)
|
|
182
|
-
|
|
183
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
### [0.4.4](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.3...@codecademy/gamut-patterns@0.4.4) (2021-06-17)
|
|
190
|
-
|
|
191
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
### [0.4.3](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.2...@codecademy/gamut-patterns@0.4.3) (2021-06-16)
|
|
198
|
-
|
|
199
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
### [0.4.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.1...@codecademy/gamut-patterns@0.4.2) (2021-06-16)
|
|
206
|
-
|
|
207
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
### [0.4.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.4.0...@codecademy/gamut-patterns@0.4.1) (2021-06-16)
|
|
214
|
-
|
|
215
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## [0.4.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.3.4...@codecademy/gamut-patterns@0.4.0) (2021-06-15)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
### Features
|
|
225
|
-
|
|
226
|
-
* **props:** Support `color` and other HTML attributes as system props without type collision GM-247 ([50a8b43](https://github.com/Codecademy/gamut/commit/50a8b43b27eff2d75307d317d724383156e5a3ed))
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
### [0.3.4](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.3.3...@codecademy/gamut-patterns@0.3.4) (2021-06-10)
|
|
231
|
-
|
|
232
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
### [0.3.3](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.3.2...@codecademy/gamut-patterns@0.3.3) (2021-06-10)
|
|
239
|
-
|
|
240
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
### [0.3.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.3.1...@codecademy/gamut-patterns@0.3.2) (2021-06-03)
|
|
247
|
-
|
|
248
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
### [0.3.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.3.0...@codecademy/gamut-patterns@0.3.1) (2021-06-02)
|
|
255
|
-
|
|
256
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
## [0.3.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.2.2...@codecademy/gamut-patterns@0.3.0) (2021-05-27)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
### Features
|
|
266
|
-
|
|
267
|
-
* Migrate final gamut-system docs + functions to variance [WEB-1413] ([67c8651](https://github.com/Codecademy/gamut/commit/67c8651dc4985dd656c8d488af4cf56ca21a813b))
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
### [0.2.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.2.1...@codecademy/gamut-patterns@0.2.2) (2021-05-25)
|
|
272
|
-
|
|
273
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
### [0.2.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.2.0...@codecademy/gamut-patterns@0.2.1) (2021-05-24)
|
|
280
|
-
|
|
281
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
## [0.2.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.1.3...@codecademy/gamut-patterns@0.2.0) (2021-05-18)
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
### Features
|
|
291
|
-
|
|
292
|
-
* **theme:** createTheme self containment ([59ddff7](https://github.com/Codecademy/gamut/commit/59ddff7224cd8e0972212dd6ba1696f40ccac835)), closes [#666666](https://github.com/Codecademy/gamut/issues/666666) [#666666](https://github.com/Codecademy/gamut/issues/666666)
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
### [0.1.3](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.1.2...@codecademy/gamut-patterns@0.1.3) (2021-05-12)
|
|
297
|
-
|
|
298
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
### [0.1.2](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.1.1...@codecademy/gamut-patterns@0.1.2) (2021-05-11)
|
|
305
|
-
|
|
306
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
### [0.1.1](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-patterns@0.1.0...@codecademy/gamut-patterns@0.1.1) (2021-05-07)
|
|
313
|
-
|
|
314
|
-
**Note:** Version bump only for package @codecademy/gamut-patterns
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
## 0.1.0 (2021-05-06)
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
### ⚠ BREAKING CHANGES
|
|
324
|
-
|
|
325
|
-
* add new gamut-patterns package
|
|
326
|
-
|
|
327
|
-
### Features
|
|
328
|
-
|
|
329
|
-
* add new gamut-patterns package ([e0b30b1](https://github.com/Codecademy/gamut/commit/e0b30b102b32b8447a1b4c97f9da63fcce365af6))
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 Ryzac, Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/babel.config.js
DELETED
package/emotion-plugin.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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/index-template.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../jest.config.base')('gamut-patterns');
|
package/pattern-template.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { startCase } = require('lodash');
|
|
3
|
-
|
|
4
|
-
function patternTemplate(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
|
-
}) as React.ForwardRefExoticComponent<
|
|
26
|
-
PatternProps & React.RefAttributes<SVGSVGElement>
|
|
27
|
-
>;
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
module.exports = patternTemplate;
|
package/svgr.config.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const emotionPlugin = require('./emotion-plugin');
|
|
2
|
-
const template = require('./pattern-template');
|
|
3
|
-
const indexTemplate = require('./index-template');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
dimensions: false,
|
|
7
|
-
titleProp: true,
|
|
8
|
-
ref: true,
|
|
9
|
-
svgProps: {
|
|
10
|
-
fill: 'currentColor',
|
|
11
|
-
role: 'img',
|
|
12
|
-
'aria-hidden': 'true',
|
|
13
|
-
},
|
|
14
|
-
prettierConfig: {
|
|
15
|
-
parser: 'typescript',
|
|
16
|
-
},
|
|
17
|
-
replaceAttrValues: {
|
|
18
|
-
'#000': 'currentColor',
|
|
19
|
-
'#111': 'currentColor',
|
|
20
|
-
'#444': 'currentColor',
|
|
21
|
-
},
|
|
22
|
-
jsx: {
|
|
23
|
-
babelConfig: {
|
|
24
|
-
plugins: [emotionPlugin],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
indexTemplate,
|
|
28
|
-
template,
|
|
29
|
-
};
|