@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
62 lines (61 loc) • 2.73 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
// \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
let _wordpress_components = require("@wordpress/components");
let ___preview_typography_tsx = require("../preview-typography.cjs");
___preview_typography_tsx = __toESM(___preview_typography_tsx);
let ___hooks_ts = require("../hooks.cjs");
let ___subtitle_tsx = require("../subtitle.cjs");
let __variation_tsx = require("./variation.cjs");
__variation_tsx = __toESM(__variation_tsx);
let react_jsx_runtime = require("react/jsx-runtime");
// packages/global-styles-ui/src/variations/variations-typography.tsx
const propertiesToFilter = ["typography"];
function TypographyVariations({ title, gap = 2 }) {
const typographyVariations = (0, ___hooks_ts.useCurrentMergeThemeStyleVariationsWithUserConfig)(propertiesToFilter);
if (typographyVariations?.length <= 1) return null;
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_components.__experimentalVStack, {
spacing: 3,
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___subtitle_tsx.Subtitle, {
level: 3,
children: title
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalGrid, {
columns: 3,
gap,
className: "global-styles-ui-style-variations-container",
children: typographyVariations.map((variation, index) => {
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__variation_tsx.default, {
variation,
properties: propertiesToFilter,
showTooltip: true,
children: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___preview_typography_tsx.default, { variation })
}, index);
})
})]
});
}
exports.default = TypographyVariations;
//# sourceMappingURL=variations-typography.cjs.map