@graphiql/react
Version:
[Changelog](https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/CHANGELOG.md) | [API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql_react.html) | [NPM](https://www.npmjs.com/package/@graphiql/react)
61 lines (60 loc) • 1.45 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { c } from "react-compiler-runtime";
import { forwardRef } from "react";
/* empty css */
import { clsx } from "clsx";
const UnStyledButton = forwardRef((props, ref) => {
const $ = c(6);
let t0;
if ($[0] !== props.className) {
t0 = clsx("graphiql-un-styled", props.className);
$[0] = props.className;
$[1] = t0;
} else {
t0 = $[1];
}
let t1;
if ($[2] !== props || $[3] !== ref || $[4] !== t0) {
t1 = /* @__PURE__ */ jsx("button", { ...props, ref, className: t0 });
$[2] = props;
$[3] = ref;
$[4] = t0;
$[5] = t1;
} else {
t1 = $[5];
}
return t1;
});
UnStyledButton.displayName = "UnStyledButton";
const Button = forwardRef((props, ref) => {
const $ = c(7);
let t0;
if ($[0] !== props.className || $[1] !== props.state) {
t0 = clsx("graphiql-button", {
success: "graphiql-button-success",
error: "graphiql-button-error"
}[props.state], props.className);
$[0] = props.className;
$[1] = props.state;
$[2] = t0;
} else {
t0 = $[2];
}
let t1;
if ($[3] !== props || $[4] !== ref || $[5] !== t0) {
t1 = /* @__PURE__ */ jsx("button", { ...props, ref, className: t0 });
$[3] = props;
$[4] = ref;
$[5] = t0;
$[6] = t1;
} else {
t1 = $[6];
}
return t1;
});
Button.displayName = "Button";
export {
Button,
UnStyledButton
};
//# sourceMappingURL=index.js.map