@thecb/components 5.3.4 → 5.6.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.esm.js CHANGED
@@ -12138,7 +12138,7 @@ var Motion = function Motion(_ref) {
12138
12138
  var ReelStyled = styled.div.withConfig({
12139
12139
  displayName: "Reelstyled__ReelStyled",
12140
12140
  componentId: "sc-bhf05j-0"
12141
- })(["display:flex;overflow-x:", ";padding:", ";height:", ";justify-content:", ";> * + *{margin-left:", ";}> *{flex:0 0 ", ";}"], function (_ref) {
12141
+ })(["display:flex;overflow-x:", ";padding:", ";height:", ";justify-content:", ";> * + *{margin-left:", ";}> *{flex:0 0 ", ";}", ""], function (_ref) {
12142
12142
  var disableScroll = _ref.disableScroll;
12143
12143
  return disableScroll ? "hidden" : "auto";
12144
12144
  }, function (_ref2) {
@@ -12156,9 +12156,18 @@ var ReelStyled = styled.div.withConfig({
12156
12156
  }, function (_ref6) {
12157
12157
  var childWidth = _ref6.childWidth;
12158
12158
  return childWidth;
12159
+ }, function (_ref7) {
12160
+ var useOrderedList = _ref7.useOrderedList,
12161
+ useUnorderedList = _ref7.useUnorderedList;
12162
+ return useOrderedList || useUnorderedList ? "\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n padding-inline-start: 0;\n list-style-type: none;\n " : "";
12159
12163
  });
12160
12164
 
12161
- var _excluded$g = ["childGap", "height", "childWidth", "padding", "justifyContent", "disableScroll", "children"];
12165
+ var _excluded$g = ["childGap", "height", "childWidth", "padding", "justifyContent", "disableScroll", "useOrderedList", "useUnorderedList", "children"];
12166
+ /*
12167
+ Safari has a bug where it refuses to recognize <ul /> tags as lists when list-style: none is used
12168
+ This affects the apple voice over (mainly used on iOS devices)
12169
+ The solution is to explicitly include "role=List"
12170
+ */
12162
12171
 
12163
12172
  var Reel = function Reel(_ref) {
12164
12173
  var _ref$childGap = _ref.childGap,
@@ -12173,17 +12182,27 @@ var Reel = function Reel(_ref) {
12173
12182
  justifyContent = _ref$justifyContent === void 0 ? "flex-start" : _ref$justifyContent,
12174
12183
  _ref$disableScroll = _ref.disableScroll,
12175
12184
  disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,
12185
+ _ref$useOrderedList = _ref.useOrderedList,
12186
+ useOrderedList = _ref$useOrderedList === void 0 ? false : _ref$useOrderedList,
12187
+ _ref$useUnorderedList = _ref.useUnorderedList,
12188
+ useUnorderedList = _ref$useUnorderedList === void 0 ? false : _ref$useUnorderedList,
12176
12189
  children = _ref.children,
12177
12190
  rest = _objectWithoutProperties(_ref, _excluded$g);
12178
12191
 
12192
+ var elementType = useOrderedList ? "ol" : useUnorderedList ? "ul" : "div";
12179
12193
  return /*#__PURE__*/React.createElement(ReelStyled, _extends({
12180
12194
  childGap: childGap,
12181
12195
  height: height,
12182
12196
  childWidth: childWidth,
12183
12197
  padding: padding,
12184
12198
  justifyContent: justifyContent,
12185
- disableScroll: disableScroll
12186
- }, rest), safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
12199
+ disableScroll: disableScroll,
12200
+ as: elementType,
12201
+ useOrderedList: useOrderedList,
12202
+ useUnorderedList: useUnorderedList
12203
+ }, rest, {
12204
+ role: useOrderedList || useUnorderedList ? "list" : "section"
12205
+ }), safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
12187
12206
  };
12188
12207
 
12189
12208
  /*
@@ -16987,7 +17006,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
16987
17006
  return /*#__PURE__*/React.createElement(Fragment, {
16988
17007
  key: "breadcrumb-".concat(linkText)
16989
17008
  }, /*#__PURE__*/React.createElement(InternalLink, {
16990
- "aria-current": index === breadcrumbsList.length - 1 && "location",
17009
+ "aria-current": index === breadcrumbsList.length - 1 ? "location" : "",
16991
17010
  to: linkDestination,
16992
17011
  active: isActive.toString(),
16993
17012
  color: themeValues.color,
@@ -16996,7 +17015,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
16996
17015
  fontWeight: themeValues.fontWeight,
16997
17016
  margin: themeValues.margin,
16998
17017
  extraStyles: "\n text-transform: uppercase;\n ".concat(isActive.toString() === "true" && "pointer-events: none;\n color: ".concat(themeValues.activeBreadcrumbColor, ";\n "), "\n &:first-child {\n margin-left: 0;\n }\n &:active {\n color: ").concat(themeValues.activeColor, "; \n }")
16999
- }, linkText), index < breadcrumbsList.length - 1 && /*#__PURE__*/React.createElement(IconChevron, null));
17018
+ }, linkText), index < breadcrumbsList.length - 1 ? /*#__PURE__*/React.createElement(IconChevron, null) : /*#__PURE__*/React.createElement(Fragment, null));
17000
17019
  })));
17001
17020
  };
17002
17021
 
@@ -35180,6 +35199,8 @@ var fallbackValues$v = {
35180
35199
  };
35181
35200
 
35182
35201
  var CollapsibleSection = function CollapsibleSection(_ref) {
35202
+ var _label$replaceAll;
35203
+
35183
35204
  var isOpen = _ref.isOpen,
35184
35205
  toggleSection = _ref.toggleSection,
35185
35206
  themeValues = _ref.themeValues,
@@ -35198,7 +35219,11 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35198
35219
  stackTitle = _ref$stackTitle === void 0 ? false : _ref$stackTitle,
35199
35220
  stackTitleContent = _ref.stackTitleContent,
35200
35221
  _ref$sectionGap = _ref.sectionGap,
35201
- sectionGap = _ref$sectionGap === void 0 ? "0.5rem" : _ref$sectionGap;
35222
+ sectionGap = _ref$sectionGap === void 0 ? "0.5rem" : _ref$sectionGap,
35223
+ _ref$name = _ref.name,
35224
+ name = _ref$name === void 0 ? "" : _ref$name,
35225
+ _ref$index = _ref.index,
35226
+ index = _ref$index === void 0 ? 1 : _ref$index;
35202
35227
 
35203
35228
  var handleKeyDown = function handleKeyDown(e) {
35204
35229
  if (e.keyCode === 13) {
@@ -35207,6 +35232,8 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35207
35232
  };
35208
35233
 
35209
35234
  var numChildren = typeof children === "Array" ? children.length : 1;
35235
+ var label = name !== "" ? name : !customTitle ? title : "collapsible section";
35236
+ var id = "".concat(label === null || label === void 0 ? void 0 : (_label$replaceAll = label.replaceAll(" ", "-")) === null || _label$replaceAll === void 0 ? void 0 : _label$replaceAll.toLowerCase(), "-").concat(index);
35210
35237
  var wrapper = {
35211
35238
  open: {
35212
35239
  height: openHeight,
@@ -35242,6 +35269,11 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35242
35269
  positionTransition: true
35243
35270
  }, stackTitle && /*#__PURE__*/React.createElement(Fragment, null, stackTitleContent), /*#__PURE__*/React.createElement(Stack, {
35244
35271
  childGap: isOpen && !isMobile ? sectionGap : "0rem"
35272
+ }, /*#__PURE__*/React.createElement(Box, {
35273
+ padding: "0",
35274
+ role: "heading",
35275
+ "aria-label": label,
35276
+ "aria-level": 3
35245
35277
  }, /*#__PURE__*/React.createElement(Box, {
35246
35278
  padding: customPadding ? customPadding : "0",
35247
35279
  background: themeValues.headingBackgroundColor,
@@ -35251,22 +35283,26 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35251
35283
  hoverStyles: "cursor: pointer;",
35252
35284
  tabIndex: "0",
35253
35285
  onKeyDown: handleKeyDown,
35254
- extraStyles: "z-index: 25;"
35286
+ extraStyles: "z-index: 25;",
35287
+ role: "button",
35288
+ "aria-expanded": isOpen.toString(),
35289
+ "aria-controls": id,
35290
+ id: "".concat(id, "-button")
35255
35291
  }, /*#__PURE__*/React.createElement(Cluster, {
35256
35292
  justify: "space-between",
35257
35293
  align: "center"
35258
35294
  }, customTitle ? /*#__PURE__*/React.createElement(Box, {
35259
35295
  width: "calc(100% - 36px)",
35260
35296
  padding: "0px"
35261
- }, title) : /*#__PURE__*/React.createElement(Heading$1, {
35262
- variant: "h6",
35297
+ }, title) : /*#__PURE__*/React.createElement(Title$1, {
35263
35298
  weight: FONT_WEIGHT_SEMIBOLD,
35264
35299
  color: themeValues.titleColor,
35265
- as: "h6"
35300
+ as: "h6",
35301
+ variant: "small"
35266
35302
  }, title), /*#__PURE__*/React.createElement(Motion, {
35267
35303
  variants: icon,
35268
35304
  extraStyles: "display: flex; align-items: center;"
35269
- }, /*#__PURE__*/React.createElement(ChevronIcon$1, null)))), /*#__PURE__*/React.createElement(AnimatePresence, {
35305
+ }, /*#__PURE__*/React.createElement(ChevronIcon$1, null))))), /*#__PURE__*/React.createElement(AnimatePresence, {
35270
35306
  initial: false
35271
35307
  }, isOpen && /*#__PURE__*/React.createElement(Motion, {
35272
35308
  padding: "0",
@@ -35276,7 +35312,10 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35276
35312
  initial: initiallyOpen ? "open" : "closed",
35277
35313
  exit: "closed",
35278
35314
  variants: wrapper,
35279
- extraStyles: "transform-origin: 100% 0; overflow-y: hidden;"
35315
+ extraStyles: "transform-origin: 100% 0; overflow-y: hidden;",
35316
+ id: "".concat(id, "-content"),
35317
+ role: "region",
35318
+ "aria-labelledby": "".concat(id, "-button")
35280
35319
  }, children))));
35281
35320
  };
35282
35321
 
@@ -35387,18 +35426,23 @@ var EditableList = function EditableList(_ref) {
35387
35426
  Modal = _ref.modal,
35388
35427
  modalProps = _ref.modalProps,
35389
35428
  autoPayMethods = _ref.autoPayMethods,
35429
+ _ref$as = _ref.as,
35430
+ as = _ref$as === void 0 ? "p" : _ref$as,
35390
35431
  qaPrefix = _ref.qaPrefix;
35432
+ var addText = "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName);
35391
35433
  return /*#__PURE__*/React.createElement(Box, {
35392
- padding: "0rem 0rem 1.5rem 0rem"
35434
+ padding: "0rem 0rem 1.5rem 0rem",
35435
+ as: "section",
35436
+ "aria-labelledby": "li"
35393
35437
  }, /*#__PURE__*/React.createElement(Stack, {
35394
35438
  childGap: "0rem"
35395
35439
  }, title !== "" && /*#__PURE__*/React.createElement(Box, {
35396
35440
  padding: "0rem 0rem 0.5rem 0rem"
35397
- }, /*#__PURE__*/React.createElement(Paragraph$1, {
35398
- variant: "pL",
35441
+ }, /*#__PURE__*/React.createElement(Title$1, {
35442
+ as: as,
35399
35443
  weight: titleWeight,
35400
35444
  color: CHARADE_GREY,
35401
- extraStyles: "letter-spacing: 0.29px;"
35445
+ extraStyles: "letter-spacing: 0.29px; font-size: 1.125rem;"
35402
35446
  }, title)), /*#__PURE__*/React.createElement(Box, {
35403
35447
  padding: "0",
35404
35448
  borderRadius: "4px",
@@ -35443,7 +35487,8 @@ var EditableList = function EditableList(_ref) {
35443
35487
  action: function action() {
35444
35488
  return removeItem(item.id);
35445
35489
  },
35446
- extraStyles: "min-width: 0;"
35490
+ extraStyles: "min-width: 0;",
35491
+ "aria-label": "Remove ".concat(itemName)
35447
35492
  })), canEdit && /*#__PURE__*/React.createElement(Box, {
35448
35493
  padding: "0 0.5rem",
35449
35494
  border: "2px solid transparent",
@@ -35456,14 +35501,16 @@ var EditableList = function EditableList(_ref) {
35456
35501
  action: function action() {
35457
35502
  return editItem(item.id);
35458
35503
  },
35459
- extraStyles: "min-width: 0;"
35504
+ extraStyles: "min-width: 0;",
35505
+ "aria-label": "Edit ".concat(itemName)
35460
35506
  }))));
35461
35507
  })), canAdd && (!maxItems || items.length < maxItems) && /*#__PURE__*/React.createElement(Box, {
35462
35508
  padding: items.length === 0 ? "0" : "1rem 0 0"
35463
35509
  }, /*#__PURE__*/React.createElement(Placeholder$1, {
35464
- text: "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName),
35510
+ text: addText,
35465
35511
  action: addItem,
35466
- dataQa: "Add " + qaPrefix
35512
+ dataQa: "Add " + qaPrefix,
35513
+ "aria-label": addText
35467
35514
  }))));
35468
35515
  };
35469
35516
 
@@ -35730,7 +35777,11 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
35730
35777
  var tabs = _ref.tabs,
35731
35778
  highlightIndex = _ref.highlightIndex,
35732
35779
  themeValues = _ref.themeValues,
35733
- isMobile = _ref.isMobile;
35780
+ isMobile = _ref.isMobile,
35781
+ _ref$useOrderedList = _ref.useOrderedList,
35782
+ useOrderedList = _ref$useOrderedList === void 0 ? true : _ref$useOrderedList,
35783
+ _ref$useUnorderedList = _ref.useUnorderedList,
35784
+ useUnorderedList = _ref$useUnorderedList === void 0 ? false : _ref$useUnorderedList;
35734
35785
  var itemsAfterIndex = tabs.slice(highlightIndex).length - 1;
35735
35786
  var itemsBeforeIndex = tabs.slice(0, highlightIndex).length;
35736
35787
  var boxesBefore = itemsAfterIndex > itemsBeforeIndex && isMobile ? itemsAfterIndex - itemsBeforeIndex : 0;
@@ -35749,14 +35800,18 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
35749
35800
  childGap: "4.5rem",
35750
35801
  childWidth: "11rem",
35751
35802
  justifyContent: "space-evenly",
35752
- disableScroll: true
35803
+ disableScroll: true,
35804
+ useOrderedList: useOrderedList,
35805
+ useUnorderedList: useUnorderedList
35753
35806
  }, repeat( /*#__PURE__*/React.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
35754
35807
  return /*#__PURE__*/React.createElement(Box, {
35755
35808
  key: t,
35756
35809
  borderSize: "3px",
35757
35810
  borderColor: highlightIndex == i ? themeValues.textColor : "transparent",
35758
35811
  borderWidthOverride: "0 0 3px 0",
35759
- extraStyles: "text-align: center;"
35812
+ extraStyles: "text-align: center; display: block;",
35813
+ as: "li",
35814
+ "aria-current": highlightIndex == i ? "step" : ""
35760
35815
  }, /*#__PURE__*/React.createElement(Text$1, {
35761
35816
  variant: "p",
35762
35817
  textAlign: "center",
@@ -38909,6 +38964,17 @@ var fallbackValues$x = {
38909
38964
  backgroundColor: backgroundColor$6
38910
38965
  };
38911
38966
 
38967
+ /*
38968
+ New (01/22) - updated <Module /> to use <Title /> atom
38969
+ Because <Title /> decouples size from element, also gave <Module />
38970
+ two new props: "as" and "fontSize"
38971
+
38972
+ When present, <Module /> will use those values to dictate element type and font size.
38973
+
38974
+ For backwards compatability, <Module /> still computes a themed font size and element type based on old
38975
+ <Heading /> variants. If "fontSize" or "as" is undefined, <Module /> will use themed values.
38976
+ */
38977
+
38912
38978
  var Module = function Module(_ref) {
38913
38979
  var heading = _ref.heading,
38914
38980
  _ref$spacing = _ref.spacing,
@@ -38920,13 +38986,20 @@ var Module = function Module(_ref) {
38920
38986
  themeValues = _ref.themeValues,
38921
38987
  _ref$variant = _ref.variant,
38922
38988
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
38989
+ fontSize = _ref.fontSize,
38990
+ as = _ref.as,
38923
38991
  children = _ref.children;
38924
- return /*#__PURE__*/React.createElement(Fragment, null, heading && /*#__PURE__*/React.createElement(Heading$1, {
38925
- variant: variant === "small" ? "h6" : variant === "default" ? "h5" : "h2",
38992
+ var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
38993
+ var computedFontSize = fontSize || themedFontSize;
38994
+ var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
38995
+ var computedElemType = as || themedElemType;
38996
+ return /*#__PURE__*/React.createElement(Fragment, null, heading && /*#__PURE__*/React.createElement(Title$1, {
38926
38997
  weight: themeValues.fontWeight,
38927
38998
  color: themeValues.fontColor,
38928
38999
  margin: "".concat(spacing, " 0 ").concat(themeValues.titleSpacing, " 0"),
38929
- textAlign: themeValues.textAlign
39000
+ textAlign: themeValues.textAlign,
39001
+ as: computedElemType,
39002
+ extraStyles: "font-size: ".concat(computedFontSize, ";")
38930
39003
  }, heading), /*#__PURE__*/React.createElement(Box, {
38931
39004
  padding: "0 0 ".concat(spacingBottom)
38932
39005
  }, /*#__PURE__*/React.createElement(Box, {
@@ -39798,7 +39871,8 @@ var Collapsible = function Collapsible(_ref2) {
39798
39871
  toggleSection: function toggleSection() {
39799
39872
  return setIsOpen(!isOpen);
39800
39873
  },
39801
- customTitle: true
39874
+ customTitle: true,
39875
+ name: "Collapsed Payment Details"
39802
39876
  }, /*#__PURE__*/React.createElement(Motion, {
39803
39877
  variants: {
39804
39878
  open: {
@@ -39907,19 +39981,21 @@ var PaymentDetails = function PaymentDetails(_ref4) {
39907
39981
  }, /*#__PURE__*/React.createElement(Cluster, {
39908
39982
  justify: "space-between",
39909
39983
  align: "center"
39910
- }, /*#__PURE__*/React.createElement(Heading$1, {
39911
- variant: "h5",
39912
- weight: "700",
39913
- as: "h1"
39914
- }, titleText), /*#__PURE__*/React.createElement(Heading$1, {
39915
- variant: "h5",
39916
- weight: "700",
39917
- as: "h1"
39918
- }, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Heading$1, {
39984
+ }, /*#__PURE__*/React.createElement(Title$1, {
39985
+ weight: FONT_WEIGHT_BOLD,
39919
39986
  as: "h1",
39920
- variant: "h3",
39921
- weight: "700",
39922
- margin: "1rem 0 0 0"
39987
+ extraStyles: "font-size: 1.375rem;",
39988
+ id: "payment-details-title"
39989
+ }, titleText), /*#__PURE__*/React.createElement(Title$1, {
39990
+ weight: FONT_WEIGHT_BOLD,
39991
+ as: "p",
39992
+ extraStyles: "font-size: 1.375rem;"
39993
+ }, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Title$1, {
39994
+ as: "h1",
39995
+ weight: FONT_WEIGHT_BOLD,
39996
+ margin: "1rem 0 0 0",
39997
+ extraStyles: "font-size: 1.75rem;",
39998
+ id: "payment-details-title"
39923
39999
  }, titleText);
39924
40000
  return isCollapsible ? /*#__PURE__*/React.createElement(Collapsible, {
39925
40001
  title: title,