@thecb/components 6.0.0-beta.6 → 6.0.0-beta.9

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
@@ -19520,6 +19520,8 @@ var Dropdown = function Dropdown(_ref8) {
19520
19520
  var onKeyDown = function onKeyDown(e) {
19521
19521
  var _optionRefs$current$l, _optionRefs$current;
19522
19522
 
19523
+ console.log("key down event is", e.target);
19524
+ console.log("key down event value is", e.target.value);
19523
19525
  var key = e.key,
19524
19526
  keyCode = e.keyCode;
19525
19527
  var focus = document.activeElement;
@@ -19594,11 +19596,12 @@ var Dropdown = function Dropdown(_ref8) {
19594
19596
  };
19595
19597
 
19596
19598
  useEffect$1(function () {
19597
- console.log("option refs in isopen useffect", optionRefs.current[0].current);
19599
+ console.log("option refs in isopen useffect", optionRefs);
19600
+ console.log("option ref current in isopen useffect", optionRefs.current[0].current);
19598
19601
  console.log("selected refs in isopen useffect", selectedRef);
19599
19602
  console.log("value in isopen useffect", value);
19600
19603
 
19601
- if (isOpen && selectedRef !== undefined) {
19604
+ if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
19602
19605
  // WAI-ARIA requires the selected option to receive focus
19603
19606
  selectedRef.current.focus();
19604
19607
  } else if (isOpen && optionRefs.current[0].current) {
@@ -19614,7 +19617,7 @@ var Dropdown = function Dropdown(_ref8) {
19614
19617
  clearTimeout(timer);
19615
19618
  setTimer(setTimeout(function () {
19616
19619
  return setInputValue("");
19617
- }, 2000));
19620
+ }, 3000));
19618
19621
  }
19619
19622
 
19620
19623
  setFilteredOptions(options.filter(function (option) {
@@ -19637,28 +19640,22 @@ var Dropdown = function Dropdown(_ref8) {
19637
19640
  return /*#__PURE__*/React.createElement(Box, {
19638
19641
  onKeyDown: onKeyDown,
19639
19642
  onClick: onClick,
19640
- padding: "0",
19643
+ padding: "12px",
19641
19644
  width: "100%",
19642
19645
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
19646
+ background: isOpen ? themeValues.hoverColor : WHITE,
19643
19647
  "aria-expanded": isOpen,
19644
19648
  role: "combobox",
19645
19649
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
19646
19650
  "aria-haspopup": "listbox",
19647
19651
  "aria-labelledby": ariaLabelledby,
19648
19652
  extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
19649
- title: hasTitles ? getSelection() : null
19650
- }, /*#__PURE__*/React.createElement(Box, {
19651
- as: "button",
19652
- background: isOpen ? themeValues.hoverColor : WHITE,
19653
- width: "100%",
19654
- padding: "12px",
19655
- hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
19656
- borderSize: "1px",
19657
- borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
19658
- borderRadius: "2px",
19659
- tabIndex: 0,
19653
+ title: hasTitles ? getSelection() : null,
19660
19654
  dataQa: placeholder,
19661
- extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
19655
+ tabIndex: 0,
19656
+ borderRadius: "2px",
19657
+ borderSize: "1px",
19658
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU
19662
19659
  }, /*#__PURE__*/React.createElement(Stack, {
19663
19660
  direction: "row",
19664
19661
  bottomItem: 2,
@@ -19667,7 +19664,10 @@ var Dropdown = function Dropdown(_ref8) {
19667
19664
  "aria-label": getSelection(),
19668
19665
  placeholder: getSelection(),
19669
19666
  value: inputValue,
19670
- onChange: noop,
19667
+ onChange: function onChange(e) {
19668
+ console.log("input change event", e.target);
19669
+ console.log("input change event value", e.target.value);
19670
+ },
19671
19671
  themeValues: themeValues,
19672
19672
  role: "searchbox",
19673
19673
  type: "text",
@@ -19681,7 +19681,7 @@ var Dropdown = function Dropdown(_ref8) {
19681
19681
  autocomplete: autocompleteValue
19682
19682
  }), /*#__PURE__*/React.createElement(IconWrapper, {
19683
19683
  open: isOpen
19684
- }, /*#__PURE__*/React.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
19684
+ }, /*#__PURE__*/React.createElement(DropdownIcon, null))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
19685
19685
  maxHeight: maxHeight,
19686
19686
  open: isOpen,
19687
19687
  ref: dropdownRef,
@@ -19821,7 +19821,8 @@ var FormSelect = function FormSelect(_ref) {
19821
19821
  disabled = _ref.disabled,
19822
19822
  themeValues = _ref.themeValues,
19823
19823
  _ref$hasTitles = _ref.hasTitles,
19824
- hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles;
19824
+ hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
19825
+ autocompleteValue = _ref.autocompleteValue;
19825
19826
 
19826
19827
  var _useState = useState(false),
19827
19828
  _useState2 = _slicedToArray(_useState, 2),
@@ -19876,7 +19877,8 @@ var FormSelect = function FormSelect(_ref) {
19876
19877
  onClick: function onClick() {
19877
19878
  return setOpen(!open);
19878
19879
  },
19879
- disabled: disabled
19880
+ disabled: disabled,
19881
+ autocompleteValue: autocompleteValue
19880
19882
  }), /*#__PURE__*/React.createElement(Stack, {
19881
19883
  direction: "row",
19882
19884
  justify: "space-between"
@@ -20649,7 +20651,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
20649
20651
  labelTextWhenNoError: labelTextWhenNoError,
20650
20652
  errorMessages: errorMessages,
20651
20653
  showErrors: showErrors,
20652
- onChange: onChange
20654
+ onChange: onChange,
20655
+ autocompleteValue: "country-name"
20653
20656
  });
20654
20657
  };
20655
20658
 
@@ -33065,7 +33068,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
33065
33068
  fieldActions: fieldActions,
33066
33069
  labelTextWhenNoError: labelTextWhenNoError,
33067
33070
  errorMessages: errorMessages,
33068
- showErrors: showErrors
33071
+ showErrors: showErrors,
33072
+ autocompleteValue: "address-level1"
33069
33073
  });
33070
33074
  };
33071
33075