@thecb/components 6.0.0-beta.11 → 6.0.0-beta.14

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
@@ -6372,7 +6372,7 @@ var Box = function Box(_ref) {
6372
6372
  onFocus: onFocus,
6373
6373
  onBlur: onBlur,
6374
6374
  onTouchEnd: onTouchEnd
6375
- }, rest), safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
6375
+ }, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
6376
6376
  };
6377
6377
 
6378
6378
  var CenterWrapper = styled.div.withConfig({
@@ -19407,7 +19407,7 @@ var IconWrapper = styled.div.withConfig({
19407
19407
  var DropdownContentWrapper = styled.div.withConfig({
19408
19408
  displayName: "Dropdown__DropdownContentWrapper",
19409
19409
  componentId: "sc-pn6m0h-1"
19410
- })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}"], GREY_CHATEAU, WHITE, function (_ref2) {
19410
+ })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
19411
19411
  var widthFitOptions = _ref2.widthFitOptions;
19412
19412
  return widthFitOptions ? "fit-content" : "100%";
19413
19413
  }, function (_ref3) {
@@ -19417,7 +19417,7 @@ var DropdownContentWrapper = styled.div.withConfig({
19417
19417
  var DropdownItemWrapper = styled.li.withConfig({
19418
19418
  displayName: "Dropdown__DropdownItemWrapper",
19419
19419
  componentId: "sc-pn6m0h-2"
19420
- })(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
19420
+ })(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
19421
19421
  var selected = _ref4.selected,
19422
19422
  themeValues = _ref4.themeValues;
19423
19423
  return selected ? themeValues.selectedColor : WHITE;
@@ -19446,7 +19446,7 @@ var Dropdown = function Dropdown(_ref8) {
19446
19446
  _ref8$disabledValues = _ref8.disabledValues,
19447
19447
  disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
19448
19448
  _ref8$onClick = _ref8.onClick,
19449
- onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
19449
+ _onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
19450
19450
  themeValues = _ref8.themeValues,
19451
19451
  maxHeight = _ref8.maxHeight,
19452
19452
  _ref8$widthFitOptions = _ref8.widthFitOptions,
@@ -19546,7 +19546,7 @@ var Dropdown = function Dropdown(_ref8) {
19546
19546
  break;
19547
19547
  }
19548
19548
  } else {
19549
- onClick();
19549
+ _onClick();
19550
19550
  }
19551
19551
 
19552
19552
  break;
@@ -19562,7 +19562,7 @@ var Dropdown = function Dropdown(_ref8) {
19562
19562
  break;
19563
19563
  }
19564
19564
  } else {
19565
- onClick();
19565
+ _onClick();
19566
19566
  }
19567
19567
 
19568
19568
  break;
@@ -19591,7 +19591,7 @@ var Dropdown = function Dropdown(_ref8) {
19591
19591
 
19592
19592
  case "Escape":
19593
19593
  if (isOpen) {
19594
- onClick();
19594
+ _onClick();
19595
19595
  }
19596
19596
 
19597
19597
  break;
@@ -19640,10 +19640,24 @@ var Dropdown = function Dropdown(_ref8) {
19640
19640
  dropdownRef.current.focus();
19641
19641
  }
19642
19642
  }, [filteredOptions]);
19643
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Stack, {
19643
+ return /*#__PURE__*/React.createElement(Box, {
19644
+ padding: "0",
19645
+ background: isOpen ? themeValues.hoverColor : WHITE,
19646
+ borderSize: "1px",
19647
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
19648
+ borderRadius: "2px",
19649
+ borderWidthOverride: "0px 1px 0px 0px",
19650
+ extraStyles: "position: relative;",
19651
+ minWidth: "100%",
19652
+ onClick: function onClick() {
19653
+ if (!isOpen) {
19654
+ _onClick();
19655
+ }
19656
+ },
19657
+ width: "100%"
19658
+ }, /*#__PURE__*/React.createElement(Stack, {
19644
19659
  direction: "row",
19645
- bottomItem: 2,
19646
- extraStyles: "position: relative;"
19660
+ bottomItem: 2
19647
19661
  }, /*#__PURE__*/React.createElement(Box, {
19648
19662
  as: "input",
19649
19663
  "aria-multiline": "false",
@@ -19659,13 +19673,19 @@ var Dropdown = function Dropdown(_ref8) {
19659
19673
  borderRadius: "2px",
19660
19674
  borderSize: "1px",
19661
19675
  borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
19676
+ borderWidthOverride: "1px 0px 1px 1px",
19662
19677
  extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
19663
19678
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
19664
19679
  isOpen: isOpen,
19680
+ minHeight: "48px",
19681
+ minWidth: "85%",
19665
19682
  name: autocompleteValue,
19666
19683
  onKeyDown: onKeyDown,
19667
- onClick: onClick,
19668
- onFocus: onClick,
19684
+ onFocus: function onFocus() {
19685
+ if (!isOpen) {
19686
+ _onClick();
19687
+ }
19688
+ },
19669
19689
  onChange: function onChange(e) {
19670
19690
  console.log("input change event", e.target);
19671
19691
  console.log("input change event value", e.target.value);
@@ -19677,9 +19697,9 @@ var Dropdown = function Dropdown(_ref8) {
19677
19697
  themeValues: themeValues,
19678
19698
  title: hasTitles ? getSelection() : null,
19679
19699
  type: "text",
19680
- tabIndex: -1,
19700
+ tabIndex: 0,
19681
19701
  value: inputValue,
19682
- width: "100%",
19702
+ width: "85%",
19683
19703
  dataQa: placeholder
19684
19704
  }), /*#__PURE__*/React.createElement(IconWrapper, {
19685
19705
  open: isOpen