UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.48 kB
{ "version": 3, "sources": ["../../src/menu/group-label.tsx"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { Context } from './context';\nimport { Text } from '../text';\nimport * as Styled from './styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GroupLabel = forwardRef(function Group(props, ref) {\n const menuContext = useContext(Context);\n if (!menuContext?.store) {\n throw new Error('Menu.GroupLabel can only be rendered inside a Menu component');\n }\n return /*#__PURE__*/_jsx(Styled.GroupLabel, {\n ref: ref,\n render:\n /*#__PURE__*/\n // @ts-expect-error The `children` prop is passed\n _jsx(Text, {\n upperCase: true,\n variant: \"muted\",\n size: \"11px\",\n weight: 500,\n lineHeight: \"16px\"\n }),\n ...props,\n store: menuContext.store\n });\n});"], "mappings": ";AAGA,SAAS,YAAY,kBAAkB;AAMvC,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,YAAY,YAAY;AACxB,SAAS,OAAO,YAAY;AACrB,IAAMA,cAAa,WAAW,SAAS,MAAM,OAAO,KAAK;AAC9D,QAAM,cAAc,WAAW,OAAO;AACtC,MAAI,CAAC,aAAa,OAAO;AACvB,UAAM,IAAI,MAAM,8DAA8D;AAAA,EAChF;AACA,SAAoB,qBAAY,mBAAY;AAAA,IAC1C;AAAA,IACA;AAAA;AAAA,MAGA,qBAAK,MAAM;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,YAAY;AAAA,MACd,CAAC;AAAA;AAAA,IACD,GAAG;AAAA,IACH,OAAO,YAAY;AAAA,EACrB,CAAC;AACH,CAAC;", "names": ["GroupLabel"] }