@wordpress/components
Version:
UI components for WordPress.
29 lines (28 loc) • 991 B
JavaScript
import clsx from "clsx";
import { forwardRef } from "@wordpress/element";
import { jsx } from "react/jsx-runtime";
// packages/components/src/color-indicator/index.tsx
function UnforwardedColorIndicator(props, forwardedRef) {
const { className, colorValue, ...additionalProps } = props;
return /* @__PURE__ */ jsx("span", {
className: clsx("component-color-indicator", className),
style: { background: colorValue },
ref: forwardedRef,
...additionalProps
});
}
/**
* ColorIndicator is a React component that renders a specific color in a
* circle. It's often used to summarize a collection of used colors in a child
* component.
*
* ```jsx
* import { ColorIndicator } from '@wordpress/components';
*
* const MyColorIndicator = () => <ColorIndicator colorValue="#0073aa" />;
* ```
*/
const ColorIndicator = forwardRef(UnforwardedColorIndicator);
ColorIndicator.displayName = "ColorIndicator";
export { ColorIndicator, ColorIndicator as default };
//# sourceMappingURL=index.mjs.map