@spaced-out/ui-design-system 0.1.57 → 0.1.58
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/CHANGELOG.md +7 -0
- package/lib/components/Text/Text.js +152 -14
- package/lib/components/Text/Text.js.flow +237 -0
- package/lib/components/Text/index.js +36 -0
- package/lib/components/Text/index.js.flow +6 -0
- package/lib/components/Toggle/Toggle.js +5 -2
- package/lib/components/Toggle/Toggle.js.flow +8 -1
- package/lib/styles/typography.module.css +10 -1
- package/lib/utils/array/are-arrays-equal.js +11 -0
- package/lib/utils/array/are-arrays-equal.js.flow +14 -0
- package/lib/utils/array/index.js +16 -0
- package/lib/utils/array/index.js.flow +3 -0
- package/lib/utils/index.js +11 -0
- package/lib/utils/index.js.flow +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.58](https://github.com/spaced-out/ui-design-system/compare/v0.1.57...v0.1.58) (2023-10-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* new typography components, added toggle label position prop ([869ed49](https://github.com/spaced-out/ui-design-system/commit/869ed49f8448b8a0630b2eebf0e2a65eb533160e))
|
|
11
|
+
|
|
5
12
|
### [0.1.57](https://github.com/spaced-out/ui-design-system/compare/v0.1.56...v0.1.57) (2023-10-04)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TitleMedium = exports.SubTitleSmall = exports.SubTitleMedium = exports.SubTitleLarge = exports.SubTitleExtraSmall = exports.JumboSmall = exports.JumboMedium = exports.FormLabelSmall = exports.FormLabelMedium = exports.FormInputSmall = exports.FormInputMedium = exports.ButtonTextSmall = exports.ButtonTextMedium = exports.ButtonTextExtraSmall = exports.BodySmall = exports.BodyMedium = exports.BodyLarge = void 0;
|
|
6
|
+
exports.TitleMedium = exports.SubTitleSmall = exports.SubTitleMedium = exports.SubTitleLarge = exports.SubTitleExtraSmall = exports.JumboSmall = exports.JumboMedium = exports.FormLabelSmall = exports.FormLabelMedium = exports.FormInputSmall = exports.FormInputMedium = exports.ButtonTextSmallUnderline = exports.ButtonTextSmall = exports.ButtonTextMediumUnderline = exports.ButtonTextMedium = exports.ButtonTextExtraSmallUnderline = exports.ButtonTextExtraSmall = exports.BodySmallBold = exports.BodySmall = exports.BodyMediumBold = exports.BodyMedium = exports.BodyLargeBold = exports.BodyLarge = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _typography = require("../../types/typography");
|
|
9
9
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
@@ -269,7 +269,7 @@ const ButtonTextExtraSmall = /*#__PURE__*/React.forwardRef((_ref11, ref) => {
|
|
|
269
269
|
}) : children);
|
|
270
270
|
});
|
|
271
271
|
exports.ButtonTextExtraSmall = ButtonTextExtraSmall;
|
|
272
|
-
const
|
|
272
|
+
const ButtonTextMediumUnderline = /*#__PURE__*/React.forwardRef((_ref12, ref) => {
|
|
273
273
|
let {
|
|
274
274
|
color = _typography.TEXT_COLORS.primary,
|
|
275
275
|
children,
|
|
@@ -280,6 +280,75 @@ const FormInputMedium = /*#__PURE__*/React.forwardRef((_ref12, ref) => {
|
|
|
280
280
|
highlightWithBackground,
|
|
281
281
|
...props
|
|
282
282
|
} = _ref12;
|
|
283
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
284
|
+
className: (0, _classify.default)(_typographyModule.default.buttonTextMedium, _typographyModule.default.underline, _typographyModule.default[color], className),
|
|
285
|
+
ref: ref
|
|
286
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
287
|
+
text: children,
|
|
288
|
+
highlight: highlightString,
|
|
289
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
290
|
+
highlightClassName: highlightedTextClassName,
|
|
291
|
+
highlightWithBackground: highlightWithBackground
|
|
292
|
+
}) : children);
|
|
293
|
+
});
|
|
294
|
+
exports.ButtonTextMediumUnderline = ButtonTextMediumUnderline;
|
|
295
|
+
const ButtonTextSmallUnderline = /*#__PURE__*/React.forwardRef((_ref13, ref) => {
|
|
296
|
+
let {
|
|
297
|
+
color = _typography.TEXT_COLORS.primary,
|
|
298
|
+
children,
|
|
299
|
+
className,
|
|
300
|
+
highlightedTextClassName,
|
|
301
|
+
highlightString,
|
|
302
|
+
caseSensitiveHighlighting,
|
|
303
|
+
highlightWithBackground,
|
|
304
|
+
...props
|
|
305
|
+
} = _ref13;
|
|
306
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
307
|
+
className: (0, _classify.default)(_typographyModule.default.buttonTextSmall, _typographyModule.default.underline, _typographyModule.default[color], className),
|
|
308
|
+
ref: ref
|
|
309
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
310
|
+
text: children,
|
|
311
|
+
highlight: highlightString,
|
|
312
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
313
|
+
highlightClassName: highlightedTextClassName,
|
|
314
|
+
highlightWithBackground: highlightWithBackground
|
|
315
|
+
}) : children);
|
|
316
|
+
});
|
|
317
|
+
exports.ButtonTextSmallUnderline = ButtonTextSmallUnderline;
|
|
318
|
+
const ButtonTextExtraSmallUnderline = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
|
|
319
|
+
let {
|
|
320
|
+
color = _typography.TEXT_COLORS.primary,
|
|
321
|
+
children,
|
|
322
|
+
className,
|
|
323
|
+
highlightedTextClassName,
|
|
324
|
+
highlightString,
|
|
325
|
+
caseSensitiveHighlighting,
|
|
326
|
+
highlightWithBackground,
|
|
327
|
+
...props
|
|
328
|
+
} = _ref14;
|
|
329
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
330
|
+
className: (0, _classify.default)(_typographyModule.default.buttonTextExtraSmall, _typographyModule.default.underline, _typographyModule.default[color], className),
|
|
331
|
+
ref: ref
|
|
332
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
333
|
+
text: children,
|
|
334
|
+
highlight: highlightString,
|
|
335
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
336
|
+
highlightClassName: highlightedTextClassName,
|
|
337
|
+
highlightWithBackground: highlightWithBackground
|
|
338
|
+
}) : children);
|
|
339
|
+
});
|
|
340
|
+
exports.ButtonTextExtraSmallUnderline = ButtonTextExtraSmallUnderline;
|
|
341
|
+
const FormInputMedium = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
|
|
342
|
+
let {
|
|
343
|
+
color = _typography.TEXT_COLORS.primary,
|
|
344
|
+
children,
|
|
345
|
+
className,
|
|
346
|
+
highlightedTextClassName,
|
|
347
|
+
highlightString,
|
|
348
|
+
caseSensitiveHighlighting,
|
|
349
|
+
highlightWithBackground,
|
|
350
|
+
...props
|
|
351
|
+
} = _ref15;
|
|
283
352
|
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
284
353
|
className: (0, _classify.default)(_typographyModule.default.formInputMedium, _typographyModule.default[color], className),
|
|
285
354
|
ref: ref
|
|
@@ -292,7 +361,7 @@ const FormInputMedium = /*#__PURE__*/React.forwardRef((_ref12, ref) => {
|
|
|
292
361
|
}) : children);
|
|
293
362
|
});
|
|
294
363
|
exports.FormInputMedium = FormInputMedium;
|
|
295
|
-
const FormInputSmall = /*#__PURE__*/React.forwardRef((
|
|
364
|
+
const FormInputSmall = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
296
365
|
let {
|
|
297
366
|
color = _typography.TEXT_COLORS.primary,
|
|
298
367
|
children,
|
|
@@ -302,7 +371,7 @@ const FormInputSmall = /*#__PURE__*/React.forwardRef((_ref13, ref) => {
|
|
|
302
371
|
caseSensitiveHighlighting,
|
|
303
372
|
highlightWithBackground,
|
|
304
373
|
...props
|
|
305
|
-
} =
|
|
374
|
+
} = _ref16;
|
|
306
375
|
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
307
376
|
className: (0, _classify.default)(_typographyModule.default.formInputSmall, _typographyModule.default[color], className),
|
|
308
377
|
ref: ref
|
|
@@ -315,7 +384,7 @@ const FormInputSmall = /*#__PURE__*/React.forwardRef((_ref13, ref) => {
|
|
|
315
384
|
}) : children);
|
|
316
385
|
});
|
|
317
386
|
exports.FormInputSmall = FormInputSmall;
|
|
318
|
-
const BodyLarge = /*#__PURE__*/React.forwardRef((
|
|
387
|
+
const BodyLarge = /*#__PURE__*/React.forwardRef((_ref17, ref) => {
|
|
319
388
|
let {
|
|
320
389
|
color = _typography.TEXT_COLORS.primary,
|
|
321
390
|
children,
|
|
@@ -325,7 +394,7 @@ const BodyLarge = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
|
|
|
325
394
|
caseSensitiveHighlighting,
|
|
326
395
|
highlightWithBackground,
|
|
327
396
|
...props
|
|
328
|
-
} =
|
|
397
|
+
} = _ref17;
|
|
329
398
|
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
330
399
|
className: (0, _classify.default)(_typographyModule.default.bodyLarge, _typographyModule.default[color], className),
|
|
331
400
|
ref: ref
|
|
@@ -338,7 +407,7 @@ const BodyLarge = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
|
|
|
338
407
|
}) : children);
|
|
339
408
|
});
|
|
340
409
|
exports.BodyLarge = BodyLarge;
|
|
341
|
-
const BodyMedium = /*#__PURE__*/React.forwardRef((
|
|
410
|
+
const BodyMedium = /*#__PURE__*/React.forwardRef((_ref18, ref) => {
|
|
342
411
|
let {
|
|
343
412
|
color = _typography.TEXT_COLORS.primary,
|
|
344
413
|
children,
|
|
@@ -348,7 +417,7 @@ const BodyMedium = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
|
|
|
348
417
|
caseSensitiveHighlighting,
|
|
349
418
|
highlightWithBackground,
|
|
350
419
|
...props
|
|
351
|
-
} =
|
|
420
|
+
} = _ref18;
|
|
352
421
|
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
353
422
|
className: (0, _classify.default)(_typographyModule.default.bodyMedium, _typographyModule.default[color], className),
|
|
354
423
|
ref: ref
|
|
@@ -361,7 +430,7 @@ const BodyMedium = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
|
|
|
361
430
|
}) : children);
|
|
362
431
|
});
|
|
363
432
|
exports.BodyMedium = BodyMedium;
|
|
364
|
-
const BodySmall = /*#__PURE__*/React.forwardRef((
|
|
433
|
+
const BodySmall = /*#__PURE__*/React.forwardRef((_ref19, ref) => {
|
|
365
434
|
let {
|
|
366
435
|
color = _typography.TEXT_COLORS.primary,
|
|
367
436
|
children,
|
|
@@ -371,7 +440,7 @@ const BodySmall = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
|
371
440
|
caseSensitiveHighlighting,
|
|
372
441
|
highlightWithBackground,
|
|
373
442
|
...props
|
|
374
|
-
} =
|
|
443
|
+
} = _ref19;
|
|
375
444
|
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
376
445
|
className: (0, _classify.default)(_typographyModule.default.bodySmall, _typographyModule.default[color], className),
|
|
377
446
|
ref: ref
|
|
@@ -384,7 +453,7 @@ const BodySmall = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
|
384
453
|
}) : children);
|
|
385
454
|
});
|
|
386
455
|
exports.BodySmall = BodySmall;
|
|
387
|
-
const
|
|
456
|
+
const BodyLargeBold = /*#__PURE__*/React.forwardRef((_ref20, ref) => {
|
|
388
457
|
let {
|
|
389
458
|
color = _typography.TEXT_COLORS.primary,
|
|
390
459
|
children,
|
|
@@ -394,7 +463,76 @@ const FormLabelMedium = /*#__PURE__*/React.forwardRef((_ref17, ref) => {
|
|
|
394
463
|
caseSensitiveHighlighting,
|
|
395
464
|
highlightWithBackground,
|
|
396
465
|
...props
|
|
397
|
-
} =
|
|
466
|
+
} = _ref20;
|
|
467
|
+
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
468
|
+
className: (0, _classify.default)(_typographyModule.default.bodyLarge, _typographyModule.default.bold, _typographyModule.default[color], className),
|
|
469
|
+
ref: ref
|
|
470
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
471
|
+
text: children,
|
|
472
|
+
highlight: highlightString,
|
|
473
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
474
|
+
highlightClassName: highlightedTextClassName,
|
|
475
|
+
highlightWithBackground: highlightWithBackground
|
|
476
|
+
}) : children);
|
|
477
|
+
});
|
|
478
|
+
exports.BodyLargeBold = BodyLargeBold;
|
|
479
|
+
const BodyMediumBold = /*#__PURE__*/React.forwardRef((_ref21, ref) => {
|
|
480
|
+
let {
|
|
481
|
+
color = _typography.TEXT_COLORS.primary,
|
|
482
|
+
children,
|
|
483
|
+
className,
|
|
484
|
+
highlightedTextClassName,
|
|
485
|
+
highlightString,
|
|
486
|
+
caseSensitiveHighlighting,
|
|
487
|
+
highlightWithBackground,
|
|
488
|
+
...props
|
|
489
|
+
} = _ref21;
|
|
490
|
+
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
491
|
+
className: (0, _classify.default)(_typographyModule.default.bodyMedium, _typographyModule.default.bold, _typographyModule.default[color], className),
|
|
492
|
+
ref: ref
|
|
493
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
494
|
+
text: children,
|
|
495
|
+
highlight: highlightString,
|
|
496
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
497
|
+
highlightClassName: highlightedTextClassName,
|
|
498
|
+
highlightWithBackground: highlightWithBackground
|
|
499
|
+
}) : children);
|
|
500
|
+
});
|
|
501
|
+
exports.BodyMediumBold = BodyMediumBold;
|
|
502
|
+
const BodySmallBold = /*#__PURE__*/React.forwardRef((_ref22, ref) => {
|
|
503
|
+
let {
|
|
504
|
+
color = _typography.TEXT_COLORS.primary,
|
|
505
|
+
children,
|
|
506
|
+
className,
|
|
507
|
+
highlightedTextClassName,
|
|
508
|
+
highlightString,
|
|
509
|
+
caseSensitiveHighlighting,
|
|
510
|
+
highlightWithBackground,
|
|
511
|
+
...props
|
|
512
|
+
} = _ref22;
|
|
513
|
+
return /*#__PURE__*/React.createElement("p", _extends({}, props, {
|
|
514
|
+
className: (0, _classify.default)(_typographyModule.default.bodySmall, _typographyModule.default.bold, _typographyModule.default[color], className),
|
|
515
|
+
ref: ref
|
|
516
|
+
}), !!highlightString?.length && typeof children === 'string' ? /*#__PURE__*/React.createElement(HighlightText, {
|
|
517
|
+
text: children,
|
|
518
|
+
highlight: highlightString,
|
|
519
|
+
caseSensitiveHighlighting: caseSensitiveHighlighting,
|
|
520
|
+
highlightClassName: highlightedTextClassName,
|
|
521
|
+
highlightWithBackground: highlightWithBackground
|
|
522
|
+
}) : children);
|
|
523
|
+
});
|
|
524
|
+
exports.BodySmallBold = BodySmallBold;
|
|
525
|
+
const FormLabelMedium = /*#__PURE__*/React.forwardRef((_ref23, ref) => {
|
|
526
|
+
let {
|
|
527
|
+
color = _typography.TEXT_COLORS.primary,
|
|
528
|
+
children,
|
|
529
|
+
className,
|
|
530
|
+
highlightedTextClassName,
|
|
531
|
+
highlightString,
|
|
532
|
+
caseSensitiveHighlighting,
|
|
533
|
+
highlightWithBackground,
|
|
534
|
+
...props
|
|
535
|
+
} = _ref23;
|
|
398
536
|
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
399
537
|
className: (0, _classify.default)(_typographyModule.default.formLabelMedium, _typographyModule.default[color], className),
|
|
400
538
|
ref: ref
|
|
@@ -407,7 +545,7 @@ const FormLabelMedium = /*#__PURE__*/React.forwardRef((_ref17, ref) => {
|
|
|
407
545
|
}) : children);
|
|
408
546
|
});
|
|
409
547
|
exports.FormLabelMedium = FormLabelMedium;
|
|
410
|
-
const FormLabelSmall = /*#__PURE__*/React.forwardRef((
|
|
548
|
+
const FormLabelSmall = /*#__PURE__*/React.forwardRef((_ref24, ref) => {
|
|
411
549
|
let {
|
|
412
550
|
color = _typography.TEXT_COLORS.primary,
|
|
413
551
|
children,
|
|
@@ -417,7 +555,7 @@ const FormLabelSmall = /*#__PURE__*/React.forwardRef((_ref18, ref) => {
|
|
|
417
555
|
caseSensitiveHighlighting,
|
|
418
556
|
highlightWithBackground,
|
|
419
557
|
...props
|
|
420
|
-
} =
|
|
558
|
+
} = _ref24;
|
|
421
559
|
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
422
560
|
className: (0, _classify.default)(_typographyModule.default.formLabelSmall, _typographyModule.default[color], className),
|
|
423
561
|
ref: ref
|
|
@@ -454,6 +454,132 @@ export const ButtonTextExtraSmall: React$AbstractComponent<
|
|
|
454
454
|
),
|
|
455
455
|
);
|
|
456
456
|
|
|
457
|
+
export const ButtonTextMediumUnderline: React$AbstractComponent<
|
|
458
|
+
TextProps,
|
|
459
|
+
HTMLSpanElement,
|
|
460
|
+
> = React.forwardRef<TextProps, HTMLSpanElement>(
|
|
461
|
+
(
|
|
462
|
+
{
|
|
463
|
+
color = TEXT_COLORS.primary,
|
|
464
|
+
children,
|
|
465
|
+
className,
|
|
466
|
+
highlightedTextClassName,
|
|
467
|
+
highlightString,
|
|
468
|
+
caseSensitiveHighlighting,
|
|
469
|
+
highlightWithBackground,
|
|
470
|
+
...props
|
|
471
|
+
}: TextProps,
|
|
472
|
+
ref,
|
|
473
|
+
): React.Node => (
|
|
474
|
+
<span
|
|
475
|
+
{...props}
|
|
476
|
+
className={classify(
|
|
477
|
+
css.buttonTextMedium,
|
|
478
|
+
css.underline,
|
|
479
|
+
css[color],
|
|
480
|
+
className,
|
|
481
|
+
)}
|
|
482
|
+
ref={ref}
|
|
483
|
+
>
|
|
484
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
485
|
+
<HighlightText
|
|
486
|
+
text={children}
|
|
487
|
+
highlight={highlightString}
|
|
488
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
489
|
+
highlightClassName={highlightedTextClassName}
|
|
490
|
+
highlightWithBackground={highlightWithBackground}
|
|
491
|
+
/>
|
|
492
|
+
) : (
|
|
493
|
+
children
|
|
494
|
+
)}
|
|
495
|
+
</span>
|
|
496
|
+
),
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
export const ButtonTextSmallUnderline: React$AbstractComponent<
|
|
500
|
+
TextProps,
|
|
501
|
+
HTMLSpanElement,
|
|
502
|
+
> = React.forwardRef<TextProps, HTMLSpanElement>(
|
|
503
|
+
(
|
|
504
|
+
{
|
|
505
|
+
color = TEXT_COLORS.primary,
|
|
506
|
+
children,
|
|
507
|
+
className,
|
|
508
|
+
highlightedTextClassName,
|
|
509
|
+
highlightString,
|
|
510
|
+
caseSensitiveHighlighting,
|
|
511
|
+
highlightWithBackground,
|
|
512
|
+
...props
|
|
513
|
+
}: TextProps,
|
|
514
|
+
ref,
|
|
515
|
+
): React.Node => (
|
|
516
|
+
<span
|
|
517
|
+
{...props}
|
|
518
|
+
className={classify(
|
|
519
|
+
css.buttonTextSmall,
|
|
520
|
+
css.underline,
|
|
521
|
+
css[color],
|
|
522
|
+
className,
|
|
523
|
+
)}
|
|
524
|
+
ref={ref}
|
|
525
|
+
>
|
|
526
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
527
|
+
<HighlightText
|
|
528
|
+
text={children}
|
|
529
|
+
highlight={highlightString}
|
|
530
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
531
|
+
highlightClassName={highlightedTextClassName}
|
|
532
|
+
highlightWithBackground={highlightWithBackground}
|
|
533
|
+
/>
|
|
534
|
+
) : (
|
|
535
|
+
children
|
|
536
|
+
)}
|
|
537
|
+
</span>
|
|
538
|
+
),
|
|
539
|
+
);
|
|
540
|
+
|
|
541
|
+
export const ButtonTextExtraSmallUnderline: React$AbstractComponent<
|
|
542
|
+
TextProps,
|
|
543
|
+
HTMLSpanElement,
|
|
544
|
+
> = React.forwardRef<TextProps, HTMLSpanElement>(
|
|
545
|
+
(
|
|
546
|
+
{
|
|
547
|
+
color = TEXT_COLORS.primary,
|
|
548
|
+
children,
|
|
549
|
+
className,
|
|
550
|
+
highlightedTextClassName,
|
|
551
|
+
highlightString,
|
|
552
|
+
caseSensitiveHighlighting,
|
|
553
|
+
highlightWithBackground,
|
|
554
|
+
...props
|
|
555
|
+
}: TextProps,
|
|
556
|
+
ref,
|
|
557
|
+
): React.Node => (
|
|
558
|
+
<span
|
|
559
|
+
{...props}
|
|
560
|
+
className={classify(
|
|
561
|
+
css.buttonTextExtraSmall,
|
|
562
|
+
css.underline,
|
|
563
|
+
css[color],
|
|
564
|
+
className,
|
|
565
|
+
)}
|
|
566
|
+
ref={ref}
|
|
567
|
+
>
|
|
568
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
569
|
+
<HighlightText
|
|
570
|
+
text={children}
|
|
571
|
+
highlight={highlightString}
|
|
572
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
573
|
+
highlightClassName={highlightedTextClassName}
|
|
574
|
+
highlightWithBackground={highlightWithBackground}
|
|
575
|
+
/>
|
|
576
|
+
) : (
|
|
577
|
+
children
|
|
578
|
+
)}
|
|
579
|
+
</span>
|
|
580
|
+
),
|
|
581
|
+
);
|
|
582
|
+
|
|
457
583
|
export const FormInputMedium: React$AbstractComponent<
|
|
458
584
|
TextProps,
|
|
459
585
|
HTMLParagraphElement,
|
|
@@ -639,6 +765,117 @@ export const BodySmall: React$AbstractComponent<
|
|
|
639
765
|
),
|
|
640
766
|
);
|
|
641
767
|
|
|
768
|
+
export const BodyLargeBold: React$AbstractComponent<
|
|
769
|
+
TextProps,
|
|
770
|
+
HTMLParagraphElement,
|
|
771
|
+
> = React.forwardRef<TextProps, HTMLParagraphElement>(
|
|
772
|
+
(
|
|
773
|
+
{
|
|
774
|
+
color = TEXT_COLORS.primary,
|
|
775
|
+
children,
|
|
776
|
+
className,
|
|
777
|
+
highlightedTextClassName,
|
|
778
|
+
highlightString,
|
|
779
|
+
caseSensitiveHighlighting,
|
|
780
|
+
highlightWithBackground,
|
|
781
|
+
...props
|
|
782
|
+
}: TextProps,
|
|
783
|
+
ref,
|
|
784
|
+
): React.Node => (
|
|
785
|
+
<p
|
|
786
|
+
{...props}
|
|
787
|
+
className={classify(css.bodyLarge, css.bold, css[color], className)}
|
|
788
|
+
ref={ref}
|
|
789
|
+
>
|
|
790
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
791
|
+
<HighlightText
|
|
792
|
+
text={children}
|
|
793
|
+
highlight={highlightString}
|
|
794
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
795
|
+
highlightClassName={highlightedTextClassName}
|
|
796
|
+
highlightWithBackground={highlightWithBackground}
|
|
797
|
+
/>
|
|
798
|
+
) : (
|
|
799
|
+
children
|
|
800
|
+
)}
|
|
801
|
+
</p>
|
|
802
|
+
),
|
|
803
|
+
);
|
|
804
|
+
|
|
805
|
+
export const BodyMediumBold: React$AbstractComponent<
|
|
806
|
+
TextProps,
|
|
807
|
+
HTMLParagraphElement,
|
|
808
|
+
> = React.forwardRef<TextProps, HTMLParagraphElement>(
|
|
809
|
+
(
|
|
810
|
+
{
|
|
811
|
+
color = TEXT_COLORS.primary,
|
|
812
|
+
children,
|
|
813
|
+
className,
|
|
814
|
+
highlightedTextClassName,
|
|
815
|
+
highlightString,
|
|
816
|
+
caseSensitiveHighlighting,
|
|
817
|
+
highlightWithBackground,
|
|
818
|
+
...props
|
|
819
|
+
}: TextProps,
|
|
820
|
+
ref,
|
|
821
|
+
): React.Node => (
|
|
822
|
+
<p
|
|
823
|
+
{...props}
|
|
824
|
+
className={classify(css.bodyMedium, css.bold, css[color], className)}
|
|
825
|
+
ref={ref}
|
|
826
|
+
>
|
|
827
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
828
|
+
<HighlightText
|
|
829
|
+
text={children}
|
|
830
|
+
highlight={highlightString}
|
|
831
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
832
|
+
highlightClassName={highlightedTextClassName}
|
|
833
|
+
highlightWithBackground={highlightWithBackground}
|
|
834
|
+
/>
|
|
835
|
+
) : (
|
|
836
|
+
children
|
|
837
|
+
)}
|
|
838
|
+
</p>
|
|
839
|
+
),
|
|
840
|
+
);
|
|
841
|
+
|
|
842
|
+
export const BodySmallBold: React$AbstractComponent<
|
|
843
|
+
TextProps,
|
|
844
|
+
HTMLParagraphElement,
|
|
845
|
+
> = React.forwardRef<TextProps, HTMLParagraphElement>(
|
|
846
|
+
(
|
|
847
|
+
{
|
|
848
|
+
color = TEXT_COLORS.primary,
|
|
849
|
+
children,
|
|
850
|
+
className,
|
|
851
|
+
highlightedTextClassName,
|
|
852
|
+
highlightString,
|
|
853
|
+
caseSensitiveHighlighting,
|
|
854
|
+
highlightWithBackground,
|
|
855
|
+
...props
|
|
856
|
+
}: TextProps,
|
|
857
|
+
ref,
|
|
858
|
+
): React.Node => (
|
|
859
|
+
<p
|
|
860
|
+
{...props}
|
|
861
|
+
className={classify(css.bodySmall, css.bold, css[color], className)}
|
|
862
|
+
ref={ref}
|
|
863
|
+
>
|
|
864
|
+
{!!highlightString?.length && typeof children === 'string' ? (
|
|
865
|
+
<HighlightText
|
|
866
|
+
text={children}
|
|
867
|
+
highlight={highlightString}
|
|
868
|
+
caseSensitiveHighlighting={caseSensitiveHighlighting}
|
|
869
|
+
highlightClassName={highlightedTextClassName}
|
|
870
|
+
highlightWithBackground={highlightWithBackground}
|
|
871
|
+
/>
|
|
872
|
+
) : (
|
|
873
|
+
children
|
|
874
|
+
)}
|
|
875
|
+
</p>
|
|
876
|
+
),
|
|
877
|
+
);
|
|
878
|
+
|
|
642
879
|
export const FormLabelMedium: React$AbstractComponent<
|
|
643
880
|
TextProps,
|
|
644
881
|
HTMLSpanElement,
|
|
@@ -9,36 +9,72 @@ Object.defineProperty(exports, "BodyLarge", {
|
|
|
9
9
|
return _Text.BodyLarge;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "BodyLargeBold", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Text.BodyLargeBold;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "BodyMedium", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function () {
|
|
15
21
|
return _Text.BodyMedium;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "BodyMediumBold", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _Text.BodyMediumBold;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
Object.defineProperty(exports, "BodySmall", {
|
|
19
31
|
enumerable: true,
|
|
20
32
|
get: function () {
|
|
21
33
|
return _Text.BodySmall;
|
|
22
34
|
}
|
|
23
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "BodySmallBold", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _Text.BodySmallBold;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
24
42
|
Object.defineProperty(exports, "ButtonTextExtraSmall", {
|
|
25
43
|
enumerable: true,
|
|
26
44
|
get: function () {
|
|
27
45
|
return _Text.ButtonTextExtraSmall;
|
|
28
46
|
}
|
|
29
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "ButtonTextExtraSmallUnderline", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _Text.ButtonTextExtraSmallUnderline;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
30
54
|
Object.defineProperty(exports, "ButtonTextMedium", {
|
|
31
55
|
enumerable: true,
|
|
32
56
|
get: function () {
|
|
33
57
|
return _Text.ButtonTextMedium;
|
|
34
58
|
}
|
|
35
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "ButtonTextMediumUnderline", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _Text.ButtonTextMediumUnderline;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
36
66
|
Object.defineProperty(exports, "ButtonTextSmall", {
|
|
37
67
|
enumerable: true,
|
|
38
68
|
get: function () {
|
|
39
69
|
return _Text.ButtonTextSmall;
|
|
40
70
|
}
|
|
41
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "ButtonTextSmallUnderline", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _Text.ButtonTextSmallUnderline;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
42
78
|
Object.defineProperty(exports, "FormInputMedium", {
|
|
43
79
|
enumerable: true,
|
|
44
80
|
get: function () {
|
|
@@ -4,11 +4,17 @@ export {TEXT_COLORS} from '../../types/typography';
|
|
|
4
4
|
export type {TextProps} from './Text';
|
|
5
5
|
export {
|
|
6
6
|
BodyLarge,
|
|
7
|
+
BodyLargeBold,
|
|
7
8
|
BodyMedium,
|
|
9
|
+
BodyMediumBold,
|
|
8
10
|
BodySmall,
|
|
11
|
+
BodySmallBold,
|
|
9
12
|
ButtonTextExtraSmall,
|
|
13
|
+
ButtonTextExtraSmallUnderline,
|
|
10
14
|
ButtonTextMedium,
|
|
15
|
+
ButtonTextMediumUnderline,
|
|
11
16
|
ButtonTextSmall,
|
|
17
|
+
ButtonTextSmallUnderline,
|
|
12
18
|
FormInputMedium,
|
|
13
19
|
FormInputSmall,
|
|
14
20
|
FormLabelMedium,
|
|
@@ -22,6 +22,7 @@ const Toggle = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
22
22
|
focused,
|
|
23
23
|
onChange,
|
|
24
24
|
ariaLabel,
|
|
25
|
+
labelPosition = 'right',
|
|
25
26
|
...props
|
|
26
27
|
} = _ref;
|
|
27
28
|
const toggleInput = /*#__PURE__*/React.createRef();
|
|
@@ -48,7 +49,9 @@ const Toggle = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
48
49
|
[_ToggleModule.default.disabled]: disabled
|
|
49
50
|
}, classNames?.wrapper),
|
|
50
51
|
onClick: onWrapClickHandler
|
|
51
|
-
}, /*#__PURE__*/React.createElement("
|
|
52
|
+
}, labelPosition === 'left' && React.Children.count(children) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: (0, _classify.default)(_ToggleModule.default.toggleLabel, classNames?.label)
|
|
54
|
+
}, children), /*#__PURE__*/React.createElement("span", {
|
|
52
55
|
className: _ToggleModule.default.toggleWrap
|
|
53
56
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
54
57
|
type: "checkbox",
|
|
@@ -63,7 +66,7 @@ const Toggle = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
63
66
|
className: (0, _classify.default)(_ToggleModule.default.toggle, {
|
|
64
67
|
[_ToggleModule.default.disabledButton]: disabled
|
|
65
68
|
})
|
|
66
|
-
})), React.Children.count(children) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
})), labelPosition === 'right' && React.Children.count(children) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
67
70
|
className: (0, _classify.default)(_ToggleModule.default.toggleLabel, classNames?.label)
|
|
68
71
|
}, children));
|
|
69
72
|
});
|
|
@@ -25,6 +25,7 @@ export type ToggleProps = {
|
|
|
25
25
|
focused?: boolean,
|
|
26
26
|
value?: string,
|
|
27
27
|
ariaLabel?: string,
|
|
28
|
+
labelPosition?: 'left' | 'right',
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export const Toggle: React$AbstractComponent<ToggleProps, HTMLInputElement> =
|
|
@@ -40,6 +41,7 @@ export const Toggle: React$AbstractComponent<ToggleProps, HTMLInputElement> =
|
|
|
40
41
|
focused,
|
|
41
42
|
onChange,
|
|
42
43
|
ariaLabel,
|
|
44
|
+
labelPosition = 'right',
|
|
43
45
|
...props
|
|
44
46
|
}: ToggleProps,
|
|
45
47
|
forwardRef,
|
|
@@ -77,6 +79,11 @@ export const Toggle: React$AbstractComponent<ToggleProps, HTMLInputElement> =
|
|
|
77
79
|
)}
|
|
78
80
|
onClick={onWrapClickHandler}
|
|
79
81
|
>
|
|
82
|
+
{labelPosition === 'left' && React.Children.count(children) > 0 && (
|
|
83
|
+
<div className={classify(css.toggleLabel, classNames?.label)}>
|
|
84
|
+
{children}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
80
87
|
<span className={css.toggleWrap}>
|
|
81
88
|
<input
|
|
82
89
|
type="checkbox"
|
|
@@ -95,7 +102,7 @@ export const Toggle: React$AbstractComponent<ToggleProps, HTMLInputElement> =
|
|
|
95
102
|
})}
|
|
96
103
|
/>
|
|
97
104
|
</span>
|
|
98
|
-
{React.Children.count(children) > 0 && (
|
|
105
|
+
{labelPosition === 'right' && React.Children.count(children) > 0 && (
|
|
99
106
|
<div className={classify(css.toggleLabel, classNames?.label)}>
|
|
100
107
|
{children}
|
|
101
108
|
</div>
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
fontLineHeight100,
|
|
31
31
|
fontLineHeight120,
|
|
32
32
|
fontLineHeight125,
|
|
33
|
+
fontLineHeight130,
|
|
33
34
|
fontLineHeight140,
|
|
34
35
|
fontLineHeight150,
|
|
35
36
|
fontLineHeight170,
|
|
@@ -61,6 +62,10 @@
|
|
|
61
62
|
align-items: center;
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
.underline {
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
}
|
|
68
|
+
|
|
64
69
|
.jumboMedium {
|
|
65
70
|
composes: baseType;
|
|
66
71
|
font-size: fontSize46;
|
|
@@ -154,7 +159,7 @@
|
|
|
154
159
|
composes: baseType;
|
|
155
160
|
font-size: fontSize12;
|
|
156
161
|
font-weight: fontWeightBook;
|
|
157
|
-
line-height:
|
|
162
|
+
line-height: fontLineHeight130;
|
|
158
163
|
letter-spacing: fontLetterSpacing4;
|
|
159
164
|
}
|
|
160
165
|
|
|
@@ -170,6 +175,10 @@
|
|
|
170
175
|
line-height: fontLineHeight140;
|
|
171
176
|
}
|
|
172
177
|
|
|
178
|
+
.bold {
|
|
179
|
+
font-weight: fontWeightMedium;
|
|
180
|
+
}
|
|
181
|
+
|
|
173
182
|
.primary {
|
|
174
183
|
color: colorTextPrimary;
|
|
175
184
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.areArraysEqual = areArraysEqual;
|
|
7
|
+
|
|
8
|
+
function areArraysEqual(array1, array2) {
|
|
9
|
+
let itemComparer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (a, b) => a === b;
|
|
10
|
+
return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
type ItemComparer<Item> = (a: Item, b: Item) => boolean;
|
|
4
|
+
|
|
5
|
+
export function areArraysEqual<Item>(
|
|
6
|
+
array1: Item[],
|
|
7
|
+
array2: Item[],
|
|
8
|
+
itemComparer: ItemComparer<Item> = (a, b) => a === b,
|
|
9
|
+
): boolean {
|
|
10
|
+
return (
|
|
11
|
+
array1.length === array2.length &&
|
|
12
|
+
array1.every((value, index) => itemComparer(value, array2[index]))
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _areArraysEqual = require("./are-arrays-equal");
|
|
7
|
+
Object.keys(_areArraysEqual).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _areArraysEqual[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _areArraysEqual[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
package/lib/utils/index.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _array = require("./array");
|
|
7
|
+
Object.keys(_array).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _array[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _array[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
6
17
|
var _classify = require("./classify");
|
|
7
18
|
Object.keys(_classify).forEach(function (key) {
|
|
8
19
|
if (key === "default" || key === "__esModule") return;
|
package/lib/utils/index.js.flow
CHANGED