@janiscommerce/ui-web 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('styled-components'), require('react-dom')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'react', 'styled-components', 'react-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.main = {}, global.React, global.styled$c, global.require$$1));
5
- })(this, (function (exports, React, styled$c, require$$1) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.main = {}, global.React, global.styled$f, global.require$$1));
5
+ })(this, (function (exports, React, styled$f, require$$1) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
9
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled$c);
10
+ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled$f);
11
11
  var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
12
12
 
13
13
  function _classCallCheck$2(instance, Constructor) {
@@ -204,10 +204,22 @@
204
204
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
205
205
  }
206
206
 
207
+ function _toConsumableArray(arr) {
208
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
209
+ }
210
+
211
+ function _arrayWithoutHoles(arr) {
212
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
213
+ }
214
+
207
215
  function _arrayWithHoles(arr) {
208
216
  if (Array.isArray(arr)) return arr;
209
217
  }
210
218
 
219
+ function _iterableToArray(iter) {
220
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
221
+ }
222
+
211
223
  function _iterableToArrayLimit(arr, i) {
212
224
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
213
225
 
@@ -255,6 +267,10 @@
255
267
  return arr2;
256
268
  }
257
269
 
270
+ function _nonIterableSpread() {
271
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
272
+ }
273
+
258
274
  function _nonIterableRest() {
259
275
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
260
276
  }
@@ -353,6 +369,522 @@
353
369
 
354
370
  var PropTypes = propTypes.exports;
355
371
 
372
+ /**
373
+ * Copy string to clipboard
374
+ * @param {string} str
375
+ */
376
+ /**
377
+ * Creates a debounced function that delays invoking func until after wait milliseconds have
378
+ * elapsed since the last time the debounced function was invoked.
379
+ * @param {function} fn - The function to debounce.
380
+ * @param {number} wait - The number of milliseconds to delay.
381
+ * @returns {function} The new debounced function.
382
+ */
383
+
384
+ function debounce(fn, wait) {
385
+ var timerID;
386
+
387
+ function debounced() {
388
+ var context = this;
389
+ clearTimeout(timerID);
390
+
391
+ for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
392
+ params[_key] = arguments[_key];
393
+ }
394
+
395
+ timerID = setTimeout.apply(void 0, [fn.bind(context), wait].concat(params));
396
+ }
397
+
398
+ debounced.cancel = function cancel() {
399
+ clearTimeout(timerID);
400
+ };
401
+
402
+ return debounced;
403
+ }
404
+
405
+ var breakpoints = {
406
+ values: {
407
+ xs: 320,
408
+ sm: 640,
409
+ md: 962,
410
+ lg: 1024,
411
+ xl: 1280
412
+ }
413
+ };
414
+
415
+ var getMin = function getMin(key) {
416
+ return "@media screen and (min-width: ".concat(breakpoints.values[key], "px)");
417
+ };
418
+
419
+ var getMax = function getMax(key) {
420
+ return "@media screen and (max-width: ".concat(breakpoints.values[key] - 1, "px)");
421
+ };
422
+
423
+ var devices = {
424
+ mobile: getMax('sm'),
425
+ tablet: getMax('md'),
426
+ tabletLg: getMax('lg'),
427
+ onlyDesktop: getMin('lg'),
428
+ desktopSm: getMax('xl'),
429
+ desktopLg: getMin('xl')
430
+ };
431
+ var mediaBreaks = {
432
+ mobile: function mobile() {
433
+ return styled$f.css(["", "{", "}"], devices.mobile, styled$f.css.apply(void 0, arguments));
434
+ },
435
+ tablet: function tablet() {
436
+ return styled$f.css(["", "{", "}"], devices.tablet, styled$f.css.apply(void 0, arguments));
437
+ },
438
+ tabletLg: function tabletLg() {
439
+ return styled$f.css(["", "{", "}"], devices.tabletLg, styled$f.css.apply(void 0, arguments));
440
+ },
441
+ onlyDesktop: function onlyDesktop() {
442
+ return styled$f.css(["", "{", "}"], devices.onlyDesktop, styled$f.css.apply(void 0, arguments));
443
+ },
444
+ desktopSm: function desktopSm() {
445
+ return styled$f.css(["", "{", "}"], devices.desktopSm, styled$f.css.apply(void 0, arguments));
446
+ },
447
+ desktopLg: function desktopLg() {
448
+ return styled$f.css(["", "{", "}"], devices.desktopLg, styled$f.css.apply(void 0, arguments));
449
+ },
450
+ onlyPrint: function onlyPrint() {
451
+ return styled$f.css(["@media print{", "}"], styled$f.css.apply(void 0, arguments));
452
+ }
453
+ };
454
+
455
+ /** Checks the current view width against different device size settings.
456
+ * Import it when needed, and get the most appropiate condition.
457
+ * (In this project, tabletLg equals the "onlyMobile" condition.)
458
+ * @returns {object} an object with the current width value and boolean values for each device.
459
+ */
460
+
461
+ var useDevices = function useDevices() {
462
+ var getWindowWidth = function getWindowWidth() {
463
+ return window.innerWidth;
464
+ };
465
+
466
+ var checkDeviceMax = function checkDeviceMax(device) {
467
+ return getWindowWidth() < breakpoints.values[device];
468
+ };
469
+
470
+ var checkDeviceMin = function checkDeviceMin(device) {
471
+ return getWindowWidth() >= breakpoints.values[device];
472
+ };
473
+
474
+ var initialWidth = getWindowWidth();
475
+ var initialMobile = checkDeviceMax('sm');
476
+ var initialTablet = checkDeviceMax('md');
477
+ var initialTabletLg = checkDeviceMax('lg');
478
+ var initialOnlyDesktop = checkDeviceMin('lg');
479
+ var initialDesktopSm = checkDeviceMax('xl');
480
+ var initialDesktopLg = checkDeviceMin('xl');
481
+
482
+ var _useState = React.useState(initialWidth),
483
+ _useState2 = _slicedToArray(_useState, 2),
484
+ width = _useState2[0],
485
+ setWidth = _useState2[1];
486
+
487
+ var _useState3 = React.useState(initialMobile),
488
+ _useState4 = _slicedToArray(_useState3, 2),
489
+ mobile = _useState4[0],
490
+ setMobile = _useState4[1];
491
+
492
+ var _useState5 = React.useState(initialTablet),
493
+ _useState6 = _slicedToArray(_useState5, 2),
494
+ tablet = _useState6[0],
495
+ setTablet = _useState6[1];
496
+
497
+ var _useState7 = React.useState(initialTabletLg),
498
+ _useState8 = _slicedToArray(_useState7, 2),
499
+ tabletLg = _useState8[0],
500
+ setTabletLg = _useState8[1];
501
+
502
+ var _useState9 = React.useState(initialOnlyDesktop),
503
+ _useState10 = _slicedToArray(_useState9, 2),
504
+ onlyDesktop = _useState10[0],
505
+ setOnlyDesktop = _useState10[1];
506
+
507
+ var _useState11 = React.useState(initialDesktopSm),
508
+ _useState12 = _slicedToArray(_useState11, 2),
509
+ desktopSm = _useState12[0],
510
+ setDesktopSm = _useState12[1];
511
+
512
+ var _useState13 = React.useState(initialDesktopLg),
513
+ _useState14 = _slicedToArray(_useState13, 2),
514
+ desktopLg = _useState14[0],
515
+ setDesktopLg = _useState14[1];
516
+
517
+ var handleChanges = debounce(function () {
518
+ var windowWidth = getWindowWidth();
519
+ var isMobile = checkDeviceMax('sm');
520
+ var isTablet = checkDeviceMax('md');
521
+ var isTabletLg = checkDeviceMax('lg');
522
+ var isOnlyDesktop = checkDeviceMin('lg');
523
+ var isDesktopSm = checkDeviceMax('xl');
524
+ var isDesktopLg = checkDeviceMin('xl');
525
+ setWidth(windowWidth);
526
+ setMobile(isMobile);
527
+ setTablet(isTablet);
528
+ setTabletLg(isTabletLg);
529
+ setOnlyDesktop(isOnlyDesktop);
530
+ setDesktopSm(isDesktopSm);
531
+ setDesktopLg(isDesktopLg);
532
+ }, 100);
533
+ React.useEffect(function () {
534
+ window.addEventListener('resize', handleChanges);
535
+ return function () {
536
+ return window.removeEventListener('resize', handleChanges);
537
+ };
538
+ });
539
+ return {
540
+ width: width,
541
+ mobile: mobile,
542
+ tablet: tablet,
543
+ tabletLg: tabletLg,
544
+ onlyDesktop: onlyDesktop,
545
+ desktopSm: desktopSm,
546
+ desktopLg: desktopLg
547
+ };
548
+ };
549
+
550
+ var viewsPalette = {
551
+ black: '#2F2F2F',
552
+ blackHover: '#585858',
553
+ blackPressed: '#16232D',
554
+ blue: '#2979FF',
555
+ blueHover: '#5393FF',
556
+ bluePressed: '#1759FF',
557
+ blueDisabled: '#93BBFF',
558
+ darkGrey: '#939598',
559
+ darkGreyHover: '#A8AAAC',
560
+ darkGreyPressed: '#747679',
561
+ fizzGreen: '#1DB779',
562
+ fizzGreenHover: '#4AC593',
563
+ fizzGreenPressed: '#109D59',
564
+ green: '#74C655',
565
+ greenHover: '#8FD177',
566
+ greenPressed: '#54B039',
567
+ grey: '#D5D7DB',
568
+ greyHover: '#DDDFE2',
569
+ greyPressed: '#C4C6CC',
570
+ lightBlue: '#08C4C4',
571
+ lightBlueHover: '#39CFCF',
572
+ lightBluePressed: '#04ADAD',
573
+ lightGrey: '#E8EAF6',
574
+ lightGreyHover: '#F4F5FB',
575
+ lightGreyPressed: '#D0D3E3',
576
+ orange: '#FF8D10',
577
+ orangeHover: '#FFA33F',
578
+ orangePressed: '#FF6E08',
579
+ red: '#F13B70',
580
+ redHover: '#F3628C',
581
+ redPressed: '#EB2450',
582
+ statusRed: '#FF4343',
583
+ statusRedHover: '#FF6868',
584
+ statusRedPressed: '#FF2A2A',
585
+ white: '#FFF',
586
+ yellow: '#FFCE17',
587
+ yellowHover: '#FFD745',
588
+ yellowPressed: '#FFBA0C',
589
+ transparentWhite: 'rgba(256, 256, 256, 0.5)'
590
+ };
591
+
592
+ /**
593
+ * @name getColor
594
+ * @private
595
+ * @module palette/utils
596
+ * @description return color from palette
597
+ * @param {string} color
598
+ * @returns {string} color
599
+ * @example getColor('blue') // #2979FF
600
+ */
601
+
602
+ var getColor = function getColor(color) {
603
+ return viewsPalette[color] || color;
604
+ };
605
+
606
+ var timingFunctions$1 = {
607
+ standard: 'cubic-bezier(0.4, 0, 0.2, 1)',
608
+ decelerate: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
609
+ accelerate: 'cubic-bezier(0.4, 0.0, 1, 1)'
610
+ };
611
+ /**
612
+ * @name getImageMeasurements
613
+ * @description return color from palette
614
+ * @param {string} size
615
+ * @param {boolean} isDesktop
616
+ * @returns {string}
617
+ * @example getImageMeasurements('large', true) // '36px'
618
+ */
619
+
620
+ var getImageMeasurements = function getImageMeasurements(size, isDesktop) {
621
+ if (!Number.isNaN(Number(size))) return "".concat(size, "px");
622
+ var imageSizes = {
623
+ small: '24px',
624
+ medium: '32px',
625
+ large: '36px',
626
+ extralarge: isDesktop ? '140px' : '100px',
627
+ auto: 'auto'
628
+ };
629
+ return imageSizes[size] || imageSizes.small;
630
+ };
631
+
632
+ var styled$e = {
633
+ SkeletonContainer: styled__default["default"].div.withConfig({
634
+ displayName: "styles__SkeletonContainer",
635
+ componentId: "sc-1xnupv9-0"
636
+ })(["border-radius:", ";height:", ";width:", ";background-color:", ";animation:pulse 1.5s ease-in-out infinite;@keyframes pulse{0%{opacity:0.4;}50%{opacity:0.8;}100%{opacity:0.4;}}"], function (_ref) {
637
+ var circle = _ref.circle;
638
+ return circle ? ' 50%' : '3px';
639
+ }, function (_ref2) {
640
+ var height = _ref2.height;
641
+ return height;
642
+ }, function (_ref3) {
643
+ var width = _ref3.width;
644
+ return width;
645
+ }, function (_ref4) {
646
+ var backgroundColor = _ref4.backgroundColor;
647
+ return backgroundColor || viewsPalette.lightGrey;
648
+ })
649
+ };
650
+
651
+ var Skeleton = function Skeleton(_ref) {
652
+ var circle = _ref.circle,
653
+ width = _ref.width,
654
+ height = _ref.height,
655
+ count = _ref.count,
656
+ backgroundColor = _ref.backgroundColor;
657
+ var currentWidth = !Number.isNaN(Number(width)) ? "".concat(width, "px") : width;
658
+ var currentHeight = !Number.isNaN(Number(height)) ? "".concat(height, "px") : height;
659
+ var skeletons = Array.from({
660
+ length: count
661
+ }, function (_, index) {
662
+ return /*#__PURE__*/React__default["default"].createElement(styled$e.SkeletonContainer, {
663
+ key: index,
664
+ width: currentWidth,
665
+ height: currentHeight,
666
+ circle: circle,
667
+ backgroundColor: backgroundColor
668
+ });
669
+ });
670
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, skeletons);
671
+ };
672
+
673
+ Skeleton.defaultProps = {
674
+ circle: false,
675
+ count: 1
676
+ };
677
+
678
+ var styled$d = {
679
+ Image: styled__default["default"].img.withConfig({
680
+ displayName: "styles__Image",
681
+ componentId: "sc-uljfj3-0"
682
+ })(["width:", ";height:", ";display:", ";border-radius:", ";"], function (_ref) {
683
+ var size = _ref.size;
684
+ return size;
685
+ }, function (_ref2) {
686
+ var size = _ref2.size;
687
+ return size;
688
+ }, function (_ref3) {
689
+ var show = _ref3.show;
690
+ return show ? 'flex' : 'none';
691
+ }, function (_ref4) {
692
+ var rounded = _ref4.rounded;
693
+ return rounded ? '50%' : '3px';
694
+ })
695
+ };
696
+
697
+ /**
698
+ * Checks if the name provided is single or compound and returns either the first two letters,
699
+ * or the initials of the two first names.
700
+ * @param {string} nameString
701
+ */
702
+
703
+ var parseName = function parseName(nameString) {
704
+ var names = nameString.split(' ');
705
+ return names.length > 1 ? names.reduce(function (accum, name, idx) {
706
+ if (idx <= 1) return [].concat(_toConsumableArray(accum), [name.substring(0, 1)]);
707
+ return accum;
708
+ }, []) : nameString.substring(0, 2).split('');
709
+ };
710
+ /**
711
+ * If both firstname and lastname are provided, returns an array with each of their initials.
712
+ * If only a firstname or a lastname is provided, parses them to return either
713
+ * their initials (if it's a compound name) or first two letters.
714
+ * @param {string} firstname
715
+ * @param {string} lastname
716
+ */
717
+
718
+
719
+ var getNamesToParse = function getNamesToParse(firstname, lastname) {
720
+ return !!firstname || !!lastname ? parseName(firstname || lastname) : null;
721
+ };
722
+ /**
723
+ * Assigns a color to the names or initials array provided.
724
+ * @param {array} name - Array containing the firstname and lastname strings
725
+ */
726
+
727
+
728
+ var getUserColor = function getUserColor(name) {
729
+ var excludedColors = ['lightGreyHover', 'lightGrey', 'white', 'transparentWhite'];
730
+ var availableColors = Object.keys(viewsPalette).filter(function (color) {
731
+ return !excludedColors.includes(color);
732
+ });
733
+ var availableIndexes = availableColors.length;
734
+
735
+ var charCodes = _toConsumableArray(name).map(function (letter) {
736
+ return letter.charCodeAt(0);
737
+ });
738
+
739
+ var charCodesLength = charCodes.length;
740
+ var rotationFactor = charCodesLength % (availableIndexes - 1) + 1;
741
+ var sumOfCharacterCodes = charCodes.reduce(function (current, next) {
742
+ return current + next;
743
+ }) % availableIndexes;
744
+ var random = charCodes[0] % availableIndexes;
745
+
746
+ for (var i = 0; i < charCodesLength; i++) {
747
+ random = (rotationFactor * random + sumOfCharacterCodes) % availableIndexes;
748
+ }
749
+
750
+ var userColor = availableColors[random];
751
+ return viewsPalette[userColor];
752
+ };
753
+ /**
754
+ * If firstname or lastname (or both) are defined, will return an object with their initials and assigned color.
755
+ * If not, returns null.
756
+ * @param {string} firstname
757
+ * @param {string} lastname
758
+ */
759
+
760
+ var getInitialsTheme = function getInitialsTheme() {
761
+ var firstname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
762
+ var lastname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
763
+ if (!!firstname && !!lastname) return [firstname.substring(0, 1), lastname.substring(0, 1)];
764
+ return getNamesToParse(firstname, lastname);
765
+ };
766
+
767
+ var timingFunctions = {
768
+ standard: 'cubic-bezier(0.4, 0, 0.2, 1)',
769
+ decelerate: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
770
+ accelerate: 'cubic-bezier(0.4, 0.0, 1, 1)'
771
+ };
772
+ var mixins = {
773
+ flexCenter: styled$f.css(["display:flex;align-items:center;justify-content:center;"]),
774
+ placeholder: function placeholder(styles) {
775
+ return styled$f.css(["&::-moz-placeholder{", "}&::-webkit-input-placeholder{", "}&:-moz-placeholder{", "}&:-ms-input-placeholder{", "}&::placeholder{", "}"], styles, styles, styles, styles, styles);
776
+ },
777
+ transition: function transition() {
778
+ var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all';
779
+ var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '200ms';
780
+ var transitionProperty;
781
+ if (property.includes(',')) transitionProperty = "transition-property: ".concat(property);
782
+ var transition = "".concat(property.split(',')[0], " ").concat(time, " ").concat(timingFunctions.standard);
783
+ return styled$f.css(["transition:", ";", ";"], transition, transitionProperty);
784
+ },
785
+ scrollbar: function scrollbar(thumbColor, shadowColor) {
786
+ return styled$f.css(["&::-webkit-scrollbar{width:5px;}&::-webkit-scrollbar-track{box-shadow:inset 0 0 6px ", ";}&::-webkit-scrollbar-thumb{height:5px;width:4px;border-radius:50px;background-color:", ";}"], shadowColor || viewsPalette.white, thumbColor);
787
+ }
788
+ };
789
+
790
+ var styled$c = {
791
+ Initials: styled__default["default"].div.withConfig({
792
+ displayName: "styles__Initials",
793
+ componentId: "sc-qlu7od-0"
794
+ })(["width:", ";height:", ";border-radius:", ";font-weight:500;color:", ";background-color:", ";text-transform:uppercase;", ";"], function (_ref) {
795
+ var size = _ref.size;
796
+ return size;
797
+ }, function (_ref2) {
798
+ var size = _ref2.size;
799
+ return size;
800
+ }, function (_ref3) {
801
+ var rounded = _ref3.rounded;
802
+ return rounded ? '50%' : '3px';
803
+ }, viewsPalette.white, function (_ref4) {
804
+ var color = _ref4.color;
805
+ return color;
806
+ }, mixins.flexCenter)
807
+ };
808
+
809
+ var InitialsAvatar = function InitialsAvatar(_ref) {
810
+ var initials = _ref.initials,
811
+ mainColor = _ref.mainColor,
812
+ imageSize = _ref.imageSize,
813
+ rounded = _ref.rounded;
814
+ return /*#__PURE__*/React__default["default"].createElement(styled$c.Initials, {
815
+ color: mainColor || getUserColor(initials),
816
+ size: imageSize,
817
+ rounded: rounded
818
+ }, initials);
819
+ };
820
+
821
+ var Avatar = function Avatar(_ref) {
822
+ var firstname = _ref.firstname,
823
+ lastname = _ref.lastname,
824
+ mainColor = _ref.mainColor,
825
+ size = _ref.size,
826
+ url = _ref.url,
827
+ rounded = _ref.rounded;
828
+ var imageRef = React.useRef();
829
+
830
+ var _useState = React.useState(true),
831
+ _useState2 = _slicedToArray(_useState, 2),
832
+ loading = _useState2[0],
833
+ setLoading = _useState2[1];
834
+
835
+ var _useState3 = React.useState(false),
836
+ _useState4 = _slicedToArray(_useState3, 2),
837
+ showInitials = _useState4[0],
838
+ setShowInitials = _useState4[1];
839
+
840
+ var _useDevices = useDevices(),
841
+ onlyDesktop = _useDevices.onlyDesktop;
842
+
843
+ var initials = getInitialsTheme(firstname, lastname) || null;
844
+ var imageSize = getImageMeasurements(size, onlyDesktop);
845
+ var defaultUserImage = "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp&f=y".concat(imageSize && "&s=".concat(imageSize));
846
+
847
+ var getInitials = function getInitials() {
848
+ try {
849
+ if (!initials) throw new Error('First or lastname not provided');
850
+ return setShowInitials(true);
851
+ } catch (_unused) {
852
+ imageRef.current.src = defaultUserImage;
853
+ }
854
+ };
855
+
856
+ if (showInitials) return /*#__PURE__*/React__default["default"].createElement(InitialsAvatar, {
857
+ initials: initials,
858
+ mainColor: mainColor,
859
+ imageSize: imageSize,
860
+ rounded: rounded
861
+ });
862
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(styled$d.Image, {
863
+ ref: imageRef,
864
+ src: url,
865
+ alt: "".concat(firstname, " ").concat(lastname),
866
+ onError: getInitials,
867
+ onLoad: function onLoad() {
868
+ return setLoading(false);
869
+ },
870
+ show: !loading,
871
+ size: imageSize,
872
+ rounded: rounded
873
+ }), loading && /*#__PURE__*/React__default["default"].createElement(Skeleton, {
874
+ circle: rounded,
875
+ width: imageSize,
876
+ height: imageSize
877
+ }));
878
+ };
879
+
880
+ Avatar.defaultProps = {
881
+ firstname: '',
882
+ lastname: '',
883
+ size: 'small',
884
+ url: '',
885
+ rounded: true
886
+ };
887
+
356
888
  var API_key = {
357
889
  path: "M408.747 682.667h-85.333l-17.92 51.627h-41.387l85.333-222.72h34.56l85.333 222.72h-42.667zM333.227 651.093h64.427l-32.427-92.16z M531.2 651.947v82.773h-38.827v-222.72h85.333c1.405-0.083 3.049-0.13 4.704-0.13 20.832 0 39.92 7.465 54.736 19.865l-0.134-0.109c13.282 13.021 21.514 31.149 21.514 51.2s-8.233 38.179-21.503 51.189l-0.012 0.011c-15.119 11.289-34.176 18.075-54.817 18.075-1.88 0-3.746-0.056-5.598-0.167l0.255 0.012zM531.2 620.8h46.507c1.015 0.079 2.199 0.124 3.393 0.124 10.644 0 20.453-3.576 28.291-9.592l-0.11 0.081c6.632-6.639 10.734-15.807 10.734-25.933 0-0.783-0.025-1.561-0.073-2.332l0.005 0.106c0.017-0.437 0.027-0.95 0.027-1.466 0-10.706-4.24-20.421-11.132-27.559l0.011 0.012c-7.552-6.897-17.648-11.122-28.729-11.122-0.55 0-1.098 0.010-1.642 0.031l0.079-0.002h-47.36z M733.44 734.72h-38.4v-222.72h38.4z M873.813 113.493h-725.333c-34.83 0.478-62.91 28.708-63.147 63.551l-0 0.023v669.44c0 35.346 28.654 64 64 64v0h725.333c35.346 0 64-28.654 64-64v0-669.44c-0.239-35.165-28.8-63.579-63.999-63.579-0.301 0-0.601 0.002-0.9 0.006l0.045-0zM148.48 156.16h725.333c0.001-0 0.003-0 0.004-0 11.632 0 21.090 9.31 21.329 20.884l0 0.022v149.333h-767.147v-149.333c0.23-11.605 9.691-20.924 21.329-20.924 0.301 0 0.602 0.006 0.9 0.019l-0.043-0.001zM873.813 867.84h-725.333c-11.782 0-21.333-9.551-21.333-21.333v0-478.293h768.853v478.293c0 0.005 0 0.011 0 0.017 0 11.782-9.551 21.333-21.333 21.333-0.3 0-0.599-0.006-0.896-0.018l0.043 0.001z M200.96 277.333c0.127 0.002 0.277 0.003 0.427 0.003 16.966 0 30.72-13.754 30.72-30.72s-13.754-30.72-30.72-30.72c-16.965 0-30.718 13.752-30.72 30.717l-0 0c-0 0.001-0 0.002-0 0.003 0 16.816 13.512 30.477 30.271 30.717l0.023 0z M294.827 277.333c16.966 0 30.72-13.754 30.72-30.72s-13.754-30.72-30.72-30.72c-16.966 0-30.72 13.754-30.72 30.72v0c0 16.966 13.754 30.72 30.72 30.72h-0z M388.267 277.333c16.966 0 30.72-13.754 30.72-30.72s-13.754-30.72-30.72-30.72c-16.966 0-30.72 13.754-30.72 30.72h0c0.237 16.87 13.85 30.483 30.698 30.72l0.022 0z",
358
890
  size: 24
@@ -1711,141 +2243,6 @@
1711
2243
  });
1712
2244
  PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.shape({})]);
1713
2245
 
1714
- var viewsPalette = {
1715
- black: '#2F2F2F',
1716
- blackHover: '#585858',
1717
- blackPressed: '#16232D',
1718
- blue: '#2979FF',
1719
- blueHover: '#5393FF',
1720
- bluePressed: '#1759FF',
1721
- blueDisabled: '#93BBFF',
1722
- darkGrey: '#939598',
1723
- darkGreyHover: '#A8AAAC',
1724
- darkGreyPressed: '#747679',
1725
- fizzGreen: '#1DB779',
1726
- fizzGreenHover: '#4AC593',
1727
- fizzGreenPressed: '#109D59',
1728
- green: '#74C655',
1729
- greenHover: '#8FD177',
1730
- greenPressed: '#54B039',
1731
- grey: '#D5D7DB',
1732
- greyHover: '#DDDFE2',
1733
- greyPressed: '#C4C6CC',
1734
- lightBlue: '#08C4C4',
1735
- lightBlueHover: '#39CFCF',
1736
- lightBluePressed: '#04ADAD',
1737
- lightGrey: '#E8EAF6',
1738
- lightGreyHover: '#F4F5FB',
1739
- lightGreyPressed: '#D0D3E3',
1740
- orange: '#FF8D10',
1741
- orangeHover: '#FFA33F',
1742
- orangePressed: '#FF6E08',
1743
- red: '#F13B70',
1744
- redHover: '#F3628C',
1745
- redPressed: '#EB2450',
1746
- statusRed: '#FF4343',
1747
- statusRedHover: '#FF6868',
1748
- statusRedPressed: '#FF2A2A',
1749
- white: '#FFF',
1750
- yellow: '#FFCE17',
1751
- yellowHover: '#FFD745',
1752
- yellowPressed: '#FFBA0C',
1753
- transparentWhite: 'rgba(256, 256, 256, 0.5)'
1754
- };
1755
-
1756
- /**
1757
- * @name getColor
1758
- * @private
1759
- * @module palette/utils
1760
- * @description return color from palette
1761
- * @param {string} color
1762
- * @returns {string} color
1763
- * @example getColor('blue') // #2979FF
1764
- */
1765
-
1766
- var getColor = function getColor(color) {
1767
- return viewsPalette[color] || color;
1768
- };
1769
-
1770
- var timingFunctions$1 = {
1771
- standard: 'cubic-bezier(0.4, 0, 0.2, 1)',
1772
- decelerate: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
1773
- accelerate: 'cubic-bezier(0.4, 0.0, 1, 1)'
1774
- };
1775
-
1776
- var timingFunctions = {
1777
- standard: 'cubic-bezier(0.4, 0, 0.2, 1)',
1778
- decelerate: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
1779
- accelerate: 'cubic-bezier(0.4, 0.0, 1, 1)'
1780
- };
1781
- var mixins = {
1782
- flexCenter: styled$c.css(["display:flex;align-items:center;justify-content:center;"]),
1783
- placeholder: function placeholder(styles) {
1784
- return styled$c.css(["&::-moz-placeholder{", "}&::-webkit-input-placeholder{", "}&:-moz-placeholder{", "}&:-ms-input-placeholder{", "}&::placeholder{", "}"], styles, styles, styles, styles, styles);
1785
- },
1786
- transition: function transition() {
1787
- var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all';
1788
- var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '200ms';
1789
- var transitionProperty;
1790
- if (property.includes(',')) transitionProperty = "transition-property: ".concat(property);
1791
- var transition = "".concat(property.split(',')[0], " ").concat(time, " ").concat(timingFunctions.standard);
1792
- return styled$c.css(["transition:", ";", ";"], transition, transitionProperty);
1793
- },
1794
- scrollbar: function scrollbar(thumbColor, shadowColor) {
1795
- return styled$c.css(["&::-webkit-scrollbar{width:5px;}&::-webkit-scrollbar-track{box-shadow:inset 0 0 6px ", ";}&::-webkit-scrollbar-thumb{height:5px;width:4px;border-radius:50px;background-color:", ";}"], shadowColor || viewsPalette.white, thumbColor);
1796
- }
1797
- };
1798
-
1799
- var breakpoints = {
1800
- values: {
1801
- xs: 320,
1802
- sm: 640,
1803
- md: 962,
1804
- lg: 1024,
1805
- xl: 1280
1806
- }
1807
- };
1808
-
1809
- var getMin = function getMin(key) {
1810
- return "@media screen and (min-width: ".concat(breakpoints.values[key], "px)");
1811
- };
1812
-
1813
- var getMax = function getMax(key) {
1814
- return "@media screen and (max-width: ".concat(breakpoints.values[key] - 1, "px)");
1815
- };
1816
-
1817
- var devices = {
1818
- mobile: getMax('sm'),
1819
- tablet: getMax('md'),
1820
- tabletLg: getMax('lg'),
1821
- onlyDesktop: getMin('lg'),
1822
- desktopSm: getMax('xl'),
1823
- desktopLg: getMin('xl')
1824
- };
1825
- var mediaBreaks = {
1826
- mobile: function mobile() {
1827
- return styled$c.css(["", "{", "}"], devices.mobile, styled$c.css.apply(void 0, arguments));
1828
- },
1829
- tablet: function tablet() {
1830
- return styled$c.css(["", "{", "}"], devices.tablet, styled$c.css.apply(void 0, arguments));
1831
- },
1832
- tabletLg: function tabletLg() {
1833
- return styled$c.css(["", "{", "}"], devices.tabletLg, styled$c.css.apply(void 0, arguments));
1834
- },
1835
- onlyDesktop: function onlyDesktop() {
1836
- return styled$c.css(["", "{", "}"], devices.onlyDesktop, styled$c.css.apply(void 0, arguments));
1837
- },
1838
- desktopSm: function desktopSm() {
1839
- return styled$c.css(["", "{", "}"], devices.desktopSm, styled$c.css.apply(void 0, arguments));
1840
- },
1841
- desktopLg: function desktopLg() {
1842
- return styled$c.css(["", "{", "}"], devices.desktopLg, styled$c.css.apply(void 0, arguments));
1843
- },
1844
- onlyPrint: function onlyPrint() {
1845
- return styled$c.css(["@media print{", "}"], styled$c.css.apply(void 0, arguments));
1846
- }
1847
- };
1848
-
1849
2246
  var _templateObject$4;
1850
2247
  var styles = {
1851
2248
  Svg: styled__default["default"].svg.withConfig({
@@ -1935,7 +2332,7 @@
1935
2332
  };
1936
2333
 
1937
2334
  var commonStyles = function commonStyles(iconColor, fontColor, color) {
1938
- return styled$c.css(["color:", ";.button-icon{fill:", ";}background:none;&:focus,&:hover{background-color:", ";}&:active{background-color:", ";}&:disabled{color:", ";.button-icon{fill:", ";}}"], getColor(fontColor || color || blue), getColor(iconColor || color || blue), lightGreyHover, lightGrey, grey, grey);
2335
+ return styled$f.css(["color:", ";.button-icon{fill:", ";}background:none;&:focus,&:hover{background-color:", ";}&:active{background-color:", ";}&:disabled{color:", ";.button-icon{fill:", ";}}"], getColor(fontColor || color || blue), getColor(iconColor || color || blue), lightGreyHover, lightGrey, grey, grey);
1939
2336
  };
1940
2337
 
1941
2338
  var getButtonStyles = function getButtonStyles(_ref) {
@@ -1945,10 +2342,10 @@
1945
2342
  iconColor = _ref.iconColor;
1946
2343
  var variantStyles = {
1947
2344
  contained: function contained() {
1948
- return styled$c.css(["color:", ";&:before{background-color:", ";}.button-icon{fill:", ";}&:focus:after,&:hover:after{background-color:", ";}&:active{background-color:", ";}&:disabled{&:before,&:after{background-color:", ";}}"], getColor(fontColor || 'white'), getColor(color), white, getHoverColor(color), getPressedColor(color), grey);
2345
+ return styled$f.css(["color:", ";&:before{background-color:", ";}.button-icon{fill:", ";}&:focus:after,&:hover:after{background-color:", ";}&:active{background-color:", ";}&:disabled{&:before,&:after{background-color:", ";}}"], getColor(fontColor || 'white'), getColor(color), white, getHoverColor(color), getPressedColor(color), grey);
1949
2346
  },
1950
2347
  outlined: function outlined() {
1951
- return styled$c.css(["", ";border:1px solid ", ";"], commonStyles(iconColor, fontColor, color), getColor(grey));
2348
+ return styled$f.css(["", ";border:1px solid ", ";"], commonStyles(iconColor, fontColor, color), getColor(grey));
1952
2349
  },
1953
2350
  cleaned: function cleaned() {
1954
2351
  return commonStyles(iconColor, fontColor, color);
@@ -2048,7 +2445,7 @@
2048
2445
  displayName: "styles__Input",
2049
2446
  componentId: "sc-18bfcwf-1"
2050
2447
  })(["opacity:0;position:absolute;cursor:pointer;"]),
2051
- iconCheckStyles: styled$c.css(["transform:translateY(-5%);fill:", ";", ""], getColor('white'), function (props) {
2448
+ iconCheckStyles: styled$f.css(["transform:translateY(-5%);fill:", ";", ""], getColor('white'), function (props) {
2052
2449
  return !!props.rounded && "\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 1px;\n\t\t";
2053
2450
  })
2054
2451
  };
@@ -2123,13 +2520,13 @@
2123
2520
  }, function (props) {
2124
2521
  switch (props.variant) {
2125
2522
  case 'outlined':
2126
- return styled$c.css(["border:1px solid ", ";color:", ";&:hover{background-color:", ";}&:hover .chip-icon,&:hover .delete-button{fill:", ";}&:active{border-color:", ";color:", ";background-color:transparent;}&:active .chip-icon,&:active .delete-button{fill:", ";}"], props.selected ? viewsPalette.blue : '#EAEBED', props.selected ? viewsPalette.blue : viewsPalette.black, viewsPalette.lightGreyHover, props.selected ? viewsPalette.blue : viewsPalette.black, viewsPalette.blue, viewsPalette.blue, viewsPalette.blue);
2523
+ return styled$f.css(["border:1px solid ", ";color:", ";&:hover{background-color:", ";}&:hover .chip-icon,&:hover .delete-button{fill:", ";}&:active{border-color:", ";color:", ";background-color:transparent;}&:active .chip-icon,&:active .delete-button{fill:", ";}"], props.selected ? viewsPalette.blue : '#EAEBED', props.selected ? viewsPalette.blue : viewsPalette.black, viewsPalette.lightGreyHover, props.selected ? viewsPalette.blue : viewsPalette.black, viewsPalette.blue, viewsPalette.blue, viewsPalette.blue);
2127
2524
 
2128
2525
  case 'contained':
2129
- return styled$c.css(["background-color:", ";color:", ";.chip-icon{fill:", ";}.delete-button{fill:", ";}&:hover{background-color:", ";}&:hover .delete-button{fill:", ";}&:active{background-color:", ";color:", ";}&:active .chip-icon,&:active .delete-button{fill:", ";}&:disabled{fill:", ";color:", ";}"], props.selected ? viewsPalette.blue : viewsPalette.lightGreyHover, props.selected ? viewsPalette.white : viewsPalette.black, props.selected ? viewsPalette.white : viewsPalette.black, props.selected ? viewsPalette.white : viewsPalette.darkGrey, props.selected ? viewsPalette.blueHover : viewsPalette.lightGrey, props.selected ? viewsPalette.white : viewsPalette.black, viewsPalette.blue, viewsPalette.white, viewsPalette.white, viewsPalette.grey, viewsPalette.grey);
2526
+ return styled$f.css(["background-color:", ";color:", ";.chip-icon{fill:", ";}.delete-button{fill:", ";}&:hover{background-color:", ";}&:hover .delete-button{fill:", ";}&:active{background-color:", ";color:", ";}&:active .chip-icon,&:active .delete-button{fill:", ";}&:disabled{fill:", ";color:", ";}"], props.selected ? viewsPalette.blue : viewsPalette.lightGreyHover, props.selected ? viewsPalette.white : viewsPalette.black, props.selected ? viewsPalette.white : viewsPalette.black, props.selected ? viewsPalette.white : viewsPalette.darkGrey, props.selected ? viewsPalette.blueHover : viewsPalette.lightGrey, props.selected ? viewsPalette.white : viewsPalette.black, viewsPalette.blue, viewsPalette.white, viewsPalette.white, viewsPalette.grey, viewsPalette.grey);
2130
2527
 
2131
2528
  case 'status':
2132
- return styled$c.css(["background-color:", ";color:", ";font-weight:700;border:none;height:24px;padding:0 17px;line-height:28px;max-width:170px;"], getColor(props.color || 'grey'), getColor(props.sizeColor || 'white'));
2529
+ return styled$f.css(["background-color:", ";color:", ";font-weight:700;border:none;height:24px;padding:0 17px;line-height:28px;max-width:170px;"], getColor(props.color || 'grey'), getColor(props.sizeColor || 'white'));
2133
2530
 
2134
2531
  default:
2135
2532
  return '';
@@ -2143,12 +2540,12 @@
2143
2540
  }, function (props) {
2144
2541
  return props.textColor && "color: ".concat(getColor(props.textColor), ";");
2145
2542
  }, mediaBreaks.onlyPrint(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n\t\t\tborder: 1px solid ", ";\n\t\t"])), viewsPalette.darkGrey)),
2146
- iconPathStyles: styled$c.css(["", ";"], mixins.transition('fill')),
2543
+ iconPathStyles: styled$f.css(["", ";"], mixins.transition('fill')),
2147
2544
  DeleteButton: styled__default["default"].button.withConfig({
2148
2545
  displayName: "styles__DeleteButton",
2149
2546
  componentId: "sc-1vnh4co-1"
2150
2547
  })(["width:16px;height:16px;margin-left:12px;"]),
2151
- deleteButtonPathStyles: styled$c.css(["", ";"], mixins.transition('fill')),
2548
+ deleteButtonPathStyles: styled$f.css(["", ";"], mixins.transition('fill')),
2152
2549
  Children: styled__default["default"].div.withConfig({
2153
2550
  displayName: "styles__Children",
2154
2551
  componentId: "sc-1vnh4co-2"
@@ -2273,7 +2670,7 @@
2273
2670
  })(["width:16px;height:16px;border-radius:50%;position:absolute;top:4px;left:4px;background-color:", ";transition:all ", " 0.2s;", ""], viewsPalette.white, timingFunctions$1.standard, function (props) {
2274
2671
  return props.checked && "\n\t\t\tleft: 100%;\n\t\t\tmargin-left: -20px;\n\t\t";
2275
2672
  });
2276
- var iconCheckStyles = styled$c.css(["position:absolute;fill:", ";", ""], function (props) {
2673
+ var iconCheckStyles = styled$f.css(["position:absolute;fill:", ";", ""], function (props) {
2277
2674
  return statusColor(props);
2278
2675
  }, onlyPrint(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n\t\tfill: ", " !important;\n\t"])), function (props) {
2279
2676
  return props.checked ? viewsPalette.black : viewsPalette.darkGrey;
@@ -2457,7 +2854,7 @@
2457
2854
  }, function (_ref4) {
2458
2855
  var hasIcon = _ref4.hasIcon;
2459
2856
  return hasIcon && "padding-left: 32px;";
2460
- }, mixins.placeholder(styled$c.css(["font-weight:400;color:", ";"], function (_ref5) {
2857
+ }, mixins.placeholder(styled$f.css(["font-weight:400;color:", ";"], function (_ref5) {
2461
2858
  var error = _ref5.error;
2462
2859
  return error ? viewsPalette.statusRed : viewsPalette.darkGreyPressed;
2463
2860
  })), function (props) {
@@ -2676,7 +3073,7 @@
2676
3073
  componentId: "sc-wtau65-1"
2677
3074
  })(["border:none;border-bottom:1px solid ", ";border-radius:0;height:23px;max-height:350px;padding:0 9px 4px 0;resize:none;font-size:", ";font-weight:400;color:", ";", ";width:", ";", " ", " &:hover{border-color:", ";}&:focus{border-color:", ";caret-color:", ";outline:none;}&:disabled{background-color:", ";color:", ";border-color:", ";cursor:default;}", " ", ""], viewsPalette.grey, fontSize, viewsPalette.black, mixins.transition('color,border-color', '0.2s'), function (props) {
2678
3075
  return props.fullWidth ? '100%' : 'auto';
2679
- }, mixins.placeholder(styled$c.css(["opacity:1;color:", ";"], function (props) {
3076
+ }, mixins.placeholder(styled$f.css(["opacity:1;color:", ";"], function (props) {
2680
3077
  return placeholderColor(props);
2681
3078
  })), mixins.scrollbar(viewsPalette.grey, viewsPalette.base), viewsPalette.black, viewsPalette.blue, viewsPalette.blue, viewsPalette.white, viewsPalette.grey, viewsPalette.grey, function (props) {
2682
3079
  return props.error && "\n\t\t\t&, &:hover, &:focus {\n\t\t\t\tborder-color: ".concat(viewsPalette.statusRed, "\n\t\t\t}\n\t\t");
@@ -3714,39 +4111,6 @@
3714
4111
 
3715
4112
  function u(){return (u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e}).apply(this,arguments)}function c(e,r){if(null==e)return {};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}function i(e){var t=React.useRef(e),n=React.useRef(function(e){t.current&&t.current(e);});return t.current=e,n.current}var s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e<r?r:e},f=function(e){return "touches"in e},v=function(e){return e&&e.ownerDocument.defaultView||self},d=function(e,r,t){var n=e.getBoundingClientRect(),o=f(r)?function(e,r){for(var t=0;t<e.length;t++)if(e[t].identifier===r)return e[t];return e[0]}(r.touches,t):r;return {left:s((o.pageX-(n.left+v(e).pageXOffset))/n.width),top:s((o.pageY-(n.top+v(e).pageYOffset))/n.height)}},h=function(e){!f(e)&&e.preventDefault();},m=React__default["default"].memo(function(o){var a=o.onMove,l=o.onKey,s=c(o,["onMove","onKey"]),m=React.useRef(null),g=i(a),p=i(l),b=React.useRef(null),_=React.useRef(!1),x=React.useMemo(function(){var e=function(e){h(e),(f(e)?e.touches.length>0:e.buttons>0)&&m.current?g(d(m.current,e,b.current)):t(!1);},r=function(){return t(!1)};function t(t){var n=_.current,o=v(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r);}return [function(e){var r=e.nativeEvent,n=m.current;if(n&&(h(r),!function(e,r){return r&&!f(e)}(r,_.current)&&n)){if(f(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier);}n.focus(),g(d(n,r,b.current)),t(!0);}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}));},t]},[p,g]),C=x[0],E=x[1],H=x[2];return React.useEffect(function(){return H},[H]),React__default["default"].createElement("div",u({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),g=function(e){return e.filter(Boolean).join(" ")},p=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=g(["react-colorful__pointer",r.className]);return React__default["default"].createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},React__default["default"].createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},b=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},x=function(e){return "#"===e[0]&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},N=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return {h:b(e.h),s:b(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:b(o/2),a:b(n,2)}},w=function(e){var r=N(e);return "hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},q=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return {r:b(255*[n,u,l,l,c,n][i]),g:b(255*[c,n,n,u,l,l][i]),b:b(255*[l,l,c,n,n,u][i]),a:b(o,2)}},z=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},B=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return {h:b(60*(u<0?u+6:u)),s:b(a?l/a*100:0),v:b(a/255*100),a:o}},K=React__default["default"].memo(function(r){var t=r.hue,n=r.onChange,o=g(["react-colorful__hue",r.className]);return React__default["default"].createElement("div",{className:o},React__default["default"].createElement(m,{onMove:function(e){n({h:360*e.left});},onKey:function(e){n({h:s(t+360*e.left,0,360)});},"aria-label":"Hue","aria-valuetext":b(t)},React__default["default"].createElement(p,{className:"react-colorful__hue-pointer",left:t/360,color:w({h:t,s:100,v:100,a:1})})))}),L=React__default["default"].memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:w({h:t.h,s:100,v:100,a:1})};return React__default["default"].createElement("div",{className:"react-colorful__saturation",style:o},React__default["default"].createElement(m,{onMove:function(e){n({s:100*e.left,v:100-100*e.top});},onKey:function(e){n({s:s(t.s+100*e.left,0,100),v:s(t.v-100*e.top,0,100)});},"aria-label":"Color","aria-valuetext":"Saturation "+b(t.s)+"%, Brightness "+b(t.v)+"%"},React__default["default"].createElement(p,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:w(t)})))}),A=function(e,r){if(e===r)return !0;for(var t in e)if(e[t]!==r[t])return !1;return !0};function T(e,t,l){var u=i(l),c=React.useState(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=React.useRef({color:t,hsva:s});React.useEffect(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r);}},[t,e]),React.useEffect(function(){var r;A(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r));},[s,e,u]);var d=React.useCallback(function(e){f(function(r){return Object.assign({},r,e)});},[]);return [s,d]}var P="undefined"!=typeof window?React.useLayoutEffect:React.useEffect,X=function(){return ("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0)},R=new Map,V=function(e){P(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!R.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',R.set(r,t);var n=X();n&&t.setAttribute("nonce",n),r.head.appendChild(t);}},[]);},$=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=c(t,["className","colorModel","color","onChange"]),f=React.useRef(null);V(f);var v=T(o,l,i),d=v[0],h=v[1],m=g(["react-colorful",n]);return React__default["default"].createElement("div",u({},s,{ref:f,className:m}),React__default["default"].createElement(L,{hsva:d,onChange:h}),React__default["default"].createElement(K,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},G={defaultColor:"000",toHsva:function(e){return B(x(e))},fromHsva:function(e){return t=(r=q(e)).g,n=r.b,"#"+z(r.r)+z(t)+z(n);var r,t,n;},equal:function(e,r){return e.toLowerCase()===r.toLowerCase()||A(x(e),x(r))}},J=function(r){return React__default["default"].createElement($,u({},r,{colorModel:G}))};
3716
4113
 
3717
- /**
3718
- * Copy string to clipboard
3719
- * @param {string} str
3720
- */
3721
- /**
3722
- * Creates a debounced function that delays invoking func until after wait milliseconds have
3723
- * elapsed since the last time the debounced function was invoked.
3724
- * @param {function} fn - The function to debounce.
3725
- * @param {number} wait - The number of milliseconds to delay.
3726
- * @returns {function} The new debounced function.
3727
- */
3728
-
3729
- function debounce(fn, wait) {
3730
- var timerID;
3731
-
3732
- function debounced() {
3733
- var context = this;
3734
- clearTimeout(timerID);
3735
-
3736
- for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
3737
- params[_key] = arguments[_key];
3738
- }
3739
-
3740
- timerID = setTimeout.apply(void 0, [fn.bind(context), wait].concat(params));
3741
- }
3742
-
3743
- debounced.cancel = function cancel() {
3744
- clearTimeout(timerID);
3745
- };
3746
-
3747
- return debounced;
3748
- }
3749
-
3750
4114
  var styled$3 = {
3751
4115
  ClickableWrapper: styled__default["default"].div.withConfig({
3752
4116
  displayName: "styles__ClickableWrapper",
@@ -4380,14 +4744,14 @@
4380
4744
  };
4381
4745
 
4382
4746
  var verticalCommonStyles = function verticalCommonStyles(open) {
4383
- return styled$c.css(["width:100%;", ";max-height:", ";left:0;right:0;"], function (_ref) {
4747
+ return styled$f.css(["width:100%;", ";max-height:", ";left:0;right:0;"], function (_ref) {
4384
4748
  var fullScreen = _ref.fullScreen;
4385
4749
  return fullScreen && 'height: 100%';
4386
4750
  }, open ? '100%' : 0);
4387
4751
  };
4388
4752
 
4389
4753
  var horizontalCommonStyles = function horizontalCommonStyles(open) {
4390
- return styled$c.css(["height:100%;", ";max-width:", ";top:0;"], function (_ref2) {
4754
+ return styled$f.css(["height:100%;", ";max-width:", ";top:0;"], function (_ref2) {
4391
4755
  var fullScreen = _ref2.fullScreen;
4392
4756
  return fullScreen && 'width: 100%';
4393
4757
  }, open ? '100%' : 0);
@@ -4396,16 +4760,16 @@
4396
4760
  var setPosition = function setPosition(position, open) {
4397
4761
  var positions = {
4398
4762
  top: function top() {
4399
- return styled$c.css(["", ";top:0;"], verticalCommonStyles(open));
4763
+ return styled$f.css(["", ";top:0;"], verticalCommonStyles(open));
4400
4764
  },
4401
4765
  bottom: function bottom() {
4402
- return styled$c.css(["", ";bottom:0;"], verticalCommonStyles(open));
4766
+ return styled$f.css(["", ";bottom:0;"], verticalCommonStyles(open));
4403
4767
  },
4404
4768
  left: function left() {
4405
- return styled$c.css(["", ";left:0;"], horizontalCommonStyles(open));
4769
+ return styled$f.css(["", ";left:0;"], horizontalCommonStyles(open));
4406
4770
  },
4407
4771
  right: function right() {
4408
- return styled$c.css(["", ";right:0;"], horizontalCommonStyles(open));
4772
+ return styled$f.css(["", ";right:0;"], horizontalCommonStyles(open));
4409
4773
  }
4410
4774
  };
4411
4775
  return positions[position];
@@ -4419,7 +4783,7 @@
4419
4783
  open = _ref3.open,
4420
4784
  transitionDuration = _ref3.transitionDuration;
4421
4785
  var transitionTime = transitionDuration / 1000;
4422
- return styled$c.css(["", ";", ";"], position && setPosition(position, open), transitionDuration && "transition: ".concat(getPropertyForTransition(position), " ").concat(transitionTime, "s ease"));
4786
+ return styled$f.css(["", ";", ";"], position && setPosition(position, open), transitionDuration && "transition: ".concat(getPropertyForTransition(position), " ").concat(transitionTime, "s ease"));
4423
4787
  });
4424
4788
  var Content = styled__default["default"].div.withConfig({
4425
4789
  displayName: "styles__Content",
@@ -4495,6 +4859,7 @@
4495
4859
  closeOnClickAway: true
4496
4860
  };
4497
4861
 
4862
+ exports.Avatar = Avatar;
4498
4863
  exports.Button = Button;
4499
4864
  exports.Checkbox = Checkbox;
4500
4865
  exports.Chip = Chip;
@@ -4509,6 +4874,7 @@
4509
4874
  exports.Input = Input;
4510
4875
  exports.Link = Link;
4511
4876
  exports.QRCode = QRCode;
4877
+ exports.Skeleton = Skeleton;
4512
4878
  exports.Switch = Switch;
4513
4879
  exports.Textarea = Textarea;
4514
4880