@ballistix.digital/react-components 0.4.78 → 0.4.80

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.js CHANGED
@@ -2628,7 +2628,7 @@ const Select = ({ options = [], value = null, onChange, onSearchInputChange, pla
2628
2628
 
2629
2629
  var SelectMenuForm = function (props) {
2630
2630
  var _a;
2631
- var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.type, type = _c === void 0 ? 'normal' : _c, _d = props.isRequired, isRequired = _d === void 0 ? false : _d, isLoading = props.isLoading, _e = props.isTouched, isTouched = _e === void 0 ? false : _e, isDisabled = props.isDisabled, _f = props.isClearable, isClearable = _f === void 0 ? true : _f, _g = props.isMulti, isMulti = _g === void 0 ? false : _g, _h = props.isSearchable, isSearchable = _h === void 0 ? true : _h, _j = props.isSolo, isSolo = _j === void 0 ? false : _j, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
2631
+ var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.type, type = _c === void 0 ? 'normal' : _c, _d = props.isRequired, isRequired = _d === void 0 ? false : _d, isLoading = props.isLoading, _e = props.isTouched, isTouched = _e === void 0 ? false : _e, isDisabled = props.isDisabled, _f = props.isClearable, isClearable = _f === void 0 ? true : _f, _g = props.isMultiple, isMultiple = _g === void 0 ? false : _g, _h = props.isSearchable, isSearchable = _h === void 0 ? true : _h, _j = props.isSolo, isSolo = _j === void 0 ? false : _j, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
2632
2632
  var _k = React.useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
2633
2633
  var _l = React.useState(true), isFocus = _l[0], setIsFocus = _l[1];
2634
2634
  var isValid = error === undefined;
@@ -2640,9 +2640,9 @@ var SelectMenuForm = function (props) {
2640
2640
  });
2641
2641
  return result;
2642
2642
  };
2643
- var handleChange = function (value) {
2644
- setState(value);
2645
- onChange && onChange(value === null || value === void 0 ? void 0 : value.value);
2643
+ var handleChange = function (selectValue) {
2644
+ setState(selectValue);
2645
+ onChange && onChange(selectValue);
2646
2646
  setIsFocus(false);
2647
2647
  };
2648
2648
  var styles$1 = handleGenerateStyle();
@@ -2664,7 +2664,7 @@ var SelectMenuForm = function (props) {
2664
2664
  //
2665
2665
  placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsxRuntime.jsx("p", __assign({ className: styles$1.emptyState }, { children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' }))), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
2666
2666
  //
2667
- loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMulti, isSearchable: isSearchable,
2667
+ loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
2668
2668
  //
2669
2669
  options: options,
2670
2670
  //
@@ -2672,13 +2672,22 @@ var SelectMenuForm = function (props) {
2672
2672
  //
2673
2673
  classNames: {
2674
2674
  menuButton: function () {
2675
- return toClassName(styles$1.input, state === null && '[&>*]:!text-gray-300 ');
2675
+ return toClassName(styles$1.input, state === null && isValid && '[&>*]:!text-gray-300 ', state === null && !isValid && '[&>*]:!text-red-300');
2676
2676
  },
2677
2677
  menu: styles$1.menu,
2678
+ tagItem: function () { return styles$1.tagItem; },
2679
+ tagItemText: styles$1.tagItemText,
2680
+ tagItemIconContainer: styles$1.tagItemIconContainer,
2681
+ tagItemIcon: styles$1.tagItemIcon,
2678
2682
  list: styles$1.list,
2679
2683
  listItem: function () { return styles$1.listItem; },
2684
+ listDisabledItem: styles$1.listDisabledItem,
2685
+ listGroupLabel: styles$1.listGroupLabel,
2680
2686
  searchContainer: styles$1.searchContainer,
2681
- } }), !isSolo && (jsxRuntime.jsxs("div", __assign({ className: styles$1.foot }, { children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", __assign({ className: styles$1.description }, { children: description }))), error && isTouched && jsxRuntime.jsx("p", __assign({ className: styles$1.error }, { children: error }))] })))] }))] })));
2687
+ searchBox: styles$1.searchBox,
2688
+ searchIcon: styles$1.searchIcon,
2689
+ closeIcon: styles$1.closeIcon,
2690
+ } }), !isSolo && (jsxRuntime.jsxs("div", __assign({ className: styles$1.foot }, { children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", __assign({ className: styles$1.description }, { children: description }))), error && isTouched && (jsxRuntime.jsx("p", __assign({ className: styles$1.error }, { children: JSON.stringify(error) })))] })))] }))] })));
2682
2691
  };
2683
2692
 
2684
2693
  var base = {
@@ -2692,9 +2701,18 @@ var base = {
2692
2701
  input: 'block w-full flex border',
2693
2702
  menuButton: '',
2694
2703
  menu: '!px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
2704
+ tagItem: '',
2705
+ tagItemText: '',
2706
+ tagItemIconContainer: '',
2707
+ tagItemIcon: '',
2695
2708
  list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
2709
+ listGroupLabel: '',
2696
2710
  listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
2711
+ listDisabledItem: '',
2697
2712
  searchContainer: '!w-full !px-2 !py-2 border-b',
2713
+ searchBox: '',
2714
+ searchIcon: '',
2715
+ closeIcon: '',
2698
2716
  emptyState: 'w-full inline-flex items-start justify-start px-4',
2699
2717
  trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
2700
2718
  description: 'text-gray-400 text-xs mt-1',