@cerberus-design/react
Version:
The Cerberus Design React component library.
49 lines (47 loc) • 1.18 kB
JavaScript
import {
Show
} from "./chunk-NUXMADXV.js";
// src/components/deprecated/Legend.tsx
import { useFieldContext } from "@ark-ui/react/field";
import { css, cx } from "styled-system/css";
import { label } from "styled-system/recipes";
import { hstack } from "styled-system/patterns";
import { jsx, jsxs } from "react/jsx-runtime";
function Legend(props) {
const { size, ...nativeProps } = props;
const { invalid, required } = useFieldContext();
return /* @__PURE__ */ jsxs(
"legend",
{
...nativeProps,
...invalid && { "aria-invalid": true },
className: cx(
nativeProps.className,
hstack({
justify: "space-between",
w: "full"
}),
label({
size
})
),
children: [
nativeProps.children,
/* @__PURE__ */ jsx(Show, { when: required, children: /* @__PURE__ */ jsx(
"span",
{
className: css({
color: "page.text.100",
fontSize: "inherit"
}),
children: "(required)"
}
) })
]
}
);
}
export {
Legend
};
//# sourceMappingURL=chunk-TOXQSWPN.js.map