@codecademy/gamut-patterns 1.0.0-alpha.f6cb5a.0 → 67.0.0-alpha.09ad1e.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/LICENSE +1 -1
- package/dist/patterns/CheckerDense.js +39 -32
- package/dist/patterns/CheckerLoose.js +39 -32
- package/dist/patterns/CheckerRegular.js +39 -32
- package/dist/patterns/DiagonalADense.js +73 -66
- package/dist/patterns/DiagonalALoose.js +217 -210
- package/dist/patterns/DiagonalARegular.js +121 -114
- package/dist/patterns/DiagonalBDense.js +55 -48
- package/dist/patterns/DiagonalBLoose.js +123 -116
- package/dist/patterns/DiagonalBRegular.js +79 -72
- package/dist/patterns/DotDense.js +34 -27
- package/dist/patterns/DotLoose.js +77 -70
- package/dist/patterns/DotRegular.js +34 -27
- package/dist/patterns/ExDense.js +56 -49
- package/dist/patterns/ExLoose.js +56 -49
- package/dist/patterns/ExRegular.js +56 -49
- package/dist/patterns/FlowerDense.js +50 -43
- package/dist/patterns/FlowerLoose.js +50 -43
- package/dist/patterns/FlowerRegular.js +50 -43
- package/dist/patterns/GridDense.js +49 -42
- package/dist/patterns/GridLoose.js +49 -42
- package/dist/patterns/GridRegular.js +49 -42
- package/dist/patterns/Herringbone.js +67 -60
- package/dist/patterns/RainDense.js +39 -32
- package/dist/patterns/RainLoose.js +39 -32
- package/dist/patterns/RainRegular.js +39 -32
- package/dist/patterns/StripeDense.js +71 -64
- package/dist/patterns/StripeLoose.js +203 -196
- package/dist/patterns/StripeRegular.js +115 -108
- package/dist/props.d.ts +1 -1
- package/dist/types.js +1 -0
- package/dist/usePatternId.js +4 -6
- package/package.json +16 -17
- package/.svgo.yml +0 -11
- package/CHANGELOG.md +0 -329
- 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/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/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
|
-
};
|