UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.11 kB
{ "version": 3, "sources": ["../../src/menu/separator.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 Separator = forwardRef(function Separator(props, ref) {\n const menuContext = useContext(Context);\n if (!menuContext?.store) {\n throw new Error('Menu.Separator can only be rendered inside a Menu component');\n }\n return /*#__PURE__*/_jsx(Styled.Separator, {\n ref: ref,\n ...props,\n store: menuContext.store,\n variant: menuContext.variant\n });\n});"], "mappings": ";AAGA,SAAS,YAAY,kBAAkB;AAMvC,SAAS,eAAe;AACxB,YAAY,YAAY;AACxB,SAAS,OAAO,YAAY;AACrB,IAAMA,aAAY,WAAW,SAASA,WAAU,OAAO,KAAK;AACjE,QAAM,cAAc,WAAW,OAAO;AACtC,MAAI,CAAC,aAAa,OAAO;AACvB,UAAM,IAAI,MAAM,6DAA6D;AAAA,EAC/E;AACA,SAAoB,qBAAY,kBAAW;AAAA,IACzC;AAAA,IACA,GAAG;AAAA,IACH,OAAO,YAAY;AAAA,IACnB,SAAS,YAAY;AAAA,EACvB,CAAC;AACH,CAAC;", "names": ["Separator"] }