@spaced-out/ui-design-system 0.1.9 → 0.1.11

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.
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
16
- const HighlightText = _ref => {
16
+ const HighlightText = /*#__PURE__*/React.forwardRef((_ref, ref) => {
17
17
  let {
18
18
  text,
19
19
  highlight,
@@ -29,15 +29,17 @@ const HighlightText = _ref => {
29
29
  highlights = (0, _string.escapeRegExp)(highlight);
30
30
  }
31
31
  const parts = text.split(new RegExp(`(${highlights})`, caseSensitiveHighlighting ? '' : 'gi')).filter(part => part !== '');
32
- return /*#__PURE__*/React.createElement("span", null, parts.map((part, idx) => highlights.toLowerCase().includes((0, _string.escapeRegExp)(part).toLowerCase()) ? /*#__PURE__*/React.createElement("span", {
32
+ return /*#__PURE__*/React.createElement("span", {
33
+ ref: ref
34
+ }, parts.map((part, idx) => highlights.toLowerCase().includes((0, _string.escapeRegExp)(part).toLowerCase()) ? /*#__PURE__*/React.createElement("span", {
33
35
  // eslint-disable-next-line react/no-array-index-key
34
36
  key: idx,
35
37
  className: (0, _classify.default)(_typographyModule.default.highlightText, {
36
38
  [_typographyModule.default.bgHighlighting]: highlightWithBackground
37
39
  }, highlightClassName)
38
40
  }, part) : part));
39
- };
40
- const JumboMedium = _ref2 => {
41
+ });
42
+ const JumboMedium = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
41
43
  let {
42
44
  color = _typography.TEXT_COLORS.primary,
43
45
  children,
@@ -49,7 +51,8 @@ const JumboMedium = _ref2 => {
49
51
  ...props
50
52
  } = _ref2;
51
53
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
52
- className: (0, _classify.default)(_typographyModule.default.jumboMedium, _typographyModule.default[color], className)
54
+ className: (0, _classify.default)(_typographyModule.default.jumboMedium, _typographyModule.default[color], className),
55
+ ref: ref
53
56
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
54
57
  text: children,
55
58
  highlight: highlightString,
@@ -57,9 +60,9 @@ const JumboMedium = _ref2 => {
57
60
  highlightClassName: highlightedTextClassName,
58
61
  highlightWithBackground: highlightWithBackground
59
62
  }) : children);
60
- };
63
+ });
61
64
  exports.JumboMedium = JumboMedium;
62
- const TitleMedium = _ref3 => {
65
+ const TitleMedium = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
63
66
  let {
64
67
  color = _typography.TEXT_COLORS.primary,
65
68
  children,
@@ -71,7 +74,8 @@ const TitleMedium = _ref3 => {
71
74
  ...props
72
75
  } = _ref3;
73
76
  return /*#__PURE__*/React.createElement("h1", _extends({}, props, {
74
- className: (0, _classify.default)(_typographyModule.default.titleMedium, _typographyModule.default[color], className)
77
+ className: (0, _classify.default)(_typographyModule.default.titleMedium, _typographyModule.default[color], className),
78
+ ref: ref
75
79
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
76
80
  text: children,
77
81
  highlight: highlightString,
@@ -79,9 +83,9 @@ const TitleMedium = _ref3 => {
79
83
  highlightClassName: highlightedTextClassName,
80
84
  highlightWithBackground: highlightWithBackground
81
85
  }) : children);
82
- };
86
+ });
83
87
  exports.TitleMedium = TitleMedium;
84
- const SubTitleLarge = _ref4 => {
88
+ const SubTitleLarge = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
85
89
  let {
86
90
  color = _typography.TEXT_COLORS.primary,
87
91
  children,
@@ -93,7 +97,8 @@ const SubTitleLarge = _ref4 => {
93
97
  ...props
94
98
  } = _ref4;
95
99
  return /*#__PURE__*/React.createElement("h2", _extends({}, props, {
96
- className: (0, _classify.default)(_typographyModule.default.subTitleLarge, _typographyModule.default[color], className)
100
+ className: (0, _classify.default)(_typographyModule.default.subTitleLarge, _typographyModule.default[color], className),
101
+ ref: ref
97
102
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
98
103
  text: children,
99
104
  highlight: highlightString,
@@ -101,9 +106,9 @@ const SubTitleLarge = _ref4 => {
101
106
  highlightClassName: highlightedTextClassName,
102
107
  highlightWithBackground: highlightWithBackground
103
108
  }) : children);
104
- };
109
+ });
105
110
  exports.SubTitleLarge = SubTitleLarge;
106
- const SubTitleMedium = _ref5 => {
111
+ const SubTitleMedium = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
107
112
  let {
108
113
  color = _typography.TEXT_COLORS.primary,
109
114
  children,
@@ -115,7 +120,8 @@ const SubTitleMedium = _ref5 => {
115
120
  ...props
116
121
  } = _ref5;
117
122
  return /*#__PURE__*/React.createElement("h3", _extends({}, props, {
118
- className: (0, _classify.default)(_typographyModule.default.subTitleMedium, _typographyModule.default[color], className)
123
+ className: (0, _classify.default)(_typographyModule.default.subTitleMedium, _typographyModule.default[color], className),
124
+ ref: ref
119
125
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
120
126
  text: children,
121
127
  highlight: highlightString,
@@ -123,9 +129,9 @@ const SubTitleMedium = _ref5 => {
123
129
  highlightClassName: highlightedTextClassName,
124
130
  highlightWithBackground: highlightWithBackground
125
131
  }) : children);
126
- };
132
+ });
127
133
  exports.SubTitleMedium = SubTitleMedium;
128
- const SubTitleSmall = _ref6 => {
134
+ const SubTitleSmall = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
129
135
  let {
130
136
  color = _typography.TEXT_COLORS.primary,
131
137
  children,
@@ -137,7 +143,8 @@ const SubTitleSmall = _ref6 => {
137
143
  ...props
138
144
  } = _ref6;
139
145
  return /*#__PURE__*/React.createElement("h4", _extends({}, props, {
140
- className: (0, _classify.default)(_typographyModule.default.subTitleSmall, _typographyModule.default[color], className)
146
+ className: (0, _classify.default)(_typographyModule.default.subTitleSmall, _typographyModule.default[color], className),
147
+ ref: ref
141
148
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
142
149
  text: children,
143
150
  highlight: highlightString,
@@ -145,9 +152,9 @@ const SubTitleSmall = _ref6 => {
145
152
  highlightClassName: highlightedTextClassName,
146
153
  highlightWithBackground: highlightWithBackground
147
154
  }) : children);
148
- };
155
+ });
149
156
  exports.SubTitleSmall = SubTitleSmall;
150
- const SubTitleExtraSmall = _ref7 => {
157
+ const SubTitleExtraSmall = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
151
158
  let {
152
159
  color = _typography.TEXT_COLORS.primary,
153
160
  children,
@@ -159,7 +166,8 @@ const SubTitleExtraSmall = _ref7 => {
159
166
  ...props
160
167
  } = _ref7;
161
168
  return /*#__PURE__*/React.createElement("h5", _extends({}, props, {
162
- className: (0, _classify.default)(_typographyModule.default.subTitleExtraSmall, _typographyModule.default[color], className)
169
+ className: (0, _classify.default)(_typographyModule.default.subTitleExtraSmall, _typographyModule.default[color], className),
170
+ ref: ref
163
171
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
164
172
  text: children,
165
173
  highlight: highlightString,
@@ -167,9 +175,9 @@ const SubTitleExtraSmall = _ref7 => {
167
175
  highlightClassName: highlightedTextClassName,
168
176
  highlightWithBackground: highlightWithBackground
169
177
  }) : children);
170
- };
178
+ });
171
179
  exports.SubTitleExtraSmall = SubTitleExtraSmall;
172
- const ButtonTextMedium = _ref8 => {
180
+ const ButtonTextMedium = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
173
181
  let {
174
182
  color = _typography.TEXT_COLORS.primary,
175
183
  children,
@@ -181,7 +189,8 @@ const ButtonTextMedium = _ref8 => {
181
189
  ...props
182
190
  } = _ref8;
183
191
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
184
- className: (0, _classify.default)(_typographyModule.default.buttonTextMedium, _typographyModule.default[color], className)
192
+ className: (0, _classify.default)(_typographyModule.default.buttonTextMedium, _typographyModule.default[color], className),
193
+ ref: ref
185
194
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
186
195
  text: children,
187
196
  highlight: highlightString,
@@ -189,9 +198,9 @@ const ButtonTextMedium = _ref8 => {
189
198
  highlightClassName: highlightedTextClassName,
190
199
  highlightWithBackground: highlightWithBackground
191
200
  }) : children);
192
- };
201
+ });
193
202
  exports.ButtonTextMedium = ButtonTextMedium;
194
- const ButtonTextSmall = _ref9 => {
203
+ const ButtonTextSmall = /*#__PURE__*/React.forwardRef((_ref9, ref) => {
195
204
  let {
196
205
  color = _typography.TEXT_COLORS.primary,
197
206
  children,
@@ -203,7 +212,8 @@ const ButtonTextSmall = _ref9 => {
203
212
  ...props
204
213
  } = _ref9;
205
214
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
206
- className: (0, _classify.default)(_typographyModule.default.buttonTextSmall, _typographyModule.default[color], className)
215
+ className: (0, _classify.default)(_typographyModule.default.buttonTextSmall, _typographyModule.default[color], className),
216
+ ref: ref
207
217
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
208
218
  text: children,
209
219
  highlight: highlightString,
@@ -211,9 +221,9 @@ const ButtonTextSmall = _ref9 => {
211
221
  highlightClassName: highlightedTextClassName,
212
222
  highlightWithBackground: highlightWithBackground
213
223
  }) : children);
214
- };
224
+ });
215
225
  exports.ButtonTextSmall = ButtonTextSmall;
216
- const ButtonTextExtraSmall = _ref10 => {
226
+ const ButtonTextExtraSmall = /*#__PURE__*/React.forwardRef((_ref10, ref) => {
217
227
  let {
218
228
  color = _typography.TEXT_COLORS.primary,
219
229
  children,
@@ -225,7 +235,8 @@ const ButtonTextExtraSmall = _ref10 => {
225
235
  ...props
226
236
  } = _ref10;
227
237
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
228
- className: (0, _classify.default)(_typographyModule.default.buttonTextExtraSmall, _typographyModule.default[color], className)
238
+ className: (0, _classify.default)(_typographyModule.default.buttonTextExtraSmall, _typographyModule.default[color], className),
239
+ ref: ref
229
240
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
230
241
  text: children,
231
242
  highlight: highlightString,
@@ -233,9 +244,9 @@ const ButtonTextExtraSmall = _ref10 => {
233
244
  highlightClassName: highlightedTextClassName,
234
245
  highlightWithBackground: highlightWithBackground
235
246
  }) : children);
236
- };
247
+ });
237
248
  exports.ButtonTextExtraSmall = ButtonTextExtraSmall;
238
- const FormInputMedium = _ref11 => {
249
+ const FormInputMedium = /*#__PURE__*/React.forwardRef((_ref11, ref) => {
239
250
  let {
240
251
  color = _typography.TEXT_COLORS.primary,
241
252
  children,
@@ -247,7 +258,8 @@ const FormInputMedium = _ref11 => {
247
258
  ...props
248
259
  } = _ref11;
249
260
  return /*#__PURE__*/React.createElement("p", _extends({}, props, {
250
- className: (0, _classify.default)(_typographyModule.default.formInputMedium, _typographyModule.default[color], className)
261
+ className: (0, _classify.default)(_typographyModule.default.formInputMedium, _typographyModule.default[color], className),
262
+ ref: ref
251
263
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
252
264
  text: children,
253
265
  highlight: highlightString,
@@ -255,9 +267,9 @@ const FormInputMedium = _ref11 => {
255
267
  highlightClassName: highlightedTextClassName,
256
268
  highlightWithBackground: highlightWithBackground
257
269
  }) : children);
258
- };
270
+ });
259
271
  exports.FormInputMedium = FormInputMedium;
260
- const FormInputSmall = _ref12 => {
272
+ const FormInputSmall = /*#__PURE__*/React.forwardRef((_ref12, ref) => {
261
273
  let {
262
274
  color = _typography.TEXT_COLORS.primary,
263
275
  children,
@@ -269,7 +281,8 @@ const FormInputSmall = _ref12 => {
269
281
  ...props
270
282
  } = _ref12;
271
283
  return /*#__PURE__*/React.createElement("p", _extends({}, props, {
272
- className: (0, _classify.default)(_typographyModule.default.formInputSmall, _typographyModule.default[color], className)
284
+ className: (0, _classify.default)(_typographyModule.default.formInputSmall, _typographyModule.default[color], className),
285
+ ref: ref
273
286
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
274
287
  text: children,
275
288
  highlight: highlightString,
@@ -277,9 +290,9 @@ const FormInputSmall = _ref12 => {
277
290
  highlightClassName: highlightedTextClassName,
278
291
  highlightWithBackground: highlightWithBackground
279
292
  }) : children);
280
- };
293
+ });
281
294
  exports.FormInputSmall = FormInputSmall;
282
- const BodyLarge = _ref13 => {
295
+ const BodyLarge = /*#__PURE__*/React.forwardRef((_ref13, ref) => {
283
296
  let {
284
297
  color = _typography.TEXT_COLORS.primary,
285
298
  children,
@@ -291,7 +304,8 @@ const BodyLarge = _ref13 => {
291
304
  ...props
292
305
  } = _ref13;
293
306
  return /*#__PURE__*/React.createElement("p", _extends({}, props, {
294
- className: (0, _classify.default)(_typographyModule.default.bodyLarge, _typographyModule.default[color], className)
307
+ className: (0, _classify.default)(_typographyModule.default.bodyLarge, _typographyModule.default[color], className),
308
+ ref: ref
295
309
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
296
310
  text: children,
297
311
  highlight: highlightString,
@@ -299,9 +313,9 @@ const BodyLarge = _ref13 => {
299
313
  highlightClassName: highlightedTextClassName,
300
314
  highlightWithBackground: highlightWithBackground
301
315
  }) : children);
302
- };
316
+ });
303
317
  exports.BodyLarge = BodyLarge;
304
- const BodyMedium = _ref14 => {
318
+ const BodyMedium = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
305
319
  let {
306
320
  color = _typography.TEXT_COLORS.primary,
307
321
  children,
@@ -313,7 +327,8 @@ const BodyMedium = _ref14 => {
313
327
  ...props
314
328
  } = _ref14;
315
329
  return /*#__PURE__*/React.createElement("p", _extends({}, props, {
316
- className: (0, _classify.default)(_typographyModule.default.bodyMedium, _typographyModule.default[color], className)
330
+ className: (0, _classify.default)(_typographyModule.default.bodyMedium, _typographyModule.default[color], className),
331
+ ref: ref
317
332
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
318
333
  text: children,
319
334
  highlight: highlightString,
@@ -321,9 +336,9 @@ const BodyMedium = _ref14 => {
321
336
  highlightClassName: highlightedTextClassName,
322
337
  highlightWithBackground: highlightWithBackground
323
338
  }) : children);
324
- };
339
+ });
325
340
  exports.BodyMedium = BodyMedium;
326
- const BodySmall = _ref15 => {
341
+ const BodySmall = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
327
342
  let {
328
343
  color = _typography.TEXT_COLORS.primary,
329
344
  children,
@@ -335,7 +350,8 @@ const BodySmall = _ref15 => {
335
350
  ...props
336
351
  } = _ref15;
337
352
  return /*#__PURE__*/React.createElement("p", _extends({}, props, {
338
- className: (0, _classify.default)(_typographyModule.default.bodySmall, _typographyModule.default[color], className)
353
+ className: (0, _classify.default)(_typographyModule.default.bodySmall, _typographyModule.default[color], className),
354
+ ref: ref
339
355
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
340
356
  text: children,
341
357
  highlight: highlightString,
@@ -343,9 +359,9 @@ const BodySmall = _ref15 => {
343
359
  highlightClassName: highlightedTextClassName,
344
360
  highlightWithBackground: highlightWithBackground
345
361
  }) : children);
346
- };
362
+ });
347
363
  exports.BodySmall = BodySmall;
348
- const FormLabelMedium = _ref16 => {
364
+ const FormLabelMedium = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
349
365
  let {
350
366
  color = _typography.TEXT_COLORS.primary,
351
367
  children,
@@ -357,7 +373,8 @@ const FormLabelMedium = _ref16 => {
357
373
  ...props
358
374
  } = _ref16;
359
375
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
360
- className: (0, _classify.default)(_typographyModule.default.formLabelMedium, _typographyModule.default[color], className)
376
+ className: (0, _classify.default)(_typographyModule.default.formLabelMedium, _typographyModule.default[color], className),
377
+ ref: ref
361
378
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
362
379
  text: children,
363
380
  highlight: highlightString,
@@ -365,9 +382,9 @@ const FormLabelMedium = _ref16 => {
365
382
  highlightClassName: highlightedTextClassName,
366
383
  highlightWithBackground: highlightWithBackground
367
384
  }) : children);
368
- };
385
+ });
369
386
  exports.FormLabelMedium = FormLabelMedium;
370
- const FormLabelSmall = _ref17 => {
387
+ const FormLabelSmall = /*#__PURE__*/React.forwardRef((_ref17, ref) => {
371
388
  let {
372
389
  color = _typography.TEXT_COLORS.primary,
373
390
  children,
@@ -379,7 +396,8 @@ const FormLabelSmall = _ref17 => {
379
396
  ...props
380
397
  } = _ref17;
381
398
  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
382
- className: (0, _classify.default)(_typographyModule.default.formLabelSmall, _typographyModule.default[color], className)
399
+ className: (0, _classify.default)(_typographyModule.default.formLabelSmall, _typographyModule.default[color], className),
400
+ ref: ref
383
401
  }), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
384
402
  text: children,
385
403
  highlight: highlightString,
@@ -387,5 +405,5 @@ const FormLabelSmall = _ref17 => {
387
405
  highlightClassName: highlightedTextClassName,
388
406
  highlightWithBackground: highlightWithBackground
389
407
  }) : children);
390
- };
408
+ });
391
409
  exports.FormLabelSmall = FormLabelSmall;