@thecb/components 11.6.4-beta.0 → 11.6.4

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,25 @@ 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?:
603
+ | "info"
604
+ | "warn"
605
+ | "primary"
606
+ | "primaryHeadline"
607
+ | "secondary"
608
+ | "secondaryHeadline"
609
+ | "success"
610
+ | "disabled";
611
+ id?: string;
612
+ extraStyles?: string;
613
+ }
614
+
615
+ declare const Badge: React.FC<Expand<BadgeProps> & HTMLAttributes<HTMLElement>>;
616
+
598
617
  interface ButtonWithActionProps {
599
618
  action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
600
619
  disabled?: boolean;
@@ -714,7 +733,7 @@ interface DropdownProps {
714
733
  }
715
734
 
716
735
  declare const Dropdown: React.FC<Expand<DropdownProps> &
717
- React.HTMLAttributes<HTMLElement>>;
736
+ Omit<React.HTMLAttributes<HTMLElement>, "onSelect">>;
718
737
 
719
738
  type SortOrder = "asc" | "desc" | null;
720
739
  interface SortableTableHeadingProps {
@@ -1326,7 +1345,7 @@ interface CollapsibleSectionProps {
1326
1345
  ) => void;
1327
1346
  isMobile?: boolean;
1328
1347
  supportsTouch?: boolean;
1329
- title?: string;
1348
+ title?: string | JSX.Element;
1330
1349
  customPadding?: string;
1331
1350
  initiallyOpen?: boolean;
1332
1351
  openHeight?: string;
@@ -1341,7 +1360,7 @@ interface CollapsibleSectionProps {
1341
1360
  }
1342
1361
 
1343
1362
  declare const CollapsibleSection: React.FC<Expand<CollapsibleSectionProps> &
1344
- React.HTMLAttributes<HTMLElement>>;
1363
+ Omit<React.HTMLAttributes<HTMLElement>, "title">>; // ommitting title prop to avoid conflicts with component's title prop
1345
1364
 
1346
1365
  interface CopyableProps {
1347
1366
  content: string;
@@ -1523,5 +1542,5 @@ interface DefaultPageTemplateProps {
1523
1542
  declare const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
1524
1543
  React.HTMLAttributes<HTMLElement>>;
1525
1544
 
1526
- 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, Dropdown, DropdownProps, DropdownThemeValues, 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 };
1545
+ 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, Dropdown, DropdownProps, DropdownThemeValues, 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 };
1527
1546
  //# 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
  };
@@ -24113,7 +24163,7 @@ var errorFontSize = {
24113
24163
  "default": "0.75rem",
24114
24164
  disabled: "0.75rem"
24115
24165
  };
24116
- var fontWeight$2 = {
24166
+ var fontWeight$3 = {
24117
24167
  "default": "".concat(FONT_WEIGHT_REGULAR),
24118
24168
  disabled: "".concat(FONT_WEIGHT_REGULAR)
24119
24169
  };
@@ -24131,7 +24181,7 @@ var fallbackValues$j = {
24131
24181
  lineHeight: lineHeight$1,
24132
24182
  fontSize: fontSize$4,
24133
24183
  errorFontSize: errorFontSize,
24134
- fontWeight: fontWeight$2,
24184
+ fontWeight: fontWeight$3,
24135
24185
  hoverFocusStyles: hoverFocusStyles
24136
24186
  };
24137
24187
 
@@ -25857,7 +25907,7 @@ var errorFontSize$1 = {
25857
25907
  "default": "0.75rem",
25858
25908
  disabled: "0.75rem"
25859
25909
  };
25860
- var fontWeight$3 = {
25910
+ var fontWeight$4 = {
25861
25911
  "default": "".concat(FONT_WEIGHT_REGULAR),
25862
25912
  disabled: "".concat(FONT_WEIGHT_REGULAR)
25863
25913
  };
@@ -25878,7 +25928,7 @@ var fallbackValues$n = {
25878
25928
  lineHeight: lineHeight$2,
25879
25929
  fontSize: fontSize$6,
25880
25930
  errorFontSize: errorFontSize$1,
25881
- fontWeight: fontWeight$3,
25931
+ fontWeight: fontWeight$4,
25882
25932
  hoverFocusStyles: hoverFocusStyles$1,
25883
25933
  formFooterPanel: formFooterPanel
25884
25934
  };
@@ -26842,7 +26892,7 @@ var Jumbo = function Jumbo(_ref) {
26842
26892
  };
26843
26893
  var Jumbo$1 = withWindowSize(Jumbo);
26844
26894
 
26845
- var fontWeight$4 = {
26895
+ var fontWeight$5 = {
26846
26896
  // v1 variants
26847
26897
  "default": "600",
26848
26898
  pS: "600",
@@ -26859,7 +26909,7 @@ var fontWeight$4 = {
26859
26909
  large: "700" // fontsize Title small
26860
26910
  };
26861
26911
  var fallbackValues$t = {
26862
- fontWeight: fontWeight$4
26912
+ fontWeight: fontWeight$5
26863
26913
  };
26864
26914
 
26865
26915
  var LabeledAmountV1 = function LabeledAmountV1(_ref) {
@@ -38937,7 +38987,7 @@ var fontSize$9 = {
38937
38987
  largeTitle: "1.75rem",
38938
38988
  small: "1.25rem"
38939
38989
  };
38940
- var fontWeight$5 = {
38990
+ var fontWeight$6 = {
38941
38991
  "default": "600",
38942
38992
  largeTitle: "700",
38943
38993
  small: "600"
@@ -38984,7 +39034,7 @@ var backgroundColor$7 = {
38984
39034
  };
38985
39035
  var fallbackValues$G = {
38986
39036
  fontSize: fontSize$9,
38987
- fontWeight: fontWeight$5,
39037
+ fontWeight: fontWeight$6,
38988
39038
  fontColor: fontColor,
38989
39039
  lineHeight: lineHeight$3,
38990
39040
  textAlign: textAlign,
@@ -47625,7 +47675,7 @@ var fontSize$a = {
47625
47675
  var lineHeight$4 = {
47626
47676
  "default": "1.5rem"
47627
47677
  };
47628
- var fontWeight$6 = {
47678
+ var fontWeight$7 = {
47629
47679
  "default": FONT_WEIGHT_REGULAR
47630
47680
  };
47631
47681
  var modalLinkHoverFocus = {
@@ -47638,7 +47688,7 @@ var fallbackValues$R = {
47638
47688
  linkColor: linkColor$4,
47639
47689
  fontSize: fontSize$a,
47640
47690
  lineHeight: lineHeight$4,
47641
- fontWeight: fontWeight$6,
47691
+ fontWeight: fontWeight$7,
47642
47692
  modalLinkHoverFocus: modalLinkHoverFocus,
47643
47693
  linkTextDecoration: linkTextDecoration
47644
47694
  };
@@ -47720,7 +47770,7 @@ var lineHeight$5 = {
47720
47770
  "default": "1.5rem",
47721
47771
  footer: "1.25rem"
47722
47772
  };
47723
- var fontWeight$7 = {
47773
+ var fontWeight$8 = {
47724
47774
  "default": FONT_WEIGHT_REGULAR,
47725
47775
  footer: FONT_WEIGHT_SEMIBOLD
47726
47776
  };
@@ -47739,7 +47789,7 @@ var fallbackValues$S = {
47739
47789
  border: border$3,
47740
47790
  fontSize: fontSize$b,
47741
47791
  lineHeight: lineHeight$5,
47742
- fontWeight: fontWeight$7,
47792
+ fontWeight: fontWeight$8,
47743
47793
  modalLinkHoverFocus: modalLinkHoverFocus$1,
47744
47794
  modalLinkTextDecoration: modalLinkTextDecoration
47745
47795
  };
@@ -49596,13 +49646,13 @@ var ToastNotification = function ToastNotification(_ref) {
49596
49646
  }));
49597
49647
  };
49598
49648
 
49599
- var fontWeight$8 = "600";
49649
+ var fontWeight$9 = "600";
49600
49650
  var fontColor$1 = WHITE;
49601
49651
  var textAlign$1 = "left";
49602
49652
  var headerBackgroundColor$1 = BRIGHT_GREY;
49603
49653
  var imageBackgroundColor$1 = MATISSE_BLUE;
49604
49654
  var fallbackValues$Z = {
49605
- fontWeight: fontWeight$8,
49655
+ fontWeight: fontWeight$9,
49606
49656
  fontColor: fontColor$1,
49607
49657
  textAlign: textAlign$1,
49608
49658
  headerBackgroundColor: headerBackgroundColor$1,