@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
24 lines (23 loc) • 862 B
JavaScript
import { GlobalStylesProvider } from "./provider.mjs";
import { jsx } from "react/jsx-runtime";
// packages/global-styles-ui/src/with-global-styles-provider.tsx
/**
* Higher-order component that wraps a component with GlobalStylesProvider.
* This allows components to access GlobalStylesContext without exposing
* the provider directly in the public API.
*
* @param Component - The component to wrap
* @return A wrapped component that accepts value, baseValue, and onChange props
*/
function withGlobalStylesProvider(Component) {
return function WrappedComponent({ value, baseValue, onChange, ...props }) {
return /* @__PURE__ */ jsx(GlobalStylesProvider, {
value,
baseValue,
onChange,
children: /* @__PURE__ */ jsx(Component, { ...props })
});
};
}
export { withGlobalStylesProvider };
//# sourceMappingURL=with-global-styles-provider.mjs.map