@l3mpire/ui 2.26.0 → 2.26.1

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.d.mts CHANGED
@@ -384,6 +384,7 @@ interface ChipInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onC
384
384
  labelType?: InputLabelProps["type"];
385
385
  error?: boolean;
386
386
  errorMessage?: string;
387
+ success?: boolean;
387
388
  disabled?: boolean;
388
389
  iconLeft?: IconDefinition;
389
390
  /** Max number of chips (0 = unlimited) */
package/dist/index.d.ts CHANGED
@@ -384,6 +384,7 @@ interface ChipInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onC
384
384
  labelType?: InputLabelProps["type"];
385
385
  error?: boolean;
386
386
  errorMessage?: string;
387
+ success?: boolean;
387
388
  disabled?: boolean;
388
389
  iconLeft?: IconDefinition;
389
390
  /** Max number of chips (0 = unlimited) */
package/dist/index.js CHANGED
@@ -3465,6 +3465,11 @@ var wrapperStates2 = {
3465
3465
  "focus-within:border-text-input-border-hover",
3466
3466
  "focus-within:shadow-focus-ring"
3467
3467
  ],
3468
+ success: [
3469
+ "bg-text-input-bg-default",
3470
+ "border-text-input-border-success",
3471
+ "text-text-input-text-default"
3472
+ ],
3468
3473
  error: [
3469
3474
  "bg-text-input-bg-default",
3470
3475
  "border-text-input-border-error",
@@ -3477,6 +3482,12 @@ var wrapperStates2 = {
3477
3482
  "cursor-not-allowed"
3478
3483
  ]
3479
3484
  };
3485
+ function resolveState3(error, success, disabled) {
3486
+ if (disabled) return "disabled";
3487
+ if (error) return "error";
3488
+ if (success) return "success";
3489
+ return "default";
3490
+ }
3480
3491
  var chipStyle = [
3481
3492
  "inline-flex items-center gap-xs shrink-0",
3482
3493
  "h-6 px-sm rounded-base",
@@ -3499,6 +3510,7 @@ var ChipInput = React27.forwardRef(
3499
3510
  labelType,
3500
3511
  error,
3501
3512
  errorMessage,
3513
+ success,
3502
3514
  disabled,
3503
3515
  iconLeft,
3504
3516
  max = 0,
@@ -3509,7 +3521,7 @@ var ChipInput = React27.forwardRef(
3509
3521
  const errorId = error && errorMessage ? `${inputId}-error` : void 0;
3510
3522
  const inputRef = React27.useRef(null);
3511
3523
  const [inputValue, setInputValue] = React27.useState("");
3512
- const state = disabled ? "disabled" : error ? "error" : "default";
3524
+ const state = resolveState3(error, success, disabled);
3513
3525
  const addChip = (val) => {
3514
3526
  const trimmed = val.trim();
3515
3527
  if (!trimmed) return;