@thecb/components 6.0.0-beta.24 → 6.0.0-beta.27
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 +12 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +4 -0
- package/src/components/atoms/layouts/Box.js +2 -0
- package/src/components/atoms/layouts/Box.styled.js +9 -1
package/dist/index.esm.js
CHANGED
|
@@ -6189,7 +6189,7 @@ var Text = function Text(_ref) {
|
|
|
6189
6189
|
|
|
6190
6190
|
var Text$1 = themeComponent(Text, "Text", fallbackValues, "p");
|
|
6191
6191
|
|
|
6192
|
-
var _excluded$2 = ["activeStyles", "hoverStyles", "disabledStyles", "extraStyles", "borderSize", "borderColor", "borderWidthOverride", "borderRadius", "textAlign", "boxShadow", "minHeight", "minWidth", "maxWidth", "padding", "hiddenStyles", "ariaControls", "ariaLabel"];
|
|
6192
|
+
var _excluded$2 = ["activeStyles", "hoverStyles", "disabledStyles", "extraStyles", "borderSize", "borderColor", "borderWidthOverride", "borderRadius", "textAlign", "boxShadow", "minHeight", "minWidth", "maxWidth", "padding", "hiddenStyles", "ariaControls", "ariaLabel", "ref"];
|
|
6193
6193
|
/*
|
|
6194
6194
|
The child span selector on hover styles targets the text inside of buttons when a button is hovered,
|
|
6195
6195
|
as long as the box wrapper has an "as" prop equal to "button"
|
|
@@ -6218,11 +6218,13 @@ var BoxWrapper = styled(function (_ref) {
|
|
|
6218
6218
|
hiddenStyles = _ref.hiddenStyles,
|
|
6219
6219
|
ariaControls = _ref.ariaControls,
|
|
6220
6220
|
ariaLabel = _ref.ariaLabel,
|
|
6221
|
+
ref = _ref.ref,
|
|
6221
6222
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
6222
6223
|
|
|
6223
6224
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
6224
6225
|
"aria-controls": ariaControls,
|
|
6225
|
-
"aria-label": ariaLabel
|
|
6226
|
+
"aria-label": ariaLabel,
|
|
6227
|
+
ref: ref
|
|
6226
6228
|
}, props));
|
|
6227
6229
|
}).withConfig({
|
|
6228
6230
|
displayName: "Boxstyled__BoxWrapper",
|
|
@@ -6292,7 +6294,7 @@ var BoxWrapper = styled(function (_ref) {
|
|
|
6292
6294
|
});
|
|
6293
6295
|
/* eslint-enable no-unused-vars */
|
|
6294
6296
|
|
|
6295
|
-
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"];
|
|
6297
|
+
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", "ref", "dataQa", "children"];
|
|
6296
6298
|
/*
|
|
6297
6299
|
Box component to create generic boxes
|
|
6298
6300
|
Supply padding, border, background, and color values
|
|
@@ -6337,6 +6339,7 @@ var Box = function Box(_ref) {
|
|
|
6337
6339
|
extraStyles = _ref.extraStyles,
|
|
6338
6340
|
_ref$srOnly = _ref.srOnly,
|
|
6339
6341
|
srOnly = _ref$srOnly === void 0 ? false : _ref$srOnly,
|
|
6342
|
+
ref = _ref.ref,
|
|
6340
6343
|
dataQa = _ref.dataQa,
|
|
6341
6344
|
children = _ref.children,
|
|
6342
6345
|
rest = _objectWithoutProperties(_ref, _excluded$3);
|
|
@@ -6371,7 +6374,8 @@ var Box = function Box(_ref) {
|
|
|
6371
6374
|
onMouseLeave: onMouseLeave,
|
|
6372
6375
|
onFocus: onFocus,
|
|
6373
6376
|
onBlur: onBlur,
|
|
6374
|
-
onTouchEnd: onTouchEnd
|
|
6377
|
+
onTouchEnd: onTouchEnd,
|
|
6378
|
+
ref: ref
|
|
6375
6379
|
}, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
|
|
6376
6380
|
};
|
|
6377
6381
|
|
|
@@ -20762,6 +20766,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20762
20766
|
return /*#__PURE__*/createRef();
|
|
20763
20767
|
}));
|
|
20764
20768
|
var dropdownRef = useRef(null);
|
|
20769
|
+
var inputRef = useRef(null);
|
|
20765
20770
|
|
|
20766
20771
|
var getSelection = function getSelection() {
|
|
20767
20772
|
var _options$find;
|
|
@@ -20873,9 +20878,11 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20873
20878
|
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
20874
20879
|
// WAI-ARIA requires the selected option to receive focus
|
|
20875
20880
|
selectedRef.current.focus();
|
|
20881
|
+
console.log("input box ref", inputRef, inputRef.current);
|
|
20876
20882
|
} else if (isOpen && optionRefs.current[0].current) {
|
|
20877
20883
|
// If no selected option, first option receives focus
|
|
20878
20884
|
optionRefs.current[0].current.focus();
|
|
20885
|
+
console.log("input box ref", inputRef, inputRef.current);
|
|
20879
20886
|
}
|
|
20880
20887
|
|
|
20881
20888
|
clearTimeout(timer);
|
|
@@ -20962,6 +20969,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
20962
20969
|
},
|
|
20963
20970
|
padding: "12px",
|
|
20964
20971
|
placeholder: getSelection(),
|
|
20972
|
+
ref: inputRef,
|
|
20965
20973
|
role: "combobox",
|
|
20966
20974
|
themeValues: themeValues,
|
|
20967
20975
|
title: hasTitles ? getSelection() : null,
|