@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
39 lines (38 loc) • 1.72 kB
JavaScript
import { __ } from "@wordpress/i18n";
import { Button, Card, CardBody, __experimentalHeading, __experimentalSpacer, __experimentalText } from "@wordpress/components";
import { jsx, jsxs } from "react/jsx-runtime";
// packages/global-styles-ui/src/font-library/google-fonts-confirm-dialog.tsx
function GoogleFontsConfirmDialog() {
const handleConfirm = () => {
window.localStorage.setItem("wp-font-library-google-fonts-permission", "true");
window.dispatchEvent(new Event("storage"));
};
return /* @__PURE__ */ jsx("div", {
className: "font-library__google-fonts-confirm",
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardBody, { children: [
/* @__PURE__ */ jsx(__experimentalHeading, {
level: 2,
children: __("Connect to Google Fonts")
}),
/* @__PURE__ */ jsx(__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ jsx(__experimentalText, {
as: "p",
children: __("To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts.")
}),
/* @__PURE__ */ jsx(__experimentalSpacer, { margin: 3 }),
/* @__PURE__ */ jsx(__experimentalText, {
as: "p",
children: __("You can alternatively upload files directly on the Upload tab.")
}),
/* @__PURE__ */ jsx(__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ jsx(Button, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: handleConfirm,
children: __("Allow access to Google Fonts")
})
] }) })
});
}
export { GoogleFontsConfirmDialog as default };
//# sourceMappingURL=google-fonts-confirm-dialog.mjs.map