UNPKG

@wordpress/global-styles-ui

Version:
29 lines (28 loc) • 1.15 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_block_editor = require("@wordpress/block-editor"); let _wordpress_i18n = require("@wordpress/i18n"); let ___hooks_ts = require("../hooks.cjs"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/global-styles-ui/src/font-sizes/font-size-preview.tsx function FontSizePreview({ fontSize }) { const [font] = (0, ___hooks_ts.useStyle)("typography"); const input = typeof fontSize?.fluid === "object" && fontSize?.fluid?.min && fontSize?.fluid?.max ? { minimumFontSize: fontSize.fluid.min, maximumFontSize: fontSize.fluid.max } : { fontSize: fontSize.size }; const computedFontSize = (0, _wordpress_block_editor.getComputedFluidTypographyValue)(input); return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "global-styles-ui-typography-preview", style: { fontSize: computedFontSize, fontFamily: font?.fontFamily ?? "serif" }, children: (0, _wordpress_i18n.__)("Aa") }); } exports.default = FontSizePreview; //# sourceMappingURL=font-size-preview.cjs.map