@thecb/components 9.1.0-beta.7 → 9.1.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.cjs.js +38 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.esm.js +38 -29
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/alert/Alert.js +7 -3
- package/src/components/atoms/dropdown/Dropdown.js +5 -5
- package/src/components/atoms/form-layouts/FormInput.js +1 -1
- package/src/components/atoms/form-layouts/index.d.ts +1 -1
- package/src/components/atoms/form-select/FormSelect.js +4 -2
- package/src/components/atoms/form-select/FormSelect.stories.js +8 -4
- package/src/components/atoms/form-select/index.d.ts +2 -1
- package/src/components/atoms/icons/icons.stories.js +0 -2
- package/src/components/atoms/layouts/Box.d.ts +1 -0
- package/src/components/atoms/layouts/Box.js +2 -0
- package/src/components/atoms/line-item/LineItem.js +6 -12
- package/src/components/atoms/searchable-select/SearchableSelect.js +2 -0
- package/src/components/atoms/searchable-select/SearchableSelect.stories.js +61 -0
- package/src/components/atoms/searchable-select/index.d.ts +1 -0
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +2 -3
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +1 -0
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/address-form/AddressForm.js +1 -2
- package/src/components/molecules/phone-form/PhoneForm.js +1 -1
- /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -455,7 +455,7 @@ interface FormInputProps {
|
|
|
455
455
|
themeValues?: object;
|
|
456
456
|
background?: string;
|
|
457
457
|
customHeight?: string;
|
|
458
|
-
autocompleteValue?: string
|
|
458
|
+
autocompleteValue?: string;
|
|
459
459
|
removeFromValue?: RegExp;
|
|
460
460
|
dataQa?: string | null;
|
|
461
461
|
}
|
|
@@ -476,9 +476,10 @@ interface FormSelectProps {
|
|
|
476
476
|
disabledValues?: string[];
|
|
477
477
|
themeValues?: object;
|
|
478
478
|
hasTitles?: boolean;
|
|
479
|
-
autocompleteValue?: string
|
|
479
|
+
autocompleteValue?: string;
|
|
480
480
|
smoothScroll?: boolean;
|
|
481
481
|
dataQa?: string | null;
|
|
482
|
+
widthFitOptions?: boolean;
|
|
482
483
|
}
|
|
483
484
|
|
|
484
485
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -638,6 +639,7 @@ declare const XCircleIconSmall: React.FC<Expand<XCircleIconSmallProps> &
|
|
|
638
639
|
React.HTMLAttributes<HTMLElement>>;
|
|
639
640
|
|
|
640
641
|
interface BoxProps {
|
|
642
|
+
autocompleteValue?: string;
|
|
641
643
|
padding?: string;
|
|
642
644
|
borderSize?: string;
|
|
643
645
|
borderColor?: string;
|
|
@@ -835,6 +837,7 @@ declare const Paragraph: React.FC<Expand<ParagraphProps> &
|
|
|
835
837
|
React.HTMLAttributes<HTMLElement>>;
|
|
836
838
|
|
|
837
839
|
interface SearchableSelectProps {
|
|
840
|
+
autocompleteValue?: boolean;
|
|
838
841
|
items: SearchableSelectOption[];
|
|
839
842
|
selectedItems: SearchableSelectOption[];
|
|
840
843
|
allSelected: boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -6522,7 +6522,7 @@ var BoxWrapper = styled(function (_ref) {
|
|
|
6522
6522
|
});
|
|
6523
6523
|
/* eslint-enable no-unused-vars */
|
|
6524
6524
|
|
|
6525
|
-
var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
|
|
6525
|
+
var _excluded$3 = ["autocompleteValue", "padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
|
|
6526
6526
|
/*
|
|
6527
6527
|
Box component to create generic boxes
|
|
6528
6528
|
Supply padding, border, background, and color values
|
|
@@ -6532,7 +6532,8 @@ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxS
|
|
|
6532
6532
|
*/
|
|
6533
6533
|
|
|
6534
6534
|
var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6535
|
-
var
|
|
6535
|
+
var autocompleteValue = _ref.autocompleteValue,
|
|
6536
|
+
_ref$padding = _ref.padding,
|
|
6536
6537
|
padding = _ref$padding === void 0 ? "16px" : _ref$padding,
|
|
6537
6538
|
_ref$borderSize = _ref.borderSize,
|
|
6538
6539
|
borderSize = _ref$borderSize === void 0 ? "0px" : _ref$borderSize,
|
|
@@ -6572,6 +6573,7 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
6572
6573
|
rest = _objectWithoutProperties(_ref, _excluded$3);
|
|
6573
6574
|
|
|
6574
6575
|
return /*#__PURE__*/React.createElement(BoxWrapper, _extends({
|
|
6576
|
+
autoComplete: autocompleteValue,
|
|
6575
6577
|
padding: padding,
|
|
6576
6578
|
borderSize: borderSize,
|
|
6577
6579
|
borderColor: borderColor,
|
|
@@ -18754,7 +18756,13 @@ var Alert = function Alert(_ref) {
|
|
|
18754
18756
|
_ref$iconPadding = _ref.iconPadding,
|
|
18755
18757
|
iconPadding = _ref$iconPadding === void 0 ? "0 0 0 1rem" : _ref$iconPadding,
|
|
18756
18758
|
_ref$contentFullHeigh = _ref.contentFullHeight,
|
|
18757
|
-
contentFullHeight = _ref$contentFullHeigh === void 0 ? false : _ref$contentFullHeigh
|
|
18759
|
+
contentFullHeight = _ref$contentFullHeigh === void 0 ? false : _ref$contentFullHeigh,
|
|
18760
|
+
_ref$ariaRole = _ref.ariaRole,
|
|
18761
|
+
ariaRole = _ref$ariaRole === void 0 ? null : _ref$ariaRole,
|
|
18762
|
+
_ref$ariaAtomic = _ref.ariaAtomic,
|
|
18763
|
+
ariaAtomic = _ref$ariaAtomic === void 0 ? true : _ref$ariaAtomic,
|
|
18764
|
+
_ref$ariaLive = _ref.ariaLive,
|
|
18765
|
+
ariaLive = _ref$ariaLive === void 0 ? "polite" : _ref$ariaLive;
|
|
18758
18766
|
var Icon = AlertIcons[variant];
|
|
18759
18767
|
var contentPadding = maxContentWidth ? "".concat(padding, " 1rem") : innerContentPadding;
|
|
18760
18768
|
var content = /*#__PURE__*/React.createElement(Sidebar, {
|
|
@@ -18800,7 +18808,7 @@ var Alert = function Alert(_ref) {
|
|
|
18800
18808
|
minHeight: "100%",
|
|
18801
18809
|
onClick: onLinkClick
|
|
18802
18810
|
}, /*#__PURE__*/React.createElement(IconQuit, null))))));
|
|
18803
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
18811
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
18804
18812
|
padding: padding,
|
|
18805
18813
|
width: "100%",
|
|
18806
18814
|
minHeight: height && parseInt(height) < 100 ? height : "100px",
|
|
@@ -18811,9 +18819,12 @@ var Alert = function Alert(_ref) {
|
|
|
18811
18819
|
borderSize: noBorder ? "0px" : "1px",
|
|
18812
18820
|
boxShadow: enableBoxShadow ? (_generateShadows = generateShadows()) === null || _generateShadows === void 0 ? void 0 : (_generateShadows$inse = _generateShadows.inset) === null || _generateShadows$inse === void 0 ? void 0 : _generateShadows$inse.base : "",
|
|
18813
18821
|
extraStyles: extraStyles,
|
|
18814
|
-
|
|
18815
|
-
|
|
18816
|
-
|
|
18822
|
+
"aria-live": ariaLive
|
|
18823
|
+
}, ariaAtomic !== null ? {
|
|
18824
|
+
"aria-atomic": ariaAtomic
|
|
18825
|
+
} : {}, ariaRole !== null ? {
|
|
18826
|
+
role: ariaRole
|
|
18827
|
+
} : {}), maxContentWidth ? /*#__PURE__*/React.createElement(Center, {
|
|
18817
18828
|
maxWidth: maxContentWidth
|
|
18818
18829
|
}, content) : content);
|
|
18819
18830
|
};
|
|
@@ -23741,8 +23752,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
23741
23752
|
autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
|
|
23742
23753
|
ariaLabelledby = _ref8.ariaLabelledby,
|
|
23743
23754
|
ariaDescribedby = _ref8.ariaDescribedby,
|
|
23744
|
-
|
|
23745
|
-
autocompleteValue = _ref8$autocompleteVal === void 0 ? null : _ref8$autocompleteVal,
|
|
23755
|
+
autocompleteValue = _ref8.autocompleteValue,
|
|
23746
23756
|
_ref8$smoothScroll = _ref8.smoothScroll,
|
|
23747
23757
|
smoothScroll = _ref8$smoothScroll === void 0 ? true : _ref8$smoothScroll,
|
|
23748
23758
|
_ref8$ariaInvalid = _ref8.ariaInvalid,
|
|
@@ -24071,7 +24081,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24071
24081
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
24072
24082
|
variant: "p",
|
|
24073
24083
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
24074
|
-
extraStyles: "padding-left: 16px
|
|
24084
|
+
extraStyles: "padding-left: 16px;\n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;")
|
|
24075
24085
|
}, choice.text));
|
|
24076
24086
|
}))) : /*#__PURE__*/React.createElement(Fragment$1, null)));
|
|
24077
24087
|
};
|
|
@@ -24175,12 +24185,13 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24175
24185
|
themeValues = _ref.themeValues,
|
|
24176
24186
|
_ref$hasTitles = _ref.hasTitles,
|
|
24177
24187
|
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
24178
|
-
|
|
24179
|
-
autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu,
|
|
24188
|
+
autocompleteValue = _ref.autocompleteValue,
|
|
24180
24189
|
_ref$smoothScroll = _ref.smoothScroll,
|
|
24181
24190
|
smoothScroll = _ref$smoothScroll === void 0 ? true : _ref$smoothScroll,
|
|
24182
24191
|
_ref$dataQa = _ref.dataQa,
|
|
24183
|
-
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa
|
|
24192
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
24193
|
+
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
24194
|
+
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions;
|
|
24184
24195
|
|
|
24185
24196
|
var _useState = useState(false),
|
|
24186
24197
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24223,6 +24234,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24223
24234
|
ariaLabelledby: createIdFromString(labelTextWhenNoError),
|
|
24224
24235
|
ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
|
|
24225
24236
|
maxHeight: dropdownMaxHeight,
|
|
24237
|
+
widthFitOptions: widthFitOptions,
|
|
24226
24238
|
hasTitles: hasTitles,
|
|
24227
24239
|
placeholder: options[0] ? options[0].text : "",
|
|
24228
24240
|
options: options,
|
|
@@ -25948,8 +25960,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25948
25960
|
themeValues = _ref15.themeValues,
|
|
25949
25961
|
background = _ref15.background,
|
|
25950
25962
|
customHeight = _ref15.customHeight,
|
|
25951
|
-
|
|
25952
|
-
autocompleteValue = _ref15$autocompleteVa === void 0 ? null : _ref15$autocompleteVa,
|
|
25963
|
+
autocompleteValue = _ref15.autocompleteValue,
|
|
25953
25964
|
extraStyles = _ref15.extraStyles,
|
|
25954
25965
|
removeFromValue = _ref15.removeFromValue,
|
|
25955
25966
|
_ref15$dataQa = _ref15.dataQa,
|
|
@@ -26619,12 +26630,11 @@ var LineItem = function LineItem(_ref) {
|
|
|
26619
26630
|
return visibleFields.includes(attr.key) && attr.key !== "description";
|
|
26620
26631
|
})) === null || _customAttributes$fil === void 0 ? void 0 : _customAttributes$fil.map(function (attr) {
|
|
26621
26632
|
return /*#__PURE__*/React.createElement(Paragraph$1, {
|
|
26622
|
-
variant:
|
|
26633
|
+
variant: "pS",
|
|
26623
26634
|
weight: "400",
|
|
26624
|
-
key: attr.key
|
|
26625
|
-
|
|
26626
|
-
|
|
26627
|
-
}, "".concat(formatAttrKeys(attr.key), ":")), /*#__PURE__*/React.createElement(Text$1, null, " ".concat(attr.value)));
|
|
26635
|
+
key: attr.key,
|
|
26636
|
+
color: STORM_GREY
|
|
26637
|
+
}, "".concat(formatAttrKeys(attr.key), ": ").concat(attr.value));
|
|
26628
26638
|
});
|
|
26629
26639
|
return /*#__PURE__*/React.createElement(Cluster, {
|
|
26630
26640
|
nowrap: true,
|
|
@@ -26639,7 +26649,7 @@ var LineItem = function LineItem(_ref) {
|
|
|
26639
26649
|
variant: themeValues.paragraphVariant,
|
|
26640
26650
|
weight: "400"
|
|
26641
26651
|
}, subDescription), visibleCustomAttrs && /*#__PURE__*/React.createElement(Stack, {
|
|
26642
|
-
childGap: "0"
|
|
26652
|
+
childGap: "0.25rem"
|
|
26643
26653
|
}, visibleCustomAttrs)), !!displayQuantity && /*#__PURE__*/React.createElement(Paragraph$1, {
|
|
26644
26654
|
variant: themeValues.paragraphVariant,
|
|
26645
26655
|
weight: themeValues.weightTitle
|
|
@@ -27331,7 +27341,8 @@ var fallbackValues$w = {
|
|
|
27331
27341
|
var SELECT_ALL = "Select All";
|
|
27332
27342
|
|
|
27333
27343
|
var SearchableSelect = function SearchableSelect(_ref) {
|
|
27334
|
-
var
|
|
27344
|
+
var autocompleteValue = _ref.autocompleteValue,
|
|
27345
|
+
items = _ref.items,
|
|
27335
27346
|
selectedItems = _ref.selectedItems,
|
|
27336
27347
|
allSelected = _ref.allSelected,
|
|
27337
27348
|
toggleSelectAllItems = _ref.toggleSelectAllItems,
|
|
@@ -27373,6 +27384,7 @@ var SearchableSelect = function SearchableSelect(_ref) {
|
|
|
27373
27384
|
border: themeValues.border,
|
|
27374
27385
|
extraStyles: disabled && "color: #6e727e; background-color: #f7f7f7; pointer-events: none;"
|
|
27375
27386
|
}, /*#__PURE__*/React.createElement(FormInput$1, {
|
|
27387
|
+
autocompleteValue: autocompleteValue,
|
|
27376
27388
|
errorMessages: {},
|
|
27377
27389
|
field: fields.searchTerm,
|
|
27378
27390
|
fieldActions: actions.fields.searchTerm,
|
|
@@ -37990,9 +38002,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
37990
38002
|
field = _ref.field,
|
|
37991
38003
|
fieldActions = _ref.fieldActions,
|
|
37992
38004
|
showErrors = _ref.showErrors,
|
|
37993
|
-
countryCode = _ref.countryCode
|
|
37994
|
-
_ref$autocompleteValu = _ref.autocompleteValue,
|
|
37995
|
-
autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu;
|
|
38005
|
+
countryCode = _ref.countryCode;
|
|
37996
38006
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
37997
38007
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
37998
38008
|
return /*#__PURE__*/React.createElement(FormSelect$1, {
|
|
@@ -38002,7 +38012,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38002
38012
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
38003
38013
|
errorMessages: errorMessages,
|
|
38004
38014
|
showErrors: showErrors,
|
|
38005
|
-
autocompleteValue:
|
|
38015
|
+
autocompleteValue: "address-level1"
|
|
38006
38016
|
});
|
|
38007
38017
|
};
|
|
38008
38018
|
|
|
@@ -39372,7 +39382,7 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39372
39382
|
onKeyDown: function onKeyDown(e) {
|
|
39373
39383
|
return e.key === "Enter" && handleSubmit(e);
|
|
39374
39384
|
},
|
|
39375
|
-
autocompleteValue: "
|
|
39385
|
+
autocompleteValue: "address-level2",
|
|
39376
39386
|
dataQa: "City"
|
|
39377
39387
|
}), /*#__PURE__*/React.createElement(FormStateDropdown, {
|
|
39378
39388
|
labelTextWhenNoError: isUS ? "State" : "State or Province",
|
|
@@ -39384,7 +39394,6 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39384
39394
|
onKeyDown: function onKeyDown(e) {
|
|
39385
39395
|
return e.key === "Enter" && handleSubmit(e);
|
|
39386
39396
|
},
|
|
39387
|
-
autocompleteValue: "administrative-area",
|
|
39388
39397
|
dataQa: "State or Province"
|
|
39389
39398
|
}), /*#__PURE__*/React.createElement(FormInput$1, {
|
|
39390
39399
|
isNum: isUS,
|
|
@@ -48391,7 +48400,7 @@ var PhoneForm = function PhoneForm(_ref) {
|
|
|
48391
48400
|
onKeyUp: function onKeyUp(e) {
|
|
48392
48401
|
return e.key === "Enter" && handleSubmit(e);
|
|
48393
48402
|
},
|
|
48394
|
-
autocompleteValue: "tel",
|
|
48403
|
+
autocompleteValue: "tel-national",
|
|
48395
48404
|
dataQa: "Phone number",
|
|
48396
48405
|
isNum: true
|
|
48397
48406
|
}), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
|