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/components/FormHeader/FormHeader.d.ts +13 -0
- package/dist/components/FormHeader/FormHeader.d.ts.map +1 -1
- package/dist/components/SearchableDropdown/SearchableDropdown.stories.d.ts +1 -0
- package/dist/components/SearchableDropdown/SearchableDropdown.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +5 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -0
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextField/TextField.d.ts +1 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +16 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1431,12 +1431,12 @@ const FormFooter = React__namespace.forwardRef(({ helperText, trailingText, vali
|
|
|
1431
1431
|
});
|
|
1432
1432
|
FormFooter.displayName = "FormFooter";
|
|
1433
1433
|
|
|
1434
|
-
const checkboxVariants = classVarianceAuthority.cva("relative inline-flex items-center justify-center shrink-0 transition-all cursor-pointer", {
|
|
1434
|
+
const checkboxVariants = classVarianceAuthority.cva("relative inline-flex items-center justify-center shrink-0 transition-all cursor-pointer box-border", {
|
|
1435
1435
|
variants: {
|
|
1436
1436
|
size: {
|
|
1437
|
-
small: "w-[
|
|
1438
|
-
medium: "w-[
|
|
1439
|
-
large: "w-[
|
|
1437
|
+
small: "w-[10px] h-[10px] rounded-small border-[1.5px]",
|
|
1438
|
+
medium: "w-[12px] h-[12px] rounded-small border-[1.5px]",
|
|
1439
|
+
large: "w-[16px] h-[16px] rounded-medium border-[2px]",
|
|
1440
1440
|
},
|
|
1441
1441
|
validationState: {
|
|
1442
1442
|
none: "",
|
|
@@ -1564,7 +1564,7 @@ const Checkbox = React__namespace.forwardRef(({ label, errorText, size = "medium
|
|
|
1564
1564
|
iconSize: 10,
|
|
1565
1565
|
},
|
|
1566
1566
|
medium: {
|
|
1567
|
-
gap: "gap-2
|
|
1567
|
+
gap: "gap-2",
|
|
1568
1568
|
labelSize: "text-body-small-regular",
|
|
1569
1569
|
iconSize: 12,
|
|
1570
1570
|
},
|
|
@@ -1577,7 +1577,7 @@ const Checkbox = React__namespace.forwardRef(({ label, errorText, size = "medium
|
|
|
1577
1577
|
const config = sizeConfig[size];
|
|
1578
1578
|
// Determine if we should show the error text
|
|
1579
1579
|
const shouldShowError = errorText && showErrorText;
|
|
1580
|
-
return (jsxRuntime.jsxs("div", { className: cn("inline-flex flex-col", containerClassName), children: [jsxRuntime.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: [jsxRuntime.jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxRuntime.jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsxRuntime.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"
|
|
1580
|
+
return (jsxRuntime.jsxs("div", { className: cn("inline-flex flex-col px-2", containerClassName), children: [jsxRuntime.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: [jsxRuntime.jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxRuntime.jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsxRuntime.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"
|
|
1581
1581
|
? "bg-action-outline-negative-faded"
|
|
1582
1582
|
: "bg-action-outline-primary-faded"), style: {
|
|
1583
1583
|
animation: "var(--animate-checkbox-ripple)",
|
|
@@ -2200,7 +2200,7 @@ const Tooltip = React__namespace.forwardRef(({ children, heading, description, p
|
|
|
2200
2200
|
});
|
|
2201
2201
|
Tooltip.displayName = "Tooltip";
|
|
2202
2202
|
|
|
2203
|
-
const FormHeader = React__namespace.forwardRef(({ label, size = "medium", isOptional = false, isRequired = false, infoHeading, infoDescription, linkText, linkHref, onLinkClick, htmlFor, className, labelClassName, linkClassName, }, ref) => {
|
|
2203
|
+
const FormHeader = React__namespace.forwardRef(({ label, size = "medium", isOptional = false, isRequired = false, infoHeading, infoDescription, LinkComponent, linkText, linkHref, onLinkClick, linkLeadingIcon, linkTrailingIcon, htmlFor, className, labelClassName, linkClassName, }, ref) => {
|
|
2204
2204
|
// Size-based configurations
|
|
2205
2205
|
const sizeConfig = {
|
|
2206
2206
|
small: {
|
|
@@ -2223,7 +2223,9 @@ const FormHeader = React__namespace.forwardRef(({ label, size = "medium", isOpti
|
|
|
2223
2223
|
},
|
|
2224
2224
|
};
|
|
2225
2225
|
const config = sizeConfig[size];
|
|
2226
|
-
return (jsxRuntime.jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [jsxRuntime.jsxs("div", { className: cn("flex items-center", config.gap), children: [jsxRuntime.jsxs("label", { htmlFor: htmlFor, className: cn("flex items-center", labelClassName), children: [jsxRuntime.jsx("span", { className: cn(config.textClassName, "text-surface-neutral-subtle"), children: label }), isRequired && (jsxRuntime.jsx("span", { className: cn(config.textClassName, "text-color-negative ml-0.5"), children: "*" })), isOptional && (jsxRuntime.jsx("span", { className: cn(config.textClassNameRegular, "text-surface-neutral-muted italic ml-1"), children: "(optional)" }))] }), infoDescription && (jsxRuntime.jsx(Tooltip, { description: infoDescription, heading: infoHeading, children: jsxRuntime.jsx(Icon, { name: "info", size: config.iconSize }) }))] }),
|
|
2226
|
+
return (jsxRuntime.jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [jsxRuntime.jsxs("div", { className: cn("flex items-center", config.gap), children: [jsxRuntime.jsxs("label", { htmlFor: htmlFor, className: cn("flex items-center", labelClassName), children: [jsxRuntime.jsx("span", { className: cn(config.textClassName, "text-surface-neutral-subtle"), children: label }), isRequired && (jsxRuntime.jsx("span", { className: cn(config.textClassName, "text-color-negative ml-0.5"), children: "*" })), isOptional && (jsxRuntime.jsx("span", { className: cn(config.textClassNameRegular, "text-surface-neutral-muted italic ml-1"), children: "(optional)" }))] }), infoDescription && (jsxRuntime.jsx(Tooltip, { description: infoDescription, heading: infoHeading, children: jsxRuntime.jsx(Icon, { name: "info", size: config.iconSize }) }))] }), LinkComponent
|
|
2227
|
+
? LinkComponent
|
|
2228
|
+
: linkText && (jsxRuntime.jsx(Link, { href: linkHref, onClick: onLinkClick, type: "action", color: "primary", size: size === "large" ? "small" : "xsmall", leadingIcon: linkLeadingIcon, trailingIcon: linkTrailingIcon, children: linkText }))] }));
|
|
2227
2229
|
});
|
|
2228
2230
|
FormHeader.displayName = "FormHeader";
|
|
2229
2231
|
|
|
@@ -2314,7 +2316,7 @@ const selectVariants = classVarianceAuthority.cva("relative flex items-center ga
|
|
|
2314
2316
|
isDisabled: false,
|
|
2315
2317
|
},
|
|
2316
2318
|
});
|
|
2317
|
-
const Select = React__namespace.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) => {
|
|
2319
|
+
const Select = React__namespace.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) => {
|
|
2318
2320
|
const [uncontrolledValue, setUncontrolledValue] = React__namespace.useState(defaultValue);
|
|
2319
2321
|
const [isOpen, setIsOpen] = React__namespace.useState(false);
|
|
2320
2322
|
const [dropdownPlacement, setDropdownPlacement] = React__namespace.useState("bottom");
|
|
@@ -2489,7 +2491,7 @@ const Select = React__namespace.forwardRef(({ className, options = [], value: co
|
|
|
2489
2491
|
gap: "gap-3",
|
|
2490
2492
|
},
|
|
2491
2493
|
};
|
|
2492
|
-
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsxs("div", { ref: selectRef, className: cn(selectVariants({
|
|
2494
|
+
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsxs("div", { ref: selectRef, className: cn(selectVariants({
|
|
2493
2495
|
size,
|
|
2494
2496
|
validationState: currentValidationState,
|
|
2495
2497
|
isDisabled,
|
|
@@ -2848,7 +2850,7 @@ const textFieldVariants = classVarianceAuthority.cva("relative flex items-center
|
|
|
2848
2850
|
isDisabled: false,
|
|
2849
2851
|
},
|
|
2850
2852
|
});
|
|
2851
|
-
const TextField = React__namespace.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) => {
|
|
2853
|
+
const TextField = React__namespace.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) => {
|
|
2852
2854
|
const [internalValue, setInternalValue] = React__namespace.useState("");
|
|
2853
2855
|
const inputValue = value !== undefined ? value : internalValue;
|
|
2854
2856
|
const hasValue = inputValue && String(inputValue).length > 0;
|
|
@@ -2891,7 +2893,7 @@ const TextField = React__namespace.forwardRef(({ label, helperText, errorText, s
|
|
|
2891
2893
|
gap: "gap-3",
|
|
2892
2894
|
},
|
|
2893
2895
|
};
|
|
2894
|
-
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsxs("div", { className: cn(textFieldVariants({
|
|
2896
|
+
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsxs("div", { className: cn(textFieldVariants({
|
|
2895
2897
|
size,
|
|
2896
2898
|
validationState: currentValidationState,
|
|
2897
2899
|
isDisabled,
|
|
@@ -3680,7 +3682,7 @@ const textAreaVariants = classVarianceAuthority.cva("relative flex flex-col bord
|
|
|
3680
3682
|
isDisabled: false,
|
|
3681
3683
|
},
|
|
3682
3684
|
});
|
|
3683
|
-
const TextArea = React__namespace.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) => {
|
|
3685
|
+
const TextArea = React__namespace.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) => {
|
|
3684
3686
|
const [internalValue, setInternalValue] = React__namespace.useState("");
|
|
3685
3687
|
const textAreaValue = value !== undefined ? value : internalValue;
|
|
3686
3688
|
const currentLength = String(textAreaValue).length;
|
|
@@ -3718,7 +3720,7 @@ const TextArea = React__namespace.forwardRef(({ label, helperText, errorText, su
|
|
|
3718
3720
|
gap: "gap-3",
|
|
3719
3721
|
},
|
|
3720
3722
|
};
|
|
3721
|
-
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsx("div", { className: cn(textAreaVariants({
|
|
3723
|
+
return (jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), children: [label && (jsxRuntime.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 })), jsxRuntime.jsx("div", { className: cn(textAreaVariants({
|
|
3722
3724
|
size,
|
|
3723
3725
|
validationState: currentValidationState,
|
|
3724
3726
|
isDisabled,
|