infinity-ui-elements 1.8.30 → 1.8.32
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/Radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup.stories.d.ts +6 -0
- package/dist/components/Radio/RadioGroup.stories.d.ts.map +1 -1
- package/dist/index.esm.js +20 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3145,8 +3145,16 @@ const RadioGroup = React__namespace.forwardRef(({ value: controlledValue, defaul
|
|
|
3145
3145
|
if (currentIndex === -1)
|
|
3146
3146
|
return;
|
|
3147
3147
|
const direction = orientation === "horizontal"
|
|
3148
|
-
?
|
|
3149
|
-
|
|
3148
|
+
? e.key === "ArrowRight"
|
|
3149
|
+
? 1
|
|
3150
|
+
: e.key === "ArrowLeft"
|
|
3151
|
+
? -1
|
|
3152
|
+
: 0
|
|
3153
|
+
: e.key === "ArrowDown"
|
|
3154
|
+
? 1
|
|
3155
|
+
: e.key === "ArrowUp"
|
|
3156
|
+
? -1
|
|
3157
|
+
: 0;
|
|
3150
3158
|
if (direction === 0)
|
|
3151
3159
|
return;
|
|
3152
3160
|
e.preventDefault();
|
|
@@ -3214,20 +3222,14 @@ const RadioGroup = React__namespace.forwardRef(({ value: controlledValue, defaul
|
|
|
3214
3222
|
...child.props,
|
|
3215
3223
|
ref: (el) => {
|
|
3216
3224
|
radioRefs.current[index] = el;
|
|
3217
|
-
// Preserve original ref if it exists
|
|
3218
|
-
const originalRef = child.ref;
|
|
3219
|
-
if (typeof originalRef === "function") {
|
|
3220
|
-
originalRef(el);
|
|
3221
|
-
}
|
|
3222
|
-
else if (originalRef && "current" in originalRef) {
|
|
3223
|
-
originalRef.current = el;
|
|
3224
|
-
}
|
|
3225
3225
|
},
|
|
3226
3226
|
name,
|
|
3227
3227
|
checked: isChecked,
|
|
3228
3228
|
onChange: (e) => {
|
|
3229
3229
|
if (e.target.checked) {
|
|
3230
|
-
handleChange(childValue
|
|
3230
|
+
handleChange(typeof childValue === "string"
|
|
3231
|
+
? childValue
|
|
3232
|
+
: String(childValue || ""));
|
|
3231
3233
|
}
|
|
3232
3234
|
// Call original onChange if it exists
|
|
3233
3235
|
if (child.props.onChange) {
|
|
@@ -3241,7 +3243,13 @@ const RadioGroup = React__namespace.forwardRef(({ value: controlledValue, defaul
|
|
|
3241
3243
|
});
|
|
3242
3244
|
});
|
|
3243
3245
|
};
|
|
3244
|
-
return (jsxRuntime.jsxs("div", { ref: ref, className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), ...props, 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: id, className: "mb-2", labelClassName: labelClassName })), jsxRuntime.jsx("div", { ref: groupRef, role: "radiogroup", "aria-label": label, "aria-required": isRequired, "aria-invalid": currentValidationState === "error", "aria-disabled": isDisabled, className: cn("flex", orientation === "horizontal"
|
|
3246
|
+
return (jsxRuntime.jsxs("div", { ref: ref, className: cn("w-full flex flex-col", sizeConfig[size].gap, containerClassName), ...props, 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: id, className: "mb-2", labelClassName: labelClassName })), jsxRuntime.jsx("div", { ref: groupRef, role: "radiogroup", "aria-label": label, "aria-required": isRequired, "aria-invalid": currentValidationState === "error", "aria-disabled": isDisabled, className: cn("flex", orientation === "horizontal"
|
|
3247
|
+
? "flex-row items-center"
|
|
3248
|
+
: "flex-col items-start", spacingConfig[spacing], groupClassName, className), onKeyDown: handleKeyDown, id: id, children: options ? renderOptions() : renderChildren() }), jsxRuntime.jsx(FormFooter, { helperText: displayHelperText, validationState: currentValidationState === "none"
|
|
3249
|
+
? "default"
|
|
3250
|
+
: currentValidationState === "error"
|
|
3251
|
+
? "negative"
|
|
3252
|
+
: "default", size: size, isDisabled: isDisabled, className: "mt-1" })] }));
|
|
3245
3253
|
});
|
|
3246
3254
|
RadioGroup.displayName = "RadioGroup";
|
|
3247
3255
|
|