@thecb/components 6.0.0-beta.15 → 6.0.0-beta.16

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
@@ -19400,7 +19400,7 @@ var fallbackValues$e = {
19400
19400
  var IconWrapper = styled.div.withConfig({
19401
19401
  displayName: "Dropdown__IconWrapper",
19402
19402
  componentId: "sc-pn6m0h-0"
19403
- })(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", " position:absolute;top:20px;right:12px;"], function (_ref) {
19403
+ })(["position:absolute;display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", " top:20px;right:12px;"], function (_ref) {
19404
19404
  var open = _ref.open;
19405
19405
  return open ? "transform: rotate(-180deg)" : "";
19406
19406
  });
@@ -19534,6 +19534,10 @@ var Dropdown = function Dropdown(_ref8) {
19534
19534
  case "ArrowDown":
19535
19535
  e.preventDefault();
19536
19536
 
19537
+ if (!isOpen) {
19538
+ _onClick();
19539
+ }
19540
+
19537
19541
  if (optionEl) {
19538
19542
  if (optionEl.current.nextElementSibling) {
19539
19543
  optionEl.current.nextElementSibling.focus();
@@ -19592,6 +19596,11 @@ var Dropdown = function Dropdown(_ref8) {
19592
19596
 
19593
19597
  break;
19594
19598
  }
19599
+
19600
+ if (keyCode > 64 && keyCode < 91 || keyCode == 32 || keyCode == 189) {
19601
+ e.preventDefault();
19602
+ setInputValue(inputValue + key);
19603
+ }
19595
19604
  };
19596
19605
 
19597
19606
  useEffect$1(function () {
@@ -19635,13 +19644,12 @@ var Dropdown = function Dropdown(_ref8) {
19635
19644
  extraStyles: "position: relative;",
19636
19645
  minWidth: "100%",
19637
19646
  onClick: function onClick() {
19638
- _onClick();
19647
+ if (!isOpen) {
19648
+ _onClick();
19649
+ }
19639
19650
  },
19640
19651
  onKeyDown: onKeyDown,
19641
19652
  width: "100%"
19642
- }, /*#__PURE__*/React.createElement(Stack, {
19643
- direction: "row",
19644
- bottomItem: 2
19645
19653
  }, /*#__PURE__*/React.createElement(Box, {
19646
19654
  as: "input",
19647
19655
  "aria-multiline": "false",
@@ -19657,7 +19665,6 @@ var Dropdown = function Dropdown(_ref8) {
19657
19665
  borderRadius: "2px",
19658
19666
  borderSize: "1px",
19659
19667
  borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
19660
- borderWidthOverride: "1px 0px 1px 1px",
19661
19668
  extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
19662
19669
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
19663
19670
  isOpen: isOpen,
@@ -19686,8 +19693,9 @@ var Dropdown = function Dropdown(_ref8) {
19686
19693
  width: "100%",
19687
19694
  dataQa: placeholder
19688
19695
  }), /*#__PURE__*/React.createElement(IconWrapper, {
19689
- open: isOpen
19690
- }, /*#__PURE__*/React.createElement(DropdownIcon, null))), /*#__PURE__*/React.createElement(Fragment, null, isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
19696
+ open: isOpen,
19697
+ onClick: _onClick
19698
+ }, /*#__PURE__*/React.createElement(DropdownIcon, null)), /*#__PURE__*/React.createElement(Fragment, null, isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
19691
19699
  maxHeight: maxHeight,
19692
19700
  open: isOpen,
19693
19701
  ref: dropdownRef,