@thecb/components 9.3.1-beta.9 → 9.3.1
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 +114 -143
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +114 -144
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.js +76 -70
- package/src/components/atoms/checkbox/Checkbox.js +2 -1
- package/src/components/atoms/dropdown/Dropdown.js +3 -3
- package/src/components/atoms/icons/KebabMenuIcon.d.ts +1 -0
- package/src/components/atoms/icons/KebabMenuIcon.js +38 -0
- package/src/components/atoms/icons/TrashIcon.js +42 -40
- package/src/components/atoms/icons/icons.stories.js +3 -1
- package/src/components/atoms/icons/index.d.ts +1 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/atoms/layouts/Motion.js +7 -10
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +2 -1
- package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
- package/src/components/molecules/popover/Popover.js +2 -1
- package/src/components/molecules/popup-menu/PopupMenu.js +152 -0
- package/src/components/molecules/popup-menu/PopupMenu.stories.js +40 -0
- package/src/components/molecules/popup-menu/PopupMenu.styled.js +20 -0
- package/src/components/molecules/popup-menu/PopupMenu.theme.js +11 -0
- package/src/components/molecules/popup-menu/index.d.ts +25 -0
- package/src/components/molecules/popup-menu/index.js +3 -0
- package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.js +79 -0
- package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.styled.js +27 -0
- package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.theme.js +23 -0
- package/src/components/molecules/radio-section/RadioSection.js +177 -284
- package/src/components/molecules/radio-section/RadioSection.stories.js +11 -42
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +1 -1
- package/src/constants/keyboard.js +7 -0
- package/src/util/general.js +10 -0
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -6371,6 +6371,15 @@ var titleCaseString = function titleCaseString(string) {
|
|
|
6371
6371
|
var kebabCaseString = function kebabCaseString(string) {
|
|
6372
6372
|
return string === null || string === void 0 ? void 0 : string.replaceAll(" ", "-").toLowerCase();
|
|
6373
6373
|
};
|
|
6374
|
+
var wrapIndex = function wrapIndex(index, length) {
|
|
6375
|
+
if (index <= -1) {
|
|
6376
|
+
return length - 1;
|
|
6377
|
+
} else if (index >= length) {
|
|
6378
|
+
return 0;
|
|
6379
|
+
} else {
|
|
6380
|
+
return index;
|
|
6381
|
+
}
|
|
6382
|
+
};
|
|
6374
6383
|
|
|
6375
6384
|
var general = /*#__PURE__*/Object.freeze({
|
|
6376
6385
|
__proto__: null,
|
|
@@ -6391,7 +6400,8 @@ var general = /*#__PURE__*/Object.freeze({
|
|
|
6391
6400
|
throttle: throttle,
|
|
6392
6401
|
titleCaseWord: titleCaseWord,
|
|
6393
6402
|
titleCaseString: titleCaseString,
|
|
6394
|
-
kebabCaseString: kebabCaseString
|
|
6403
|
+
kebabCaseString: kebabCaseString,
|
|
6404
|
+
wrapIndex: wrapIndex
|
|
6395
6405
|
});
|
|
6396
6406
|
|
|
6397
6407
|
var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
|
|
@@ -12511,7 +12521,7 @@ var _excluded$f = ["position", "padding", "children"];
|
|
|
12511
12521
|
This should be sufficient for most scenarios, but if you need to, you have the ability to make Motion act like all of the other primitives using the props provided.
|
|
12512
12522
|
*/
|
|
12513
12523
|
|
|
12514
|
-
var Motion = function
|
|
12524
|
+
var Motion = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12515
12525
|
var _ref$position = _ref.position,
|
|
12516
12526
|
position = _ref$position === void 0 ? "relative" : _ref$position,
|
|
12517
12527
|
_ref$padding = _ref.padding,
|
|
@@ -12521,9 +12531,10 @@ var Motion = function Motion(_ref) {
|
|
|
12521
12531
|
|
|
12522
12532
|
return /*#__PURE__*/React__default.createElement(MotionWrapper, _extends({
|
|
12523
12533
|
position: position,
|
|
12524
|
-
padding: padding
|
|
12534
|
+
padding: padding,
|
|
12535
|
+
ref: ref
|
|
12525
12536
|
}, rest), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
12526
|
-
};
|
|
12537
|
+
});
|
|
12527
12538
|
|
|
12528
12539
|
var ReelStyled = styled__default.div.withConfig({
|
|
12529
12540
|
displayName: "Reelstyled__ReelStyled",
|
|
@@ -12926,7 +12937,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
12926
12937
|
*/
|
|
12927
12938
|
|
|
12928
12939
|
|
|
12929
|
-
var ButtonWithAction = function
|
|
12940
|
+
var ButtonWithAction = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
12930
12941
|
var _ref2$action = _ref2.action,
|
|
12931
12942
|
action = _ref2$action === void 0 ? noop : _ref2$action,
|
|
12932
12943
|
_ref2$variant = _ref2.variant,
|
|
@@ -12957,6 +12968,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
|
|
|
12957
12968
|
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 ");
|
|
12958
12969
|
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 ".concat(extraDisabledStyles, "\n ");
|
|
12959
12970
|
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
12971
|
+
ref: ref,
|
|
12960
12972
|
variant: variant,
|
|
12961
12973
|
padding: themeValues.padding,
|
|
12962
12974
|
minHeight: themeValues.height,
|
|
@@ -12985,7 +12997,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
|
|
|
12985
12997
|
textWrap: textWrap,
|
|
12986
12998
|
extraStyles: textExtraStyles
|
|
12987
12999
|
}, text)));
|
|
12988
|
-
};
|
|
13000
|
+
});
|
|
12989
13001
|
|
|
12990
13002
|
var primaryColor = {
|
|
12991
13003
|
info: "".concat(WHITE),
|
|
@@ -15299,7 +15311,8 @@ var ShoppingCartIcon = function ShoppingCartIcon() {
|
|
|
15299
15311
|
};
|
|
15300
15312
|
|
|
15301
15313
|
var TrashIcon = function TrashIcon(_ref) {
|
|
15302
|
-
var themeValues = _ref.themeValues
|
|
15314
|
+
var themeValues = _ref.themeValues,
|
|
15315
|
+
iconFill = _ref.iconFill;
|
|
15303
15316
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
15304
15317
|
width: "20px",
|
|
15305
15318
|
height: "20px",
|
|
@@ -15323,12 +15336,12 @@ var TrashIcon = function TrashIcon(_ref) {
|
|
|
15323
15336
|
xlinkHref: "#trash-path-1"
|
|
15324
15337
|
})), /*#__PURE__*/React__default.createElement("use", {
|
|
15325
15338
|
id: "trash-Mask",
|
|
15326
|
-
fill: themeValues.singleIconColor,
|
|
15339
|
+
fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
|
|
15327
15340
|
fillRule: "nonzero",
|
|
15328
15341
|
xlinkHref: "#trash-path-1"
|
|
15329
15342
|
}), /*#__PURE__*/React__default.createElement("polygon", {
|
|
15330
15343
|
id: "trash-Path",
|
|
15331
|
-
fill: themeValues.singleIconColor,
|
|
15344
|
+
fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
|
|
15332
15345
|
fillRule: "nonzero",
|
|
15333
15346
|
mask: "url(#trash-mask-2)",
|
|
15334
15347
|
points: "0 0 20 0 20 20 0 20"
|
|
@@ -18259,6 +18272,34 @@ var PlusCircleIcon = function PlusCircleIcon(_ref) {
|
|
|
18259
18272
|
}));
|
|
18260
18273
|
};
|
|
18261
18274
|
|
|
18275
|
+
var KebabMenuIcon = function KebabMenuIcon() {
|
|
18276
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
18277
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18278
|
+
width: "21",
|
|
18279
|
+
height: "32",
|
|
18280
|
+
viewBox: "0 0 21 32",
|
|
18281
|
+
fill: "none"
|
|
18282
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
18283
|
+
d: "M0 4C0 1.79086 1.79086 0 4 0L17 0C19.2091 0 21 1.79086 21 4V28C21 30.2091 19.2091 32 17 32H4C1.79086 32 0 30.2091 0 28L0 4Z",
|
|
18284
|
+
fill: "none"
|
|
18285
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
18286
|
+
fillRule: "evenodd",
|
|
18287
|
+
clipRule: "evenodd",
|
|
18288
|
+
d: "M10.5 6C9.39333 6 8.5 6.89333 8.5 8C8.5 9.10667 9.39333 10 10.5 10C11.6067 10 12.5 9.10667 12.5 8C12.5 6.89333 11.6067 6 10.5 6Z",
|
|
18289
|
+
fill: "#3B5BDB"
|
|
18290
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
18291
|
+
fillRule: "evenodd",
|
|
18292
|
+
clipRule: "evenodd",
|
|
18293
|
+
d: "M10.5 14C9.39333 14 8.5 14.8933 8.5 16C8.5 17.1067 9.39333 18 10.5 18C11.6067 18 12.5 17.1067 12.5 16C12.5 14.8933 11.6067 14 10.5 14Z",
|
|
18294
|
+
fill: "#3B5BDB"
|
|
18295
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
18296
|
+
fillRule: "evenodd",
|
|
18297
|
+
clipRule: "evenodd",
|
|
18298
|
+
d: "M10.5 22C9.39333 22 8.5 22.9067 8.5 24C8.5 25.0933 9.40667 26 10.5 26C11.5933 26 12.5 25.0933 12.5 24C12.5 22.9067 11.6067 22 10.5 22Z",
|
|
18299
|
+
fill: "#3B5BDB"
|
|
18300
|
+
}));
|
|
18301
|
+
};
|
|
18302
|
+
|
|
18262
18303
|
var color$2 = "#15749D";
|
|
18263
18304
|
var hoverColor$1 = "#116285";
|
|
18264
18305
|
var activeColor$1 = "#0E506D";
|
|
@@ -22085,6 +22126,14 @@ var fallbackValues$d = {
|
|
|
22085
22126
|
disabledCheckedStyles: disabledCheckedStyles
|
|
22086
22127
|
};
|
|
22087
22128
|
|
|
22129
|
+
var ARROW_LEFT = 37;
|
|
22130
|
+
var ARROW_UP = 38;
|
|
22131
|
+
var ARROW_RIGHT = 39;
|
|
22132
|
+
var ARROW_DOWN = 40;
|
|
22133
|
+
var ENTER = 13;
|
|
22134
|
+
var ESCAPE = 27;
|
|
22135
|
+
var SPACEBAR = 32;
|
|
22136
|
+
|
|
22088
22137
|
var CheckboxContainer = styled__default.div.withConfig({
|
|
22089
22138
|
displayName: "Checkbox__CheckboxContainer",
|
|
22090
22139
|
componentId: "sc-36kqbv-0"
|
|
@@ -22155,7 +22204,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22155
22204
|
setFocused = _useState2[1];
|
|
22156
22205
|
|
|
22157
22206
|
var handleClick = function handleClick(e, func) {
|
|
22158
|
-
if (
|
|
22207
|
+
if (e.keyCode === ENTER) {
|
|
22159
22208
|
func();
|
|
22160
22209
|
}
|
|
22161
22210
|
};
|
|
@@ -24061,10 +24110,9 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24061
24110
|
dataQa: "".concat(ariaLabelledby, "-dropdown")
|
|
24062
24111
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
24063
24112
|
as: "input",
|
|
24064
|
-
"aria-multiline": "false",
|
|
24065
24113
|
autoComplete: autocompleteValue,
|
|
24066
24114
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
24067
|
-
"aria-activedescendant": "focused_option",
|
|
24115
|
+
"aria-activedescendant": isOpen ? "focused_option" : undefined,
|
|
24068
24116
|
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
24069
24117
|
"aria-haspopup": "listbox",
|
|
24070
24118
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -24128,7 +24176,7 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24128
24176
|
return handleItemSelection(e, choice, i);
|
|
24129
24177
|
},
|
|
24130
24178
|
onKeyDown: function onKeyDown(e) {
|
|
24131
|
-
if (e.keyCode ===
|
|
24179
|
+
if (e.keyCode === ENTER) {
|
|
24132
24180
|
handleItemSelection(e, choice, i);
|
|
24133
24181
|
}
|
|
24134
24182
|
},
|
|
@@ -25494,7 +25542,7 @@ var Popover = function Popover(_ref) {
|
|
|
25494
25542
|
handleTogglePopover(false);
|
|
25495
25543
|
},
|
|
25496
25544
|
onKeyDown: function onKeyDown(e) {
|
|
25497
|
-
if (e.keyCode ===
|
|
25545
|
+
if (e.keyCode === ESCAPE) {
|
|
25498
25546
|
handleTogglePopover(false);
|
|
25499
25547
|
}
|
|
25500
25548
|
},
|
|
@@ -27389,8 +27437,7 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
27389
27437
|
name = _ref2.name,
|
|
27390
27438
|
_ref2$disabled = _ref2.disabled,
|
|
27391
27439
|
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
27392
|
-
|
|
27393
|
-
ariaDescribedBy = _ref2$ariaDescribedBy === void 0 ? "" : _ref2$ariaDescribedBy,
|
|
27440
|
+
ariaDescribedBy = _ref2.ariaDescribedBy,
|
|
27394
27441
|
themeValues = _ref2.themeValues,
|
|
27395
27442
|
_ref2$ariaLabelledBy = _ref2.ariaLabelledBy,
|
|
27396
27443
|
ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
|
|
@@ -38306,7 +38353,7 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
38306
38353
|
});
|
|
38307
38354
|
|
|
38308
38355
|
var handleKeyDown = function handleKeyDown(e) {
|
|
38309
|
-
if (e.keyCode ===
|
|
38356
|
+
if (e.keyCode === ENTER) {
|
|
38310
38357
|
onToggle();
|
|
38311
38358
|
}
|
|
38312
38359
|
};
|
|
@@ -39835,7 +39882,7 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
|
|
|
39835
39882
|
extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles;
|
|
39836
39883
|
|
|
39837
39884
|
var handleKeyDown = function handleKeyDown(e) {
|
|
39838
|
-
if (e.keyCode ===
|
|
39885
|
+
if (e.keyCode === ENTER) {
|
|
39839
39886
|
toggleSection();
|
|
39840
39887
|
}
|
|
39841
39888
|
};
|
|
@@ -48642,6 +48689,7 @@ var fallbackValues$Q = {
|
|
|
48642
48689
|
focusStyles: focusStyles
|
|
48643
48690
|
};
|
|
48644
48691
|
|
|
48692
|
+
var _excluded$z = ["themeValues", "isMobile", "supportsTouch", "sections", "openSection", "toggleOpenSection", "staggeredAnimation", "initiallyOpen", "openHeight", "containerStyles", "ariaDescribedBy", "isSectionRequired"];
|
|
48645
48693
|
/*
|
|
48646
48694
|
Takes an array of section objects, each object should look like:
|
|
48647
48695
|
{
|
|
@@ -48670,8 +48718,6 @@ var idString = function idString(section) {
|
|
|
48670
48718
|
};
|
|
48671
48719
|
|
|
48672
48720
|
var RadioSection = function RadioSection(_ref) {
|
|
48673
|
-
var _sections$;
|
|
48674
|
-
|
|
48675
48721
|
var themeValues = _ref.themeValues,
|
|
48676
48722
|
isMobile = _ref.isMobile,
|
|
48677
48723
|
supportsTouch = _ref.supportsTouch,
|
|
@@ -48690,12 +48736,39 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48690
48736
|
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
48691
48737
|
ariaDescribedBy = _ref.ariaDescribedBy,
|
|
48692
48738
|
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
48693
|
-
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire
|
|
48694
|
-
|
|
48739
|
+
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
|
|
48740
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
48741
|
+
|
|
48742
|
+
var _useState = React.useState(null),
|
|
48743
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48744
|
+
focused = _useState2[0],
|
|
48745
|
+
setFocused = _useState2[1];
|
|
48746
|
+
|
|
48747
|
+
var sectionRefs = React.useRef(_toConsumableArray(Array(sections.length)).map(function () {
|
|
48748
|
+
return /*#__PURE__*/React.createRef();
|
|
48749
|
+
}));
|
|
48695
48750
|
|
|
48696
|
-
var handleKeyDown = function handleKeyDown(id, e) {
|
|
48697
|
-
if (
|
|
48751
|
+
var handleKeyDown = function handleKeyDown(id, e, i) {
|
|
48752
|
+
if (e.currentTarget !== e.target) {
|
|
48753
|
+
return;
|
|
48754
|
+
} // Allow Enter and Space to select a section
|
|
48755
|
+
|
|
48756
|
+
|
|
48757
|
+
if (e.keyCode === ENTER || e.keyCode === SPACEBAR) {
|
|
48758
|
+
e.preventDefault();
|
|
48698
48759
|
toggleOpenSection(id);
|
|
48760
|
+
} // Allow Up and Down arrow navigation between sections
|
|
48761
|
+
|
|
48762
|
+
|
|
48763
|
+
if (e.keyCode == ARROW_UP || e.keyCode == ARROW_DOWN || e.keyCode == ARROW_LEFT || e.keyCode == ARROW_RIGHT) {
|
|
48764
|
+
var _sectionRefs$current$, _sectionRefs$current$2, _sections$nextIndex, _sections$nextIndex2;
|
|
48765
|
+
|
|
48766
|
+
e.preventDefault();
|
|
48767
|
+
var indexIncrement = e.keyCode == ARROW_RIGHT || e.keyCode == ARROW_DOWN ? 1 : -1;
|
|
48768
|
+
var nextIndex = wrapIndex(i + indexIncrement, sections.length);
|
|
48769
|
+
sectionRefs === null || sectionRefs === void 0 ? void 0 : (_sectionRefs$current$ = sectionRefs.current[nextIndex]) === null || _sectionRefs$current$ === void 0 ? void 0 : (_sectionRefs$current$2 = _sectionRefs$current$.current) === null || _sectionRefs$current$2 === void 0 ? void 0 : _sectionRefs$current$2.focus();
|
|
48770
|
+
setFocused((_sections$nextIndex = sections[nextIndex]) === null || _sections$nextIndex === void 0 ? void 0 : _sections$nextIndex.id);
|
|
48771
|
+
toggleOpenSection((_sections$nextIndex2 = sections[nextIndex]) === null || _sections$nextIndex2 === void 0 ? void 0 : _sections$nextIndex2.id);
|
|
48699
48772
|
}
|
|
48700
48773
|
};
|
|
48701
48774
|
|
|
@@ -48734,44 +48807,41 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48734
48807
|
var fade = _ref4.fade;
|
|
48735
48808
|
return fade && "opacity: 0.4;";
|
|
48736
48809
|
});
|
|
48737
|
-
|
|
48738
|
-
var _useState = React.useState(null),
|
|
48739
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
48740
|
-
focused = _useState2[0],
|
|
48741
|
-
setFocused = _useState2[1];
|
|
48742
|
-
|
|
48743
48810
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48744
48811
|
padding: "1px",
|
|
48745
48812
|
border: "1px solid ".concat(themeValues.borderColor),
|
|
48746
48813
|
borderRadius: "4px",
|
|
48747
48814
|
extraStyles: containerStyles
|
|
48748
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48815
|
+
}, /*#__PURE__*/React__default.createElement(Stack, _extends({
|
|
48749
48816
|
childGap: "0",
|
|
48750
48817
|
role: "radiogroup",
|
|
48751
48818
|
"aria-required": isSectionRequired
|
|
48752
|
-
},
|
|
48819
|
+
}, rest), sections.filter(function (section) {
|
|
48753
48820
|
return !section.hidden;
|
|
48754
|
-
}).map(function (section) {
|
|
48821
|
+
}).map(function (section, i) {
|
|
48755
48822
|
return /*#__PURE__*/React__default.createElement(Motion, {
|
|
48756
48823
|
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
48757
|
-
|
|
48758
|
-
|
|
48824
|
+
ref: sectionRefs.current[i],
|
|
48825
|
+
onBlur: function onBlur() {
|
|
48826
|
+
return !section.disabled && setFocused(null);
|
|
48759
48827
|
},
|
|
48760
48828
|
onFocus: function onFocus() {
|
|
48761
48829
|
return !section.disabled && setFocused(section.id);
|
|
48762
48830
|
},
|
|
48763
|
-
|
|
48764
|
-
return !section.disabled &&
|
|
48831
|
+
onKeyDown: function onKeyDown(e) {
|
|
48832
|
+
return !section.disabled && handleKeyDown(section.id, e, i);
|
|
48765
48833
|
},
|
|
48766
48834
|
hoverStyles: themeValues.focusStyles,
|
|
48767
48835
|
animate: openSection === section.id ? "open" : "closed",
|
|
48768
48836
|
initial: initiallyOpen ? "open" : "closed",
|
|
48769
|
-
key: "item-".concat(
|
|
48837
|
+
key: "item-".concat(section.id),
|
|
48770
48838
|
extraStyles: borderStyles,
|
|
48771
48839
|
role: "radio",
|
|
48772
48840
|
"aria-checked": openSection === section.id,
|
|
48773
48841
|
"aria-disabled": section.disabled,
|
|
48774
|
-
"aria-required": section
|
|
48842
|
+
"aria-required": section.required,
|
|
48843
|
+
"aria-labelledby": section.id,
|
|
48844
|
+
"aria-describedby": "right-icons-".concat(idString(section))
|
|
48775
48845
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48776
48846
|
childGap: "0"
|
|
48777
48847
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48810,7 +48880,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48810
48880
|
return toggleOpenSection(section.id);
|
|
48811
48881
|
},
|
|
48812
48882
|
tabIndex: "-1",
|
|
48813
|
-
isRequired: section
|
|
48883
|
+
isRequired: section.required
|
|
48814
48884
|
})), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48815
48885
|
align: "center"
|
|
48816
48886
|
}, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48820,9 +48890,10 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48820
48890
|
htmlFor: "radio-input-".concat(idString(section)),
|
|
48821
48891
|
color: CHARADE_GREY
|
|
48822
48892
|
}, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48893
|
+
id: "right-icons-".concat(idString(section)),
|
|
48823
48894
|
childGap: "0.5rem",
|
|
48824
|
-
"aria-label":
|
|
48825
|
-
role:
|
|
48895
|
+
"aria-label": section.rightIconsLabel || null,
|
|
48896
|
+
role: section.rightIconsRole || null
|
|
48826
48897
|
}, section.rightIcons.map(function (icon) {
|
|
48827
48898
|
return /*#__PURE__*/React__default.createElement(RightIcon, {
|
|
48828
48899
|
src: icon.img,
|
|
@@ -48845,107 +48916,6 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48845
48916
|
variants: wrapper,
|
|
48846
48917
|
extraStyles: "transform-origin: 100% 0;"
|
|
48847
48918
|
}, section.content))));
|
|
48848
|
-
}), areSectionsGrouped && sections.map(function (sectionGroup) {
|
|
48849
|
-
return sectionGroup.filter(function (section) {
|
|
48850
|
-
return !section.hidden;
|
|
48851
|
-
}).map(function (section) {
|
|
48852
|
-
return /*#__PURE__*/React__default.createElement(Motion, {
|
|
48853
|
-
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
48854
|
-
onKeyDown: function onKeyDown(e) {
|
|
48855
|
-
return !section.disabled && handleKeyDown(section.id, e);
|
|
48856
|
-
},
|
|
48857
|
-
onFocus: function onFocus() {
|
|
48858
|
-
return !section.disabled && setFocused(section.id);
|
|
48859
|
-
},
|
|
48860
|
-
onBlur: function onBlur() {
|
|
48861
|
-
return !section.disabled && setFocused(null);
|
|
48862
|
-
},
|
|
48863
|
-
hoverStyles: themeValues.focusStyles,
|
|
48864
|
-
animate: openSection === section.id ? "open" : "closed",
|
|
48865
|
-
initial: initiallyOpen ? "open" : "closed",
|
|
48866
|
-
key: "item-".concat(sections.indexOf(sectionGroup), "-").concat(sectionGroup.indexOf(section)),
|
|
48867
|
-
extraStyles: borderStyles,
|
|
48868
|
-
role: "radio",
|
|
48869
|
-
"aria-checked": openSection === section.id,
|
|
48870
|
-
"aria-disabled": section.disabled,
|
|
48871
|
-
"aria-required": section === null || section === void 0 ? void 0 : section.required
|
|
48872
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48873
|
-
childGap: "0"
|
|
48874
|
-
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
48875
|
-
padding: section.hideRadioButton ? "1.5rem" : "1.25rem 1.5rem",
|
|
48876
|
-
background: section.disabled ? themeValues.headingDisabledColor : themeValues.headingBackgroundColor,
|
|
48877
|
-
onClick: isMobile && supportsTouch || section.disabled ? noop : function () {
|
|
48878
|
-
return toggleOpenSection(section.id);
|
|
48879
|
-
},
|
|
48880
|
-
onTouchEnd: isMobile && supportsTouch && !section.disabled ? function () {
|
|
48881
|
-
return toggleOpenSection(section.id);
|
|
48882
|
-
} : noop,
|
|
48883
|
-
key: "header-".concat(section.id),
|
|
48884
|
-
borderSize: "0px",
|
|
48885
|
-
borderColor: themeValues.borderColor,
|
|
48886
|
-
borderWidthOverride: openSection === section.id && !!section.content ? "0px 0px 1px 0px" : "",
|
|
48887
|
-
extraStyles: !section.disabled ? "cursor: pointer;" : "",
|
|
48888
|
-
dataQa: section.dataQa ? section.dataQa : section.id
|
|
48889
|
-
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48890
|
-
justify: "space-between",
|
|
48891
|
-
align: "center",
|
|
48892
|
-
childGap: "1px",
|
|
48893
|
-
nowrap: true
|
|
48894
|
-
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48895
|
-
justify: "flex-start",
|
|
48896
|
-
align: "center",
|
|
48897
|
-
nowrap: true
|
|
48898
|
-
}, !section.hideRadioButton && /*#__PURE__*/React__default.createElement(Box, {
|
|
48899
|
-
padding: "0"
|
|
48900
|
-
}, /*#__PURE__*/React__default.createElement(RadioButton$2, {
|
|
48901
|
-
id: "radio-input-".concat(idString(section)),
|
|
48902
|
-
name: idString(section),
|
|
48903
|
-
ariaDescribedBy: ariaDescribedBy,
|
|
48904
|
-
radioOn: openSection === section.id,
|
|
48905
|
-
radioFocused: focused === section.id,
|
|
48906
|
-
toggleRadio: section.disabled ? noop : function () {
|
|
48907
|
-
return toggleOpenSection(section.id);
|
|
48908
|
-
},
|
|
48909
|
-
tabIndex: "-1",
|
|
48910
|
-
isRequired: section === null || section === void 0 ? void 0 : section.required
|
|
48911
|
-
})), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48912
|
-
align: "center"
|
|
48913
|
-
}, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
|
|
48914
|
-
padding: section.titleIcon ? "0 0 0 8px" : "0"
|
|
48915
|
-
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48916
|
-
as: "label",
|
|
48917
|
-
htmlFor: "radio-input-".concat(idString(section)),
|
|
48918
|
-
color: CHARADE_GREY
|
|
48919
|
-
}, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48920
|
-
childGap: "0.5rem",
|
|
48921
|
-
"aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
|
|
48922
|
-
role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
|
|
48923
|
-
}, section.rightIcons.map(function (icon) {
|
|
48924
|
-
return /*#__PURE__*/React__default.createElement(RightIcon, {
|
|
48925
|
-
src: icon.img,
|
|
48926
|
-
key: icon.img,
|
|
48927
|
-
fade: !icon.enabled,
|
|
48928
|
-
isMobile: isMobile,
|
|
48929
|
-
alt: icon.altText,
|
|
48930
|
-
"aria-disabled": !icon.enabled
|
|
48931
|
-
});
|
|
48932
|
-
})), section.rightTitleContent && /*#__PURE__*/React__default.createElement(React.Fragment, null, section.rightTitleContent))), /*#__PURE__*/React__default.createElement(AnimatePresence, {
|
|
48933
|
-
initial: false
|
|
48934
|
-
}, openSection === section.id && /*#__PURE__*/React__default.createElement(Motion, {
|
|
48935
|
-
key: "content-".concat(section.id),
|
|
48936
|
-
padding: "0",
|
|
48937
|
-
background: themeValues.bodyBackgroundColor,
|
|
48938
|
-
layoutTransition: true,
|
|
48939
|
-
initial: "closed",
|
|
48940
|
-
animate: "open",
|
|
48941
|
-
exit: "closed",
|
|
48942
|
-
variants: wrapper,
|
|
48943
|
-
extraStyles: "transform-origin: 100% 0;"
|
|
48944
|
-
}, section.content))), sectionGroup.indexOf(section) !== sectionGroup.length - 1 && /*#__PURE__*/React__default.createElement(SolidDivider$1, {
|
|
48945
|
-
borderSize: "2px",
|
|
48946
|
-
borderColor: themeValues.borderColor
|
|
48947
|
-
}));
|
|
48948
|
-
});
|
|
48949
48919
|
})));
|
|
48950
48920
|
};
|
|
48951
48921
|
|
|
@@ -49976,6 +49946,7 @@ exports.ImageBox = ImageBox;
|
|
|
49976
49946
|
exports.Imposter = Imposter;
|
|
49977
49947
|
exports.InternalLink = InternalLink;
|
|
49978
49948
|
exports.Jumbo = Jumbo$1;
|
|
49949
|
+
exports.KebabMenuIcon = KebabMenuIcon;
|
|
49979
49950
|
exports.KioskImage = KioskImage;
|
|
49980
49951
|
exports.LabeledAmount = LabeledAmount$1;
|
|
49981
49952
|
exports.LineItem = LineItem$1;
|