@thecb/components 10.5.0-beta.5 → 10.5.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
@@ -292,8 +292,17 @@ declare namespace colors_d {
292
292
 
293
293
  type StyleDeclaration = string;
294
294
 
295
+ interface StyleOptions {
296
+ XS?: string;
297
+ SM?: string;
298
+ MD?: string;
299
+ LG?: string;
300
+ XL?: string;
301
+ }
302
+
303
+ declare const BORDER_RADIUS: StyleOptions;
295
304
  declare const BORDER_THIN: StyleDeclaration;
296
- declare const CORNER_STANDARD: StyleDeclaration;
305
+ declare const FONT_SIZE: StyleOptions;
297
306
  declare const FONT_WEIGHT_REGULAR: StyleDeclaration;
298
307
  declare const FONT_WEIGHT_SEMIBOLD: StyleDeclaration;
299
308
  declare const FONT_WEIGHT_BOLD: StyleDeclaration;
@@ -303,11 +312,11 @@ declare const COMPACT_JUMBO_HEIGHT: StyleDeclaration;
303
312
  declare const JUMBO_HEIGHT: StyleDeclaration;
304
313
  declare const SPACER_HEIGHT: StyleDeclaration;
305
314
  declare const LINK_TEXT_DECORATION: StyleDeclaration;
306
- declare const SPACING_XS: StyleDeclaration;
307
- declare const SPACING_NORMAL: StyleDeclaration;
315
+ declare const SPACING: StyleOptions;
308
316
 
317
+ declare const style_constants_d_BORDER_RADIUS: typeof BORDER_RADIUS;
309
318
  declare const style_constants_d_BORDER_THIN: typeof BORDER_THIN;
310
- declare const style_constants_d_CORNER_STANDARD: typeof CORNER_STANDARD;
319
+ declare const style_constants_d_FONT_SIZE: typeof FONT_SIZE;
311
320
  declare const style_constants_d_FONT_WEIGHT_REGULAR: typeof FONT_WEIGHT_REGULAR;
312
321
  declare const style_constants_d_FONT_WEIGHT_SEMIBOLD: typeof FONT_WEIGHT_SEMIBOLD;
313
322
  declare const style_constants_d_FONT_WEIGHT_BOLD: typeof FONT_WEIGHT_BOLD;
@@ -317,12 +326,12 @@ declare const style_constants_d_COMPACT_JUMBO_HEIGHT: typeof COMPACT_JUMBO_HEIGH
317
326
  declare const style_constants_d_JUMBO_HEIGHT: typeof JUMBO_HEIGHT;
318
327
  declare const style_constants_d_SPACER_HEIGHT: typeof SPACER_HEIGHT;
319
328
  declare const style_constants_d_LINK_TEXT_DECORATION: typeof LINK_TEXT_DECORATION;
320
- declare const style_constants_d_SPACING_XS: typeof SPACING_XS;
321
- declare const style_constants_d_SPACING_NORMAL: typeof SPACING_NORMAL;
329
+ declare const style_constants_d_SPACING: typeof SPACING;
322
330
  declare namespace style_constants_d {
323
331
  export {
332
+ style_constants_d_BORDER_RADIUS as BORDER_RADIUS,
324
333
  style_constants_d_BORDER_THIN as BORDER_THIN,
325
- style_constants_d_CORNER_STANDARD as CORNER_STANDARD,
334
+ style_constants_d_FONT_SIZE as FONT_SIZE,
326
335
  style_constants_d_FONT_WEIGHT_REGULAR as FONT_WEIGHT_REGULAR,
327
336
  style_constants_d_FONT_WEIGHT_SEMIBOLD as FONT_WEIGHT_SEMIBOLD,
328
337
  style_constants_d_FONT_WEIGHT_BOLD as FONT_WEIGHT_BOLD,
@@ -332,8 +341,7 @@ declare namespace style_constants_d {
332
341
  style_constants_d_JUMBO_HEIGHT as JUMBO_HEIGHT,
333
342
  style_constants_d_SPACER_HEIGHT as SPACER_HEIGHT,
334
343
  style_constants_d_LINK_TEXT_DECORATION as LINK_TEXT_DECORATION,
335
- style_constants_d_SPACING_XS as SPACING_XS,
336
- style_constants_d_SPACING_NORMAL as SPACING_NORMAL,
344
+ style_constants_d_SPACING as SPACING,
337
345
  };
338
346
  }
339
347
 
package/dist/index.esm.js CHANGED
@@ -4900,8 +4900,19 @@ var themeUtils = /*#__PURE__*/Object.freeze({
4900
4900
 
4901
4901
  /* These are constants used by nav frontend components */
4902
4902
 
4903
+ var BORDER_RADIUS = {
4904
+ MD: "4px" // Figma: Corners/Standard Corner
4905
+ };
4903
4906
  var BORDER_THIN = "1px";
4904
- var CORNER_STANDARD = "4px";
4907
+ var FONT_SIZE = {
4908
+ XS: "0.750rem",
4909
+ // 12px
4910
+ SM: "0.875rem",
4911
+ // 14px
4912
+ MD: "1.000rem",
4913
+ // 16px
4914
+ LG: "1.125rem" // 18px
4915
+ };
4905
4916
  var FONT_WEIGHT_REGULAR = "400";
4906
4917
  var FONT_WEIGHT_SEMIBOLD = "600";
4907
4918
  var FONT_WEIGHT_BOLD = "700";
@@ -4911,13 +4922,17 @@ var COMPACT_JUMBO_HEIGHT = "65px";
4911
4922
  var JUMBO_HEIGHT = "300px";
4912
4923
  var SPACER_HEIGHT = "65px";
4913
4924
  var LINK_TEXT_DECORATION = "underline solid 1px";
4914
- var SPACING_XS = "1.0rem";
4915
- var SPACING_NORMAL = "1.5rem";
4925
+ var SPACING = {
4926
+ XS: "1.0rem",
4927
+ // Figma: Spacing/XS
4928
+ MD: "1.5rem" // Figma: Spacing/Normal
4929
+ };
4916
4930
 
4917
4931
  var style_constants = /*#__PURE__*/Object.freeze({
4918
4932
  __proto__: null,
4933
+ BORDER_RADIUS: BORDER_RADIUS,
4919
4934
  BORDER_THIN: BORDER_THIN,
4920
- CORNER_STANDARD: CORNER_STANDARD,
4935
+ FONT_SIZE: FONT_SIZE,
4921
4936
  FONT_WEIGHT_REGULAR: FONT_WEIGHT_REGULAR,
4922
4937
  FONT_WEIGHT_SEMIBOLD: FONT_WEIGHT_SEMIBOLD,
4923
4938
  FONT_WEIGHT_BOLD: FONT_WEIGHT_BOLD,
@@ -4927,8 +4942,7 @@ var style_constants = /*#__PURE__*/Object.freeze({
4927
4942
  JUMBO_HEIGHT: JUMBO_HEIGHT,
4928
4943
  SPACER_HEIGHT: SPACER_HEIGHT,
4929
4944
  LINK_TEXT_DECORATION: LINK_TEXT_DECORATION,
4930
- SPACING_XS: SPACING_XS,
4931
- SPACING_NORMAL: SPACING_NORMAL
4945
+ SPACING: SPACING
4932
4946
  });
4933
4947
 
4934
4948
  /*
@@ -14183,7 +14197,7 @@ var IconQuitLarge = function IconQuitLarge(_ref) {
14183
14197
  version: "1.1",
14184
14198
  xmlns: "http://www.w3.org/2000/svg",
14185
14199
  xmlnsXlink: "http://www.w3.org/1999/xlink"
14186
- }, /*#__PURE__*/React.createElement("title", null, "Icon/X"), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("polygon", {
14200
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("polygon", {
14187
14201
  id: "quit-large-path-1",
14188
14202
  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"
14189
14203
  })), /*#__PURE__*/React.createElement("g", {
@@ -25997,7 +26011,7 @@ var useToastNotification = function useToastNotification() {
25997
26011
  toastState = _useState2[0],
25998
26012
  setToastState = _useState2[1];
25999
26013
  useEffect$1(function () {
26000
- if (toastState.isOpen) {
26014
+ if (toastState.isOpen && timeout > 0) {
26001
26015
  setTimeout(function () {
26002
26016
  setToastState(initialToastState);
26003
26017
  }, timeout);
@@ -46454,7 +46468,7 @@ var ButtonLayoutWrapper = function ButtonLayoutWrapper(_ref) {
46454
46468
  var safeChildren = Array.isArray(children) ? children : [children];
46455
46469
  var flexGrow = isMobile ? "flex-grow: 1;" : "";
46456
46470
  return /*#__PURE__*/React.createElement(Box, {
46457
- padding: SPACING_NORMAL
46471
+ padding: SPACING.MD
46458
46472
  }, /*#__PURE__*/React.createElement(Stack, {
46459
46473
  childGap: "1rem",
46460
46474
  direction: "row",
@@ -46479,16 +46493,18 @@ var CancelButton = function CancelButton(_ref) {
46479
46493
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46480
46494
  _ref$isMobile = _ref.isMobile,
46481
46495
  isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
46482
- var fullWidth = isMobile ? "width: 100%;" : "";
46496
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46497
+ var width = isMobile ? "width: 100%;" : "";
46483
46498
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
46484
46499
  action: cancelAction ? cancelAction : hideModal,
46485
- borderRadius: CORNER_STANDARD,
46500
+ borderRadius: BORDER_RADIUS.MD,
46486
46501
  className: "modal-cancel-button",
46487
46502
  dataQa: cancelButtonText,
46488
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46503
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46489
46504
  name: cancelButtonText,
46490
46505
  role: "button",
46491
46506
  text: cancelButtonText,
46507
+ textExtraStyles: "".concat(fontSize),
46492
46508
  variant: "secondary"
46493
46509
  });
46494
46510
  };
@@ -46502,16 +46518,18 @@ var CloseButton = function CloseButton(_ref) {
46502
46518
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46503
46519
  _ref$isMobile = _ref.isMobile,
46504
46520
  isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
46505
- var fullWidth = isMobile ? "width: 100%;" : "";
46521
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46522
+ var width = isMobile ? "width: 100%;" : "";
46506
46523
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
46507
46524
  action: hideModal,
46508
- borderRadius: CORNER_STANDARD,
46525
+ borderRadius: BORDER_RADIUS.MD,
46509
46526
  className: "modal-close-button",
46510
46527
  dataQa: closeButtonText,
46511
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46528
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46512
46529
  name: closeButtonText,
46513
46530
  role: "button",
46514
46531
  text: closeButtonText,
46532
+ textExtraStyles: "".concat(fontSize),
46515
46533
  variant: "primary"
46516
46534
  });
46517
46535
  };
@@ -46534,19 +46552,21 @@ var ContinueButton = function ContinueButton(_ref) {
46534
46552
  _ref$useDangerButton = _ref.useDangerButton,
46535
46553
  useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton;
46536
46554
  var ContinueButtonAtom = continueURL ? ButtonWithLink : ButtonWithAction;
46537
- var fullWidth = isMobile ? "width: 100%;" : "";
46555
+ var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
46556
+ var width = isMobile ? "width: 100%;" : "";
46538
46557
  return /*#__PURE__*/React.createElement(ContinueButtonAtom, {
46539
46558
  action: continueAction,
46540
- borderRadius: CORNER_STANDARD,
46559
+ borderRadius: BORDER_RADIUS.MD,
46541
46560
  className: "modal-continue-button",
46542
46561
  dataQa: continueButtonText,
46543
46562
  disabled: isContinueActionDisabled,
46544
- extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(fullWidth),
46563
+ extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
46545
46564
  isLoading: isLoading,
46546
- linkExtraStyles: "display: inline-block; ".concat(fullWidth),
46565
+ linkExtraStyles: "display: inline-block; ".concat(width),
46547
46566
  name: continueButtonText,
46548
46567
  role: "button",
46549
46568
  text: continueButtonText,
46569
+ textExtraStyles: "".concat(fontSize),
46550
46570
  url: continueURL,
46551
46571
  variant: useDangerButton ? "danger" : "primary"
46552
46572
  });
@@ -46601,11 +46621,11 @@ var Modal$2 = function Modal(_ref) {
46601
46621
  _ref$maxHeight = _ref.maxHeight,
46602
46622
  maxHeight = _ref$maxHeight === void 0 ? "" : _ref$maxHeight,
46603
46623
  _ref$modalBodyBg = _ref.modalBodyBg,
46604
- modalBodyBg = _ref$modalBodyBg === void 0 ? ATHENS_GREY : _ref$modalBodyBg,
46624
+ modalBodyBg = _ref$modalBodyBg === void 0 ? "" : _ref$modalBodyBg,
46605
46625
  _ref$modalBodyText = _ref.modalBodyText,
46606
46626
  modalBodyText = _ref$modalBodyText === void 0 ? "" : _ref$modalBodyText,
46607
46627
  _ref$modalHeaderBg = _ref.modalHeaderBg,
46608
- modalHeaderBg = _ref$modalHeaderBg === void 0 ? WHITE : _ref$modalHeaderBg,
46628
+ modalHeaderBg = _ref$modalHeaderBg === void 0 ? "" : _ref$modalHeaderBg,
46609
46629
  _ref$modalHeaderText = _ref.modalHeaderText,
46610
46630
  modalHeaderText = _ref$modalHeaderText === void 0 ? "" : _ref$modalHeaderText,
46611
46631
  _ref$modalOpen = _ref.modalOpen,
@@ -46663,8 +46683,8 @@ var Modal$2 = function Modal(_ref) {
46663
46683
  WebkitBackdropFilter: blurUnderlay ? "blur(4px)" : "none"
46664
46684
  },
46665
46685
  dialogStyle: {
46666
- borderRadius: CORNER_STANDARD,
46667
- margin: SPACING_XS,
46686
+ borderRadius: BORDER_RADIUS.MD,
46687
+ margin: SPACING.XS,
46668
46688
  overflow: "auto",
46669
46689
  width: isMobile ? "" : customWidth || "615px"
46670
46690
  },
@@ -46676,29 +46696,29 @@ var Modal$2 = function Modal(_ref) {
46676
46696
  padding: "0",
46677
46697
  boxShadow: "inset 0px -2px 0px 0px rgb(0, 80, 149)"
46678
46698
  }, /*#__PURE__*/React.createElement(Box, {
46679
- background: modalHeaderBg,
46699
+ background: modalHeaderBg || WHITE,
46680
46700
  borderColor: SILVER_GREY,
46681
46701
  borderWidthOverride: "0 0 ".concat(BORDER_THIN, " 0"),
46682
- padding: "".concat(SPACING_XS, " ").concat(SPACING_NORMAL)
46702
+ padding: "".concat(SPACING.XS, " ").concat(SPACING.MD)
46683
46703
  }, /*#__PURE__*/React.createElement(Cluster, {
46684
46704
  justify: "flex-start",
46685
46705
  align: "center"
46686
46706
  }, /*#__PURE__*/React.createElement(Title$1, {
46687
46707
  as: "h2",
46688
46708
  weight: FONT_WEIGHT_SEMIBOLD,
46689
- fontSize: "1.25rem"
46709
+ fontSize: isMobile ? FONT_SIZE.MD : FONT_SIZE.LG
46690
46710
  }, modalHeaderText))), /*#__PURE__*/React.createElement(Box, {
46691
- background: modalBodyBg,
46711
+ background: modalBodyBg || ATHENS_GREY,
46692
46712
  padding: "0"
46693
46713
  }, /*#__PURE__*/React.createElement(Box, {
46694
- padding: SPACING_NORMAL,
46714
+ padding: SPACING.MD,
46695
46715
  borderWidthOverride: !noButtons && "0 0 ".concat(BORDER_THIN, " 0"),
46696
46716
  borderColor: !noButtons && SILVER_GREY,
46697
46717
  extraStyles: maxHeight ? "max-height: ".concat(maxHeight, "; overflow: auto;") : ""
46698
46718
  }, defaultWrapper ? /*#__PURE__*/React.createElement(Paragraph$1, {
46699
- variant: "p"
46719
+ variant: isMobile ? "pS" : "p"
46700
46720
  }, modalBodyText) : /*#__PURE__*/React.createElement(Box, {
46701
- padding: maxHeight ? "0 0 ".concat(SPACING_XS, " 0") : "0"
46721
+ padding: maxHeight ? "0 0 ".concat(SPACING.XS, " 0") : "0"
46702
46722
  }, modalBodyText)), noButtons ? /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement(ButtonLayoutWrapper, {
46703
46723
  isMobile: isMobile
46704
46724
  }, [hasCancelButton && /*#__PURE__*/React.createElement(CancelButton, {
@@ -50230,7 +50250,9 @@ var ToastNotification = function ToastNotification(_ref) {
50230
50250
  height = _ref$height === void 0 ? "56px" : _ref$height,
50231
50251
  _ref$childGap = _ref.childGap,
50232
50252
  childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
50233
- backgroundColor = _ref.backgroundColor;
50253
+ backgroundColor = _ref.backgroundColor,
50254
+ _ref$role = _ref.role,
50255
+ role = _ref$role === void 0 ? "alert" : _ref$role;
50234
50256
  return /*#__PURE__*/React.createElement(Box, {
50235
50257
  onClick: closeToastNotification,
50236
50258
  background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
@@ -50241,7 +50263,12 @@ var ToastNotification = function ToastNotification(_ref) {
50241
50263
  padding: "0rem 1rem",
50242
50264
  borderRadius: "4px",
50243
50265
  boxShadow: generateShadows().standard.base,
50244
- extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n ")
50266
+ extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n "),
50267
+ role: role
50268
+ }, /*#__PURE__*/React.createElement(Cluster, {
50269
+ align: "center",
50270
+ childGap: childGap,
50271
+ justify: "space-between"
50245
50272
  }, /*#__PURE__*/React.createElement(Cluster, {
50246
50273
  align: "center",
50247
50274
  childGap: childGap
@@ -50251,7 +50278,7 @@ var ToastNotification = function ToastNotification(_ref) {
50251
50278
  }, /*#__PURE__*/React.createElement(Paragraph$1, {
50252
50279
  weight: FONT_WEIGHT_SEMIBOLD,
50253
50280
  extraStyles: "word-break: break-word;"
50254
- }, message)), /*#__PURE__*/React.createElement(IconQuitLarge, null)));
50281
+ }, message))), /*#__PURE__*/React.createElement(IconQuitLarge, null)));
50255
50282
  };
50256
50283
 
50257
50284
  var fontWeight$9 = "600";