@thecb/components 10.5.0-beta.4 → 10.5.0-beta.6

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.cjs.js CHANGED
@@ -4908,8 +4908,19 @@ var themeUtils = /*#__PURE__*/Object.freeze({
4908
4908
 
4909
4909
  /* These are constants used by nav frontend components */
4910
4910
 
4911
+ var BORDER_RADIUS = {
4912
+ MD: "4px" // Figma: Corners/Standard Corner
4913
+ };
4911
4914
  var BORDER_THIN = "1px";
4912
- var CORNER_STANDARD = "4px";
4915
+ var FONT_SIZE = {
4916
+ XS: "0.750rem",
4917
+ // 12px
4918
+ SM: "0.875rem",
4919
+ // 14px
4920
+ MD: "1.000rem",
4921
+ // 16px
4922
+ LG: "1.125rem" // 18px
4923
+ };
4913
4924
  var FONT_WEIGHT_REGULAR = "400";
4914
4925
  var FONT_WEIGHT_SEMIBOLD = "600";
4915
4926
  var FONT_WEIGHT_BOLD = "700";
@@ -4919,13 +4930,17 @@ var COMPACT_JUMBO_HEIGHT = "65px";
4919
4930
  var JUMBO_HEIGHT = "300px";
4920
4931
  var SPACER_HEIGHT = "65px";
4921
4932
  var LINK_TEXT_DECORATION = "underline solid 1px";
4922
- var SPACING_XS = "1.0rem";
4923
- var SPACING_NORMAL = "1.5rem";
4933
+ var SPACING = {
4934
+ XS: "1.0rem",
4935
+ // Figma: Spacing/XS
4936
+ MD: "1.5rem" // Figma: Spacing/Normal
4937
+ };
4924
4938
 
4925
4939
  var style_constants = /*#__PURE__*/Object.freeze({
4926
4940
  __proto__: null,
4941
+ BORDER_RADIUS: BORDER_RADIUS,
4927
4942
  BORDER_THIN: BORDER_THIN,
4928
- CORNER_STANDARD: CORNER_STANDARD,
4943
+ FONT_SIZE: FONT_SIZE,
4929
4944
  FONT_WEIGHT_REGULAR: FONT_WEIGHT_REGULAR,
4930
4945
  FONT_WEIGHT_SEMIBOLD: FONT_WEIGHT_SEMIBOLD,
4931
4946
  FONT_WEIGHT_BOLD: FONT_WEIGHT_BOLD,
@@ -4935,8 +4950,7 @@ var style_constants = /*#__PURE__*/Object.freeze({
4935
4950
  JUMBO_HEIGHT: JUMBO_HEIGHT,
4936
4951
  SPACER_HEIGHT: SPACER_HEIGHT,
4937
4952
  LINK_TEXT_DECORATION: LINK_TEXT_DECORATION,
4938
- SPACING_XS: SPACING_XS,
4939
- SPACING_NORMAL: SPACING_NORMAL
4953
+ SPACING: SPACING
4940
4954
  });
4941
4955
 
4942
4956
  /*
@@ -14139,7 +14153,9 @@ var GenericErrorIcon = function GenericErrorIcon() {
14139
14153
  }));
14140
14154
  };
14141
14155
 
14142
- var IconAdd = function IconAdd() {
14156
+ var IconAdd = function IconAdd(_ref) {
14157
+ var _ref$strokeWidth = _ref.strokeWidth,
14158
+ strokeWidth = _ref$strokeWidth === void 0 ? 1 : _ref$strokeWidth;
14143
14159
  return /*#__PURE__*/React__default.createElement("svg", {
14144
14160
  xmlns: "http://www.w3.org/2000/svg",
14145
14161
  xmlnsXlink: "http://www.w3.org/1999/xlink",
@@ -14154,7 +14170,7 @@ var IconAdd = function IconAdd() {
14154
14170
  fill: "none",
14155
14171
  fillRule: "evenodd",
14156
14172
  stroke: "none",
14157
- strokeWidth: "1"
14173
+ strokeWidth: strokeWidth
14158
14174
  }, /*#__PURE__*/React__default.createElement("g", {
14159
14175
  transform: "translate(-407 -563)"
14160
14176
  }, /*#__PURE__*/React__default.createElement("g", {
@@ -14172,6 +14188,7 @@ var IconAdd = function IconAdd() {
14172
14188
  xlinkHref: "#path-1"
14173
14189
  })), /*#__PURE__*/React__default.createElement("circle", {
14174
14190
  className: "stroke",
14191
+ strokeWidth: strokeWidth,
14175
14192
  cx: "8.155",
14176
14193
  cy: "8.072",
14177
14194
  r: "8"
@@ -14188,7 +14205,7 @@ var IconQuitLarge = function IconQuitLarge(_ref) {
14188
14205
  version: "1.1",
14189
14206
  xmlns: "http://www.w3.org/2000/svg",
14190
14207
  xmlnsXlink: "http://www.w3.org/1999/xlink"
14191
- }, /*#__PURE__*/React__default.createElement("title", null, "Icon/X"), /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("polygon", {
14208
+ }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("polygon", {
14192
14209
  id: "quit-large-path-1",
14193
14210
  points: "18.9999989 6.40999946 17.589999 4.9999997 11.9999993 10.5899995 6.40999946 4.9999997 4.9999997 6.40999946 10.5899995 11.9999993 4.9999997 17.589999 6.40999946 18.9999989 11.9999993 13.409999 17.589999 18.9999989 18.9999989 17.589999 13.409999 11.9999993"
14194
14211
  })), /*#__PURE__*/React__default.createElement("g", {
@@ -26002,7 +26019,7 @@ var useToastNotification = function useToastNotification() {
26002
26019
  toastState = _useState2[0],
26003
26020
  setToastState = _useState2[1];
26004
26021
  React.useEffect(function () {
26005
- if (toastState.isOpen) {
26022
+ if (toastState.isOpen && timeout > 0) {
26006
26023
  setTimeout(function () {
26007
26024
  setToastState(initialToastState);
26008
26025
  }, timeout);
@@ -27844,13 +27861,13 @@ var Placeholder = function Placeholder(_ref2) {
27844
27861
  childGap: "0"
27845
27862
  }, variant === "large" && /*#__PURE__*/React__default.createElement("div", null), /*#__PURE__*/React__default.createElement(Box, {
27846
27863
  padding: "0",
27847
- extraStyles: ".fill { \n fill: ".concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } .stroke { \n stroke: ").concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n }")
27864
+ extraStyles: ".fill { \n fill: ".concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } .stroke { \n stroke: ").concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } ")
27848
27865
  }, variant === "large" ? /*#__PURE__*/React__default.createElement(Center, {
27849
27866
  intrinsic: true
27850
27867
  }, getLargeIcon(largeIcon), /*#__PURE__*/React__default.createElement(Text$1, {
27851
27868
  variant: "pS",
27852
27869
  color: themeValues.color,
27853
- weight: FONT_WEIGHT_REGULAR,
27870
+ weight: FONT_WEIGHT_SEMIBOLD,
27854
27871
  extraStyles: "text-align: center;"
27855
27872
  }, text)) : /*#__PURE__*/React__default.createElement(Cover, {
27856
27873
  singleChild: true,
@@ -27858,12 +27875,14 @@ var Placeholder = function Placeholder(_ref2) {
27858
27875
  }, /*#__PURE__*/React__default.createElement(Cluster, {
27859
27876
  justify: "center",
27860
27877
  align: "center"
27861
- }, /*#__PURE__*/React__default.createElement(IconAdd, null), /*#__PURE__*/React__default.createElement(Center, {
27878
+ }, /*#__PURE__*/React__default.createElement(IconAdd, {
27879
+ strokeWidth: "2"
27880
+ }), /*#__PURE__*/React__default.createElement(Center, {
27862
27881
  intrinsic: true
27863
27882
  }, /*#__PURE__*/React__default.createElement(Text$1, {
27864
27883
  variant: "pS",
27865
27884
  color: themeValues.color,
27866
- weight: FONT_WEIGHT_REGULAR,
27885
+ weight: FONT_WEIGHT_SEMIBOLD,
27867
27886
  extraStyles: "padding: 0 0 0 8px; text-align: center;"
27868
27887
  }, text)))))))))));
27869
27888
  };
@@ -46317,7 +46336,7 @@ var Modal$1 = function Modal(_ref) {
46317
46336
  // - https://react.dev/reference/react/useRef#caveats
46318
46337
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46319
46338
  // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46320
- var modalContainerRef = React.useRef("[id='react-aria-modal-dialog']");
46339
+ var modalContainerRef = React.useRef("#react-aria-modal-dialog");
46321
46340
  return /*#__PURE__*/React__default.createElement("div", {
46322
46341
  ref: modalContainerRef,
46323
46342
  tabIndex: "-1",
@@ -46457,7 +46476,7 @@ var ButtonLayoutWrapper = function ButtonLayoutWrapper(_ref) {
46457
46476
  var safeChildren = Array.isArray(children) ? children : [children];
46458
46477
  var flexGrow = isMobile ? "flex-grow: 1;" : "";
46459
46478
  return /*#__PURE__*/React__default.createElement(Box, {
46460
- padding: SPACING_NORMAL
46479
+ padding: SPACING.MD
46461
46480
  }, /*#__PURE__*/React__default.createElement(Stack, {
46462
46481
  childGap: "1rem",
46463
46482
  direction: "row",
@@ -46482,16 +46501,18 @@ var CancelButton = function CancelButton(_ref) {
46482
46501
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46483
46502
  _ref$isMobile = _ref.isMobile,
46484
46503
  isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
46485
- var fullWidth = isMobile ? "width: 100%;" : "";
46504
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46505
+ var width = isMobile ? "width: 100%;" : "";
46486
46506
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46487
46507
  action: cancelAction ? cancelAction : hideModal,
46488
- borderRadius: CORNER_STANDARD,
46508
+ borderRadius: BORDER_RADIUS.MD,
46489
46509
  className: "modal-cancel-button",
46490
46510
  dataQa: cancelButtonText,
46491
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46511
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46492
46512
  name: cancelButtonText,
46493
46513
  role: "button",
46494
46514
  text: cancelButtonText,
46515
+ textExtraStyles: "".concat(fontSize),
46495
46516
  variant: "secondary"
46496
46517
  });
46497
46518
  };
@@ -46505,16 +46526,18 @@ var CloseButton = function CloseButton(_ref) {
46505
46526
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46506
46527
  _ref$isMobile = _ref.isMobile,
46507
46528
  isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
46508
- var fullWidth = isMobile ? "width: 100%;" : "";
46529
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46530
+ var width = isMobile ? "width: 100%;" : "";
46509
46531
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46510
46532
  action: hideModal,
46511
- borderRadius: CORNER_STANDARD,
46533
+ borderRadius: BORDER_RADIUS.MD,
46512
46534
  className: "modal-close-button",
46513
46535
  dataQa: closeButtonText,
46514
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46536
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46515
46537
  name: closeButtonText,
46516
46538
  role: "button",
46517
46539
  text: closeButtonText,
46540
+ textExtraStyles: "".concat(fontSize),
46518
46541
  variant: "primary"
46519
46542
  });
46520
46543
  };
@@ -46537,19 +46560,21 @@ var ContinueButton = function ContinueButton(_ref) {
46537
46560
  _ref$useDangerButton = _ref.useDangerButton,
46538
46561
  useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton;
46539
46562
  var ContinueButtonAtom = continueURL ? ButtonWithLink : ButtonWithAction;
46540
- var fullWidth = isMobile ? "width: 100%;" : "";
46563
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46564
+ var width = isMobile ? "width: 100%;" : "";
46541
46565
  return /*#__PURE__*/React__default.createElement(ContinueButtonAtom, {
46542
46566
  action: continueAction,
46543
- borderRadius: CORNER_STANDARD,
46567
+ borderRadius: BORDER_RADIUS.MD,
46544
46568
  className: "modal-continue-button",
46545
46569
  dataQa: continueButtonText,
46546
46570
  disabled: isContinueActionDisabled,
46547
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46571
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46548
46572
  isLoading: isLoading,
46549
- linkExtraStyles: "display: inline-block; ".concat(fullWidth),
46573
+ linkExtraStyles: "display: inline-block; ".concat(width),
46550
46574
  name: continueButtonText,
46551
46575
  role: "button",
46552
46576
  text: continueButtonText,
46577
+ textExtraStyles: "".concat(fontSize),
46553
46578
  url: continueURL,
46554
46579
  variant: useDangerButton ? "danger" : "primary"
46555
46580
  });
@@ -46604,11 +46629,11 @@ var Modal$2 = function Modal(_ref) {
46604
46629
  _ref$maxHeight = _ref.maxHeight,
46605
46630
  maxHeight = _ref$maxHeight === void 0 ? "" : _ref$maxHeight,
46606
46631
  _ref$modalBodyBg = _ref.modalBodyBg,
46607
- modalBodyBg = _ref$modalBodyBg === void 0 ? ATHENS_GREY : _ref$modalBodyBg,
46632
+ modalBodyBg = _ref$modalBodyBg === void 0 ? "" : _ref$modalBodyBg,
46608
46633
  _ref$modalBodyText = _ref.modalBodyText,
46609
46634
  modalBodyText = _ref$modalBodyText === void 0 ? "" : _ref$modalBodyText,
46610
46635
  _ref$modalHeaderBg = _ref.modalHeaderBg,
46611
- modalHeaderBg = _ref$modalHeaderBg === void 0 ? WHITE : _ref$modalHeaderBg,
46636
+ modalHeaderBg = _ref$modalHeaderBg === void 0 ? "" : _ref$modalHeaderBg,
46612
46637
  _ref$modalHeaderText = _ref.modalHeaderText,
46613
46638
  modalHeaderText = _ref$modalHeaderText === void 0 ? "" : _ref$modalHeaderText,
46614
46639
  _ref$modalOpen = _ref.modalOpen,
@@ -46640,7 +46665,7 @@ var Modal$2 = function Modal(_ref) {
46640
46665
  // - https://react.dev/reference/react/useRef#caveats
46641
46666
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46642
46667
  // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46643
- var modalContainerRef = React.useRef("[id='react-aria-modal-dialog']");
46668
+ var modalContainerRef = React.useRef("#react-aria-modal-dialog");
46644
46669
  var hasCloseButton = onlyCloseButton && !noButtons;
46645
46670
  var hasCancelButton = !onlyContinueButton && !onlyCloseButton && !noButtons;
46646
46671
  var hasContinueButton = onlyContinueButton && !noButtons || !onlyCloseButton && !noButtons;
@@ -46666,8 +46691,8 @@ var Modal$2 = function Modal(_ref) {
46666
46691
  WebkitBackdropFilter: blurUnderlay ? "blur(4px)" : "none"
46667
46692
  },
46668
46693
  dialogStyle: {
46669
- borderRadius: CORNER_STANDARD,
46670
- margin: SPACING_XS,
46694
+ borderRadius: BORDER_RADIUS.MD,
46695
+ margin: SPACING.XS,
46671
46696
  overflow: "auto",
46672
46697
  width: isMobile ? "" : customWidth || "615px"
46673
46698
  },
@@ -46679,29 +46704,29 @@ var Modal$2 = function Modal(_ref) {
46679
46704
  padding: "0",
46680
46705
  boxShadow: "inset 0px -2px 0px 0px rgb(0, 80, 149)"
46681
46706
  }, /*#__PURE__*/React__default.createElement(Box, {
46682
- background: modalHeaderBg,
46707
+ background: modalHeaderBg || WHITE,
46683
46708
  borderColor: SILVER_GREY,
46684
46709
  borderWidthOverride: "0 0 ".concat(BORDER_THIN, " 0"),
46685
- padding: "".concat(SPACING_XS, " ").concat(SPACING_NORMAL)
46710
+ padding: "".concat(SPACING.XS, " ").concat(SPACING.MD)
46686
46711
  }, /*#__PURE__*/React__default.createElement(Cluster, {
46687
46712
  justify: "flex-start",
46688
46713
  align: "center"
46689
46714
  }, /*#__PURE__*/React__default.createElement(Title$1, {
46690
46715
  as: "h2",
46691
46716
  weight: FONT_WEIGHT_SEMIBOLD,
46692
- fontSize: "1.25rem"
46717
+ fontSize: isMobile ? FONT_SIZE.MD : FONT_SIZE.LG
46693
46718
  }, modalHeaderText))), /*#__PURE__*/React__default.createElement(Box, {
46694
- background: modalBodyBg,
46719
+ background: modalBodyBg || ATHENS_GREY,
46695
46720
  padding: "0"
46696
46721
  }, /*#__PURE__*/React__default.createElement(Box, {
46697
- padding: SPACING_NORMAL,
46722
+ padding: SPACING.MD,
46698
46723
  borderWidthOverride: !noButtons && "0 0 ".concat(BORDER_THIN, " 0"),
46699
46724
  borderColor: !noButtons && SILVER_GREY,
46700
46725
  extraStyles: maxHeight ? "max-height: ".concat(maxHeight, "; overflow: auto;") : ""
46701
46726
  }, defaultWrapper ? /*#__PURE__*/React__default.createElement(Paragraph$1, {
46702
- variant: "p"
46727
+ variant: isMobile ? "pS" : "p"
46703
46728
  }, modalBodyText) : /*#__PURE__*/React__default.createElement(Box, {
46704
- padding: maxHeight ? "0 0 ".concat(SPACING_XS, " 0") : "0"
46729
+ padding: maxHeight ? "0 0 ".concat(SPACING.XS, " 0") : "0"
46705
46730
  }, modalBodyText)), noButtons ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null) : /*#__PURE__*/React__default.createElement(ButtonLayoutWrapper, {
46706
46731
  isMobile: isMobile
46707
46732
  }, [hasCancelButton && /*#__PURE__*/React__default.createElement(CancelButton, {
@@ -50233,7 +50258,9 @@ var ToastNotification = function ToastNotification(_ref) {
50233
50258
  height = _ref$height === void 0 ? "56px" : _ref$height,
50234
50259
  _ref$childGap = _ref.childGap,
50235
50260
  childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
50236
- backgroundColor = _ref.backgroundColor;
50261
+ backgroundColor = _ref.backgroundColor,
50262
+ _ref$role = _ref.role,
50263
+ role = _ref$role === void 0 ? "alert" : _ref$role;
50237
50264
  return /*#__PURE__*/React__default.createElement(Box, {
50238
50265
  onClick: closeToastNotification,
50239
50266
  background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
@@ -50244,7 +50271,12 @@ var ToastNotification = function ToastNotification(_ref) {
50244
50271
  padding: "0rem 1rem",
50245
50272
  borderRadius: "4px",
50246
50273
  boxShadow: generateShadows().standard.base,
50247
- extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n ")
50274
+ extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n "),
50275
+ role: role
50276
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
50277
+ align: "center",
50278
+ childGap: childGap,
50279
+ justify: "space-between"
50248
50280
  }, /*#__PURE__*/React__default.createElement(Cluster, {
50249
50281
  align: "center",
50250
50282
  childGap: childGap
@@ -50254,7 +50286,7 @@ var ToastNotification = function ToastNotification(_ref) {
50254
50286
  }, /*#__PURE__*/React__default.createElement(Paragraph$1, {
50255
50287
  weight: FONT_WEIGHT_SEMIBOLD,
50256
50288
  extraStyles: "word-break: break-word;"
50257
- }, message)), /*#__PURE__*/React__default.createElement(IconQuitLarge, null)));
50289
+ }, message))), /*#__PURE__*/React__default.createElement(IconQuitLarge, null)));
50258
50290
  };
50259
50291
 
50260
50292
  var fontWeight$9 = "600";