@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.
Files changed (43) hide show
  1. package/dist/patterns/CheckerDense.js +37 -39
  2. package/dist/patterns/CheckerLoose.js +37 -39
  3. package/dist/patterns/CheckerRegular.js +37 -39
  4. package/dist/patterns/DiagonalADense.js +71 -73
  5. package/dist/patterns/DiagonalALoose.js +215 -217
  6. package/dist/patterns/DiagonalARegular.js +119 -121
  7. package/dist/patterns/DiagonalBDense.js +53 -55
  8. package/dist/patterns/DiagonalBLoose.js +121 -123
  9. package/dist/patterns/DiagonalBRegular.js +77 -79
  10. package/dist/patterns/DotDense.js +32 -34
  11. package/dist/patterns/DotLoose.js +75 -77
  12. package/dist/patterns/DotRegular.js +32 -34
  13. package/dist/patterns/ExDense.js +54 -56
  14. package/dist/patterns/ExLoose.js +54 -56
  15. package/dist/patterns/ExRegular.js +54 -56
  16. package/dist/patterns/FlowerDense.js +48 -50
  17. package/dist/patterns/FlowerLoose.js +48 -50
  18. package/dist/patterns/FlowerRegular.js +48 -50
  19. package/dist/patterns/GridDense.js +47 -49
  20. package/dist/patterns/GridLoose.js +47 -49
  21. package/dist/patterns/GridRegular.js +47 -49
  22. package/dist/patterns/Herringbone.js +65 -67
  23. package/dist/patterns/RainDense.js +37 -39
  24. package/dist/patterns/RainLoose.js +37 -39
  25. package/dist/patterns/RainRegular.js +37 -39
  26. package/dist/patterns/StripeDense.js +69 -71
  27. package/dist/patterns/StripeLoose.js +201 -203
  28. package/dist/patterns/StripeRegular.js +113 -115
  29. package/dist/props.d.ts +141 -32
  30. package/dist/props.js +14 -6
  31. package/dist/types.js +1 -0
  32. package/dist/usePatternId.js +5 -8
  33. package/package.json +17 -30
  34. package/.svgo.yml +0 -11
  35. package/CHANGELOG.md +0 -329
  36. package/LICENSE +0 -21
  37. package/babel.config.js +0 -5
  38. package/emotion-plugin.js +0 -46
  39. package/index-template.js +0 -10
  40. package/jest.config.js +0 -1
  41. package/pattern-template.js +0 -30
  42. package/svgr.config.js +0 -29
  43. package/tsconfig.json +0 -12
@@ -1,123 +1,121 @@
1
- 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); }
2
-
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
-
5
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
1
  import * as React from 'react';
8
2
  import { Svg } from '../props';
9
3
  import { usePatternId } from '../usePatternId';
10
- export var StripeRegular = /*#__PURE__*/React.forwardRef(function (_ref, svgRef) {
11
- var _ref$title = _ref.title,
12
- title = _ref$title === void 0 ? 'Stripe Regular' : _ref$title,
13
- titleId = _ref.titleId,
14
- props = _objectWithoutProperties(_ref, ["title", "titleId"]);
15
-
16
- var patternId = usePatternId('StripeRegular');
17
- return /*#__PURE__*/React.createElement(Svg, _extends({
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const StripeRegular = /*#__PURE__*/React.forwardRef(({
6
+ title = 'Stripe Regular',
7
+ titleId,
8
+ ...props
9
+ }, svgRef) => {
10
+ const patternId = usePatternId('StripeRegular');
11
+ return /*#__PURE__*/_jsxs(Svg, {
18
12
  fill: "currentColor",
19
13
  role: "img",
20
14
  "aria-hidden": "true",
21
15
  ref: svgRef,
22
- "aria-labelledby": titleId
23
- }, props), title ? /*#__PURE__*/React.createElement("title", {
24
- id: titleId
25
- }, title) : null, /*#__PURE__*/React.createElement("pattern", {
26
- id: patternId,
27
- x: 0,
28
- y: 0,
29
- width: 8,
30
- height: 8,
31
- patternUnits: "userSpaceOnUse"
32
- }, /*#__PURE__*/React.createElement("rect", {
33
- x: 1,
34
- width: 1,
35
- height: 1,
36
- fill: "currentColor"
37
- }), /*#__PURE__*/React.createElement("rect", {
38
- width: 1,
39
- height: 1,
40
- fill: "currentColor"
41
- }), /*#__PURE__*/React.createElement("rect", {
42
- x: 2,
43
- width: 1,
44
- height: 1,
45
- fill: "currentColor"
46
- }), /*#__PURE__*/React.createElement("rect", {
47
- x: 3,
48
- width: 1,
49
- height: 1,
50
- fill: "currentColor"
51
- }), /*#__PURE__*/React.createElement("rect", {
52
- x: 1,
53
- y: 4,
54
- width: 1,
55
- height: 1,
56
- fill: "currentColor"
57
- }), /*#__PURE__*/React.createElement("rect", {
58
- y: 4,
59
- width: 1,
60
- height: 1,
61
- fill: "currentColor"
62
- }), /*#__PURE__*/React.createElement("rect", {
63
- x: 2,
64
- y: 4,
65
- width: 1,
66
- height: 1,
67
- fill: "currentColor"
68
- }), /*#__PURE__*/React.createElement("rect", {
69
- x: 3,
70
- y: 4,
71
- width: 1,
72
- height: 1,
73
- fill: "currentColor"
74
- }), /*#__PURE__*/React.createElement("rect", {
75
- x: 5,
76
- width: 1,
77
- height: 1,
78
- fill: "currentColor"
79
- }), /*#__PURE__*/React.createElement("rect", {
80
- x: 4,
81
- width: 1,
82
- height: 1,
83
- fill: "currentColor"
84
- }), /*#__PURE__*/React.createElement("rect", {
85
- x: 6,
86
- width: 1,
87
- height: 1,
88
- fill: "currentColor"
89
- }), /*#__PURE__*/React.createElement("rect", {
90
- x: 7,
91
- width: 1,
92
- height: 1,
93
- fill: "currentColor"
94
- }), /*#__PURE__*/React.createElement("rect", {
95
- x: 5,
96
- y: 4,
97
- width: 1,
98
- height: 1,
99
- fill: "currentColor"
100
- }), /*#__PURE__*/React.createElement("rect", {
101
- x: 4,
102
- y: 4,
103
- width: 1,
104
- height: 1,
105
- fill: "currentColor"
106
- }), /*#__PURE__*/React.createElement("rect", {
107
- x: 6,
108
- y: 4,
109
- width: 1,
110
- height: 1,
111
- fill: "currentColor"
112
- }), /*#__PURE__*/React.createElement("rect", {
113
- x: 7,
114
- y: 4,
115
- width: 1,
116
- height: 1,
117
- fill: "currentColor"
118
- })), /*#__PURE__*/React.createElement("rect", {
119
- width: "100%",
120
- height: "100%",
121
- fill: "url(#".concat(patternId, ")")
122
- }));
16
+ "aria-labelledby": titleId,
17
+ ...props,
18
+ children: [title ? /*#__PURE__*/_jsx("title", {
19
+ id: titleId,
20
+ children: title
21
+ }) : null, /*#__PURE__*/_jsxs("pattern", {
22
+ id: patternId,
23
+ x: 0,
24
+ y: 0,
25
+ width: 8,
26
+ height: 8,
27
+ patternUnits: "userSpaceOnUse",
28
+ children: [/*#__PURE__*/_jsx("rect", {
29
+ x: 1,
30
+ width: 1,
31
+ height: 1,
32
+ fill: "currentColor"
33
+ }), /*#__PURE__*/_jsx("rect", {
34
+ width: 1,
35
+ height: 1,
36
+ fill: "currentColor"
37
+ }), /*#__PURE__*/_jsx("rect", {
38
+ x: 2,
39
+ width: 1,
40
+ height: 1,
41
+ fill: "currentColor"
42
+ }), /*#__PURE__*/_jsx("rect", {
43
+ x: 3,
44
+ width: 1,
45
+ height: 1,
46
+ fill: "currentColor"
47
+ }), /*#__PURE__*/_jsx("rect", {
48
+ x: 1,
49
+ y: 4,
50
+ width: 1,
51
+ height: 1,
52
+ fill: "currentColor"
53
+ }), /*#__PURE__*/_jsx("rect", {
54
+ y: 4,
55
+ width: 1,
56
+ height: 1,
57
+ fill: "currentColor"
58
+ }), /*#__PURE__*/_jsx("rect", {
59
+ x: 2,
60
+ y: 4,
61
+ width: 1,
62
+ height: 1,
63
+ fill: "currentColor"
64
+ }), /*#__PURE__*/_jsx("rect", {
65
+ x: 3,
66
+ y: 4,
67
+ width: 1,
68
+ height: 1,
69
+ fill: "currentColor"
70
+ }), /*#__PURE__*/_jsx("rect", {
71
+ x: 5,
72
+ width: 1,
73
+ height: 1,
74
+ fill: "currentColor"
75
+ }), /*#__PURE__*/_jsx("rect", {
76
+ x: 4,
77
+ width: 1,
78
+ height: 1,
79
+ fill: "currentColor"
80
+ }), /*#__PURE__*/_jsx("rect", {
81
+ x: 6,
82
+ width: 1,
83
+ height: 1,
84
+ fill: "currentColor"
85
+ }), /*#__PURE__*/_jsx("rect", {
86
+ x: 7,
87
+ width: 1,
88
+ height: 1,
89
+ fill: "currentColor"
90
+ }), /*#__PURE__*/_jsx("rect", {
91
+ x: 5,
92
+ y: 4,
93
+ width: 1,
94
+ height: 1,
95
+ fill: "currentColor"
96
+ }), /*#__PURE__*/_jsx("rect", {
97
+ x: 4,
98
+ y: 4,
99
+ width: 1,
100
+ height: 1,
101
+ fill: "currentColor"
102
+ }), /*#__PURE__*/_jsx("rect", {
103
+ x: 6,
104
+ y: 4,
105
+ width: 1,
106
+ height: 1,
107
+ fill: "currentColor"
108
+ }), /*#__PURE__*/_jsx("rect", {
109
+ x: 7,
110
+ y: 4,
111
+ width: 1,
112
+ height: 1,
113
+ fill: "currentColor"
114
+ })]
115
+ }), /*#__PURE__*/_jsx("rect", {
116
+ width: "100%",
117
+ height: "100%",
118
+ fill: `url(#${patternId})`
119
+ })]
120
+ });
123
121
  });
package/dist/props.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StyleProps } from '@codecademy/variance';
3
2
  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
3
  readonly flexBasis: {
@@ -40,6 +39,9 @@ declare const patternStyles: import("@codecademy/variance/dist/types/config").Pa
40
39
  readonly gridArea: {
41
40
  readonly property: "gridArea";
42
41
  };
42
+ readonly containerType: {
43
+ readonly property: "containerType";
44
+ };
43
45
  readonly display: {
44
46
  readonly property: "display";
45
47
  };
@@ -47,66 +49,125 @@ declare const patternStyles: import("@codecademy/variance/dist/types/config").Pa
47
49
  readonly property: "overflow";
48
50
  };
49
51
  readonly overflowX: {
50
- readonly property: "overflowX";
52
+ readonly property: {
53
+ readonly physical: "overflowX";
54
+ readonly logical: "overflowInline";
55
+ };
56
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
51
57
  };
52
58
  readonly overflowY: {
53
- readonly property: "overflowY";
59
+ readonly property: {
60
+ readonly physical: "overflowY";
61
+ readonly logical: "overflowBlock";
62
+ };
63
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
54
64
  };
55
65
  readonly dimensions: {
56
66
  readonly property: "width";
57
- readonly properties: readonly ["width", "height"];
67
+ readonly properties: {
68
+ readonly physical: readonly ["width", "height"];
69
+ readonly logical: readonly ["inlineSize", "blockSize"];
70
+ };
71
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
58
72
  readonly transform: (value: string | number) => string | 0;
59
73
  };
60
74
  readonly width: {
61
- readonly property: "width";
75
+ readonly property: {
76
+ readonly physical: "width";
77
+ readonly logical: "inlineSize";
78
+ };
79
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
62
80
  readonly transform: (value: string | number) => string | 0;
63
81
  };
64
82
  readonly minWidth: {
65
- readonly property: "minWidth";
83
+ readonly property: {
84
+ readonly physical: "minWidth";
85
+ readonly logical: "minInlineSize";
86
+ };
87
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
66
88
  readonly transform: (value: string | number) => string | 0;
67
89
  };
68
90
  readonly maxWidth: {
69
- readonly property: "maxWidth";
91
+ readonly property: {
92
+ readonly physical: "maxWidth";
93
+ readonly logical: "maxInlineSize";
94
+ };
95
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
70
96
  readonly transform: (value: string | number) => string | 0;
71
97
  };
72
98
  readonly height: {
73
- readonly property: "height";
99
+ readonly property: {
100
+ readonly physical: "height";
101
+ readonly logical: "blockSize";
102
+ };
103
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
74
104
  readonly transform: (value: string | number) => string | 0;
75
105
  };
76
106
  readonly minHeight: {
77
- readonly property: "minHeight";
107
+ readonly property: {
108
+ readonly physical: "minHeight";
109
+ readonly logical: "minBlockSize";
110
+ };
111
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
78
112
  readonly transform: (value: string | number) => string | 0;
79
113
  };
80
114
  readonly maxHeight: {
81
- readonly property: "maxHeight";
115
+ readonly property: {
116
+ readonly physical: "maxHeight";
117
+ readonly logical: "maxBlockSize";
118
+ };
119
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
82
120
  readonly transform: (value: string | number) => string | 0;
83
121
  };
84
122
  readonly verticalAlign: {
85
123
  readonly property: "verticalAlign";
86
124
  };
125
+ readonly direction: {
126
+ readonly property: "direction";
127
+ };
87
128
  }>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
88
129
  readonly position: {
89
130
  readonly property: "position";
90
131
  };
91
132
  readonly inset: {
92
133
  readonly property: "inset";
93
- readonly properties: readonly ["top", "right", "bottom", "left"];
134
+ readonly properties: {
135
+ readonly physical: readonly ["top", "right", "bottom", "left"];
136
+ readonly logical: readonly ["insetBlockStart", "insetInlineEnd", "insetBlockEnd", "insetInlineStart"];
137
+ };
138
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
94
139
  readonly transform: (value: string | number) => string | 0;
95
140
  };
96
141
  readonly top: {
97
- readonly property: "top";
142
+ readonly property: {
143
+ readonly physical: "top";
144
+ readonly logical: "insetBlockStart";
145
+ };
146
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
98
147
  readonly transform: (value: string | number) => string | 0;
99
148
  };
100
149
  readonly right: {
101
- readonly property: "right";
150
+ readonly property: {
151
+ readonly physical: "right";
152
+ readonly logical: "insetInlineEnd";
153
+ };
154
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
102
155
  readonly transform: (value: string | number) => string | 0;
103
156
  };
104
157
  readonly bottom: {
105
- readonly property: "bottom";
158
+ readonly property: {
159
+ readonly physical: "bottom";
160
+ readonly logical: "insetBlockEnd";
161
+ };
162
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
106
163
  readonly transform: (value: string | number) => string | 0;
107
164
  };
108
165
  readonly left: {
109
- readonly property: "left";
166
+ readonly property: {
167
+ readonly physical: "left";
168
+ readonly logical: "insetInlineStart";
169
+ };
170
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
110
171
  readonly transform: (value: string | number) => string | 0;
111
172
  };
112
173
  readonly zIndex: {
@@ -122,29 +183,53 @@ declare const patternStyles: import("@codecademy/variance/dist/types/config").Pa
122
183
  };
123
184
  readonly px: {
124
185
  readonly property: "padding";
125
- readonly properties: readonly ["paddingLeft", "paddingRight"];
186
+ readonly properties: {
187
+ readonly physical: readonly ["paddingLeft", "paddingRight"];
188
+ readonly logical: readonly ["paddingInlineStart", "paddingInlineEnd"];
189
+ };
126
190
  readonly scale: "spacing";
191
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
127
192
  };
128
193
  readonly py: {
129
194
  readonly property: "padding";
130
- readonly properties: readonly ["paddingTop", "paddingBottom"];
195
+ readonly properties: {
196
+ readonly physical: readonly ["paddingTop", "paddingBottom"];
197
+ readonly logical: readonly ["paddingBlockStart", "paddingBlockEnd"];
198
+ };
131
199
  readonly scale: "spacing";
200
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
132
201
  };
133
202
  readonly pt: {
134
- readonly property: "paddingTop";
203
+ readonly property: {
204
+ readonly physical: "paddingTop";
205
+ readonly logical: "paddingBlockStart";
206
+ };
135
207
  readonly scale: "spacing";
208
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
136
209
  };
137
210
  readonly pb: {
138
- readonly property: "paddingBottom";
211
+ readonly property: {
212
+ readonly physical: "paddingBottom";
213
+ readonly logical: "paddingBlockEnd";
214
+ };
139
215
  readonly scale: "spacing";
216
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
140
217
  };
141
218
  readonly pr: {
142
- readonly property: "paddingRight";
219
+ readonly property: {
220
+ readonly physical: "paddingRight";
221
+ readonly logical: "paddingInlineEnd";
222
+ };
143
223
  readonly scale: "spacing";
224
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
144
225
  };
145
226
  readonly pl: {
146
- readonly property: "paddingLeft";
227
+ readonly property: {
228
+ readonly physical: "paddingLeft";
229
+ readonly logical: "paddingInlineStart";
230
+ };
147
231
  readonly scale: "spacing";
232
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
148
233
  };
149
234
  readonly m: {
150
235
  readonly property: "margin";
@@ -152,32 +237,56 @@ declare const patternStyles: import("@codecademy/variance/dist/types/config").Pa
152
237
  };
153
238
  readonly mx: {
154
239
  readonly property: "margin";
155
- readonly properties: readonly ["marginLeft", "marginRight"];
240
+ readonly properties: {
241
+ readonly physical: readonly ["marginLeft", "marginRight"];
242
+ readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
243
+ };
244
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
156
245
  readonly scale: "spacing";
157
246
  };
158
247
  readonly my: {
159
248
  readonly property: "margin";
160
- readonly properties: readonly ["marginTop", "marginBottom"];
249
+ readonly properties: {
250
+ readonly physical: readonly ["marginTop", "marginBottom"];
251
+ readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
252
+ };
253
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
161
254
  readonly scale: "spacing";
162
255
  };
163
256
  readonly mt: {
164
- readonly property: "marginTop";
257
+ readonly property: {
258
+ readonly physical: "marginTop";
259
+ readonly logical: "marginBlockStart";
260
+ };
165
261
  readonly scale: "spacing";
262
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
166
263
  };
167
264
  readonly mb: {
168
- readonly property: "marginBottom";
265
+ readonly property: {
266
+ readonly physical: "marginBottom";
267
+ readonly logical: "marginBlockEnd";
268
+ };
169
269
  readonly scale: "spacing";
270
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
170
271
  };
171
272
  readonly mr: {
172
- readonly property: "marginRight";
273
+ readonly property: {
274
+ readonly physical: "marginRight";
275
+ readonly logical: "marginInlineEnd";
276
+ };
173
277
  readonly scale: "spacing";
278
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
174
279
  };
175
280
  readonly ml: {
176
- readonly property: "marginLeft";
281
+ readonly property: {
282
+ readonly physical: "marginLeft";
283
+ readonly logical: "marginInlineStart";
284
+ };
177
285
  readonly scale: "spacing";
286
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
178
287
  };
179
288
  }>>]>>;
180
- export declare type PatternStyleProps = StyleProps<typeof patternStyles>;
289
+ export type PatternStyleProps = StyleProps<typeof patternStyles>;
181
290
  export interface PatternProps extends Omit<React.SVGProps<SVGSVGElement>, keyof PatternStyleProps>, PatternStyleProps {
182
291
  /**
183
292
  * A suffix added to the end of the unique generated ID for the icon. This is useful if you have multiple of the same icon on the page and need to pass accessibility guidelines.
@@ -186,8 +295,8 @@ export interface PatternProps extends Omit<React.SVGProps<SVGSVGElement>, keyof
186
295
  title?: string;
187
296
  ref?: React.Ref<SVGSVGElement>;
188
297
  }
189
- export declare const Svg: import("@emotion/styled").StyledComponent<{
190
- theme?: import("@emotion/react").Theme | undefined;
191
- as?: import("react").ElementType<any> | undefined;
192
- } & PatternProps, Pick<import("react").SVGProps<SVGSVGElement>, "string" | "scale" | "filter" | "fill" | "values" | "spacing" | "clipPath" | "cursor" | "direction" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "paintOrder" | "pointerEvents" | "rotate" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "mask" | "offset" | "min" | "max" | "end" | "clip" | "className" | "id" | "lang" | "media" | "method" | "name" | "style" | "target" | "type" | "role" | "tabIndex" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "alphabetic" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "hanging" | "horizAdvX" | "horizOriginX" | "href" | "ideographic" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mathematical" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "path" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "shapeRendering" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">, {}>;
298
+ export declare const Svg: import("react").ForwardRefExoticComponent<Omit<{
299
+ theme?: import("@emotion/react").Theme;
300
+ as?: React.ElementType;
301
+ } & PatternProps & Pick<import("react").SVGProps<SVGSVGElement>, "string" | "scale" | "filter" | "fill" | "values" | "spacing" | "name" | "alignmentBaseline" | "baselineShift" | "clipPath" | "clipRule" | "colorInterpolationFilters" | "cursor" | "cx" | "cy" | "d" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontSizeAdjust" | "fontVariant" | "imageRendering" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "paintOrder" | "pointerEvents" | "r" | "rotate" | "rx" | "ry" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textRendering" | "transform" | "transformOrigin" | "unicodeBidi" | "vectorEffect" | "visibility" | "wordSpacing" | "writingMode" | "x" | "y" | "mask" | "offset" | "min" | "max" | "end" | "clip" | "suppressHydrationWarning" | "className" | "id" | "lang" | "media" | "method" | "style" | "target" | "type" | "role" | "tabIndex" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "alphabetic" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolation" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "fontStretch" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "hanging" | "horizAdvX" | "horizOriginX" | "href" | "ideographic" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "local" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mathematical" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "path" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
193
302
  export {};
package/dist/props.js CHANGED
@@ -1,9 +1,17 @@
1
1
  import { styledOptions, system } from '@codecademy/gamut-styles';
2
2
  import { variance } from '@codecademy/variance';
3
3
  import styled from '@emotion/styled';
4
- var patternStyles = variance.compose(system.layout, system.positioning, system.space);
5
- export var Svg = styled('svg', styledOptions())(patternStyles);
6
- Svg.defaultProps = {
7
- width: '100%',
8
- height: '100%'
9
- };
4
+ import { forwardRef } from 'react';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const patternStyles = variance.compose(system.layout, system.positioning, system.space);
7
+ const StyledSvg = styled('svg', styledOptions())(patternStyles);
8
+ export const Svg = /*#__PURE__*/forwardRef(({
9
+ height = '100%',
10
+ width = '100%',
11
+ ...rest
12
+ }, ref) => /*#__PURE__*/_jsx(StyledSvg, {
13
+ height: height,
14
+ ref: ref,
15
+ width: width,
16
+ ...rest
17
+ }));
package/dist/types.js CHANGED
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,7 @@
1
- import { useMemo } from 'react';
2
- var counter = {};
1
+ import { useId, useMemo } from 'react';
3
2
  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]);
3
+ const generatedId = useId();
4
+ return useMemo(() => {
5
+ return `${id}-pattern-${generatedId}`;
6
+ }, [id, generatedId]);
10
7
  }