@lykomi/web-primitives 0.53.1 → 0.54.1
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/field.js +2 -2
- package/package.json +1 -1
package/dist/field.js
CHANGED
|
@@ -25,7 +25,7 @@ export function Field({ label, hint, error, htmlFor, action, className, children
|
|
|
25
25
|
child?.props["aria-required"] === true ||
|
|
26
26
|
child?.props["aria-required"] === "true";
|
|
27
27
|
const labelContent = (_jsxs(_Fragment, { children: [label, required && (_jsxs("span", { "aria-hidden": "true", className: "font-normal", children: [" ", "(Required)"] }))] }));
|
|
28
|
-
const labelClass = "text-
|
|
28
|
+
const labelClass = "text-sm font-medium text-muted-foreground";
|
|
29
29
|
const descriptions = [child?.props["aria-describedby"], hint && `${id}-hint`, error && `${id}-error`]
|
|
30
30
|
.filter(Boolean)
|
|
31
31
|
.join(" ") || undefined;
|
|
@@ -36,7 +36,7 @@ export function Field({ label, hint, error, htmlFor, action, className, children
|
|
|
36
36
|
"aria-invalid": error ? true : child.props["aria-invalid"],
|
|
37
37
|
})
|
|
38
38
|
: children;
|
|
39
|
-
return (_jsxs("div", { "data-agent-field": id, "data-agent-context": agentContext ? undefined : "off", className: cn("grid gap-
|
|
39
|
+
return (_jsxs("div", { "data-agent-field": id, "data-agent-context": agentContext ? undefined : "off", className: cn("grid gap-2", className), children: [singleControl || htmlFor ? (_jsxs(_Fragment, { children: [(label || action) && (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [label ? (_jsx("label", { "data-agent-field-label": true, htmlFor: controlId, className: labelClass, children: labelContent })) : (_jsx("span", {})), action] })), control] })) : (_jsxs(_Fragment, { children: [action && _jsx("div", { className: "flex justify-end", children: action }), _jsxs("label", { className: "grid gap-2", children: [label && (_jsx("span", { "data-agent-field-label": true, className: labelClass, children: labelContent })), control] })] })), hint && (_jsx("span", { id: `${id}-hint`, className: "block text-xs text-muted-foreground", children: hint })), error && (_jsx("span", { id: `${id}-error`, className: "block text-xs text-destructive", children: error }))] }));
|
|
40
40
|
}
|
|
41
41
|
export function FieldSet({ className, ...props }) {
|
|
42
42
|
return _jsx("div", { className: cn("grid gap-4", className), ...props });
|