@coin-voyage/paykit
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
23 lines • 973 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import useMeasure from "react-use-measure";
import { Container, ThemeContainer } from "./styles";
export default function ThemedButton({ children, variant = "primary", autoSize = true, duration = 0.3, style }) {
const [contentRef, bounds] = useMeasure();
return (_jsx(Container, { className: variant, initial: false, animate: autoSize
? {
width: bounds.width > 10 ? bounds.width : "auto",
}
: undefined, transition: {
duration: duration,
ease: [0.25, 1, 0.5, 1],
delay: 0.01,
}, style: style, children: _jsx("div", { ref: contentRef, style: {
flex: 1,
whiteSpace: "nowrap",
textAlign: "center",
position: "relative",
padding: "0 12px",
}, children: children }) }));
}
export { ThemeContainer };
//# sourceMappingURL=index.js.map