@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
51 lines (50 loc) • 1.42 kB
JavaScript
import e from "../node_modules/clsx/dist/clsx.js";
import { Button as t } from "../Button/Button.js";
import { FormControl as n } from "../forms/FormControl/FormControl.js";
import r from "./CTAForm.module.js";
import i, { forwardRef as a } from "react";
import { jsx as o } from "react/jsx-runtime";
//#region src/CTAForm/CTAForm.tsx
var s = a(({ className: t, ...n }, i) => /* @__PURE__ */ o("form", {
ref: i,
className: e(r.CTAForm, t),
...n
})), c = a(({ className: t, children: a, ...s }, c) => {
let l = i.Children.toArray(a).map((e) => i.isValidElement(e) && e.type === n ? i.cloneElement(e, {
fullWidth: !0,
required: !0,
...e.props
}) : e);
return /* @__PURE__ */ o("div", {
ref: c,
className: e(r["CTAForm-input"], t),
...s,
children: l
});
}), l = a(({ className: t, children: a, ...s }, c) => {
let l = i.Children.toArray(a).map((e) => i.isValidElement(e) && e.type === n ? i.cloneElement(e, {
fullWidth: !0,
size: "large",
...e.props
}) : e);
return /* @__PURE__ */ o("div", {
ref: c,
className: e(r["CTAForm-confirm"], t),
...s,
children: l
});
}), u = a(({ className: n, children: i, ...a }, s) => /* @__PURE__ */ o(t, {
type: "submit",
variant: "secondary",
className: e(r["CTAForm-button"], n),
ref: s,
...a,
children: i
})), d = Object.assign(s, {
Input: c,
Confirm: l,
Action: u
});
//#endregion
export { d as CTAForm };
//# sourceMappingURL=CTAForm.js.map