@wordpress/components
Version:
UI components for WordPress.
1 lines • 1.58 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","names":["PanelHeader","forwardRef"],"sources":["../../src/panel/index.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport PanelHeader from './header';\nimport type { PanelProps } from './types';\n\nfunction UnforwardedPanel(\n\t{ header, className, children }: PanelProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst classNames = clsx( className, 'components-panel' );\n\treturn (\n\t\t<div className={ classNames } ref={ ref }>\n\t\t\t{ header && <PanelHeader label={ header } /> }\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * `Panel` expands and collapses multiple sections of content.\n *\n * ```jsx\n * import { Panel, PanelBody, PanelRow } from '@wordpress/components';\n * import { more } from '@wordpress/icons';\n *\n * const MyPanel = () => (\n * \t<Panel header=\"My Panel\">\n * \t\t<PanelBody title=\"My Block Settings\" icon={ more } initialOpen={ true }>\n * \t\t\t<PanelRow>My Panel Inputs and Labels</PanelRow>\n * \t\t</PanelBody>\n * \t</Panel>\n * );\n * ```\n */\nexport const Panel = forwardRef( UnforwardedPanel );\nPanel.displayName = 'Panel';\n\nexport default Panel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,iBACR,EAAE,QAAQ,WAAW,YACrB,KACC;CACD,MAAM,cAAA,GAAa,KAAA,QAAA,CAAM,WAAW,kBAAmB;CACvD,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAY;EAAmB;EAApC,UAAA,CACG,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,SAAD,EAAa,OAAQ,OAAU,CAAA,GACzC,QACE;;AAEP;;;;;;;;;;;;;;;;;AAkBA,MAAa,SAAA,GAAQC,mBAAAA,WAAAA,CAAY,gBAAiB;AAClD,MAAM,cAAc"}