infinity-ui-elements 1.8.4 → 1.8.5
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/FormFooter/FormFooter.d.ts.map +1 -1
- package/dist/components/FormHeader/FormHeader.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +28 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +28 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1372,17 +1372,17 @@ const FormFooter = React.forwardRef(({ helperText, trailingText, validationState
|
|
|
1372
1372
|
// Size-based configurations
|
|
1373
1373
|
const sizeConfig = {
|
|
1374
1374
|
small: {
|
|
1375
|
-
|
|
1375
|
+
textClassName: "text-caption-small-regular",
|
|
1376
1376
|
iconSize: 12,
|
|
1377
1377
|
gap: "gap-1",
|
|
1378
1378
|
},
|
|
1379
1379
|
medium: {
|
|
1380
|
-
|
|
1380
|
+
textClassName: "text-caption-medium-regular",
|
|
1381
1381
|
iconSize: 14,
|
|
1382
1382
|
gap: "gap-1",
|
|
1383
1383
|
},
|
|
1384
1384
|
large: {
|
|
1385
|
-
|
|
1385
|
+
textClassName: "text-caption-large-regular",
|
|
1386
1386
|
iconSize: 16,
|
|
1387
1387
|
gap: "gap-1.5",
|
|
1388
1388
|
},
|
|
@@ -1391,20 +1391,22 @@ const FormFooter = React.forwardRef(({ helperText, trailingText, validationState
|
|
|
1391
1391
|
// Determine text color based on validation state and disabled state
|
|
1392
1392
|
const getTextColor = () => {
|
|
1393
1393
|
if (isDisabled)
|
|
1394
|
-
return "disabled";
|
|
1394
|
+
return "text-surface-ink-neutral-disabled";
|
|
1395
1395
|
if (validationState === "positive")
|
|
1396
|
-
return "positive";
|
|
1396
|
+
return "text-feedback-ink-positive-intense";
|
|
1397
1397
|
if (validationState === "negative")
|
|
1398
|
-
return "negative";
|
|
1398
|
+
return "text-feedback-ink-negative-subtle";
|
|
1399
1399
|
if (validationState === "default")
|
|
1400
|
-
return "
|
|
1401
|
-
return "
|
|
1400
|
+
return "text-surface-ink-neutral-subtle";
|
|
1401
|
+
return "text-surface-ink-neutral-subtle";
|
|
1402
1402
|
};
|
|
1403
|
+
const helperTextColorClass = getTextColor();
|
|
1404
|
+
const trailingTextColorClass = getTextColor();
|
|
1403
1405
|
// Don't render anything if there's no content
|
|
1404
1406
|
if (!helperText && !trailingText) {
|
|
1405
1407
|
return null;
|
|
1406
1408
|
}
|
|
1407
|
-
return (jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [helperText && (jsxs("div", { className: cn("flex items-center", config.gap), children: [validationState === "positive" && (jsx("svg", { width: config.iconSize, height: config.iconSize, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-feedback-ink-positive-intense shrink-0", children: jsx("path", { d: "M3 7L6 10L11 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })), validationState === "negative" && (jsxs("svg", { width: config.iconSize, height: config.iconSize, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-feedback-ink-negative-subtle shrink-0", children: [jsx("circle", { cx: "7", cy: "7", r: "6", stroke: "currentColor", strokeWidth: "1" }), jsx("path", { d: "M7 4V7.5M7 10V9.5", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round" })] })), jsx(
|
|
1409
|
+
return (jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-1", config.gap, className), children: [helperText && (jsxs("div", { className: cn("flex items-center", config.gap), children: [validationState === "positive" && (jsx("svg", { width: config.iconSize, height: config.iconSize, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-feedback-ink-positive-intense shrink-0", children: jsx("path", { d: "M3 7L6 10L11 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })), validationState === "negative" && (jsxs("svg", { width: config.iconSize, height: config.iconSize, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-feedback-ink-negative-subtle shrink-0", children: [jsx("circle", { cx: "7", cy: "7", r: "6", stroke: "currentColor", strokeWidth: "1" }), jsx("path", { d: "M7 4V7.5M7 10V9.5", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round" })] })), jsx("span", { className: cn(config.textClassName, helperTextColorClass, "italic font-size-100 leading-100", helperTextClassName), children: helperText })] })), trailingText && (jsx("span", { className: cn(config.textClassName, trailingTextColorClass, "font-size-100 leading-100 shrink-0", trailingTextClassName), children: trailingText }))] }));
|
|
1408
1410
|
});
|
|
1409
1411
|
FormFooter.displayName = "FormFooter";
|
|
1410
1412
|
|
|
@@ -1542,7 +1544,7 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
|
|
|
1542
1544
|
},
|
|
1543
1545
|
medium: {
|
|
1544
1546
|
gap: "gap-2.5",
|
|
1545
|
-
labelSize: "text-body-
|
|
1547
|
+
labelSize: "text-body-small-regular",
|
|
1546
1548
|
iconSize: 12,
|
|
1547
1549
|
},
|
|
1548
1550
|
large: {
|
|
@@ -2181,23 +2183,26 @@ const FormHeader = React.forwardRef(({ label, size = "medium", isOptional = fals
|
|
|
2181
2183
|
// Size-based configurations
|
|
2182
2184
|
const sizeConfig = {
|
|
2183
2185
|
small: {
|
|
2184
|
-
|
|
2186
|
+
textClassName: "text-body-xsmall-semibold",
|
|
2187
|
+
textClassNameRegular: "text-caption-small-regular",
|
|
2185
2188
|
iconSize: 12,
|
|
2186
2189
|
gap: "gap-1.5",
|
|
2187
2190
|
},
|
|
2188
2191
|
medium: {
|
|
2189
|
-
|
|
2192
|
+
textClassName: "text-body-small-semibold",
|
|
2193
|
+
textClassNameRegular: "text-caption-medium-regular",
|
|
2190
2194
|
iconSize: 14,
|
|
2191
2195
|
gap: "gap-2",
|
|
2192
2196
|
},
|
|
2193
2197
|
large: {
|
|
2194
|
-
|
|
2198
|
+
textClassName: "text-body-medium-semibold",
|
|
2199
|
+
textClassNameRegular: "text-caption-large-regular",
|
|
2195
2200
|
iconSize: 16,
|
|
2196
2201
|
gap: "gap-2.5",
|
|
2197
2202
|
},
|
|
2198
2203
|
};
|
|
2199
2204
|
const config = sizeConfig[size];
|
|
2200
|
-
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(
|
|
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 }))] }));
|
|
2201
2206
|
});
|
|
2202
2207
|
FormHeader.displayName = "FormHeader";
|
|
2203
2208
|
|
|
@@ -2249,7 +2254,7 @@ const Modal = React.forwardRef(({ isOpen, onClose, title, description, footer, c
|
|
|
2249
2254
|
});
|
|
2250
2255
|
Modal.displayName = "Modal";
|
|
2251
2256
|
|
|
2252
|
-
const selectVariants = cva("relative flex items-center gap-2 border rounded-
|
|
2257
|
+
const selectVariants = cva("relative flex items-center gap-2 border rounded-large transition-all font-display font-size-100 leading-100", {
|
|
2253
2258
|
variants: {
|
|
2254
2259
|
size: {
|
|
2255
2260
|
small: "h-[28px] px-3 text-xs gap-2",
|
|
@@ -2442,7 +2447,13 @@ const Select = React.forwardRef(({ className, options = [], value: controlledVal
|
|
|
2442
2447
|
}, [isOpen, value, options, isDisabled, isLoading]);
|
|
2443
2448
|
// Transform options to dropdown menu items
|
|
2444
2449
|
const menuItems = options.map((option) => ({
|
|
2445
|
-
|
|
2450
|
+
value: option.value,
|
|
2451
|
+
label: option.label ?? String(option.value),
|
|
2452
|
+
description: option.description,
|
|
2453
|
+
leadingIcon: option.leadingIcon,
|
|
2454
|
+
trailingIcon: option.trailingIcon,
|
|
2455
|
+
isDisabled: option.isDisabled,
|
|
2456
|
+
variant: option.variant,
|
|
2446
2457
|
onClick: () => handleSelect(option),
|
|
2447
2458
|
}));
|
|
2448
2459
|
const widthStyle = menuWidth === "full" ? "100%" : menuWidth === "auto" ? "auto" : menuWidth;
|
|
@@ -2467,9 +2478,7 @@ const Select = React.forwardRef(({ className, options = [], value: controlledVal
|
|
|
2467
2478
|
? "text-feedback-ink-positive-intense"
|
|
2468
2479
|
: currentValidationState === "negative"
|
|
2469
2480
|
? "text-feedback-ink-negative-subtle"
|
|
2470
|
-
: "text-surface-ink-neutral-muted"), children: prefix })), jsx("span", { className: cn("flex-1 text-left truncate", !selectedOption && "text-surface-ink-neutral-muted", isDisabled && "text-surface-ink-neutral-disabled"), children: isLoading
|
|
2471
|
-
? "Loading..."
|
|
2472
|
-
: selectedOption?.label || selectedOption?.title || placeholder }), showClearButton && hasValue && !isDisabled && !isLoading && (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: jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })), suffix && !showClearButton && (jsx("span", { className: cn("shrink-0 flex items-center", isDisabled
|
|
2481
|
+
: "text-surface-ink-neutral-muted"), children: prefix })), jsx("span", { className: cn("flex-1 text-left truncate", !selectedOption && "text-surface-ink-neutral-muted", isDisabled && "text-surface-ink-neutral-disabled"), children: isLoading ? "Loading..." : selectedOption?.label || placeholder }), showClearButton && hasValue && !isDisabled && !isLoading && (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: jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })), suffix && !showClearButton && (jsx("span", { className: cn("shrink-0 flex items-center", isDisabled
|
|
2473
2482
|
? "text-surface-ink-neutral-disabled"
|
|
2474
2483
|
: currentValidationState === "positive"
|
|
2475
2484
|
? "text-feedback-ink-positive-intense"
|