@wordpress/components
Version:
UI components for WordPress.
35 lines (33 loc) • 885 B
JavaScript
/**
* WordPress dependencies
*/
import { forwardRef, useContext } from '@wordpress/element';
/**
* Internal dependencies
*/
import { Context } from './context';
import { Text } from '../text';
import * as Styled from './styles';
import { jsx as _jsx } from "react/jsx-runtime";
export const GroupLabel = forwardRef(function Group(props, ref) {
const menuContext = useContext(Context);
if (!menuContext?.store) {
throw new Error('Menu.GroupLabel can only be rendered inside a Menu component');
}
return /*#__PURE__*/_jsx(Styled.GroupLabel, {
ref: ref,
render:
/*#__PURE__*/
// @ts-expect-error The `children` prop is passed
_jsx(Text, {
upperCase: true,
variant: "muted",
size: "11px",
weight: 500,
lineHeight: "16px"
}),
...props,
store: menuContext.store
});
});
//# sourceMappingURL=group-label.js.map