infinity-ui-elements 1.8.60 → 1.8.62
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/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 +31 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +30 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/icons.d.ts +2 -0
- package/dist/lib/icons.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -98,6 +98,14 @@ const iconRegistry = {
|
|
|
98
98
|
chevronUp: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
99
|
<path d="M12 11.2727L6.55555 17L5 15.3637L12 8L19 15.3637L17.4445 17L12 11.2727Z" fill="#081416"/>
|
|
100
100
|
</svg>
|
|
101
|
+
`,
|
|
102
|
+
chevronLeft: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
103
|
+
<path d="M11.2727 12L17 17.4445L15.3637 19L8 12L15.3637 5L17 6.55555L11.2727 12Z" fill="#081416"/>
|
|
104
|
+
</svg>
|
|
105
|
+
`,
|
|
106
|
+
chevronRight: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
107
|
+
<path d="M13.7272 12L8 6.55555L9.63635 5L17 12L9.63635 19L8 17.4445L13.7272 12Z" fill="#081416"/>
|
|
108
|
+
</svg>
|
|
101
109
|
`,
|
|
102
110
|
};
|
|
103
111
|
const Icon = ({ name, size = 24, className = "", style = {}, ...props }) => {
|
|
@@ -2864,9 +2872,8 @@ const textFieldVariants = classVarianceAuthority.cva("relative flex items-center
|
|
|
2864
2872
|
validationState: {
|
|
2865
2873
|
none: `
|
|
2866
2874
|
border-action-outline-neutral-faded
|
|
2867
|
-
hover:border-action-outline-neutral-faded-hover
|
|
2868
|
-
hover:bg-action-fill-neutral-faded-hover
|
|
2869
2875
|
focus-within:border-action-outline-primary-default
|
|
2876
|
+
focus-within:bg-white!
|
|
2870
2877
|
focus-within:ring-2
|
|
2871
2878
|
ring-surface-outline-primary-muted`,
|
|
2872
2879
|
positive: `
|
|
@@ -2889,11 +2896,16 @@ const textFieldVariants = classVarianceAuthority.cva("relative flex items-center
|
|
|
2889
2896
|
cursor-not-allowed`,
|
|
2890
2897
|
false: "",
|
|
2891
2898
|
},
|
|
2899
|
+
isReadOnly: {
|
|
2900
|
+
true: "",
|
|
2901
|
+
false: "hover:border-action-outline-neutral-faded-hover hover:bg-action-fill-neutral-faded-hover",
|
|
2902
|
+
},
|
|
2892
2903
|
},
|
|
2893
2904
|
defaultVariants: {
|
|
2894
2905
|
size: "medium",
|
|
2895
2906
|
validationState: "none",
|
|
2896
2907
|
isDisabled: false,
|
|
2908
|
+
isReadOnly: false,
|
|
2897
2909
|
},
|
|
2898
2910
|
});
|
|
2899
2911
|
const TextField = React__namespace.forwardRef(({ label, helperText, errorText, successText, size = "medium", validationState = "none", isDisabled = false, isLoading = false, isRequired = false, isOptional = false, prefix, suffix, showClearButton = false, infoDescription, infoHeading, LinkComponent, linkText, linkHref, onLinkClick, onClear, containerClassName, labelClassName, inputClassName, className, value, onChange, ...props }, ref) => {
|
|
@@ -2943,13 +2955,14 @@ const TextField = React__namespace.forwardRef(({ label, helperText, errorText, s
|
|
|
2943
2955
|
size,
|
|
2944
2956
|
validationState: currentValidationState,
|
|
2945
2957
|
isDisabled,
|
|
2958
|
+
isReadOnly: props.readOnly,
|
|
2946
2959
|
}), isLoading && "text-field-loading", className), children: [prefix && (jsxRuntime.jsx("span", { className: cn("shrink-0 flex items-center", isDisabled
|
|
2947
2960
|
? "text-surface-ink-neutral-disabled"
|
|
2948
2961
|
: currentValidationState === "positive"
|
|
2949
2962
|
? "text-feedback-ink-positive-intense"
|
|
2950
2963
|
: currentValidationState === "negative"
|
|
2951
2964
|
? "text-feedback-ink-negative-subtle"
|
|
2952
|
-
: "text-surface-ink-neutral-muted"), children: prefix })), jsxRuntime.jsx("input", { ref: ref, value: inputValue, onChange: handleChange, disabled: isDisabled, required: isRequired, className: cn("
|
|
2965
|
+
: "text-surface-ink-neutral-muted"), children: prefix })), jsxRuntime.jsx("input", { ref: ref, value: inputValue, onChange: handleChange, disabled: isDisabled, required: isRequired, className: cn("w-full bg-transparent border-none outline-none text-surface-ink-neutral-normal placeholder:text-surface-ink-neutral-muted disabled:cursor-not-allowed disabled:text-surface-ink-neutral-disabled", inputClassName), ...props }), showClearButton && hasValue && !isDisabled && (jsxRuntime.jsx("button", { type: "button", onClick: handleClear, className: "shrink-0 flex items-center justify-center text-surface-ink-neutral-muted hover:text-surface-ink-neutral-normal transition-colors", tabIndex: -1, children: jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })), suffix && (jsxRuntime.jsx("span", { className: cn("shrink-0 flex items-center", isDisabled
|
|
2953
2966
|
? "text-surface-ink-neutral-disabled"
|
|
2954
2967
|
: currentValidationState === "positive"
|
|
2955
2968
|
? "text-feedback-ink-positive-intense"
|
|
@@ -3125,7 +3138,7 @@ const Select = React__namespace.forwardRef(({ className, options = [], value: co
|
|
|
3125
3138
|
// Build the suffix: include both the optional suffix and the chevron icon
|
|
3126
3139
|
const chevronIcon = (jsxRuntime.jsx(Icon, { name: isOpen ? "chevronUp" : "chevronDown", size: 16, className: "shrink-0 transition-colors" }));
|
|
3127
3140
|
const displaySuffix = suffix ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [suffix, chevronIcon] })) : (chevronIcon);
|
|
3128
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: "relative", children: [jsxRuntime.jsx(TextField, { ref: inputRef, label: label, helperText: helperText, errorText: errorText, successText: successText, validationState: validationState, isDisabled: isDisabled, isRequired: isRequired, isOptional: isOptional, isLoading: isLoading, size: size, prefix: displayPrefix, suffix: displaySuffix, showClearButton: showClearButton && hasValue && !isLoading, onClear: handleClear, placeholder: placeholder, value: displayValue, readOnly: true, containerClassName: containerClassName, labelClassName: labelClassName, className: cn("cursor-pointer", triggerClassName, className), inputClassName: "cursor-pointer", infoHeading: infoHeading, infoDescription: infoDescription, LinkComponent: LinkComponent, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, onClick: toggleOpen, onKeyDown: handleKeyDown, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, ...props }), isOpen && !isDisabled && !isLoading && (jsxRuntime.jsx("div", { ref: dropdownContainerRef, className: cn("absolute z-50 left-0 right-0", dropdownPlacement === "bottom"
|
|
3141
|
+
return (jsxRuntime.jsxs("div", { ref: containerRef, className: "relative w-full", children: [jsxRuntime.jsx(TextField, { ref: inputRef, label: label, helperText: helperText, errorText: errorText, successText: successText, validationState: validationState, isDisabled: isDisabled, isRequired: isRequired, isOptional: isOptional, isLoading: isLoading, size: size, prefix: displayPrefix, suffix: displaySuffix, showClearButton: showClearButton && hasValue && !isLoading, onClear: handleClear, placeholder: placeholder, value: displayValue, readOnly: true, containerClassName: cn("w-full", containerClassName), labelClassName: labelClassName, className: cn("cursor-pointer", triggerClassName, className), inputClassName: "cursor-pointer", infoHeading: infoHeading, infoDescription: infoDescription, LinkComponent: LinkComponent, linkText: linkText, linkHref: linkHref, onLinkClick: onLinkClick, onClick: toggleOpen, onKeyDown: handleKeyDown, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, ...props }), isOpen && !isDisabled && !isLoading && (jsxRuntime.jsx("div", { ref: dropdownContainerRef, className: cn("absolute z-50 left-0 right-0", dropdownPlacement === "bottom"
|
|
3129
3142
|
? "top-full mt-1"
|
|
3130
3143
|
: "bottom-full mb-1"), children: jsxRuntime.jsx(DropdownMenu, { items: menuItems, sectionHeading: sectionHeading, isEmpty: options.length === 0, emptyTitle: emptyTitle, emptyDescription: emptyDescription, emptyIcon: emptyIcon, disableFooter: true, onClose: () => handleOpenChange(false), className: menuClassName, width: widthStyle }) }))] }));
|
|
3131
3144
|
});
|
|
@@ -3247,12 +3260,12 @@ const Pagination = React__namespace.forwardRef(({ className, currentPage: contro
|
|
|
3247
3260
|
return [];
|
|
3248
3261
|
};
|
|
3249
3262
|
const pageNumbers = getPageNumbers();
|
|
3250
|
-
return (jsxRuntime.jsxs("div", { ref: ref, className: cn(paginationVariants({ size }), className), ...props, children: [showRowsPerPage && (jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("span", { className: "text-surface-ink-neutral-muted whitespace-nowrap", children: rowsPerPageLabel }), jsxRuntime.jsx("div", { className: "w-[80px]", children: jsxRuntime.jsx(Select, { value: rowsPerPage.toString(), options: rowsPerPageSelectOptions, onChange: handleRowsPerPageChange, size: selectSize, isDisabled: isDisabled, menuWidth: "auto" }) })] })), jsxRuntime.jsxs("div", { className: "flex items-center gap-3 ml-auto", children: [showPrevNext && (jsxRuntime.jsx(Button, { variant: "tertiary", color: "neutral", size: buttonSize, onClick: handlePrevPage, isDisabled: isPrevDisabled, leadingIcon: jsxRuntime.jsx(
|
|
3263
|
+
return (jsxRuntime.jsxs("div", { ref: ref, className: cn(paginationVariants({ size }), className), ...props, children: [showRowsPerPage && (jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("span", { className: "text-surface-ink-neutral-muted whitespace-nowrap", children: rowsPerPageLabel }), jsxRuntime.jsx("div", { className: "w-[80px]", children: jsxRuntime.jsx(Select, { value: rowsPerPage.toString(), options: rowsPerPageSelectOptions, onChange: handleRowsPerPageChange, size: selectSize, isDisabled: isDisabled, menuWidth: "auto" }) })] })), jsxRuntime.jsxs("div", { className: "flex items-center gap-3 ml-auto", children: [showPrevNext && (jsxRuntime.jsx(Button, { variant: "tertiary", color: "neutral", size: buttonSize, onClick: handlePrevPage, isDisabled: isPrevDisabled, leadingIcon: jsxRuntime.jsx(Icon, { name: "chevronLeft", size: 16 }), "aria-label": "Previous page", children: prevLabel })), showPageJumper ? (
|
|
3251
3264
|
// Show page dropdown selector
|
|
3252
3265
|
jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("div", { className: "w-[80px]", children: jsxRuntime.jsx(Select, { value: currentPage.toString(), options: pageOptions, onChange: (value) => handlePageChange(typeof value === "string" ? parseInt(value) : value), size: selectSize, isDisabled: isDisabled, menuWidth: "auto" }) }), jsxRuntime.jsxs("span", { className: "text-surface-ink-neutral-muted whitespace-nowrap", children: [ofLabel, " ", totalPages] })] })) : (
|
|
3253
3266
|
// Show numbered page buttons
|
|
3254
3267
|
showPageNumber &&
|
|
3255
|
-
pageNumbers.length > 0 && (jsxRuntime.jsx(ButtonGroup, { variant: "separated", size: buttonSize, isDisabled: isDisabled, value: currentPage, onChange: (value) => handlePageChange(value), children: pageNumbers.map((pageNum) => (jsxRuntime.jsx(Button, { value: pageNum, variant: "tertiary", color: "primary", "aria-label": `Page ${pageNum}`, "aria-current": pageNum === currentPage ? "page" : undefined, children: pageNum }, pageNum))) }))), showPrevNext && (jsxRuntime.jsx(Button, { variant: "tertiary", color: "neutral", size: buttonSize, onClick: handleNextPage, isDisabled: isNextDisabled, trailingIcon: jsxRuntime.jsx(
|
|
3268
|
+
pageNumbers.length > 0 && (jsxRuntime.jsx(ButtonGroup, { variant: "separated", size: buttonSize, isDisabled: isDisabled, value: currentPage, onChange: (value) => handlePageChange(value), children: pageNumbers.map((pageNum) => (jsxRuntime.jsx(Button, { value: pageNum, variant: "tertiary", color: "primary", "aria-label": `Page ${pageNum}`, "aria-current": pageNum === currentPage ? "page" : undefined, children: pageNum }, pageNum))) }))), showPrevNext && (jsxRuntime.jsx(Button, { variant: "tertiary", color: "neutral", size: buttonSize, onClick: handleNextPage, isDisabled: isNextDisabled, trailingIcon: jsxRuntime.jsx(Icon, { name: "chevronRight", size: 16 }), "aria-label": "Next page", children: nextLabel }))] })] }));
|
|
3256
3269
|
});
|
|
3257
3270
|
Pagination.displayName = "Pagination";
|
|
3258
3271
|
|
|
@@ -4696,10 +4709,12 @@ const textAreaVariants = classVarianceAuthority.cva("relative flex flex-col bord
|
|
|
4696
4709
|
validationState: {
|
|
4697
4710
|
none: `
|
|
4698
4711
|
border-action-outline-neutral-faded
|
|
4699
|
-
hover:border-action-outline-
|
|
4700
|
-
|
|
4712
|
+
hover:border-action-outline-neutral-faded-hover
|
|
4713
|
+
hover:bg-action-fill-neutral-faded-hover
|
|
4714
|
+
focus-within:border-action-outline-primary-default
|
|
4715
|
+
focus-within:bg-white!
|
|
4701
4716
|
focus-within:ring-2
|
|
4702
|
-
ring-
|
|
4717
|
+
ring-surface-outline-primary-muted`,
|
|
4703
4718
|
positive: `
|
|
4704
4719
|
border-action-outline-positive-default
|
|
4705
4720
|
focus-within:border-action-outline-positive-hover
|
|
@@ -4712,11 +4727,13 @@ const textAreaVariants = classVarianceAuthority.cva("relative flex flex-col bord
|
|
|
4712
4727
|
},
|
|
4713
4728
|
isDisabled: {
|
|
4714
4729
|
true: `
|
|
4715
|
-
border
|
|
4716
|
-
hover:border-action-outline-neutral-disabled
|
|
4730
|
+
border
|
|
4717
4731
|
border-action-outline-neutral-disabled
|
|
4718
|
-
|
|
4719
|
-
|
|
4732
|
+
hover:border-action-outline-neutral-disabled
|
|
4733
|
+
bg-surface-fill-neutral-intense
|
|
4734
|
+
hover:bg-surface-fill-neutral-intense
|
|
4735
|
+
cursor-not-allowed`,
|
|
4736
|
+
false: "",
|
|
4720
4737
|
},
|
|
4721
4738
|
},
|
|
4722
4739
|
defaultVariants: {
|