@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
44 lines (43 loc) • 2.31 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_i18n = require("@wordpress/i18n");
let _wordpress_components = require("@wordpress/components");
let react_jsx_runtime = require("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__ */ (0, react_jsx_runtime.jsx)("div", {
className: "font-library__google-fonts-confirm",
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Card, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_components.CardBody, { children: [
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalHeading, {
level: 2,
children: (0, _wordpress_i18n.__)("Connect to Google Fonts")
}),
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalText, {
as: "p",
children: (0, _wordpress_i18n.__)("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__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalSpacer, { margin: 3 }),
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalText, {
as: "p",
children: (0, _wordpress_i18n.__)("You can alternatively upload files directly on the Upload tab.")
}),
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Button, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: handleConfirm,
children: (0, _wordpress_i18n.__)("Allow access to Google Fonts")
})
] }) })
});
}
exports.default = GoogleFontsConfirmDialog;
//# sourceMappingURL=google-fonts-confirm-dialog.cjs.map