UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.09 kB
{ "version": 3, "sources": ["../../src/menu/group.tsx"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { Context } from './context';\nimport * as Styled from './styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Group = forwardRef(function Group(props, ref) {\n const menuContext = useContext(Context);\n if (!menuContext?.store) {\n throw new Error('Menu.Group can only be rendered inside a Menu component');\n }\n return /*#__PURE__*/_jsx(Styled.Group, {\n ref: ref,\n ...props,\n store: menuContext.store\n });\n});"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA;AAAA;AAGA,qBAAuC;AAMvC,qBAAwB;AACxB,aAAwB;AACxB,yBAA4B;AACrB,IAAMA,aAAQ,2BAAW,SAASA,OAAM,OAAO,KAAK;AACzD,QAAM,kBAAc,2BAAW,sBAAO;AACtC,MAAI,CAAC,aAAa,OAAO;AACvB,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACA,SAAoB,uCAAAC,KAAY,cAAO;AAAA,IACrC;AAAA,IACA,GAAG;AAAA,IACH,OAAO,YAAY;AAAA,EACrB,CAAC;AACH,CAAC;", "names": ["Group", "_jsx"] }