@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
28 lines (27 loc) • 892 B
JavaScript
import { __unstableMotion } from "@wordpress/components";
import { useStylesPreviewColors } from "./preview-hooks.mjs";
import { jsx } from "react/jsx-runtime";
// packages/global-styles-ui/src/highlighted-colors.tsx
function HighlightedColors({ normalizedColorSwatchSize, ratio }) {
const { highlightedColors } = useStylesPreviewColors();
const scaledSwatchSize = normalizedColorSwatchSize * ratio;
return highlightedColors.map(({ slug, color }, index) => /* @__PURE__ */ jsx(__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}`));
}
export { HighlightedColors as default };
//# sourceMappingURL=highlighted-colors.mjs.map