@ballistix.digital/react-components 8.2.0 → 8.2.1-rc-86.0

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
@@ -1471,7 +1471,7 @@ var $dfbd7d015eae4218$var$InputFooter = function(props) {
1471
1471
  errorDataCy,
1472
1472
  isTouched
1473
1473
  ]);
1474
- if (isHidden && (0, $iA2ta$lodash.isNil)(errorElement) && (0, $iA2ta$lodash.isNil)(hintElement)) return null;
1474
+ if (isHidden || (0, $iA2ta$lodash.isNil)(errorElement) && (0, $iA2ta$lodash.isNil)(hintElement)) return null;
1475
1475
  return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
1476
1476
  className: styles.foot,
1477
1477
  children: [
@@ -2255,6 +2255,7 @@ https://www.npmjs.com/package/react-tailwindcss-select
2255
2255
 
2256
2256
 
2257
2257
 
2258
+
2258
2259
  var $f32ee84b87891376$var$base = {
2259
2260
  container: '',
2260
2261
  body: 'relative rounded-md',
@@ -2276,9 +2277,7 @@ var $f32ee84b87891376$var$base = {
2276
2277
  searchIcon: '',
2277
2278
  closeIcon: '',
2278
2279
  emptyState: 'w-full inline-flex items-start justify-start px-4',
2279
- trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
2280
- description: 'text-gray-400 text-xs mt-1',
2281
- error: 'text-red-500 text-xs ml-5 mt-1'
2280
+ trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center'
2282
2281
  };
2283
2282
  var $f32ee84b87891376$var$leading = {
2284
2283
  input: 'pl-10'
@@ -2287,35 +2286,29 @@ var $f32ee84b87891376$var$trailing = {};
2287
2286
  var $f32ee84b87891376$var$normal = {
2288
2287
  leading: 'pl-3',
2289
2288
  input: 'rounded-md border-gray-200 shadow-xs focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
2290
- trailing: '',
2291
- description: 'mt-2 text-sm'
2289
+ trailing: ''
2292
2290
  };
2293
2291
  var $f32ee84b87891376$var$inset = {
2294
2292
  container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-xs ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
2295
- input: 'border-0 ring-0! p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
2296
- description: 'hidden'
2293
+ input: 'border-0 ring-0! p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0'
2297
2294
  };
2298
2295
  var $f32ee84b87891376$var$overlapping = {
2299
2296
  container: 'relative',
2300
- input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
2301
- description: 'hidden'
2297
+ input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6'
2302
2298
  };
2303
2299
  var $f32ee84b87891376$var$pill = {
2304
2300
  foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
2305
2301
  input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
2306
- trailing: 'pr-2',
2307
- description: 'text-xs'
2302
+ trailing: 'pr-2'
2308
2303
  };
2309
2304
  var $f32ee84b87891376$var$floored = {
2310
2305
  body: 'relative mt-2',
2311
- input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
2312
- description: 'text-xs mt-2'
2306
+ input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0'
2313
2307
  };
2314
2308
  var $f32ee84b87891376$var$invalid = {
2315
2309
  container: 'ring-red-500',
2316
2310
  input: // 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
2317
- 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500',
2318
- description: 'text-sm text-red-600'
2311
+ 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500'
2319
2312
  };
2320
2313
  var $f32ee84b87891376$var$disabled = {
2321
2314
  input: 'block w-full rounded-md border-0 text-gray-900 shadow-xs ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200'
@@ -2337,12 +2330,11 @@ var $f32ee84b87891376$export$2e2bcd8739ae039 = $f32ee84b87891376$var$styles;
2337
2330
 
2338
2331
  var $f3fccf014e1f10d5$var$SelectMenuForm = function(props) {
2339
2332
  var _a;
2340
- 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.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, _j = props.isOptionalLabelHidden, isOptionalLabelHidden = _j === void 0 ? false : _j, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
2333
+ var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, hint = props.hint, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, _j = props.isOptionalLabelHidden, isOptionalLabelHidden = _j === void 0 ? false : _j, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
2341
2334
  var _k = (0, $iA2ta$react.useState)(true), isFocus = _k[0], setIsFocus = _k[1];
2342
2335
  var _l = (0, $iA2ta$react.useState)(value !== null && value !== void 0 ? value : null), state = _l[0], setState = _l[1];
2343
2336
  var isValid = error === undefined;
2344
2337
  var selectDataCy = "form-select-".concat(name);
2345
- var errorDataCy = "form-select-error-".concat(name);
2346
2338
  var handleGenerateStyle = function() {
2347
2339
  var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $f32ee84b87891376$export$2e2bcd8739ae039).base);
2348
2340
  var keys = (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $f32ee84b87891376$export$2e2bcd8739ae039).base);
@@ -2377,17 +2369,11 @@ var $f3fccf014e1f10d5$var$SelectMenuForm = function(props) {
2377
2369
  }, [
2378
2370
  value
2379
2371
  ]);
2380
- var descriptionElement = (0, $iA2ta$react.useMemo)(function() {
2381
- if (!description || error && isTouched) return null;
2382
- return (0, $iA2ta$reactjsxruntime.jsx)("p", {
2383
- className: styles.description,
2384
- children: description
2385
- });
2372
+ var formattedError = (0, $iA2ta$react.useMemo)(function() {
2373
+ if (error) return JSON.stringify(error).replaceAll('"', '');
2374
+ return null;
2386
2375
  }, [
2387
- description,
2388
- error,
2389
- isTouched,
2390
- styles.description
2376
+ error
2391
2377
  ]);
2392
2378
  return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
2393
2379
  className: styles.container,
@@ -2398,7 +2384,8 @@ var $f3fccf014e1f10d5$var$SelectMenuForm = function(props) {
2398
2384
  required: required,
2399
2385
  isRequired: isRequired,
2400
2386
  isOptionalLabelHidden: isOptionalLabelHidden,
2401
- styles: styles
2387
+ styles: styles,
2388
+ description: description
2402
2389
  }),
2403
2390
  (0, $iA2ta$reactjsxruntime.jsxs)("div", {
2404
2391
  className: styles.container,
@@ -2451,16 +2438,13 @@ var $f3fccf014e1f10d5$var$SelectMenuForm = function(props) {
2451
2438
  }
2452
2439
  })
2453
2440
  }),
2454
- !isSolo && (0, $iA2ta$reactjsxruntime.jsxs)("div", {
2455
- className: styles.foot,
2456
- children: [
2457
- descriptionElement,
2458
- error && isTouched && (0, $iA2ta$reactjsxruntime.jsx)("p", {
2459
- className: styles.error,
2460
- "data-cy": errorDataCy,
2461
- children: JSON.stringify(error).replaceAll('"', '')
2462
- })
2463
- ]
2441
+ (0, $iA2ta$reactjsxruntime.jsx)((0, $dfbd7d015eae4218$export$2e2bcd8739ae039), {
2442
+ isHidden: isSolo,
2443
+ name: name,
2444
+ error: formattedError,
2445
+ isTouched: isTouched,
2446
+ hint: hint,
2447
+ styles: styles
2464
2448
  })
2465
2449
  ]
2466
2450
  })