@thecb/components 5.3.3 → 5.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.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,13 @@ 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"];
12162
12166
 
12163
12167
  var Reel = function Reel(_ref) {
12164
12168
  var _ref$childGap = _ref.childGap,
@@ -12173,16 +12177,24 @@ var Reel = function Reel(_ref) {
12173
12177
  justifyContent = _ref$justifyContent === void 0 ? "flex-start" : _ref$justifyContent,
12174
12178
  _ref$disableScroll = _ref.disableScroll,
12175
12179
  disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,
12180
+ _ref$useOrderedList = _ref.useOrderedList,
12181
+ useOrderedList = _ref$useOrderedList === void 0 ? false : _ref$useOrderedList,
12182
+ _ref$useUnorderedList = _ref.useUnorderedList,
12183
+ useUnorderedList = _ref$useUnorderedList === void 0 ? false : _ref$useUnorderedList,
12176
12184
  children = _ref.children,
12177
12185
  rest = _objectWithoutProperties(_ref, _excluded$g);
12178
12186
 
12187
+ var elementType = useOrderedList ? "ol" : useUnorderedList ? "ul" : "div";
12179
12188
  return /*#__PURE__*/React.createElement(ReelStyled, _extends({
12180
12189
  childGap: childGap,
12181
12190
  height: height,
12182
12191
  childWidth: childWidth,
12183
12192
  padding: padding,
12184
12193
  justifyContent: justifyContent,
12185
- disableScroll: disableScroll
12194
+ disableScroll: disableScroll,
12195
+ as: elementType,
12196
+ useOrderedList: useOrderedList,
12197
+ useUnorderedList: useUnorderedList
12186
12198
  }, rest), safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
12187
12199
  };
12188
12200
 
@@ -35180,6 +35192,8 @@ var fallbackValues$v = {
35180
35192
  };
35181
35193
 
35182
35194
  var CollapsibleSection = function CollapsibleSection(_ref) {
35195
+ var _label$replaceAll;
35196
+
35183
35197
  var isOpen = _ref.isOpen,
35184
35198
  toggleSection = _ref.toggleSection,
35185
35199
  themeValues = _ref.themeValues,
@@ -35198,7 +35212,11 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35198
35212
  stackTitle = _ref$stackTitle === void 0 ? false : _ref$stackTitle,
35199
35213
  stackTitleContent = _ref.stackTitleContent,
35200
35214
  _ref$sectionGap = _ref.sectionGap,
35201
- sectionGap = _ref$sectionGap === void 0 ? "0.5rem" : _ref$sectionGap;
35215
+ sectionGap = _ref$sectionGap === void 0 ? "0.5rem" : _ref$sectionGap,
35216
+ _ref$name = _ref.name,
35217
+ name = _ref$name === void 0 ? "" : _ref$name,
35218
+ _ref$index = _ref.index,
35219
+ index = _ref$index === void 0 ? 1 : _ref$index;
35202
35220
 
35203
35221
  var handleKeyDown = function handleKeyDown(e) {
35204
35222
  if (e.keyCode === 13) {
@@ -35207,6 +35225,8 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35207
35225
  };
35208
35226
 
35209
35227
  var numChildren = typeof children === "Array" ? children.length : 1;
35228
+ var label = name !== "" ? name : !customTitle ? title : "collapsible section";
35229
+ 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
35230
  var wrapper = {
35211
35231
  open: {
35212
35232
  height: openHeight,
@@ -35242,6 +35262,11 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35242
35262
  positionTransition: true
35243
35263
  }, stackTitle && /*#__PURE__*/React.createElement(Fragment, null, stackTitleContent), /*#__PURE__*/React.createElement(Stack, {
35244
35264
  childGap: isOpen && !isMobile ? sectionGap : "0rem"
35265
+ }, /*#__PURE__*/React.createElement(Box, {
35266
+ padding: "0",
35267
+ role: "heading",
35268
+ "aria-label": label,
35269
+ "aria-level": 3
35245
35270
  }, /*#__PURE__*/React.createElement(Box, {
35246
35271
  padding: customPadding ? customPadding : "0",
35247
35272
  background: themeValues.headingBackgroundColor,
@@ -35251,22 +35276,26 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35251
35276
  hoverStyles: "cursor: pointer;",
35252
35277
  tabIndex: "0",
35253
35278
  onKeyDown: handleKeyDown,
35254
- extraStyles: "z-index: 25;"
35279
+ extraStyles: "z-index: 25;",
35280
+ role: "button",
35281
+ "aria-expanded": isOpen.toString(),
35282
+ "aria-controls": id,
35283
+ id: "".concat(id, "-button")
35255
35284
  }, /*#__PURE__*/React.createElement(Cluster, {
35256
35285
  justify: "space-between",
35257
35286
  align: "center"
35258
35287
  }, customTitle ? /*#__PURE__*/React.createElement(Box, {
35259
35288
  width: "calc(100% - 36px)",
35260
35289
  padding: "0px"
35261
- }, title) : /*#__PURE__*/React.createElement(Heading$1, {
35262
- variant: "h6",
35290
+ }, title) : /*#__PURE__*/React.createElement(Title$1, {
35263
35291
  weight: FONT_WEIGHT_SEMIBOLD,
35264
35292
  color: themeValues.titleColor,
35265
- as: "h6"
35293
+ as: "h6",
35294
+ variant: "small"
35266
35295
  }, title), /*#__PURE__*/React.createElement(Motion, {
35267
35296
  variants: icon,
35268
35297
  extraStyles: "display: flex; align-items: center;"
35269
- }, /*#__PURE__*/React.createElement(ChevronIcon$1, null)))), /*#__PURE__*/React.createElement(AnimatePresence, {
35298
+ }, /*#__PURE__*/React.createElement(ChevronIcon$1, null))))), /*#__PURE__*/React.createElement(AnimatePresence, {
35270
35299
  initial: false
35271
35300
  }, isOpen && /*#__PURE__*/React.createElement(Motion, {
35272
35301
  padding: "0",
@@ -35276,7 +35305,10 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
35276
35305
  initial: initiallyOpen ? "open" : "closed",
35277
35306
  exit: "closed",
35278
35307
  variants: wrapper,
35279
- extraStyles: "transform-origin: 100% 0; overflow-y: hidden;"
35308
+ extraStyles: "transform-origin: 100% 0; overflow-y: hidden;",
35309
+ id: "".concat(id, "-content"),
35310
+ role: "region",
35311
+ "aria-labelledby": "".concat(id, "-button")
35280
35312
  }, children))));
35281
35313
  };
35282
35314
 
@@ -35387,18 +35419,23 @@ var EditableList = function EditableList(_ref) {
35387
35419
  Modal = _ref.modal,
35388
35420
  modalProps = _ref.modalProps,
35389
35421
  autoPayMethods = _ref.autoPayMethods,
35422
+ _ref$as = _ref.as,
35423
+ as = _ref$as === void 0 ? "p" : _ref$as,
35390
35424
  qaPrefix = _ref.qaPrefix;
35425
+ var addText = "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName);
35391
35426
  return /*#__PURE__*/React.createElement(Box, {
35392
- padding: "0rem 0rem 1.5rem 0rem"
35427
+ padding: "0rem 0rem 1.5rem 0rem",
35428
+ as: "section",
35429
+ "aria-labelledby": "li"
35393
35430
  }, /*#__PURE__*/React.createElement(Stack, {
35394
35431
  childGap: "0rem"
35395
35432
  }, title !== "" && /*#__PURE__*/React.createElement(Box, {
35396
35433
  padding: "0rem 0rem 0.5rem 0rem"
35397
- }, /*#__PURE__*/React.createElement(Paragraph$1, {
35398
- variant: "pL",
35434
+ }, /*#__PURE__*/React.createElement(Title$1, {
35435
+ as: as,
35399
35436
  weight: titleWeight,
35400
35437
  color: CHARADE_GREY,
35401
- extraStyles: "letter-spacing: 0.29px;"
35438
+ extraStyles: "letter-spacing: 0.29px; font-size: 1.125rem;"
35402
35439
  }, title)), /*#__PURE__*/React.createElement(Box, {
35403
35440
  padding: "0",
35404
35441
  borderRadius: "4px",
@@ -35443,7 +35480,8 @@ var EditableList = function EditableList(_ref) {
35443
35480
  action: function action() {
35444
35481
  return removeItem(item.id);
35445
35482
  },
35446
- extraStyles: "min-width: 0;"
35483
+ extraStyles: "min-width: 0;",
35484
+ "aria-label": "Remove ".concat(itemName)
35447
35485
  })), canEdit && /*#__PURE__*/React.createElement(Box, {
35448
35486
  padding: "0 0.5rem",
35449
35487
  border: "2px solid transparent",
@@ -35456,14 +35494,16 @@ var EditableList = function EditableList(_ref) {
35456
35494
  action: function action() {
35457
35495
  return editItem(item.id);
35458
35496
  },
35459
- extraStyles: "min-width: 0;"
35497
+ extraStyles: "min-width: 0;",
35498
+ "aria-label": "Edit ".concat(itemName)
35460
35499
  }))));
35461
35500
  })), canAdd && (!maxItems || items.length < maxItems) && /*#__PURE__*/React.createElement(Box, {
35462
35501
  padding: items.length === 0 ? "0" : "1rem 0 0"
35463
35502
  }, /*#__PURE__*/React.createElement(Placeholder$1, {
35464
- text: "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName),
35503
+ text: addText,
35465
35504
  action: addItem,
35466
- dataQa: "Add " + qaPrefix
35505
+ dataQa: "Add " + qaPrefix,
35506
+ "aria-label": addText
35467
35507
  }))));
35468
35508
  };
35469
35509
 
@@ -35730,7 +35770,11 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
35730
35770
  var tabs = _ref.tabs,
35731
35771
  highlightIndex = _ref.highlightIndex,
35732
35772
  themeValues = _ref.themeValues,
35733
- isMobile = _ref.isMobile;
35773
+ isMobile = _ref.isMobile,
35774
+ _ref$useOrderedList = _ref.useOrderedList,
35775
+ useOrderedList = _ref$useOrderedList === void 0 ? true : _ref$useOrderedList,
35776
+ _ref$useUnorderedList = _ref.useUnorderedList,
35777
+ useUnorderedList = _ref$useUnorderedList === void 0 ? false : _ref$useUnorderedList;
35734
35778
  var itemsAfterIndex = tabs.slice(highlightIndex).length - 1;
35735
35779
  var itemsBeforeIndex = tabs.slice(0, highlightIndex).length;
35736
35780
  var boxesBefore = itemsAfterIndex > itemsBeforeIndex && isMobile ? itemsAfterIndex - itemsBeforeIndex : 0;
@@ -35749,14 +35793,17 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
35749
35793
  childGap: "4.5rem",
35750
35794
  childWidth: "11rem",
35751
35795
  justifyContent: "space-evenly",
35752
- disableScroll: true
35796
+ disableScroll: true,
35797
+ useOrderedList: useOrderedList,
35798
+ useUnorderedList: useUnorderedList
35753
35799
  }, repeat( /*#__PURE__*/React.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
35754
35800
  return /*#__PURE__*/React.createElement(Box, {
35755
35801
  key: t,
35756
35802
  borderSize: "3px",
35757
35803
  borderColor: highlightIndex == i ? themeValues.textColor : "transparent",
35758
35804
  borderWidthOverride: "0 0 3px 0",
35759
- extraStyles: "text-align: center;"
35805
+ extraStyles: "text-align: center;",
35806
+ as: "li"
35760
35807
  }, /*#__PURE__*/React.createElement(Text$1, {
35761
35808
  variant: "p",
35762
35809
  textAlign: "center",
@@ -38909,6 +38956,17 @@ var fallbackValues$x = {
38909
38956
  backgroundColor: backgroundColor$6
38910
38957
  };
38911
38958
 
38959
+ /*
38960
+ New (01/22) - updated <Module /> to use <Title /> atom
38961
+ Because <Title /> decouples size from element, also gave <Module />
38962
+ two new props: "as" and "fontSize"
38963
+
38964
+ When present, <Module /> will use those values to dictate element type and font size.
38965
+
38966
+ For backwards compatability, <Module /> still computes a themed font size and element type based on old
38967
+ <Heading /> variants. If "fontSize" or "as" is undefined, <Module /> will use themed values.
38968
+ */
38969
+
38912
38970
  var Module = function Module(_ref) {
38913
38971
  var heading = _ref.heading,
38914
38972
  _ref$spacing = _ref.spacing,
@@ -38920,13 +38978,20 @@ var Module = function Module(_ref) {
38920
38978
  themeValues = _ref.themeValues,
38921
38979
  _ref$variant = _ref.variant,
38922
38980
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
38981
+ fontSize = _ref.fontSize,
38982
+ as = _ref.as,
38923
38983
  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",
38984
+ var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
38985
+ var computedFontSize = fontSize || themedFontSize;
38986
+ var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
38987
+ var computedElemType = as || themedElemType;
38988
+ return /*#__PURE__*/React.createElement(Fragment, null, heading && /*#__PURE__*/React.createElement(Title$1, {
38926
38989
  weight: themeValues.fontWeight,
38927
38990
  color: themeValues.fontColor,
38928
38991
  margin: "".concat(spacing, " 0 ").concat(themeValues.titleSpacing, " 0"),
38929
- textAlign: themeValues.textAlign
38992
+ textAlign: themeValues.textAlign,
38993
+ as: computedElemType,
38994
+ extraStyles: "font-size: ".concat(computedFontSize, ";")
38930
38995
  }, heading), /*#__PURE__*/React.createElement(Box, {
38931
38996
  padding: "0 0 ".concat(spacingBottom)
38932
38997
  }, /*#__PURE__*/React.createElement(Box, {
@@ -39798,7 +39863,8 @@ var Collapsible = function Collapsible(_ref2) {
39798
39863
  toggleSection: function toggleSection() {
39799
39864
  return setIsOpen(!isOpen);
39800
39865
  },
39801
- customTitle: true
39866
+ customTitle: true,
39867
+ name: "Collapsed Payment Details"
39802
39868
  }, /*#__PURE__*/React.createElement(Motion, {
39803
39869
  variants: {
39804
39870
  open: {
@@ -39907,19 +39973,21 @@ var PaymentDetails = function PaymentDetails(_ref4) {
39907
39973
  }, /*#__PURE__*/React.createElement(Cluster, {
39908
39974
  justify: "space-between",
39909
39975
  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, {
39976
+ }, /*#__PURE__*/React.createElement(Title$1, {
39977
+ weight: FONT_WEIGHT_BOLD,
39919
39978
  as: "h1",
39920
- variant: "h3",
39921
- weight: "700",
39922
- margin: "1rem 0 0 0"
39979
+ extraStyles: "font-size: 1.375rem;",
39980
+ id: "payment-details-title"
39981
+ }, titleText), /*#__PURE__*/React.createElement(Title$1, {
39982
+ weight: FONT_WEIGHT_BOLD,
39983
+ as: "p",
39984
+ extraStyles: "font-size: 1.375rem;"
39985
+ }, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Title$1, {
39986
+ as: "h1",
39987
+ weight: FONT_WEIGHT_BOLD,
39988
+ margin: "1rem 0 0 0",
39989
+ extraStyles: "font-size: 1.75rem;",
39990
+ id: "payment-details-title"
39923
39991
  }, titleText);
39924
39992
  return isCollapsible ? /*#__PURE__*/React.createElement(Collapsible, {
39925
39993
  title: title,