@thecb/components 10.11.2 → 10.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.d.ts CHANGED
@@ -576,8 +576,10 @@ declare const ButtonWithLink: React.FC<Expand<ButtonWithLinkProps> &
576
576
  React.HTMLAttributes<HTMLElement>>;
577
577
 
578
578
  interface CardProps {
579
- text?: string;
579
+ text?: string | React.ReactNode;
580
+ textAs?: string;
580
581
  titleText?: string;
582
+ titleAs?: string;
581
583
  titleVariant?: string;
582
584
  extraStyles?: string;
583
585
  imgSrc?: string;
@@ -601,6 +603,10 @@ interface CardProps {
601
603
  borderRadius?: string;
602
604
  width?: string;
603
605
  padding?: string;
606
+ showQuitLink?: boolean;
607
+ onQuitClick?: (
608
+ event: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>
609
+ ) => void;
604
610
  }
605
611
 
606
612
  declare const Card: React.FC<Expand<CardProps> &
package/dist/index.esm.js CHANGED
@@ -39857,20 +39857,40 @@ var fallbackValues$E = {
39857
39857
  };
39858
39858
 
39859
39859
  var CardText = function CardText(_ref) {
39860
- var padding = _ref.padding,
39860
+ var showQuitLink = _ref.showQuitLink,
39861
+ onQuitClick = _ref.onQuitClick,
39862
+ titleAs = _ref.titleAs,
39863
+ padding = _ref.padding,
39861
39864
  text = _ref.text,
39865
+ _ref$textAs = _ref.textAs,
39866
+ textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
39862
39867
  titleText = _ref.titleText,
39863
39868
  _ref$titleVariant = _ref.titleVariant,
39864
39869
  titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
39865
39870
  themeValues = _ref.themeValues;
39866
39871
  return /*#__PURE__*/React.createElement(Box, {
39867
39872
  padding: padding
39868
- }, /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null, titleText && /*#__PURE__*/React.createElement(Title$1, {
39869
- as: "p",
39873
+ }, /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Cluster, {
39874
+ justify: "space-between",
39875
+ align: "center",
39876
+ overflow: true
39877
+ }, titleText && /*#__PURE__*/React.createElement(Title$1, {
39878
+ as: titleAs,
39870
39879
  variant: titleVariant,
39871
39880
  color: themeValues.titleColor,
39872
39881
  weight: themeValues.titleWeight
39873
- }, titleText), /*#__PURE__*/React.createElement(Paragraph$1, {
39882
+ }, titleText), showQuitLink && /*#__PURE__*/React.createElement(Box, {
39883
+ padding: "0",
39884
+ onClick: onQuitClick,
39885
+ onKeyDown: function onKeyDown(e) {
39886
+ return e.key === "Enter" && onQuitClick();
39887
+ },
39888
+ role: "button",
39889
+ tabIndex: 0,
39890
+ "aria-label": "Close Card: ".concat(titleText),
39891
+ extraStyles: "cursor: pointer;"
39892
+ }, /*#__PURE__*/React.createElement(IconQuitLarge, null))), /*#__PURE__*/React.createElement(Paragraph$1, {
39893
+ as: textAs,
39874
39894
  color: themeValues.textColor
39875
39895
  }, text))));
39876
39896
  };
@@ -39911,9 +39931,17 @@ var Card = function Card(_ref) {
39911
39931
  _ref$imgObjectFit = _ref.imgObjectFit,
39912
39932
  imgObjectFit = _ref$imgObjectFit === void 0 ? "none" : _ref$imgObjectFit,
39913
39933
  imgAltText = _ref.imgAltText,
39934
+ _ref$onQuitClick = _ref.onQuitClick,
39935
+ onQuitClick = _ref$onQuitClick === void 0 ? noop : _ref$onQuitClick,
39914
39936
  _ref$padding = _ref.padding,
39915
39937
  padding = _ref$padding === void 0 ? "24px" : _ref$padding,
39938
+ _ref$showQuitLink = _ref.showQuitLink,
39939
+ showQuitLink = _ref$showQuitLink === void 0 ? false : _ref$showQuitLink,
39916
39940
  text = _ref.text,
39941
+ _ref$textAs = _ref.textAs,
39942
+ textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
39943
+ _ref$titleAs = _ref.titleAs,
39944
+ titleAs = _ref$titleAs === void 0 ? "h2" : _ref$titleAs,
39917
39945
  titleText = _ref.titleText,
39918
39946
  _ref$titleVariant = _ref.titleVariant,
39919
39947
  titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
@@ -39970,9 +39998,13 @@ var Card = function Card(_ref) {
39970
39998
  width: "100%",
39971
39999
  extraStyles: "flex-basis: 100%;"
39972
40000
  }, text && /*#__PURE__*/React.createElement(CardText$1, {
40001
+ onQuitClick: onQuitClick,
39973
40002
  padding: padding,
40003
+ showQuitLink: showQuitLink,
40004
+ titleAs: titleAs,
39974
40005
  titleText: titleText,
39975
40006
  text: text,
40007
+ textAs: textAs,
39976
40008
  titleVariant: titleVariant
39977
40009
  }), children)))));
39978
40010
  };