UNPKG

@wordpress/global-styles-ui

Version:
33 lines (32 loc) • 1.1 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_components = require("@wordpress/components"); let __preview_hooks_tsx = require("./preview-hooks.cjs"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/global-styles-ui/src/highlighted-colors.tsx function HighlightedColors({ normalizedColorSwatchSize, ratio }) { const { highlightedColors } = (0, __preview_hooks_tsx.useStylesPreviewColors)(); const scaledSwatchSize = normalizedColorSwatchSize * ratio; return highlightedColors.map(({ slug, color }, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__unstableMotion.div, { style: { height: scaledSwatchSize, width: scaledSwatchSize, background: color, borderRadius: scaledSwatchSize / 2 }, animate: { scale: 1, opacity: 1 }, initial: { scale: .1, opacity: 0 }, transition: { delay: index === 1 ? .2 : .1 } }, `${slug}-${index}`)); } exports.default = HighlightedColors; //# sourceMappingURL=highlighted-colors.cjs.map