"use strict";(self.webpackChunk_woocommerce_storybook=self.webpackChunk_woocommerce_storybook||[]).push([[7714],{"../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}__webpack_require__.d(__webpack_exports__,{A:()=>_objectWithoutProperties})},"../../packages/js/components/src/section/context.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>Level});var Level=(0,__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js").createContext)(2)},"../../packages/js/components/src/section/header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>H});var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),_context__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../packages/js/components/src/section/context.tsx");function H(props){var level=(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_context__WEBPACK_IMPORTED_MODULE_1__.$),Heading="h"+Math.min(level,6);return(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Heading,props)}try{H.displayName="H",H.__docgenInfo={description:'These components are used to frame out the page content for accessible heading hierarchy. Instead of defining fixed heading levels\n(`h2`, `h3`, …) you can use `` to create "section headings", which look to the parent `
`s for the appropriate\nheading level.',displayName:"H",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/js/components/src/section/header.tsx#H"]={docgenInfo:H.__docgenInfo,name:"H",path:"../../packages/js/components/src/section/header.tsx#H"})}catch(__react_docgen_typescript_loader_error){}},"../../packages/js/components/src/section/section.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{w:()=>Section});var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),_wordpress_element__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),_context__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../packages/js/components/src/section/context.tsx"),_excluded=["component","children"],Section=function Section(_ref){var component=_ref.component,children=_ref.children,props=(0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__.A)(_ref,_excluded),Component=component||"div";return(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_context__WEBPACK_IMPORTED_MODULE_2__.$.Consumer,null,(function(level){return(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_context__WEBPACK_IMPORTED_MODULE_2__.$.Provider,{value:level+1},!1===component?children:(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(Component,props,children))}))};try{Section.displayName="Section",Section.__docgenInfo={description:"The section wrapper, used to indicate a sub-section (and change the header level context).",displayName:"Section",props:{component:{defaultValue:null,description:"The wrapper component for this section. Optional, defaults to `div`. If passed false, no wrapper is used. Additional props passed to Section are passed on to the component.",name:"component",required:!1,type:{name:"string | false | ComponentType<{}>"}},className:{defaultValue:null,description:"Optional classname",name:"className",required:!1,type:{name:"string"}},children:{defaultValue:null,description:"The children inside this section, rendered in the `component`. This increases the context level for the next heading used.",name:"children",required:!0,type:{name:"ReactNode"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/js/components/src/section/section.tsx#Section"]={docgenInfo:Section.__docgenInfo,name:"Section",path:"../../packages/js/components/src/section/section.tsx#Section"})}catch(__react_docgen_typescript_loader_error){}},"../../packages/js/components/src/section/stories/section.story.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Basic:()=>Basic,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),_woocommerce_components__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../packages/js/components/src/section/header.tsx"),_woocommerce_components__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../packages/js/components/src/section/section.tsx"),Basic=function Basic(){return(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div",null,(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_components__WEBPACK_IMPORTED_MODULE_1__.H,null,"Header using a contextual level (h3)"),(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_components__WEBPACK_IMPORTED_MODULE_2__.w,{component:"article"},(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p",null,"This is an article component wrapper."),(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_components__WEBPACK_IMPORTED_MODULE_1__.H,null,"Another header with contextual level (h4)"),(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_components__WEBPACK_IMPORTED_MODULE_2__.w,{component:!1},(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p",null,"There is no wrapper component here."),(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_components__WEBPACK_IMPORTED_MODULE_1__.H,null,"This is an h5"))))};const __WEBPACK_DEFAULT_EXPORT__={title:"WooCommerce Admin/components/Section",component:_woocommerce_components__WEBPACK_IMPORTED_MODULE_2__.w};Basic.parameters={...Basic.parameters,docs:{...Basic.parameters?.docs,source:{originalSource:'() =>
\n Header using a contextual level (h3)\n
\n

This is an article component wrapper.

\n Another header with contextual level (h4)\n
\n

There is no wrapper component here.

\n This is an h5\n
\n
\n
',...Basic.parameters?.docs?.source}}}}}]);