@livechat/design-system-react-components 1.0.0-alpha.19 → 1.0.0-alpha.21

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/dsrc.es.js CHANGED
@@ -35,7 +35,7 @@ var __publicField = (obj, key, value) => {
35
35
  };
36
36
  import * as React from "react";
37
37
  import cx from "clsx";
38
- import { Close, Info as Info$1, Warning, CheckCircleSolid, Block, Person, Check, ChevronUp, ChevronDown, Error as Error2, Search, LockBlack } from "@livechat/design-system-icons/react/material";
38
+ import { Close, Info as Info$1, Warning, CheckCircleSolid, Block, Person, ChevronUp, ChevronDown, Check, Error as Error2, Search, LockBlack } from "@livechat/design-system-icons/react/material";
39
39
  import debounce from "lodash.debounce";
40
40
  import { getContrast } from "polished";
41
41
  import * as ReactDOM from "react-dom";
@@ -302,7 +302,7 @@ const IconSizeMap = {
302
302
  height: 32
303
303
  }
304
304
  };
305
- const baseClass$E = "icon";
305
+ const baseClass$F = "icon";
306
306
  const Icon = (props) => {
307
307
  const _a = props, {
308
308
  source,
@@ -322,7 +322,7 @@ const Icon = (props) => {
322
322
  const GeneratedIcon = React.createElement(source, __spreadProps(__spreadValues({}, IconSizeMap[size]), {
323
323
  color: customColor
324
324
  }));
325
- const mergedClassNames = cx(className, styles$x[baseClass$E], kind && styles$x[`${baseClass$E}--${disabled ? "disabled--" : ""}${kind}`]);
325
+ const mergedClassNames = cx(className, styles$x[baseClass$F], kind && styles$x[`${baseClass$F}--${disabled ? "disabled--" : ""}${kind}`]);
326
326
  return /* @__PURE__ */ React.createElement("span", __spreadProps(__spreadValues({}, restProps), {
327
327
  className: mergedClassNames
328
328
  }), GeneratedIcon);
@@ -362,7 +362,7 @@ const IconConfig = {
362
362
  kind: "error"
363
363
  }
364
364
  };
365
- const baseClass$D = "alert";
365
+ const baseClass$E = "alert";
366
366
  const Alert = ({
367
367
  children,
368
368
  className,
@@ -371,7 +371,7 @@ const Alert = ({
371
371
  }) => {
372
372
  const containerRef = React.useRef(null);
373
373
  const [isSmallContainer, setIsSmallContainer] = React.useState(false);
374
- const mergedClassNames = cx(styles$w[baseClass$D], styles$w[`${baseClass$D}--${kind}`], isSmallContainer && styles$w[`${baseClass$D}--small`], className);
374
+ const mergedClassNames = cx(styles$w[baseClass$E], styles$w[`${baseClass$E}--${kind}`], isSmallContainer && styles$w[`${baseClass$E}--small`], className);
375
375
  React.useEffect(() => {
376
376
  const handleResize = debounce(() => {
377
377
  if (containerRef.current && containerRef.current.offsetWidth <= 400) {
@@ -386,15 +386,16 @@ const Alert = ({
386
386
  ref: containerRef,
387
387
  className: mergedClassNames
388
388
  }, /* @__PURE__ */ React.createElement("div", {
389
- className: styles$w[`${baseClass$D}__content`]
389
+ className: styles$w[`${baseClass$E}__content`]
390
390
  }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, IconConfig[kind]), {
391
- className: styles$w[`${baseClass$D}__content-icon`]
391
+ size: "large",
392
+ className: styles$w[`${baseClass$E}__content-icon`]
392
393
  })), /* @__PURE__ */ React.createElement(Text, {
393
394
  as: "div",
394
- className: cx(styles$w[`${baseClass$D}__content-text`], onClose && styles$w[`${baseClass$D}__content-text--margin`])
395
+ className: cx(styles$w[`${baseClass$E}__content-text`], onClose && styles$w[`${baseClass$E}__content-text--margin`])
395
396
  }, children)), onClose && /* @__PURE__ */ React.createElement("button", {
396
397
  type: "button",
397
- className: styles$w[`${baseClass$D}__close-icon`],
398
+ className: styles$w[`${baseClass$E}__close-icon`],
398
399
  onClick: onClose
399
400
  }, /* @__PURE__ */ React.createElement(Icon, {
400
401
  source: Close,
@@ -458,7 +459,7 @@ var styles$v = {
458
459
  "avatar--xlarge": "lc-Avatar-module__avatar--xlarge___zwgeW",
459
460
  "avatar--xxlarge": "lc-Avatar-module__avatar--xxlarge___Ur0ul"
460
461
  };
461
- const baseClass$C = "avatar";
462
+ const baseClass$D = "avatar";
462
463
  const defaultBackgroundColor = "var(--surface-basic-disabled)";
463
464
  const defaultFontColor = "var(--content-subtle)";
464
465
  const Avatar = ({
@@ -482,15 +483,15 @@ const Avatar = ({
482
483
  const backgroundColor = color || defaultBackgroundColor;
483
484
  const fontColor = color ? getFontColor(color) : defaultFontColor;
484
485
  const mergedClassNames = cx({
485
- [styles$v[baseClass$C]]: true,
486
- [styles$v[`${baseClass$C}--${shape}`]]: true,
487
- [styles$v[`${baseClass$C}--${size}`]]: true,
488
- [styles$v[`${baseClass$C}--with-rim`]]: withRim,
486
+ [styles$v[baseClass$D]]: true,
487
+ [styles$v[`${baseClass$D}--${shape}`]]: true,
488
+ [styles$v[`${baseClass$D}--${size}`]]: true,
489
+ [styles$v[`${baseClass$D}--with-rim`]]: withRim,
489
490
  [`${className}`]: className
490
491
  });
491
- const mergedStatusClassNames = cx(styles$v[`${baseClass$C}__status`], styles$v[`${baseClass$C}__status--${shape}`], styles$v[`${baseClass$C}__status--${size}`], styles$v[`${baseClass$C}__status--${status}`]);
492
- const mergedIconClassNames = cx(styles$v[`${baseClass$C}__icon`], styles$v[`${baseClass$C}__icon--${size}`]);
493
- const mergedRimClassNames = cx(styles$v[`${baseClass$C}__rim`], styles$v[`${baseClass$C}__rim--${size}`]);
492
+ const mergedStatusClassNames = cx(styles$v[`${baseClass$D}__status`], styles$v[`${baseClass$D}__status--${shape}`], styles$v[`${baseClass$D}__status--${size}`], styles$v[`${baseClass$D}__status--${status}`]);
493
+ const mergedIconClassNames = cx(styles$v[`${baseClass$D}__icon`], styles$v[`${baseClass$D}__icon--${size}`]);
494
+ const mergedRimClassNames = cx(styles$v[`${baseClass$D}__rim`], styles$v[`${baseClass$D}__rim--${size}`]);
494
495
  const handleError = React.useCallback(() => setShouldDisplayFallbackAvatar(true), []);
495
496
  React.useEffect(() => {
496
497
  setShouldDisplayFallbackAvatar(isImproperImageSetup);
@@ -499,20 +500,20 @@ const Avatar = ({
499
500
  className: mergedClassNames,
500
501
  style: { backgroundColor }
501
502
  }, withRim && /* @__PURE__ */ React.createElement("div", {
502
- "data-testid": `${baseClass$C}__rim`,
503
+ "data-testid": `${baseClass$D}__rim`,
503
504
  className: mergedRimClassNames
504
505
  }), status && /* @__PURE__ */ React.createElement("div", {
505
- "data-testid": `${baseClass$C}__status`,
506
+ "data-testid": `${baseClass$D}__status`,
506
507
  className: mergedStatusClassNames
507
508
  }), shouldDisplayImage && /* @__PURE__ */ React.createElement("img", {
508
- className: styles$v[`${baseClass$C}__image`],
509
+ className: styles$v[`${baseClass$D}__image`],
509
510
  src,
510
511
  alt,
511
512
  onError: handleError
512
513
  }), shouldDisplayInitials && /* @__PURE__ */ React.createElement("span", {
513
514
  style: { color: fontColor }
514
515
  }, initials), shouldDisplayFallbackAvatar && /* @__PURE__ */ React.createElement(Icon, {
515
- "data-testid": `${baseClass$C}__icon`,
516
+ "data-testid": `${baseClass$D}__icon`,
516
517
  className: mergedIconClassNames,
517
518
  source: Person,
518
519
  kind: "primary"
@@ -530,25 +531,37 @@ var styles$u = {
530
531
  "badge--secondary": "lc-Badge-module__badge--secondary___JjNIJ",
531
532
  "badge--tertiary": "lc-Badge-module__badge--tertiary___e83wV"
532
533
  };
533
- const baseClass$B = "badge";
534
- const Badge = ({
535
- children,
536
- className,
537
- kind = "primary",
538
- size = "medium",
539
- type = "content"
540
- }) => {
541
- const mergedClassNames = cx(className, styles$u[baseClass$B], styles$u[`${baseClass$B}--${kind}`], styles$u[`${baseClass$B}--${size}`]);
534
+ function formatCount(count, max) {
535
+ return count > max ? `${max}+` : `${count}`;
536
+ }
537
+ const baseClass$C = "badge";
538
+ const Badge = (_e) => {
539
+ var _f = _e, {
540
+ className,
541
+ count = 0,
542
+ max = 99,
543
+ kind = "primary",
544
+ size = "medium",
545
+ type = "counter"
546
+ } = _f, spanProps = __objRest(_f, [
547
+ "className",
548
+ "count",
549
+ "max",
550
+ "kind",
551
+ "size",
552
+ "type"
553
+ ]);
554
+ const mergedClassNames = cx(className, styles$u[baseClass$C], styles$u[`${baseClass$C}--${kind}`], styles$u[`${baseClass$C}--${size}`]);
542
555
  const content = {
543
- ["content"]: children,
556
+ ["counter"]: formatCount(count, max),
544
557
  ["alert"]: "!",
545
558
  ["dot"]: /* @__PURE__ */ React.createElement("span", {
546
- className: styles$u[`${baseClass$B}__dot`]
559
+ className: styles$u[`${baseClass$C}__dot`]
547
560
  })
548
561
  }[type];
549
- return /* @__PURE__ */ React.createElement("span", {
562
+ return /* @__PURE__ */ React.createElement("span", __spreadValues({
550
563
  className: mergedClassNames
551
- }, content);
564
+ }, spanProps), content);
552
565
  };
553
566
  const loader = "lc-Loader-module__loader___LRflD";
554
567
  const loader__spinner = "lc-Loader-module__loader__spinner___l3C1g";
@@ -564,8 +577,8 @@ var styles$t = {
564
577
  rotate,
565
578
  loader__label
566
579
  };
567
- const baseClass$A = "loader";
568
- const spinnerClass = `${baseClass$A}__spinner`;
580
+ const baseClass$B = "loader";
581
+ const spinnerClass = `${baseClass$B}__spinner`;
569
582
  const Loader = ({
570
583
  primaryColor,
571
584
  secondaryColor,
@@ -574,7 +587,7 @@ const Loader = ({
574
587
  size = "medium"
575
588
  }) => {
576
589
  return /* @__PURE__ */ React.createElement("div", {
577
- className: cx(styles$t[baseClass$A], className)
590
+ className: cx(styles$t[baseClass$B], className)
578
591
  }, /* @__PURE__ */ React.createElement("div", {
579
592
  className: cx(styles$t[spinnerClass], styles$t[`${spinnerClass}--${size}`])
580
593
  }, /* @__PURE__ */ React.createElement("div", {
@@ -614,9 +627,9 @@ var styles$s = {
614
627
  btn__content,
615
628
  btn__icon
616
629
  };
617
- const baseClass$z = "btn";
618
- const Button = (_e) => {
619
- var _f = _e, {
630
+ const baseClass$A = "btn";
631
+ const Button = (_g) => {
632
+ var _h = _g, {
620
633
  loading = false,
621
634
  disabled = false,
622
635
  type = "button",
@@ -629,7 +642,7 @@ const Button = (_e) => {
629
642
  className,
630
643
  children,
631
644
  href
632
- } = _f, props = __objRest(_f, [
645
+ } = _h, props = __objRest(_h, [
633
646
  "loading",
634
647
  "disabled",
635
648
  "type",
@@ -645,11 +658,11 @@ const Button = (_e) => {
645
658
  ]);
646
659
  const isDisabled = loading || disabled;
647
660
  const Component = href ? "a" : "button";
648
- const mergedClassNames = cx(className, styles$s[baseClass$z], styles$s[`${baseClass$z}--${kind}`], styles$s[`${baseClass$z}--${size}`], {
649
- [styles$s[`${baseClass$z}--loading`]]: loading,
650
- [styles$s[`${baseClass$z}--full-width`]]: fullWidth,
651
- [styles$s[`${baseClass$z}--icon-only`]]: !children && icon2,
652
- [styles$s[`${baseClass$z}--disabled`]]: isDisabled
661
+ const mergedClassNames = cx(className, styles$s[baseClass$A], styles$s[`${baseClass$A}--${kind}`], styles$s[`${baseClass$A}--${size}`], {
662
+ [styles$s[`${baseClass$A}--loading`]]: loading,
663
+ [styles$s[`${baseClass$A}--full-width`]]: fullWidth,
664
+ [styles$s[`${baseClass$A}--icon-only`]]: !children && icon2,
665
+ [styles$s[`${baseClass$A}--disabled`]]: isDisabled
653
666
  });
654
667
  return /* @__PURE__ */ React.createElement(Component, __spreadValues({
655
668
  className: mergedClassNames,
@@ -659,12 +672,12 @@ const Button = (_e) => {
659
672
  }, props), loading && /* @__PURE__ */ React.createElement(Loader, {
660
673
  size: "small",
661
674
  label: loaderLabel,
662
- className: styles$s[`${baseClass$z}__loader`]
675
+ className: styles$s[`${baseClass$A}__loader`]
663
676
  }), icon2 && React.cloneElement(icon2, {
664
- className: cx(styles$s[`${baseClass$z}__icon`], styles$s[`${baseClass$z}__icon--${iconPosition}`]),
677
+ className: cx(styles$s[`${baseClass$A}__icon`], styles$s[`${baseClass$A}__icon--${iconPosition}`]),
665
678
  disabled
666
679
  }), /* @__PURE__ */ React.createElement("div", {
667
- className: styles$s[`${baseClass$z}__content`]
680
+ className: styles$s[`${baseClass$A}__content`]
668
681
  }, children));
669
682
  };
670
683
  const btn = "lc-ButtonGroup-module__btn___bXPrU";
@@ -678,9 +691,9 @@ var styles$r = {
678
691
  };
679
692
  function noop() {
680
693
  }
681
- const baseClass$y = "btn-group";
682
- const ButtonGroup = (_g) => {
683
- var _h = _g, {
694
+ const baseClass$z = "btn-group";
695
+ const ButtonGroup = (_i) => {
696
+ var _j = _i, {
684
697
  size = "medium",
685
698
  fullWidth = false,
686
699
  onIndexChange = noop,
@@ -688,7 +701,7 @@ const ButtonGroup = (_g) => {
688
701
  children,
689
702
  currentIndex,
690
703
  initialIndex = -1
691
- } = _h, restProps = __objRest(_h, [
704
+ } = _j, restProps = __objRest(_j, [
692
705
  "size",
693
706
  "fullWidth",
694
707
  "onIndexChange",
@@ -697,7 +710,7 @@ const ButtonGroup = (_g) => {
697
710
  "currentIndex",
698
711
  "initialIndex"
699
712
  ]);
700
- const mergedClassName = cx(styles$r[baseClass$y], className);
713
+ const mergedClassName = cx(styles$r[baseClass$z], className);
701
714
  const [currentStateIndex, setCurrentStateIndex] = React.useState(initialIndex);
702
715
  const isControlled = typeof currentIndex === "number";
703
716
  const _currentIndex = isControlled ? currentIndex : currentStateIndex;
@@ -725,51 +738,112 @@ const ButtonGroup = (_g) => {
725
738
  })));
726
739
  };
727
740
  const card = "lc-Card-module__card___GqMm2";
728
- const card__title = "lc-Card-module__card__title___1YjAR";
729
- const card__text = "lc-Card-module__card__text___-jYlF";
730
- const card__img = "lc-Card-module__card__img___teLC8";
741
+ const card__header = "lc-Card-module__card__header___0ptfD";
742
+ const card__header__image = "lc-Card-module__card__header__image___QMwSu";
743
+ const card__header__heading = "lc-Card-module__card__header__heading___Wkikx";
744
+ const card__header__heading__title = "lc-Card-module__card__header__heading__title___Uxi8s";
745
+ const card__header__heading__description = "lc-Card-module__card__header__heading__description___6LnOK";
746
+ const card__content = "lc-Card-module__card__content___KuDcc";
747
+ const card__actions = "lc-Card-module__card__actions___q9sAo";
748
+ const card__actions__line = "lc-Card-module__card__actions__line___TF1bt";
749
+ const card__actions__buttons = "lc-Card-module__card__actions__buttons___PDMMR";
731
750
  var styles$q = {
732
751
  card,
733
- card__title,
734
- card__text,
735
- card__img
736
- };
737
- const Card = (_i) => {
738
- var _j = _i, {
739
- img,
740
- title,
752
+ card__header,
753
+ card__header__image,
754
+ card__header__heading,
755
+ card__header__heading__title,
756
+ card__header__heading__description,
757
+ card__content,
758
+ "card__expanded-content": "lc-Card-module__card__expanded-content___yB-QL",
759
+ card__actions,
760
+ card__actions__line,
761
+ card__actions__buttons,
762
+ "card__actions__buttons-expander": "lc-Card-module__card__actions__buttons-expander___lz4h-"
763
+ };
764
+ const baseClass$y = "card";
765
+ const headerClass = `${baseClass$y}__header`;
766
+ const headingClass = `${headerClass}__heading`;
767
+ const actionsClass = `${baseClass$y}__actions`;
768
+ const Card = (_k) => {
769
+ var _l = _k, {
770
+ alt,
771
+ buttonsOptions = [],
741
772
  children,
742
- className
743
- } = _j, restProps = __objRest(_j, [
744
- "img",
745
- "title",
773
+ className,
774
+ description,
775
+ expandableContent,
776
+ src,
777
+ title
778
+ } = _l, divProps = __objRest(_l, [
779
+ "alt",
780
+ "buttonsOptions",
746
781
  "children",
747
- "className"
782
+ "className",
783
+ "description",
784
+ "expandableContent",
785
+ "src",
786
+ "title"
748
787
  ]);
749
- return /* @__PURE__ */ React.createElement(Text, __spreadValues({
788
+ const [isExpanded, setIsExpanded] = React.useState(false);
789
+ const expandIcon = isExpanded ? ChevronUp : ChevronDown;
790
+ const expandButtonText = isExpanded ? "Hide" : "Show more";
791
+ const shouldShowActionButtons = (buttonsOptions == null ? void 0 : buttonsOptions.length) > 0;
792
+ const shouldShowExpandAction = !!expandableContent;
793
+ const shouldShowActions = shouldShowActionButtons || shouldShowExpandAction;
794
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
795
+ className: cx(styles$q[baseClass$y], className)
796
+ }, divProps), /* @__PURE__ */ React.createElement("div", {
797
+ className: styles$q[headerClass]
798
+ }, src && /* @__PURE__ */ React.createElement("img", {
799
+ alt,
800
+ className: styles$q[`${headerClass}__image`],
801
+ src
802
+ }), /* @__PURE__ */ React.createElement("div", {
803
+ className: styles$q[headingClass]
804
+ }, /* @__PURE__ */ React.createElement(Heading, {
805
+ size: "sm",
806
+ className: styles$q[`${headingClass}__title`]
807
+ }, title), /* @__PURE__ */ React.createElement(Text, {
808
+ size: "sm",
809
+ className: styles$q[`${headingClass}__description`]
810
+ }, description))), /* @__PURE__ */ React.createElement(Text, {
750
811
  as: "div",
751
812
  size: "md",
752
- className: cx(styles$q["card"], className)
753
- }, restProps), (img || title) && /* @__PURE__ */ React.createElement(Heading, {
813
+ className: styles$q[`${baseClass$y}__content`]
814
+ }, children), isExpanded && /* @__PURE__ */ React.createElement(Text, {
754
815
  as: "div",
755
- size: "sm",
756
- className: styles$q["card__title"]
757
- }, img && /* @__PURE__ */ React.createElement("img", {
758
- src: img,
759
- className: styles$q["card__img"]
760
- }), title && /* @__PURE__ */ React.createElement("div", {
761
- className: styles$q["card__text"]
762
- }, title)), children);
816
+ size: "md",
817
+ className: styles$q[`${baseClass$y}__expanded-content`]
818
+ }, expandableContent), shouldShowActions && /* @__PURE__ */ React.createElement("div", {
819
+ className: styles$q[actionsClass]
820
+ }, /* @__PURE__ */ React.createElement("div", {
821
+ className: styles$q[`${actionsClass}__line`]
822
+ }), /* @__PURE__ */ React.createElement("div", {
823
+ className: styles$q[`${actionsClass}__buttons`]
824
+ }, shouldShowActionButtons && buttonsOptions.map(({ kind, onClick, children: buttonChildren }) => /* @__PURE__ */ React.createElement(Button, {
825
+ size: "compact",
826
+ kind,
827
+ onClick
828
+ }, buttonChildren)), shouldShowExpandAction && /* @__PURE__ */ React.createElement(Button, {
829
+ className: styles$q[`${actionsClass}__buttons-expander`],
830
+ kind: "plain",
831
+ iconPosition: "right",
832
+ icon: /* @__PURE__ */ React.createElement(Icon, {
833
+ source: expandIcon
834
+ }),
835
+ onClick: () => setIsExpanded(!isExpanded)
836
+ }, expandButtonText))));
763
837
  };
764
838
  var styles$p = {
765
839
  "field-description": "lc-FieldDescription-module__field-description___IcRDH"
766
840
  };
767
841
  const baseClass$x = "field-description";
768
- const FieldDescription = (_k) => {
769
- var _l = _k, {
842
+ const FieldDescription = (_m) => {
843
+ var _n = _m, {
770
844
  children,
771
845
  className = ""
772
- } = _l, props = __objRest(_l, [
846
+ } = _n, props = __objRest(_n, [
773
847
  "children",
774
848
  "className"
775
849
  ]);
@@ -800,8 +874,8 @@ var styles$o = {
800
874
  checkbox__helper
801
875
  };
802
876
  const baseClass$w = "checkbox";
803
- const Checkbox = React.forwardRef((_m, ref) => {
804
- var _n = _m, { checked, disabled, children, description, className } = _n, restInputProps = __objRest(_n, ["checked", "disabled", "children", "description", "className"]);
877
+ const Checkbox = React.forwardRef((_o, ref) => {
878
+ var _p = _o, { checked, disabled, children, description, className } = _p, restInputProps = __objRest(_p, ["checked", "disabled", "children", "description", "className"]);
805
879
  return /* @__PURE__ */ React.createElement("div", {
806
880
  className: cx(styles$o[baseClass$w], className, {
807
881
  [styles$o[`${baseClass$w}--selected`]]: checked,
@@ -834,11 +908,11 @@ var styles$n = {
834
908
  "field-error": "lc-FieldError-module__field-error___IDkPT"
835
909
  };
836
910
  const baseClass$v = "field-error";
837
- const FieldError = (_o) => {
838
- var _p = _o, {
911
+ const FieldError = (_q) => {
912
+ var _r = _q, {
839
913
  children,
840
914
  className = ""
841
- } = _p, props = __objRest(_p, [
915
+ } = _r, props = __objRest(_r, [
842
916
  "children",
843
917
  "className"
844
918
  ]);
@@ -856,15 +930,15 @@ var styles$m = {
856
930
  "field-group--stretched": "lc-FieldGroup-module__field-group--stretched___6rkuO"
857
931
  };
858
932
  const baseClass$u = "field-group";
859
- const FieldGroup = (_q) => {
860
- var _r = _q, {
933
+ const FieldGroup = (_s) => {
934
+ var _t = _s, {
861
935
  className = "",
862
936
  children,
863
937
  description,
864
938
  error,
865
939
  inline,
866
940
  stretch
867
- } = _r, props = __objRest(_r, [
941
+ } = _t, props = __objRest(_t, [
868
942
  "className",
869
943
  "children",
870
944
  "description",
@@ -893,14 +967,14 @@ var styles$l = {
893
967
  form__helper
894
968
  };
895
969
  const baseClass$t = "form";
896
- const Form = (_s) => {
897
- var _t = _s, {
970
+ const Form = (_u) => {
971
+ var _v = _u, {
898
972
  className,
899
973
  children,
900
974
  labelText,
901
975
  helperText,
902
976
  formFooter
903
- } = _t, restProps = __objRest(_t, [
977
+ } = _v, restProps = __objRest(_v, [
904
978
  "className",
905
979
  "children",
906
980
  "labelText",
@@ -985,13 +1059,13 @@ var styles$j = {
985
1059
  "form-group__helper": "lc-FormGroup-module__form-group__helper___SRuxe"
986
1060
  };
987
1061
  const baseClass$r = "form-group";
988
- const FormGroup = (_u) => {
989
- var _v = _u, {
1062
+ const FormGroup = (_w) => {
1063
+ var _x = _w, {
990
1064
  className = "",
991
1065
  children,
992
1066
  labelText,
993
1067
  helperText
994
- } = _v, props = __objRest(_v, [
1068
+ } = _x, props = __objRest(_x, [
995
1069
  "className",
996
1070
  "children",
997
1071
  "labelText",
@@ -1024,8 +1098,8 @@ var styles$i = {
1024
1098
  "input--large": "lc-Input-module__input--large___jX5RW"
1025
1099
  };
1026
1100
  const baseClass$q = "input";
1027
- const Input = React.forwardRef((_w, ref) => {
1028
- var _x = _w, { size = "medium", error = false, className } = _x, inputProps = __objRest(_x, ["size", "error", "className"]);
1101
+ const Input = React.forwardRef((_y, ref) => {
1102
+ var _z = _y, { size = "medium", error = false, className } = _z, inputProps = __objRest(_z, ["size", "error", "className"]);
1029
1103
  return /* @__PURE__ */ React.createElement("input", __spreadValues({
1030
1104
  className: cx(className, styles$i[baseClass$q], styles$i[`${baseClass$q}--${size}`], {
1031
1105
  [styles$i[`${baseClass$q}--error`]]: error
@@ -1040,11 +1114,11 @@ var styles$h = {
1040
1114
  "link--bold": "lc-Link-module__link--bold___1rGdO"
1041
1115
  };
1042
1116
  const baseClass$p = "link";
1043
- const Link = (_y) => {
1044
- var _z = _y, {
1117
+ const Link = (_A) => {
1118
+ var _B = _A, {
1045
1119
  bold = false,
1046
1120
  className = ""
1047
- } = _z, rest = __objRest(_z, [
1121
+ } = _B, rest = __objRest(_B, [
1048
1122
  "bold",
1049
1123
  "className"
1050
1124
  ]);
@@ -1095,13 +1169,13 @@ const KeyCodes = {
1095
1169
  arrowDown: "ArrowDown"
1096
1170
  };
1097
1171
  const baseClass$o = "modal-base";
1098
- const ModalBase = (_A) => {
1099
- var _B = _A, {
1172
+ const ModalBase = (_C) => {
1173
+ var _D = _C, {
1100
1174
  children,
1101
1175
  className = "",
1102
1176
  onClose,
1103
1177
  closeOnEscPress = true
1104
- } = _B, props = __objRest(_B, [
1178
+ } = _D, props = __objRest(_D, [
1105
1179
  "children",
1106
1180
  "className",
1107
1181
  "onClose",
@@ -1141,14 +1215,14 @@ const ModalBase = (_A) => {
1141
1215
  }), children));
1142
1216
  };
1143
1217
  const baseClass$n = "action-modal";
1144
- const ActionModal = (_C) => {
1145
- var _D = _C, {
1218
+ const ActionModal = (_E) => {
1219
+ var _F = _E, {
1146
1220
  children,
1147
1221
  className = "",
1148
1222
  icon: icon2,
1149
1223
  heading,
1150
1224
  actions
1151
- } = _D, props = __objRest(_D, [
1225
+ } = _F, props = __objRest(_F, [
1152
1226
  "children",
1153
1227
  "className",
1154
1228
  "icon",
@@ -1169,13 +1243,13 @@ const ActionModal = (_C) => {
1169
1243
  }, actions));
1170
1244
  };
1171
1245
  const baseClass$m = "modal";
1172
- const Modal = (_E) => {
1173
- var _F = _E, {
1246
+ const Modal = (_G) => {
1247
+ var _H = _G, {
1174
1248
  children,
1175
1249
  className = "",
1176
1250
  heading,
1177
1251
  footer
1178
- } = _F, props = __objRest(_F, [
1252
+ } = _H, props = __objRest(_H, [
1179
1253
  "children",
1180
1254
  "className",
1181
1255
  "heading",
@@ -1228,8 +1302,8 @@ var styles$f = {
1228
1302
  "numeric-input--error": "lc-NumericInput-module__numeric-input--error___TMxRx"
1229
1303
  };
1230
1304
  const baseClass$l = "numeric-input";
1231
- const NumericInput = (_G) => {
1232
- var _H = _G, {
1305
+ const NumericInput = (_I) => {
1306
+ var _J = _I, {
1233
1307
  className,
1234
1308
  error,
1235
1309
  value,
@@ -1239,7 +1313,7 @@ const NumericInput = (_G) => {
1239
1313
  noControls,
1240
1314
  style,
1241
1315
  onChange
1242
- } = _H, restProps = __objRest(_H, [
1316
+ } = _J, restProps = __objRest(_J, [
1243
1317
  "className",
1244
1318
  "error",
1245
1319
  "value",
@@ -1793,13 +1867,13 @@ const SIZE_VALUE_FROM_SIZE = {
1793
1867
  large: 56
1794
1868
  };
1795
1869
  const baseClass$h = "progress-circle";
1796
- const ProgressCircle = React.forwardRef((_I, ref) => {
1797
- var _J = _I, {
1870
+ const ProgressCircle = React.forwardRef((_K, ref) => {
1871
+ var _L = _K, {
1798
1872
  status = "normal",
1799
1873
  progressValue,
1800
1874
  className,
1801
1875
  size = "medium"
1802
- } = _J, restProps = __objRest(_J, [
1876
+ } = _L, restProps = __objRest(_L, [
1803
1877
  "status",
1804
1878
  "progressValue",
1805
1879
  "className",
@@ -1854,13 +1928,13 @@ var styles$a = {
1854
1928
  "progress-bar__indicator--normal": "lc-ProgressBar-module__progress-bar__indicator--normal___0Uhle"
1855
1929
  };
1856
1930
  const baseClass$g = "progress-bar";
1857
- const ProgressBar = React.forwardRef((_K, ref) => {
1858
- var _L = _K, {
1931
+ const ProgressBar = React.forwardRef((_M, ref) => {
1932
+ var _N = _M, {
1859
1933
  status = "normal",
1860
1934
  percent,
1861
1935
  size = "medium",
1862
1936
  className = ""
1863
- } = _L, restProps = __objRest(_L, [
1937
+ } = _N, restProps = __objRest(_N, [
1864
1938
  "status",
1865
1939
  "percent",
1866
1940
  "size",
@@ -1980,8 +2054,8 @@ var styles$8 = {
1980
2054
  "radio-button--disabled": "lc-RadioButton-module__radio-button--disabled___wHSA7"
1981
2055
  };
1982
2056
  const baseClass$e = "radio-button";
1983
- const RadioButton = React.forwardRef((_M, ref) => {
1984
- var _N = _M, { children, className = "", description, checked, disabled } = _N, props = __objRest(_N, ["children", "className", "description", "checked", "disabled"]);
2057
+ const RadioButton = React.forwardRef((_O, ref) => {
2058
+ var _P = _O, { children, className = "", description, checked, disabled } = _P, props = __objRest(_P, ["children", "className", "description", "checked", "disabled"]);
1985
2059
  const mergedClassNames = cx(styles$8[baseClass$e], className, {
1986
2060
  [styles$8[`${baseClass$e}--selected`]]: checked,
1987
2061
  [styles$8[`${baseClass$e}--disabled`]]: disabled
@@ -2138,26 +2212,26 @@ var styles$6 = {
2138
2212
  "switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa"
2139
2213
  };
2140
2214
  const baseClass$c = "switch";
2141
- const Switch = (_O) => {
2142
- var _P = _O, {
2215
+ const Switch = (_Q) => {
2216
+ var _R = _Q, {
2143
2217
  className = "",
2144
2218
  defaultOn = false,
2145
2219
  disabled = false,
2146
- loading = false,
2147
2220
  name = baseClass$c,
2148
2221
  on,
2149
2222
  onChange = noop,
2150
2223
  size = "large",
2224
+ state = "regular",
2151
2225
  innerRef
2152
- } = _P, props = __objRest(_P, [
2226
+ } = _R, props = __objRest(_R, [
2153
2227
  "className",
2154
2228
  "defaultOn",
2155
2229
  "disabled",
2156
- "loading",
2157
2230
  "name",
2158
2231
  "on",
2159
2232
  "onChange",
2160
2233
  "size",
2234
+ "state",
2161
2235
  "innerRef"
2162
2236
  ]);
2163
2237
  const [checked, setChecked] = React.useState(() => on !== void 0 ? on : defaultOn);
@@ -2166,12 +2240,13 @@ const Switch = (_O) => {
2166
2240
  setChecked(on);
2167
2241
  }
2168
2242
  }, [on]);
2243
+ const isLoading = state === "loading";
2244
+ const isLocked = state === "locked";
2169
2245
  const iconSize = size === "large" ? "small" : "xsmall";
2170
2246
  const toggleStyles = checked ? "on" : "off";
2171
- const shouldBehaveAsDisabled = disabled || loading;
2247
+ const shouldBehaveAsDisabled = disabled || isLoading || isLocked;
2172
2248
  const availabilityStyles = shouldBehaveAsDisabled ? "disabled" : "enabled";
2173
2249
  const mergedClassNames = cx(styles$6[baseClass$c], styles$6[`${baseClass$c}--${size}`], className);
2174
- const shouldShowDisabledIcon = disabled && !loading;
2175
2250
  const handleChange = (e) => {
2176
2251
  const hasOnChangePassed = onChange !== noop;
2177
2252
  if (hasOnChangePassed) {
@@ -2198,10 +2273,10 @@ const Switch = (_O) => {
2198
2273
  className: cx(styles$6[`${baseClass$c}__track`], styles$6[`${baseClass$c}__track--${toggleStyles}`], styles$6[`${baseClass$c}__track--${availabilityStyles}`])
2199
2274
  }), /* @__PURE__ */ React.createElement("span", {
2200
2275
  className: cx(styles$6[`${baseClass$c}__slider`], styles$6[`${baseClass$c}__slider--${size}`], styles$6[`${baseClass$c}__slider--${size}--${toggleStyles}`])
2201
- }, loading && /* @__PURE__ */ React.createElement(Loader, {
2276
+ }, isLoading && /* @__PURE__ */ React.createElement(Loader, {
2202
2277
  className: cx(styles$6[`${baseClass$c}__loader`], styles$6[`${baseClass$c}__loader--${size}`])
2203
- }), shouldShowDisabledIcon && /* @__PURE__ */ React.createElement(Icon, {
2204
- "data-testid": "disabled-icon",
2278
+ }), isLocked && /* @__PURE__ */ React.createElement(Icon, {
2279
+ "data-testid": "lock-icon",
2205
2280
  size: iconSize,
2206
2281
  source: LockBlack,
2207
2282
  kind: "primary"
@@ -2215,13 +2290,13 @@ var styles$5 = {
2215
2290
  "tab--selected": "lc-Tab-module__tab--selected___c0EkL"
2216
2291
  };
2217
2292
  const baseClass$b = "tab";
2218
- const Tab = (_Q) => {
2219
- var _R = _Q, {
2293
+ const Tab = (_S) => {
2294
+ var _T = _S, {
2220
2295
  children,
2221
2296
  className,
2222
2297
  description,
2223
2298
  isSelected
2224
- } = _R, restProps = __objRest(_R, [
2299
+ } = _T, restProps = __objRest(_T, [
2225
2300
  "children",
2226
2301
  "className",
2227
2302
  "description",
@@ -2291,8 +2366,8 @@ const getCustomTextClass = (customColor) => {
2291
2366
  }
2292
2367
  return getContrast(customColor, "#FFFFFF") > 4.5 ? "text-white" : "text-black";
2293
2368
  };
2294
- const Tag = (_S) => {
2295
- var _T = _S, {
2369
+ const Tag = (_U) => {
2370
+ var _V = _U, {
2296
2371
  className = "",
2297
2372
  children,
2298
2373
  dismissible = false,
@@ -2303,7 +2378,7 @@ const Tag = (_S) => {
2303
2378
  icon: icon2,
2304
2379
  avatar: avatar2,
2305
2380
  customColor
2306
- } = _T, restProps = __objRest(_T, [
2381
+ } = _V, restProps = __objRest(_V, [
2307
2382
  "className",
2308
2383
  "children",
2309
2384
  "dismissible",
@@ -2619,15 +2694,15 @@ const iconConfig = {
2619
2694
  }
2620
2695
  };
2621
2696
  const baseClass$6 = "toast";
2622
- const Toast = (_U) => {
2623
- var _V = _U, {
2697
+ const Toast = (_W) => {
2698
+ var _X = _W, {
2624
2699
  action,
2625
2700
  className,
2626
2701
  children,
2627
2702
  removable,
2628
2703
  kind = "info",
2629
2704
  onClose
2630
- } = _V, divProps = __objRest(_V, [
2705
+ } = _X, divProps = __objRest(_X, [
2631
2706
  "action",
2632
2707
  "className",
2633
2708
  "children",