@thecb/components 11.6.2 → 11.6.3-beta.1

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
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React, { ReactNode, HTMLAttributes } from 'react';
2
2
 
3
3
  type Color = string;
4
4
 
@@ -595,6 +595,15 @@ interface AlertProps {
595
595
  declare const Alert: React.FC<Expand<AlertProps> &
596
596
  React.HTMLAttributes<HTMLElement>>;
597
597
 
598
+ interface BadgeProps {
599
+ label: string;
600
+ Icon?: JSX.Element;
601
+ iconOnLeft?: boolean;
602
+ variant?: "info" | "warn" | "primary" | "primaryHeadline" | "secondary" | "secondaryHeadline" | "success" | "disabled";
603
+ }
604
+
605
+ declare const Badge: React.FC<Expand<BadgeProps> & HTMLAttributes<HTMLElement>>;
606
+
598
607
  interface ButtonWithActionProps {
599
608
  action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
600
609
  disabled?: boolean;
@@ -1272,7 +1281,7 @@ interface CollapsibleSectionProps {
1272
1281
  ) => void;
1273
1282
  isMobile?: boolean;
1274
1283
  supportsTouch?: boolean;
1275
- title?: string;
1284
+ title?: string | JSX.Element;
1276
1285
  customPadding?: string;
1277
1286
  initiallyOpen?: boolean;
1278
1287
  openHeight?: string;
@@ -1469,5 +1478,5 @@ interface DefaultPageTemplateProps {
1469
1478
  declare const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
1470
1479
  React.HTMLAttributes<HTMLElement>>;
1471
1480
 
1472
- export { AddValidatorAction, Alert, AlertProps, ArrowDownCircleIconSmall, ArrowDownCircleIconSmallProps, ArrowLeftCircleIconMedium, ArrowLeftCircleIconMediumProps, ArrowLeftCircleIconSmall, ArrowLeftCircleIconSmallProps, ArrowRightCircleIconSmall, ArrowRightCircleIconSmallProps, ArrowUpCircleIconSmall, ArrowUpCircleIconSmallProps, BankIconLarge, BankIconLargeProps, Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, CaretArrowDown, CaretArrowDownProps, CaretArrowUp, CaretArrowUpProps, CashieringImage, Center, CenterProps, ChargebackIconMedium, ChargebackIconMediumProps, ChargebackIconSmall, ChargebackIconSmallProps, ChargebackReversalIconMedium, ChargebackReversalIconMediumProps, ChargebackReversalIconSmall, ChargebackReversalIconSmallProps, ClearAction, CloseIcon, Cluster, ClusterProps, CollapsibleSection, CollapsibleSectionProps, Copyable, CopyableProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, EditableTable, EditableTableProps, ErrorMessageDictionary, ExternalLink, ExternalLinkProps, Field, FieldActionPayload, FieldActions, FooterWithSubfooter, FooterWithSubfooterProps, FormInput, FormInputProps, FormSelect, FormSelectOption, FormSelectProps, FormTextarea, FormTextareaProps, GuidedCheckoutImage, HistoryIconSmall, InternalLink, InternalLinkProps, KebabMenuIcon, KioskImage, Loading, LoadingProps, MultiCartIcon, MultipleSelectFilter, MultipleSelectFilterProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, PaydotImage, Popover, PopoverProps, PopupMenu, PopupMenuProps, ProfileImage, RadioGroup, RadioGroupProps, ReduxAction, RefundIconMedium, RefundIconMediumProps, RefundIconSmall, RefundIconSmallProps, RemoveValidatorAction, RevenueManagementImage, Search, SearchProps, SearchableSelect, SearchableSelectOption, SearchableSelectProps, SetAction, SortOrder, SortableTableHeading, SortableTableHeadingProps, Spinner, SpinnerProps, Stack, StackProps, StandardCheckoutImage, SuccessfulIconMedium, SuccessfulIconMediumProps, SuccessfulIconSmall, SuccessfulIconSmallProps, Switcher, SwitcherProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeading, TableHeadingProps, TableListItem, TableListItemProps, TableProps, TableRow, TableRowProps, Text, TextProps, Title, TitleProps, ToastNotification, ToastNotificationProps, ToastVariants, TrashIconV2, ValidatorFn, XCircleIconMedium, XCircleIconMediumProps, XCircleIconSmall, XCircleIconSmallProps, index_d as constants, index as hooks };
1481
+ export { AddValidatorAction, Alert, AlertProps, ArrowDownCircleIconSmall, ArrowDownCircleIconSmallProps, ArrowLeftCircleIconMedium, ArrowLeftCircleIconMediumProps, ArrowLeftCircleIconSmall, ArrowLeftCircleIconSmallProps, ArrowRightCircleIconSmall, ArrowRightCircleIconSmallProps, ArrowUpCircleIconSmall, ArrowUpCircleIconSmallProps, Badge, BadgeProps, BankIconLarge, BankIconLargeProps, Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, CaretArrowDown, CaretArrowDownProps, CaretArrowUp, CaretArrowUpProps, CashieringImage, Center, CenterProps, ChargebackIconMedium, ChargebackIconMediumProps, ChargebackIconSmall, ChargebackIconSmallProps, ChargebackReversalIconMedium, ChargebackReversalIconMediumProps, ChargebackReversalIconSmall, ChargebackReversalIconSmallProps, ClearAction, CloseIcon, Cluster, ClusterProps, CollapsibleSection, CollapsibleSectionProps, Copyable, CopyableProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, EditableTable, EditableTableProps, ErrorMessageDictionary, ExternalLink, ExternalLinkProps, Field, FieldActionPayload, FieldActions, FooterWithSubfooter, FooterWithSubfooterProps, FormInput, FormInputProps, FormSelect, FormSelectOption, FormSelectProps, FormTextarea, FormTextareaProps, GuidedCheckoutImage, HistoryIconSmall, InternalLink, InternalLinkProps, KebabMenuIcon, KioskImage, Loading, LoadingProps, MultiCartIcon, MultipleSelectFilter, MultipleSelectFilterProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, PaydotImage, Popover, PopoverProps, PopupMenu, PopupMenuProps, ProfileImage, RadioGroup, RadioGroupProps, ReduxAction, RefundIconMedium, RefundIconMediumProps, RefundIconSmall, RefundIconSmallProps, RemoveValidatorAction, RevenueManagementImage, Search, SearchProps, SearchableSelect, SearchableSelectOption, SearchableSelectProps, SetAction, SortOrder, SortableTableHeading, SortableTableHeadingProps, Spinner, SpinnerProps, Stack, StackProps, StandardCheckoutImage, SuccessfulIconMedium, SuccessfulIconMediumProps, SuccessfulIconSmall, SuccessfulIconSmallProps, Switcher, SwitcherProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeading, TableHeadingProps, TableListItem, TableListItemProps, TableProps, TableRow, TableRowProps, Text, TextProps, Title, TitleProps, ToastNotification, ToastNotificationProps, ToastVariants, TrashIconV2, ValidatorFn, XCircleIconMedium, XCircleIconMediumProps, XCircleIconSmall, XCircleIconSmallProps, index_d as constants, index as hooks };
1473
1482
  //# sourceMappingURL=index.d.ts.map
package/dist/index.esm.js CHANGED
@@ -348,6 +348,8 @@ var BORDER_RADIUS = {
348
348
  };
349
349
  var BORDER_THIN = "1px";
350
350
  var FONT_SIZE = {
351
+ XXS: "0.625rem",
352
+ // 10px
351
353
  XS: "0.750rem",
352
354
  // 12px
353
355
  SM: "0.875rem",
@@ -19715,6 +19717,9 @@ var background$1 = {
19715
19717
  info: "".concat(INFO_BLUE),
19716
19718
  warn: "".concat(HALF_COLONIAL_WHITE),
19717
19719
  primary: "".concat(CORNFLOWER_BLUE),
19720
+ primaryHeadline: "".concat(CORNFLOWER_BLUE),
19721
+ secondary: "".concat(ROYAL_BLUE_VIVID),
19722
+ secondaryHeadline: "".concat(ROYAL_BLUE_VIVID),
19718
19723
  success: "".concat(HINT_GREEN),
19719
19724
  disabled: "".concat(GRECIAN_GREY)
19720
19725
  };
@@ -19722,12 +19727,48 @@ var color$5 = {
19722
19727
  info: "".concat(MATISSE_BLUE),
19723
19728
  warn: "".concat(ZEST_ORANGE),
19724
19729
  primary: "".concat(ROYAL_BLUE_VIVID),
19730
+ primaryHeadline: "".concat(ROYAL_BLUE_VIVID),
19731
+ secondary: "".concat(CORNFLOWER_BLUE),
19732
+ secondaryHeadline: "".concat(CORNFLOWER_BLUE),
19725
19733
  success: "".concat(SEA_GREEN),
19726
19734
  disabled: "".concat(MANATEE_GREY)
19727
19735
  };
19736
+ var fontWeight$1 = {
19737
+ info: FONT_WEIGHT_REGULAR,
19738
+ warn: FONT_WEIGHT_REGULAR,
19739
+ primary: FONT_WEIGHT_REGULAR,
19740
+ primaryHeadline: FONT_WEIGHT_SEMIBOLD,
19741
+ secondary: FONT_WEIGHT_REGULAR,
19742
+ secondaryHeadline: FONT_WEIGHT_SEMIBOLD,
19743
+ success: FONT_WEIGHT_REGULAR,
19744
+ disabled: FONT_WEIGHT_REGULAR
19745
+ };
19746
+ var fontSizeMobile = {
19747
+ info: fallbackValues.fontSize.pXXS,
19748
+ warn: fallbackValues.fontSize.pXXS,
19749
+ primary: fallbackValues.fontSize.pXXS,
19750
+ primaryHeadline: fallbackValues.fontSize.pXS,
19751
+ secondary: fallbackValues.fontSize.pXXS,
19752
+ secondaryHeadline: fallbackValues.fontSize.pXS,
19753
+ success: fallbackValues.fontSize.pXXS,
19754
+ disabled: fallbackValues.fontSize.pXXS
19755
+ };
19756
+ var fontSizeDesktop = {
19757
+ info: fallbackValues.fontSize.pXS,
19758
+ warn: fallbackValues.fontSize.pXS,
19759
+ primary: fallbackValues.fontSize.pXS,
19760
+ primaryHeadline: fallbackValues.fontSize.pS,
19761
+ secondary: fallbackValues.fontSize.pXS,
19762
+ secondaryHeadline: fallbackValues.fontSize.pS,
19763
+ success: fallbackValues.fontSize.pXS,
19764
+ disabled: fallbackValues.fontSize.pXS
19765
+ };
19728
19766
  var fallbackValues$7 = {
19729
19767
  background: background$1,
19730
- color: color$5
19768
+ color: color$5,
19769
+ fontWeight: fontWeight$1,
19770
+ fontSizeMobile: fontSizeMobile,
19771
+ fontSizeDesktop: fontSizeDesktop
19731
19772
  };
19732
19773
 
19733
19774
  var StyledBadgeContainer = styled(Box).withConfig({
@@ -19737,22 +19778,31 @@ var StyledBadgeContainer = styled(Box).withConfig({
19737
19778
  var StyledBadge = styled(Text$1).withConfig({
19738
19779
  displayName: "Badge__StyledBadge",
19739
19780
  componentId: "sc-1g438j-1"
19740
- })(["font-family:\"Public Sans\",sans-serif;font-size:10px;font-style:normal;font-weight:400;line-height:150%;letter-spacing:0.2px;white-space:nowrap;@media screen and (min-width:1049px){font-size:12px;line-height:150%;letter-spacing:0.24px;}"]);
19781
+ })(["line-height:150%;letter-spacing:", ";white-space:nowrap;"], function (props) {
19782
+ return props.isMobile ? "0.2px" : "0.24px";
19783
+ });
19741
19784
  var Badge = function Badge(_ref) {
19742
19785
  var label = _ref.label,
19743
19786
  Icon = _ref.Icon,
19744
19787
  themeValues = _ref.themeValues,
19745
19788
  _ref$iconOnLeft = _ref.iconOnLeft,
19746
19789
  iconOnLeft = _ref$iconOnLeft === void 0 ? true : _ref$iconOnLeft,
19747
- id = _ref.id;
19790
+ id = _ref.id,
19791
+ extraStyles = _ref.extraStyles;
19792
+ var _useContext = useContext(ThemeContext),
19793
+ isMobile = _useContext.isMobile;
19748
19794
  return /*#__PURE__*/React__default.createElement(StyledBadgeContainer, {
19749
19795
  background: themeValues.background,
19750
- id: id
19796
+ id: id,
19797
+ extraStyles: extraStyles
19751
19798
  }, iconOnLeft && Icon && /*#__PURE__*/React__default.createElement(Icon, {
19752
19799
  color: themeValues.color,
19753
19800
  fill: themeValues.color
19754
19801
  }), /*#__PURE__*/React__default.createElement(StyledBadge, {
19755
- color: themeValues.color
19802
+ color: themeValues.color,
19803
+ weight: themeValues.fontWeight,
19804
+ fontSize: isMobile ? themeValues.fontSizeMobile : themeValues.fontSizeDesktop,
19805
+ isMobile: isMobile
19756
19806
  }, label), !iconOnLeft && Icon && /*#__PURE__*/React__default.createElement(Icon, {
19757
19807
  color: themeValues.color,
19758
19808
  fill: themeValues.color
@@ -21142,7 +21192,7 @@ var activeColor$2 = "".concat(STORM_GREY$1);
21142
21192
  var activeBreadcrumbColor = "".concat(STORM_GREY$1);
21143
21193
  var fontSize$2 = "0.875rem";
21144
21194
  var lineHeight = "1.25rem";
21145
- var fontWeight$1 = "400";
21195
+ var fontWeight$2 = "400";
21146
21196
  var margin = "0.5rem";
21147
21197
  var hover = "text-decoration: ".concat(LINK_TEXT_DECORATION$2, ";");
21148
21198
  var fallbackValues$9 = {
@@ -21151,7 +21201,7 @@ var fallbackValues$9 = {
21151
21201
  activeBreadcrumbColor: activeBreadcrumbColor,
21152
21202
  fontSize: fontSize$2,
21153
21203
  lineHeight: lineHeight,
21154
- fontWeight: fontWeight$1,
21204
+ fontWeight: fontWeight$2,
21155
21205
  margin: margin,
21156
21206
  hover: hover
21157
21207
  };
@@ -24112,7 +24162,7 @@ var errorFontSize = {
24112
24162
  "default": "0.75rem",
24113
24163
  disabled: "0.75rem"
24114
24164
  };
24115
- var fontWeight$2 = {
24165
+ var fontWeight$3 = {
24116
24166
  "default": "".concat(FONT_WEIGHT_REGULAR),
24117
24167
  disabled: "".concat(FONT_WEIGHT_REGULAR)
24118
24168
  };
@@ -24130,7 +24180,7 @@ var fallbackValues$j = {
24130
24180
  lineHeight: lineHeight$1,
24131
24181
  fontSize: fontSize$4,
24132
24182
  errorFontSize: errorFontSize,
24133
- fontWeight: fontWeight$2,
24183
+ fontWeight: fontWeight$3,
24134
24184
  hoverFocusStyles: hoverFocusStyles
24135
24185
  };
24136
24186
 
@@ -25856,7 +25906,7 @@ var errorFontSize$1 = {
25856
25906
  "default": "0.75rem",
25857
25907
  disabled: "0.75rem"
25858
25908
  };
25859
- var fontWeight$3 = {
25909
+ var fontWeight$4 = {
25860
25910
  "default": "".concat(FONT_WEIGHT_REGULAR),
25861
25911
  disabled: "".concat(FONT_WEIGHT_REGULAR)
25862
25912
  };
@@ -25877,7 +25927,7 @@ var fallbackValues$n = {
25877
25927
  lineHeight: lineHeight$2,
25878
25928
  fontSize: fontSize$6,
25879
25929
  errorFontSize: errorFontSize$1,
25880
- fontWeight: fontWeight$3,
25930
+ fontWeight: fontWeight$4,
25881
25931
  hoverFocusStyles: hoverFocusStyles$1,
25882
25932
  formFooterPanel: formFooterPanel
25883
25933
  };
@@ -26841,7 +26891,7 @@ var Jumbo = function Jumbo(_ref) {
26841
26891
  };
26842
26892
  var Jumbo$1 = withWindowSize(Jumbo);
26843
26893
 
26844
- var fontWeight$4 = {
26894
+ var fontWeight$5 = {
26845
26895
  // v1 variants
26846
26896
  "default": "600",
26847
26897
  pS: "600",
@@ -26858,7 +26908,7 @@ var fontWeight$4 = {
26858
26908
  large: "700" // fontsize Title small
26859
26909
  };
26860
26910
  var fallbackValues$t = {
26861
- fontWeight: fontWeight$4
26911
+ fontWeight: fontWeight$5
26862
26912
  };
26863
26913
 
26864
26914
  var LabeledAmountV1 = function LabeledAmountV1(_ref) {
@@ -38936,7 +38986,7 @@ var fontSize$9 = {
38936
38986
  largeTitle: "1.75rem",
38937
38987
  small: "1.25rem"
38938
38988
  };
38939
- var fontWeight$5 = {
38989
+ var fontWeight$6 = {
38940
38990
  "default": "600",
38941
38991
  largeTitle: "700",
38942
38992
  small: "600"
@@ -38983,7 +39033,7 @@ var backgroundColor$7 = {
38983
39033
  };
38984
39034
  var fallbackValues$G = {
38985
39035
  fontSize: fontSize$9,
38986
- fontWeight: fontWeight$5,
39036
+ fontWeight: fontWeight$6,
38987
39037
  fontColor: fontColor,
38988
39038
  lineHeight: lineHeight$3,
38989
39039
  textAlign: textAlign,
@@ -47624,7 +47674,7 @@ var fontSize$a = {
47624
47674
  var lineHeight$4 = {
47625
47675
  "default": "1.5rem"
47626
47676
  };
47627
- var fontWeight$6 = {
47677
+ var fontWeight$7 = {
47628
47678
  "default": FONT_WEIGHT_REGULAR
47629
47679
  };
47630
47680
  var modalLinkHoverFocus = {
@@ -47637,7 +47687,7 @@ var fallbackValues$R = {
47637
47687
  linkColor: linkColor$4,
47638
47688
  fontSize: fontSize$a,
47639
47689
  lineHeight: lineHeight$4,
47640
- fontWeight: fontWeight$6,
47690
+ fontWeight: fontWeight$7,
47641
47691
  modalLinkHoverFocus: modalLinkHoverFocus,
47642
47692
  linkTextDecoration: linkTextDecoration
47643
47693
  };
@@ -47719,7 +47769,7 @@ var lineHeight$5 = {
47719
47769
  "default": "1.5rem",
47720
47770
  footer: "1.25rem"
47721
47771
  };
47722
- var fontWeight$7 = {
47772
+ var fontWeight$8 = {
47723
47773
  "default": FONT_WEIGHT_REGULAR,
47724
47774
  footer: FONT_WEIGHT_SEMIBOLD
47725
47775
  };
@@ -47738,7 +47788,7 @@ var fallbackValues$S = {
47738
47788
  border: border$3,
47739
47789
  fontSize: fontSize$b,
47740
47790
  lineHeight: lineHeight$5,
47741
- fontWeight: fontWeight$7,
47791
+ fontWeight: fontWeight$8,
47742
47792
  modalLinkHoverFocus: modalLinkHoverFocus$1,
47743
47793
  modalLinkTextDecoration: modalLinkTextDecoration
47744
47794
  };
@@ -49595,13 +49645,13 @@ var ToastNotification = function ToastNotification(_ref) {
49595
49645
  }));
49596
49646
  };
49597
49647
 
49598
- var fontWeight$8 = "600";
49648
+ var fontWeight$9 = "600";
49599
49649
  var fontColor$1 = WHITE;
49600
49650
  var textAlign$1 = "left";
49601
49651
  var headerBackgroundColor$1 = BRIGHT_GREY;
49602
49652
  var imageBackgroundColor$1 = MATISSE_BLUE;
49603
49653
  var fallbackValues$Z = {
49604
- fontWeight: fontWeight$8,
49654
+ fontWeight: fontWeight$9,
49605
49655
  fontColor: fontColor$1,
49606
49656
  textAlign: textAlign$1,
49607
49657
  headerBackgroundColor: headerBackgroundColor$1,