@thecb/components 4.2.7-beta.1 → 4.2.7-beta.10

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
@@ -6481,7 +6481,7 @@ function _templateObject2$2() {
6481
6481
  }
6482
6482
 
6483
6483
  function _templateObject$3() {
6484
- var data = _taggedTemplateLiteral(["\n overflow: ", ";\n box-sizing: border-box;\n"]);
6484
+ var data = _taggedTemplateLiteral(["\n overflow: ", ";\n box-sizing: border-box;\n justify-self: ", ";\n align-self: ", ";\n flex-grow: ", ";\n ", ";\n"]);
6485
6485
 
6486
6486
  _templateObject$3 = function _templateObject() {
6487
6487
  return data;
@@ -6499,27 +6499,39 @@ var ClusterWrapper = styled__default(function (_ref) {
6499
6499
  })(_templateObject$3(), function (_ref2) {
6500
6500
  var overflow = _ref2.overflow;
6501
6501
  return overflow ? "visible" : "hidden";
6502
+ }, function (_ref3) {
6503
+ var justifySelf = _ref3.justifySelf;
6504
+ return justifySelf;
6505
+ }, function (_ref4) {
6506
+ var alignSelf = _ref4.alignSelf;
6507
+ return alignSelf;
6508
+ }, function (_ref5) {
6509
+ var flexGrow = _ref5.flexGrow;
6510
+ return flexGrow;
6511
+ }, function (_ref6) {
6512
+ var extraStyles = _ref6.extraStyles;
6513
+ return extraStyles;
6502
6514
  });
6503
- var ClusterInnerWrapper = styled__default.div(_templateObject2$2(), function (_ref3) {
6504
- var nowrap = _ref3.nowrap;
6515
+ var ClusterInnerWrapper = styled__default.div(_templateObject2$2(), function (_ref7) {
6516
+ var nowrap = _ref7.nowrap;
6505
6517
  return nowrap ? "nowrap" : "wrap";
6506
- }, function (_ref4) {
6507
- var justify = _ref4.justify;
6518
+ }, function (_ref8) {
6519
+ var justify = _ref8.justify;
6508
6520
  return justify;
6509
- }, function (_ref5) {
6510
- var align = _ref5.align;
6521
+ }, function (_ref9) {
6522
+ var align = _ref9.align;
6511
6523
  return align;
6512
- }, function (_ref6) {
6513
- var childGap = _ref6.childGap;
6524
+ }, function (_ref10) {
6525
+ var childGap = _ref10.childGap;
6514
6526
  return childGap;
6515
- }, function (_ref7) {
6516
- var minHeight = _ref7.minHeight;
6527
+ }, function (_ref11) {
6528
+ var minHeight = _ref11.minHeight;
6517
6529
  return minHeight;
6518
- }, function (_ref8) {
6519
- var minWidth = _ref8.minWidth;
6530
+ }, function (_ref12) {
6531
+ var minWidth = _ref12.minWidth;
6520
6532
  return minWidth;
6521
- }, function (_ref9) {
6522
- var childGap = _ref9.childGap;
6533
+ }, function (_ref13) {
6534
+ var childGap = _ref13.childGap;
6523
6535
  return childGap;
6524
6536
  });
6525
6537
 
@@ -6541,12 +6553,21 @@ var Cluster = function Cluster(_ref) {
6541
6553
  nowrap = _ref.nowrap,
6542
6554
  _ref$overflow = _ref.overflow,
6543
6555
  overflow = _ref$overflow === void 0 ? false : _ref$overflow,
6556
+ justifySelf = _ref.justifySelf,
6557
+ alignSelf = _ref.alignSelf,
6558
+ flexGrow = _ref.flexGrow,
6559
+ extraStyles = _ref.extraStyles,
6544
6560
  children = _ref.children,
6545
- rest = _objectWithoutProperties(_ref, ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "children"]);
6561
+ rest = _objectWithoutProperties(_ref, ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "justifySelf", "alignSelf", "flexGrow", "extraStyles", "children"]);
6546
6562
 
6547
6563
  return /*#__PURE__*/React__default.createElement(ClusterWrapper, _extends({
6548
6564
  overflow: overflow
6549
- }, rest), /*#__PURE__*/React__default.createElement(ClusterInnerWrapper, {
6565
+ }, rest, {
6566
+ justifySelf: justifySelf,
6567
+ alignSelf: alignSelf,
6568
+ flexGrow: flexGrow,
6569
+ extraStyles: extraStyles
6570
+ }), /*#__PURE__*/React__default.createElement(ClusterInnerWrapper, {
6550
6571
  justify: justify,
6551
6572
  align: align,
6552
6573
  childGap: childGap,
@@ -6898,7 +6919,7 @@ function _templateObject3$2() {
6898
6919
  }
6899
6920
 
6900
6921
  function _templateObject2$4() {
6901
- var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-wrap: wrap;\n overflow: hidden;\n padding: ", ";\n margin: ", ";\n\n > * {\n flex-grow: 1;\n ", ";\n ", "\n }\n\n ", "\n\n ", "\n\n ", "\n"]);
6922
+ var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-wrap: wrap;\n overflow: hidden;\n padding: ", ";\n margin: ", ";\n ", "\n\n > * {\n flex-grow: 1;\n ", ";\n ", "\n ", "\n }\n\n ", "\n\n ", "\n\n ", "\n"]);
6902
6923
 
6903
6924
  _templateObject2$4 = function _templateObject2() {
6904
6925
  return data;
@@ -6924,22 +6945,28 @@ var SwitcherInnerContainer = styled__default.div(_templateObject2$4(), function
6924
6945
  var childGap = _ref2.childGap;
6925
6946
  return "calc((".concat(childGap, " / 2) * -1)");
6926
6947
  }, function (_ref3) {
6927
- var maxChildrenOnly = _ref3.maxChildrenOnly,
6928
- breakpoint = _ref3.breakpoint,
6929
- childGap = _ref3.childGap;
6930
- return !maxChildrenOnly ? "flex-basis: calc((".concat(breakpoint, " - (100% - ").concat(childGap, ")) * 999);") : "";
6948
+ var constrainMobile = _ref3.constrainMobile;
6949
+ return constrainMobile && "max-width: 100%; margin-left: 0; margin-right: 0;";
6931
6950
  }, function (_ref4) {
6932
- var childGap = _ref4.childGap;
6933
- return "margin: calc(".concat(childGap, " / 2);");
6951
+ var maxChildrenOnly = _ref4.maxChildrenOnly,
6952
+ breakpoint = _ref4.breakpoint,
6953
+ childGap = _ref4.childGap;
6954
+ return !maxChildrenOnly ? "flex-basis: calc((".concat(breakpoint, " - (100% - ").concat(childGap, ")) * 999);") : "";
6934
6955
  }, function (_ref5) {
6935
- var largeChild = _ref5.largeChild,
6936
- largeChildSize = _ref5.largeChildSize;
6937
- return largeChild && largeChildSize ? "> :nth-child(".concat(largeChild, ") {\n flex-grow: ").concat(largeChildSize, ";\n }") : "";
6956
+ var childGap = _ref5.childGap;
6957
+ return "margin: calc(".concat(childGap, " / 2);");
6938
6958
  }, function (_ref6) {
6939
- var maxChildren = _ref6.maxChildren;
6940
- return maxChildren ? "> :nth-last-child(".concat(maxChildren + 1, "), > :nth-last-child(").concat(maxChildren + 1, ") ~ * {\n flex-basis: 100%;\n }") : "";
6959
+ var constrainMobile = _ref6.constrainMobile;
6960
+ return constrainMobile && "margin-left: 0; margin-right: 0;";
6941
6961
  }, function (_ref7) {
6942
- var extraStyles = _ref7.extraStyles;
6962
+ var largeChild = _ref7.largeChild,
6963
+ largeChildSize = _ref7.largeChildSize;
6964
+ return largeChild && largeChildSize ? "> :nth-child(".concat(largeChild, ") {\n flex-grow: ").concat(largeChildSize, ";\n }") : "";
6965
+ }, function (_ref8) {
6966
+ var maxChildren = _ref8.maxChildren;
6967
+ return maxChildren ? "> :nth-last-child(".concat(maxChildren + 1, "), > :nth-last-child(").concat(maxChildren + 1, ") ~ * {\n flex-basis: 100%;\n }") : "";
6968
+ }, function (_ref9) {
6969
+ var extraStyles = _ref9.extraStyles;
6943
6970
  return styled.css(_templateObject3$2(), extraStyles);
6944
6971
  });
6945
6972
 
@@ -6968,6 +6995,11 @@ var SwitcherInnerContainer = styled__default.div(_templateObject2$4(), function
6968
6995
  products/services should share the same width no matter the orientation, otherwise
6969
6996
  one or more cards could be perceived as highlighted or featured in some way. Or
6970
6997
  a set of numbered steps in, for example, a list of items to complete or tasks to do."
6998
+
6999
+ New: Set the "constrainMobile" prop to true in order to prevent switcher content from
7000
+ overflowing the mobile viewport:
7001
+
7002
+ <Switcher constrainMobile={isMobile} />
6971
7003
  */
6972
7004
 
6973
7005
  var Switcher = function Switcher(_ref) {
@@ -6984,7 +7016,9 @@ var Switcher = function Switcher(_ref) {
6984
7016
  padding = _ref$padding === void 0 ? "0" : _ref$padding,
6985
7017
  children = _ref.children,
6986
7018
  extraStyles = _ref.extraStyles,
6987
- rest = _objectWithoutProperties(_ref, ["breakpoint", "childGap", "largeChild", "largeChildSize", "maxChildren", "maxChildrenOnly", "padding", "children", "extraStyles"]);
7019
+ _ref$constrainMobile = _ref.constrainMobile,
7020
+ constrainMobile = _ref$constrainMobile === void 0 ? false : _ref$constrainMobile,
7021
+ rest = _objectWithoutProperties(_ref, ["breakpoint", "childGap", "largeChild", "largeChildSize", "maxChildren", "maxChildrenOnly", "padding", "children", "extraStyles", "constrainMobile"]);
6988
7022
 
6989
7023
  return /*#__PURE__*/React__default.createElement(SwitcherOuterContainer, null, /*#__PURE__*/React__default.createElement(SwitcherInnerContainer, _extends({
6990
7024
  breakpoint: breakpoint,
@@ -6994,7 +7028,8 @@ var Switcher = function Switcher(_ref) {
6994
7028
  maxChildren: maxChildren,
6995
7029
  maxChildrenOnly: maxChildrenOnly,
6996
7030
  padding: padding,
6997
- extraStyles: extraStyles
7031
+ extraStyles: extraStyles,
7032
+ constrainMobile: constrainMobile
6998
7033
  }, rest), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null))));
6999
7034
  };
7000
7035
 
@@ -12684,14 +12719,16 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12684
12719
  _ref2$extraStyles = _ref2.extraStyles,
12685
12720
  extraStyles = _ref2$extraStyles === void 0 ? "" : _ref2$extraStyles,
12686
12721
  tabIndex = _ref2.tabIndex,
12687
- children = _ref2.children;
12722
+ children = _ref2.children,
12723
+ rest = _objectWithoutProperties(_ref2, ["action", "variant", "text", "isLoading", "dataQa", "textExtraStyles", "contentOverride", "extraStyles", "tabIndex", "children"]);
12724
+
12688
12725
  var themeContext = React.useContext(styled.ThemeContext);
12689
12726
  var themeValues = createThemeValues(themeContext, fallbackValues$1, "Button", variant);
12690
12727
  var isMobile = themeContext.isMobile;
12691
12728
  var hoverStyles = "\n outline: none;\n background-color: ".concat(themeValues.hoverBackgroundColor, ";\n border-color: ").concat(themeValues.hoverBorderColor, ";\n color: ").concat(themeValues.hoverColor, ";\n text-decoration: ").concat(variant === "ghost" || variant === "smallGhost" ? "underline" : "none", ";\n cursor: pointer;\n ");
12692
12729
  var activeStyles = "\n outline: none;\n background-color: ".concat(themeValues.activeBackgroundColor, ";\n border-color: ").concat(themeValues.activeBorderColor, ";\n color: ").concat(themeValues.activeColor, ";\n text-decoration: ").concat(variant === "ghost" || variant === "smallGhost" ? "underline" : "none", ";\n ");
12693
- var disabledStyles = "\n background-clor: #6D717E;\n border-color: #6D717E;\n color: #FFFFFF;\n &:focus {\n box-shadow: 0 0 10px #6D717E;\n outline: none;\n }\n ";
12694
- return /*#__PURE__*/React__default.createElement(Box, {
12730
+ var disabledStyles = "\n background-color: #6D717E;\n border-color: #6D717E;\n color: #FFFFFF;\n cursor: default;\n &:focus {\n box-shadow: 0 0 10px #6D717E;\n outline: none;\n }\n ";
12731
+ return /*#__PURE__*/React__default.createElement(Box, _extends({
12695
12732
  variant: variant,
12696
12733
  padding: themeValues.padding,
12697
12734
  minHeight: themeValues.height,
@@ -12708,7 +12745,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12708
12745
  extraStyles: "margin: 0.5rem; ".concat(extraStyles),
12709
12746
  dataQa: dataQa,
12710
12747
  tabIndex: tabIndex
12711
- }, contentOverride ? children : /*#__PURE__*/React__default.createElement(Center, {
12748
+ }, rest), contentOverride ? children : /*#__PURE__*/React__default.createElement(Center, {
12712
12749
  intrinsic: true
12713
12750
  }, isLoading ? /*#__PURE__*/React__default.createElement(Spinner, {
12714
12751
  isMobile: isMobile
@@ -13738,6 +13775,93 @@ var IconAdd = function IconAdd() {
13738
13775
  }))))));
13739
13776
  };
13740
13777
 
13778
+ var IconQuit = function IconQuit(_ref) {
13779
+ var _ref$fill = _ref.fill,
13780
+ fill = _ref$fill === void 0 ? MINESHAFT_GREY : _ref$fill,
13781
+ _ref$width = _ref.width,
13782
+ width = _ref$width === void 0 ? "24px" : _ref$width,
13783
+ _ref$height = _ref.height,
13784
+ height = _ref$height === void 0 ? "24px" : _ref$height;
13785
+ return /*#__PURE__*/React__default.createElement("svg", {
13786
+ xmlns: "http://www.w3.org/2000/svg",
13787
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
13788
+ width: width,
13789
+ height: height,
13790
+ viewBox: "0 0 24 24"
13791
+ }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("path", {
13792
+ id: "quit",
13793
+ d: "M18.9999989 6.40999946L17.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.9999993z"
13794
+ })), /*#__PURE__*/React__default.createElement("g", {
13795
+ fill: "none",
13796
+ fillRule: "evenodd",
13797
+ stroke: "none",
13798
+ strokeWidth: "1"
13799
+ }, /*#__PURE__*/React__default.createElement("mask", {
13800
+ id: "quitMask",
13801
+ fill: "#fff"
13802
+ }, /*#__PURE__*/React__default.createElement("use", {
13803
+ xlinkHref: "#quit"
13804
+ })), /*#__PURE__*/React__default.createElement("use", {
13805
+ fill: fill,
13806
+ xlinkHref: "#quit"
13807
+ }), /*#__PURE__*/React__default.createElement("g", {
13808
+ fill: fill,
13809
+ mask: "url(#quitMask)"
13810
+ }, /*#__PURE__*/React__default.createElement("path", {
13811
+ d: "M0 0H24V24H0z"
13812
+ }))));
13813
+ };
13814
+
13815
+ var IconQuitLarge = function IconQuitLarge(_ref) {
13816
+ var _ref$fill = _ref.fill,
13817
+ fill = _ref$fill === void 0 ? "#091325" : _ref$fill;
13818
+ return /*#__PURE__*/React__default.createElement("svg", {
13819
+ width: "14px",
13820
+ height: "14px",
13821
+ viewBox: "0 0 14 14",
13822
+ version: "1.1",
13823
+ xmlns: "http://www.w3.org/2000/svg",
13824
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
13825
+ }, /*#__PURE__*/React__default.createElement("title", null, "Icon/X"), /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("polygon", {
13826
+ id: "quit-large-path-1",
13827
+ 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"
13828
+ })), /*#__PURE__*/React__default.createElement("g", {
13829
+ id: "quit-large-[D]-Cart---Slideout",
13830
+ stroke: "none",
13831
+ strokeWidth: "1",
13832
+ fill: "none",
13833
+ fillRule: "evenodd"
13834
+ }, /*#__PURE__*/React__default.createElement("g", {
13835
+ id: "quit-large-[D]-Cart-Slideout---Standard",
13836
+ transform: "translate(-741.000000, -34.000000)"
13837
+ }, /*#__PURE__*/React__default.createElement("g", {
13838
+ id: "quit-large-Close-Icon",
13839
+ transform: "translate(724.000000, 17.000000)"
13840
+ }, /*#__PURE__*/React__default.createElement("g", {
13841
+ id: "quit-large-Group",
13842
+ transform: "translate(12.000000, 12.000000)"
13843
+ }, /*#__PURE__*/React__default.createElement("mask", {
13844
+ id: "quit-large-mask-2",
13845
+ fill: "white"
13846
+ }, /*#__PURE__*/React__default.createElement("use", {
13847
+ xlinkHref: "#quit-large-path-1"
13848
+ })), /*#__PURE__*/React__default.createElement("use", {
13849
+ id: "quit-large-Fill-2",
13850
+ fill: fill,
13851
+ xlinkHref: "#quit-large-path-1"
13852
+ }), /*#__PURE__*/React__default.createElement("g", {
13853
+ mask: "url(#quit-large-mask-2)",
13854
+ fill: fill,
13855
+ id: "quit-large-\u2B91\uD83C\uDFA8"
13856
+ }, /*#__PURE__*/React__default.createElement("g", null, /*#__PURE__*/React__default.createElement("rect", {
13857
+ id: "quit-large-\u279D\u270F\uFE0F",
13858
+ x: "0",
13859
+ y: "0",
13860
+ width: "24",
13861
+ height: "24"
13862
+ }))))))));
13863
+ };
13864
+
13741
13865
  var TimeoutImage = function TimeoutImage() {
13742
13866
  return /*#__PURE__*/React__default.createElement("svg", {
13743
13867
  xmlns: "http://www.w3.org/2000/svg",
@@ -14818,6 +14942,45 @@ var ShoppingCartIcon = function ShoppingCartIcon() {
14818
14942
  })))));
14819
14943
  };
14820
14944
 
14945
+ var TrashIcon = function TrashIcon(_ref) {
14946
+ var themeValues = _ref.themeValues;
14947
+ return /*#__PURE__*/React__default.createElement("svg", {
14948
+ width: "20px",
14949
+ height: "20px",
14950
+ viewBox: "0 0 20 20",
14951
+ version: "1.1",
14952
+ xmlns: "http://www.w3.org/2000/svg",
14953
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
14954
+ }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("path", {
14955
+ d: "M15,7 L14,15.5714286 C14,16.3571429 13.25,17 12.3333333,17 L12.3333333,17 L7.66666667,17 C6.75,17 6,16.3571429 6,15.5714286 L6,15.5714286 L5,7 L15,7 Z M12.1428571,3 L13,4 L16,4 L16,6 L4,6 L4,4 L7,4 L7.85714286,3 L12.1428571,3 Z",
14956
+ id: "trash-path-1"
14957
+ })), /*#__PURE__*/React__default.createElement("g", {
14958
+ id: "trash-Icons-/-Small-/-20px-S-/-Trash---Mobile---20px",
14959
+ stroke: "none",
14960
+ strokeWidth: "1",
14961
+ fill: "none",
14962
+ fillRule: "evenodd"
14963
+ }, /*#__PURE__*/React__default.createElement("mask", {
14964
+ id: "trash-mask-2",
14965
+ fill: "white"
14966
+ }, /*#__PURE__*/React__default.createElement("use", {
14967
+ xlinkHref: "#trash-path-1"
14968
+ })), /*#__PURE__*/React__default.createElement("use", {
14969
+ id: "trash-Mask",
14970
+ fill: themeValues.singleIconColor,
14971
+ fillRule: "nonzero",
14972
+ xlinkHref: "#trash-path-1"
14973
+ }), /*#__PURE__*/React__default.createElement("polygon", {
14974
+ id: "trash-Path",
14975
+ fill: themeValues.singleIconColor,
14976
+ fillRule: "nonzero",
14977
+ mask: "url(#trash-mask-2)",
14978
+ points: "0 0 20 0 20 20 0 20"
14979
+ })));
14980
+ };
14981
+
14982
+ var TrashIcon$1 = themeComponent(TrashIcon, "Icons", fallbackValues$2, "primary");
14983
+
14821
14984
  var color$2 = "#15749D";
14822
14985
  var hoverColor$1 = "#116285";
14823
14986
  var activeColor$1 = "#0E506D";
@@ -15172,43 +15335,6 @@ var AlertWarningIcon = function AlertWarningIcon() {
15172
15335
  })))));
15173
15336
  };
15174
15337
 
15175
- var IconQuit = function IconQuit(_ref) {
15176
- var _ref$fill = _ref.fill,
15177
- fill = _ref$fill === void 0 ? MINESHAFT_GREY : _ref$fill,
15178
- _ref$width = _ref.width,
15179
- width = _ref$width === void 0 ? "24px" : _ref$width,
15180
- _ref$height = _ref.height,
15181
- height = _ref$height === void 0 ? "24px" : _ref$height;
15182
- return /*#__PURE__*/React__default.createElement("svg", {
15183
- xmlns: "http://www.w3.org/2000/svg",
15184
- xmlnsXlink: "http://www.w3.org/1999/xlink",
15185
- width: width,
15186
- height: height,
15187
- viewBox: "0 0 24 24"
15188
- }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("path", {
15189
- id: "quit",
15190
- d: "M18.9999989 6.40999946L17.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.9999993z"
15191
- })), /*#__PURE__*/React__default.createElement("g", {
15192
- fill: "none",
15193
- fillRule: "evenodd",
15194
- stroke: "none",
15195
- strokeWidth: "1"
15196
- }, /*#__PURE__*/React__default.createElement("mask", {
15197
- id: "quitMask",
15198
- fill: "#fff"
15199
- }, /*#__PURE__*/React__default.createElement("use", {
15200
- xlinkHref: "#quit"
15201
- })), /*#__PURE__*/React__default.createElement("use", {
15202
- fill: fill,
15203
- xlinkHref: "#quit"
15204
- }), /*#__PURE__*/React__default.createElement("g", {
15205
- fill: fill,
15206
- mask: "url(#quitMask)"
15207
- }, /*#__PURE__*/React__default.createElement("path", {
15208
- d: "M0 0H24V24H0z"
15209
- }))));
15210
- };
15211
-
15212
15338
  var AlertIcons = {
15213
15339
  error: AlertErrorIcon,
15214
15340
  info: AlertInfoIcon,
@@ -34730,7 +34856,8 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
34730
34856
  key: "header",
34731
34857
  hoverStyles: "cursor: pointer;",
34732
34858
  tabIndex: "0",
34733
- onKeyDown: handleKeyDown
34859
+ onKeyDown: handleKeyDown,
34860
+ extraStyles: "z-index: 25;"
34734
34861
  }, /*#__PURE__*/React__default.createElement(Cluster, {
34735
34862
  justify: "space-between",
34736
34863
  align: "center"
@@ -34755,7 +34882,7 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
34755
34882
  initial: initiallyOpen ? "open" : "closed",
34756
34883
  exit: "closed",
34757
34884
  variants: wrapper,
34758
- extraStyles: "transform-origin: 100% 0;"
34885
+ extraStyles: "transform-origin: 100% 0; overflow-y: hidden;"
34759
34886
  }, children))));
34760
34887
  };
34761
34888
 
@@ -40855,6 +40982,8 @@ exports.HamburgerButton = HamburgerButton;
40855
40982
  exports.Heading = Heading$1;
40856
40983
  exports.HighlightTabRow = HighlightTabRow$1;
40857
40984
  exports.IconAdd = IconAdd;
40985
+ exports.IconQuit = IconQuit;
40986
+ exports.IconQuitLarge = IconQuitLarge;
40858
40987
  exports.Imposter = Imposter;
40859
40988
  exports.InternalLink = InternalLink;
40860
40989
  exports.Jumbo = Jumbo$1;
@@ -40924,6 +41053,7 @@ exports.Text = Text$1;
40924
41053
  exports.Timeout = Timeout$1;
40925
41054
  exports.TimeoutImage = TimeoutImage;
40926
41055
  exports.ToggleSwitch = ToggleSwitch$1;
41056
+ exports.TrashIcon = TrashIcon$1;
40927
41057
  exports.TypeaheadInput = TypeaheadInput;
40928
41058
  exports.VerifiedEmailIcon = VerifiedEmailIcon$1;
40929
41059
  exports.VoidedIcon = VoidedIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.2.7-beta.1",
3
+ "version": "4.2.7-beta.10",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { AlertIcons, IconQuit } from "../../../deprecated/icons";
2
+ import { AlertIcons } from "../../../deprecated/icons";
3
+ import { IconQuit } from "../icons";
3
4
  import { Box, Center, Cluster, Stack, Cover, Sidebar } from "../layouts";
4
5
  import Text from "../text";
5
6
  import { fallbackValues } from "./Alert.theme";
@@ -70,7 +70,8 @@ const ButtonWithAction = ({
70
70
  contentOverride = false,
71
71
  extraStyles = "",
72
72
  tabIndex,
73
- children
73
+ children,
74
+ ...rest
74
75
  }) => {
75
76
  const themeContext = useContext(ThemeContext);
76
77
  const themeValues = createThemeValues(
@@ -101,9 +102,10 @@ const ButtonWithAction = ({
101
102
  };
102
103
  `;
103
104
  const disabledStyles = `
104
- background-clor: #6D717E;
105
+ background-color: #6D717E;
105
106
  border-color: #6D717E;
106
107
  color: #FFFFFF;
108
+ cursor: default;
107
109
  &:focus {
108
110
  box-shadow: 0 0 10px #6D717E;
109
111
  outline: none;
@@ -128,6 +130,7 @@ const ButtonWithAction = ({
128
130
  extraStyles={`margin: 0.5rem; ${extraStyles}`}
129
131
  dataQa={dataQa}
130
132
  tabIndex={tabIndex}
133
+ {...rest}
131
134
  >
132
135
  {contentOverride ? (
133
136
  children
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { MINESHAFT_GREY } from "../../constants/colors";
2
+ import { MINESHAFT_GREY } from "../../../constants/colors";
3
3
 
4
- export const IconQuit = ({
4
+ const IconQuit = ({
5
5
  fill = MINESHAFT_GREY,
6
6
  width = "24px",
7
7
  height = "24px"
@@ -30,3 +30,5 @@ export const IconQuit = ({
30
30
  </g>
31
31
  </svg>
32
32
  );
33
+
34
+ export default IconQuit;
@@ -0,0 +1,61 @@
1
+ import React from "react";
2
+
3
+ const IconQuitLarge = ({ fill = "#091325" }) => (
4
+ <svg
5
+ width="14px"
6
+ height="14px"
7
+ viewBox="0 0 14 14"
8
+ version="1.1"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlnsXlink="http://www.w3.org/1999/xlink"
11
+ >
12
+ <title>Icon/X</title>
13
+ <defs>
14
+ <polygon
15
+ id="quit-large-path-1"
16
+ 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"
17
+ ></polygon>
18
+ </defs>
19
+ <g
20
+ id="quit-large-[D]-Cart---Slideout"
21
+ stroke="none"
22
+ strokeWidth="1"
23
+ fill="none"
24
+ fillRule="evenodd"
25
+ >
26
+ <g
27
+ id="quit-large-[D]-Cart-Slideout---Standard"
28
+ transform="translate(-741.000000, -34.000000)"
29
+ >
30
+ <g
31
+ id="quit-large-Close-Icon"
32
+ transform="translate(724.000000, 17.000000)"
33
+ >
34
+ <g id="quit-large-Group" transform="translate(12.000000, 12.000000)">
35
+ <mask id="quit-large-mask-2" fill="white">
36
+ <use xlinkHref="#quit-large-path-1"></use>
37
+ </mask>
38
+ <use
39
+ id="quit-large-Fill-2"
40
+ fill={fill}
41
+ xlinkHref="#quit-large-path-1"
42
+ ></use>
43
+ <g mask="url(#quit-large-mask-2)" fill={fill} id="quit-large-⮑🎨">
44
+ <g>
45
+ <rect
46
+ id="quit-large-➝✏️"
47
+ x="0"
48
+ y="0"
49
+ width="24"
50
+ height="24"
51
+ ></rect>
52
+ </g>
53
+ </g>
54
+ </g>
55
+ </g>
56
+ </g>
57
+ </g>
58
+ </svg>
59
+ );
60
+
61
+ export default IconQuitLarge;
@@ -0,0 +1,47 @@
1
+ import React from "react";
2
+ import { fallbackValues } from "./Icons.theme";
3
+ import { themeComponent } from "../../../util/themeUtils";
4
+
5
+ const TrashIcon = ({ themeValues }) => (
6
+ <svg
7
+ width="20px"
8
+ height="20px"
9
+ viewBox="0 0 20 20"
10
+ version="1.1"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ xmlnsXlink="http://www.w3.org/1999/xlink"
13
+ >
14
+ <defs>
15
+ <path
16
+ d="M15,7 L14,15.5714286 C14,16.3571429 13.25,17 12.3333333,17 L12.3333333,17 L7.66666667,17 C6.75,17 6,16.3571429 6,15.5714286 L6,15.5714286 L5,7 L15,7 Z M12.1428571,3 L13,4 L16,4 L16,6 L4,6 L4,4 L7,4 L7.85714286,3 L12.1428571,3 Z"
17
+ id="trash-path-1"
18
+ ></path>
19
+ </defs>
20
+ <g
21
+ id="trash-Icons-/-Small-/-20px-S-/-Trash---Mobile---20px"
22
+ stroke="none"
23
+ strokeWidth="1"
24
+ fill="none"
25
+ fillRule="evenodd"
26
+ >
27
+ <mask id="trash-mask-2" fill="white">
28
+ <use xlinkHref="#trash-path-1"></use>
29
+ </mask>
30
+ <use
31
+ id="trash-Mask"
32
+ fill={themeValues.singleIconColor}
33
+ fillRule="nonzero"
34
+ xlinkHref="#trash-path-1"
35
+ ></use>
36
+ <polygon
37
+ id="trash-Path"
38
+ fill={themeValues.singleIconColor}
39
+ fillRule="nonzero"
40
+ mask="url(#trash-mask-2)"
41
+ points="0 0 20 0 20 20 0 20"
42
+ ></polygon>
43
+ </g>
44
+ </svg>
45
+ );
46
+
47
+ export default themeComponent(TrashIcon, "Icons", fallbackValues, "primary");
@@ -19,6 +19,8 @@ import BankIcon from "./BankIcon";
19
19
  import GenericCard from "./GenericCard";
20
20
  import PaymentIcon from "./PaymentIcon";
21
21
  import IconAdd from "./IconAdd";
22
+ import IconQuit from "./IconQuit";
23
+ import IconQuitLarge from "./IconQuitLarge";
22
24
  import TimeoutImage from "./TimeoutImage";
23
25
  import AutopayOnIcon from "./AutopayOnIcon";
24
26
  import NotFoundIcon from "./NotFoundIcon";
@@ -44,6 +46,7 @@ import ProfileIcon from "./ProfileIcon";
44
46
  import GenericCardLarge from "./GenericCardLarge";
45
47
  import EmptyCartIcon from "./EmptyCartIcon";
46
48
  import ShoppingCartIcon from "./ShoppingCartIcon";
49
+ import TrashIcon from "./TrashIcon";
47
50
 
48
51
  export {
49
52
  AccountsIcon,
@@ -67,6 +70,8 @@ export {
67
70
  GenericCard,
68
71
  PaymentIcon,
69
72
  IconAdd,
73
+ IconQuit,
74
+ IconQuitLarge,
70
75
  TimeoutImage,
71
76
  AutopayOnIcon,
72
77
  NotFoundIcon,
@@ -91,5 +96,6 @@ export {
91
96
  ProfileIcon,
92
97
  GenericCardLarge,
93
98
  EmptyCartIcon,
94
- ShoppingCartIcon
99
+ ShoppingCartIcon,
100
+ TrashIcon
95
101
  };
@@ -19,10 +19,21 @@ const Cluster = ({
19
19
  minWidth,
20
20
  nowrap,
21
21
  overflow = false,
22
+ justifySelf,
23
+ alignSelf,
24
+ flexGrow,
25
+ extraStyles,
22
26
  children,
23
27
  ...rest
24
28
  }) => (
25
- <ClusterWrapper overflow={overflow} {...rest}>
29
+ <ClusterWrapper
30
+ overflow={overflow}
31
+ {...rest}
32
+ justifySelf={justifySelf}
33
+ alignSelf={alignSelf}
34
+ flexGrow={flexGrow}
35
+ extraStyles={extraStyles}
36
+ >
26
37
  <ClusterInnerWrapper
27
38
  justify={justify}
28
39
  align={align}
@@ -7,6 +7,10 @@ export const ClusterWrapper = styled(({ overflow, ...props }) => (
7
7
  ))`
8
8
  overflow: ${({ overflow }) => (overflow ? "visible" : "hidden")};
9
9
  box-sizing: border-box;
10
+ justify-self: ${({ justifySelf }) => justifySelf};
11
+ align-self: ${({ alignSelf }) => alignSelf};
12
+ flex-grow: ${({ flexGrow }) => flexGrow};
13
+ ${({ extraStyles }) => extraStyles};
10
14
  `;
11
15
 
12
16
  export const ClusterInnerWrapper = styled.div`
@@ -30,6 +30,11 @@ import {
30
30
  products/services should share the same width no matter the orientation, otherwise
31
31
  one or more cards could be perceived as highlighted or featured in some way. Or
32
32
  a set of numbered steps in, for example, a list of items to complete or tasks to do."
33
+
34
+ New: Set the "constrainMobile" prop to true in order to prevent switcher content from
35
+ overflowing the mobile viewport:
36
+
37
+ <Switcher constrainMobile={isMobile} />
33
38
  */
34
39
 
35
40
  const Switcher = ({
@@ -42,6 +47,7 @@ const Switcher = ({
42
47
  padding = "0",
43
48
  children,
44
49
  extraStyles,
50
+ constrainMobile = false,
45
51
  ...rest
46
52
  }) => (
47
53
  <SwitcherOuterContainer>
@@ -54,6 +60,7 @@ const Switcher = ({
54
60
  maxChildrenOnly={maxChildrenOnly}
55
61
  padding={padding}
56
62
  extraStyles={extraStyles}
63
+ constrainMobile={constrainMobile}
57
64
  {...rest}
58
65
  >
59
66
  {safeChildren(children, <Fragment />)}
@@ -12,6 +12,8 @@ export const SwitcherInnerContainer = styled.div`
12
12
  overflow: hidden;
13
13
  padding: ${({ padding }) => padding};
14
14
  margin: ${({ childGap }) => `calc((${childGap} / 2) * -1)`};
15
+ ${({ constrainMobile }) =>
16
+ constrainMobile && `max-width: 100%; margin-left: 0; margin-right: 0;`}
15
17
 
16
18
  > * {
17
19
  flex-grow: 1;
@@ -20,6 +22,8 @@ export const SwitcherInnerContainer = styled.div`
20
22
  ? `flex-basis: calc((${breakpoint} - (100% - ${childGap})) * 999);`
21
23
  : ``};
22
24
  ${({ childGap }) => `margin: calc(${childGap} / 2);`}
25
+ ${({ constrainMobile }) =>
26
+ constrainMobile && `margin-left: 0; margin-right: 0;`}
23
27
  }
24
28
 
25
29
  ${({ largeChild, largeChildSize }) =>
@@ -79,6 +79,7 @@ const CollapsibleSection = ({
79
79
  hoverStyles={`cursor: pointer;`}
80
80
  tabIndex="0"
81
81
  onKeyDown={handleKeyDown}
82
+ extraStyles={`z-index: 25;`}
82
83
  >
83
84
  <Cluster justify="space-between" align="center">
84
85
  {customTitle ? (
@@ -113,7 +114,7 @@ const CollapsibleSection = ({
113
114
  initial={initiallyOpen ? "open" : "closed"}
114
115
  exit="closed"
115
116
  variants={wrapper}
116
- extraStyles={`transform-origin: 100% 0;`}
117
+ extraStyles={`transform-origin: 100% 0; overflow-y: hidden;`}
117
118
  >
118
119
  {children}
119
120
  </Motion>
@@ -13,7 +13,6 @@ import { AlertInfoIcon } from "./AlertInfoIcon";
13
13
  import { AlertErrorIcon } from "./AlertErrorIcon";
14
14
  import { AlertSuccessIcon } from "./AlertSuccessIcon";
15
15
  import { AlertWarningIcon } from "./AlertWarningIcon";
16
- import { IconQuit } from "./IconQuit";
17
16
 
18
17
  const AlertIcons = {
19
18
  error: AlertErrorIcon,
@@ -33,6 +32,5 @@ export {
33
32
  IconNeutral,
34
33
  IconValid,
35
34
  IconInvalid,
36
- AlertIcons,
37
- IconQuit
35
+ AlertIcons
38
36
  };