infinity-ui-elements 1.8.6 → 1.8.8

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
@@ -1410,12 +1410,12 @@ const FormFooter = React.forwardRef(({ helperText, trailingText, validationState
1410
1410
  });
1411
1411
  FormFooter.displayName = "FormFooter";
1412
1412
 
1413
- const checkboxVariants = cva("relative inline-flex items-center justify-center shrink-0 transition-all cursor-pointer", {
1413
+ const checkboxVariants = cva("relative inline-flex items-center justify-center shrink-0 transition-all cursor-pointer box-border", {
1414
1414
  variants: {
1415
1415
  size: {
1416
- small: "w-[14px] h-[14px] rounded-small border-[1.5px]",
1417
- medium: "w-[16px] h-[16px] rounded-small border-[1.5px]",
1418
- large: "w-[20px] h-[20px] rounded-medium border-[2px]",
1416
+ small: "w-[10px] h-[10px] rounded-small border-[1.5px]",
1417
+ medium: "w-[12px] h-[12px] rounded-small border-[1.5px]",
1418
+ large: "w-[16px] h-[16px] rounded-medium border-[2px]",
1419
1419
  },
1420
1420
  validationState: {
1421
1421
  none: "",
@@ -1543,7 +1543,7 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1543
1543
  iconSize: 10,
1544
1544
  },
1545
1545
  medium: {
1546
- gap: "gap-2.5",
1546
+ gap: "gap-2",
1547
1547
  labelSize: "text-body-small-regular",
1548
1548
  iconSize: 12,
1549
1549
  },
@@ -1556,7 +1556,7 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1556
1556
  const config = sizeConfig[size];
1557
1557
  // Determine if we should show the error text
1558
1558
  const shouldShowError = errorText && showErrorText;
1559
- return (jsxs("div", { className: cn("inline-flex flex-col", containerClassName), children: [jsxs("div", { className: cn("inline-flex items-center", config.gap, isDisabled ? "cursor-not-allowed" : "cursor-pointer"), onClick: handleContainerClick, onKeyDown: handleKeyDown, role: "checkbox", "aria-checked": isIndeterminate ? "mixed" : isChecked, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : 0, children: [jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsx("div", { className: cn("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full pointer-events-none w-full h-full", validationState === "error"
1559
+ return (jsxs("div", { className: cn("inline-flex flex-col px-2", containerClassName), children: [jsxs("div", { className: cn("inline-flex items-center", config.gap, isDisabled ? "cursor-not-allowed" : "cursor-pointer"), onClick: handleContainerClick, onKeyDown: handleKeyDown, role: "checkbox", "aria-checked": isIndeterminate ? "mixed" : isChecked, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : 0, children: [jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsx("div", { className: cn("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full pointer-events-none w-full h-full", validationState === "error"
1560
1560
  ? "bg-action-outline-negative-faded"
1561
1561
  : "bg-action-outline-primary-faded"), style: {
1562
1562
  animation: "var(--animate-checkbox-ripple)",
@@ -2179,7 +2179,7 @@ const Tooltip = React.forwardRef(({ children, heading, description, placement =
2179
2179
  });
2180
2180
  Tooltip.displayName = "Tooltip";
2181
2181
 
2182
- const FormHeader = React.forwardRef(({ label, size = "medium", isOptional = false, isRequired = false, infoHeading, infoDescription, linkText, linkHref, onLinkClick, htmlFor, className, labelClassName, linkClassName, }, ref) => {
2182
+ const FormHeader = React.forwardRef(({ label, size = "medium", isOptional = false, isRequired = false, infoHeading, infoDescription, LinkComponent, linkText, linkHref, onLinkClick, linkLeadingIcon, linkTrailingIcon, htmlFor, className, labelClassName, linkClassName, }, ref) => {
2183
2183
  // Size-based configurations
2184
2184
  const sizeConfig = {
2185
2185
  small: {
@@ -2202,7 +2202,9 @@ const FormHeader = React.forwardRef(({ label, size = "medium", isOptional = fals
2202
2202
  },
2203
2203
  };
2204
2204
  const config = sizeConfig[size];
2205
- return (jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [jsxs("div", { className: cn("flex items-center", config.gap), children: [jsxs("label", { htmlFor: htmlFor, className: cn("flex items-center", labelClassName), children: [jsx("span", { className: cn(config.textClassName, "text-surface-neutral-subtle"), children: label }), isRequired && (jsx("span", { className: cn(config.textClassName, "text-color-negative ml-0.5"), children: "*" })), isOptional && (jsx("span", { className: cn(config.textClassNameRegular, "text-surface-neutral-muted italic ml-1"), children: "(optional)" }))] }), infoDescription && (jsx(Tooltip, { description: infoDescription, heading: infoHeading, children: jsx(Icon, { name: "info", size: config.iconSize }) }))] }), linkText && (jsx(Link, { href: linkHref, onClick: onLinkClick, type: "action", color: "primary", size: size === "large" ? "small" : "xsmall", children: linkText }))] }));
2205
+ return (jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [jsxs("div", { className: cn("flex items-center", config.gap), children: [jsxs("label", { htmlFor: htmlFor, className: cn("flex items-center", labelClassName), children: [jsx("span", { className: cn(config.textClassName, "text-surface-neutral-subtle"), children: label }), isRequired && (jsx("span", { className: cn(config.textClassName, "text-color-negative ml-0.5"), children: "*" })), isOptional && (jsx("span", { className: cn(config.textClassNameRegular, "text-surface-neutral-muted italic ml-1"), children: "(optional)" }))] }), infoDescription && (jsx(Tooltip, { description: infoDescription, heading: infoHeading, children: jsx(Icon, { name: "info", size: config.iconSize }) }))] }), LinkComponent
2206
+ ? LinkComponent
2207
+ : linkText && (jsx(Link, { href: linkHref, onClick: onLinkClick, type: "action", color: "primary", size: size === "large" ? "small" : "xsmall", leadingIcon: linkLeadingIcon, trailingIcon: linkTrailingIcon, children: linkText }))] }));
2206
2208
  });
2207
2209
  FormHeader.displayName = "FormHeader";
2208
2210
 
@@ -2293,7 +2295,7 @@ const selectVariants = cva("relative flex items-center gap-2 border rounded-larg
2293
2295
  isDisabled: false,
2294
2296
  },
2295
2297
  });
2296
- const Select = React.forwardRef(({ className, options = [], value: controlledValue, defaultValue, onChange, placeholder = "Select an option", label, helperText, errorText, successText, validationState = "none", isDisabled = false, isRequired = false, isOptional = false, isLoading = false, size = "medium", prefix, suffix, showClearButton = false, onClear, containerClassName, labelClassName, triggerClassName, menuClassName, menuWidth = "full", sectionHeading, emptyTitle = "No options available", emptyDescription = "There are no options to select from.", emptyIcon, infoHeading, infoDescription, linkText, linkHref, onLinkClick, ...props }, ref) => {
2298
+ const Select = React.forwardRef(({ className, options = [], value: controlledValue, defaultValue, onChange, placeholder = "Select an option", label, helperText, errorText, successText, validationState = "none", isDisabled = false, isRequired = false, isOptional = false, isLoading = false, size = "medium", prefix, suffix, showClearButton = false, onClear, containerClassName, labelClassName, triggerClassName, menuClassName, menuWidth = "full", sectionHeading, emptyTitle = "No options available", emptyDescription = "There are no options to select from.", emptyIcon, infoHeading, infoDescription, LinkComponent, linkText, linkHref, onLinkClick, ...props }, ref) => {
2297
2299
  const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);
2298
2300
  const [isOpen, setIsOpen] = React.useState(false);
2299
2301
  const [dropdownPlacement, setDropdownPlacement] = React.useState("bottom");
@@ -2468,7 +2470,7 @@ const Select = React.forwardRef(({ className, options = [], value: controlledVal
2468
2470
  gap: "gap-3",
2469
2471
  },
2470
2472
  };
2471
- return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsxs("div", { ref: selectRef, className: cn(selectVariants({
2473
+ return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, LinkComponent: LinkComponent, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsxs("div", { ref: selectRef, className: cn(selectVariants({
2472
2474
  size,
2473
2475
  validationState: currentValidationState,
2474
2476
  isDisabled,
@@ -2827,7 +2829,7 @@ const textFieldVariants = cva("relative flex items-center gap-2 border rounded-l
2827
2829
  isDisabled: false,
2828
2830
  },
2829
2831
  });
2830
- const TextField = React.forwardRef(({ label, helperText, errorText, successText, size = "medium", validationState = "none", isDisabled = false, isRequired = false, isOptional = false, prefix, suffix, showClearButton = false, infoDescription, infoHeading, linkText, linkHref, onLinkClick, onClear, containerClassName, labelClassName, inputClassName, className, value, onChange, ...props }, ref) => {
2832
+ const TextField = React.forwardRef(({ label, helperText, errorText, successText, size = "medium", validationState = "none", isDisabled = false, isRequired = false, isOptional = false, prefix, suffix, showClearButton = false, infoDescription, infoHeading, LinkComponent, linkText, linkHref, onLinkClick, onClear, containerClassName, labelClassName, inputClassName, className, value, onChange, ...props }, ref) => {
2831
2833
  const [internalValue, setInternalValue] = React.useState("");
2832
2834
  const inputValue = value !== undefined ? value : internalValue;
2833
2835
  const hasValue = inputValue && String(inputValue).length > 0;
@@ -2870,7 +2872,7 @@ const TextField = React.forwardRef(({ label, helperText, errorText, successText,
2870
2872
  gap: "gap-3",
2871
2873
  },
2872
2874
  };
2873
- return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsxs("div", { className: cn(textFieldVariants({
2875
+ return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, LinkComponent: LinkComponent, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsxs("div", { className: cn(textFieldVariants({
2874
2876
  size,
2875
2877
  validationState: currentValidationState,
2876
2878
  isDisabled,
@@ -3659,7 +3661,7 @@ const textAreaVariants = cva("relative flex flex-col border rounded-large transi
3659
3661
  isDisabled: false,
3660
3662
  },
3661
3663
  });
3662
- const TextArea = React.forwardRef(({ label, helperText, errorText, successText, size = "medium", validationState = "none", isDisabled = false, isRequired = false, isOptional = false, maxChar, showCharCount = true, infoDescription, infoHeading, linkText, linkHref, onLinkClick, containerClassName, labelClassName, textAreaClassName, className, value, onChange, rows = 4, ...props }, ref) => {
3664
+ const TextArea = React.forwardRef(({ label, helperText, errorText, successText, size = "medium", validationState = "none", isDisabled = false, isRequired = false, isOptional = false, maxChar, showCharCount = true, infoDescription, infoHeading, LinkComponent, linkText, linkHref, onLinkClick, containerClassName, labelClassName, textAreaClassName, className, value, onChange, rows = 4, ...props }, ref) => {
3663
3665
  const [internalValue, setInternalValue] = React.useState("");
3664
3666
  const textAreaValue = value !== undefined ? value : internalValue;
3665
3667
  const currentLength = String(textAreaValue).length;
@@ -3697,7 +3699,7 @@ const TextArea = React.forwardRef(({ label, helperText, errorText, successText,
3697
3699
  gap: "gap-3",
3698
3700
  },
3699
3701
  };
3700
- return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsx("div", { className: cn(textAreaVariants({
3702
+ return (jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsx(FormHeader, { label: label, size: size, isRequired: isRequired, isOptional: isOptional, infoHeading: infoHeading, infoDescription: infoDescription, LinkComponent: LinkComponent, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, htmlFor: props.id, className: "mb-2", labelClassName: labelClassName })), jsx("div", { className: cn(textAreaVariants({
3701
3703
  size,
3702
3704
  validationState: currentValidationState,
3703
3705
  isDisabled,