-
Notifications
You must be signed in to change notification settings - Fork 0
/
Heading-Heading-stories.b7b0e42e.iframe.bundle.js
1 lines (1 loc) · 5.04 KB
/
Heading-Heading-stories.b7b0e42e.iframe.bundle.js
1
"use strict";(self.webpackChunk_backstage_canon=self.webpackChunk_backstage_canon||[]).push([[2],{"./src/components/Heading/Heading.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AllVariants:()=>AllVariants,CustomTag:()=>CustomTag,Default:()=>Default,Responsive:()=>Responsive,Title1:()=>Title1,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Heading_stories});var react=__webpack_require__("../../node_modules/react/index.js"),canon=__webpack_require__("./src/contexts/canon.tsx");const Heading=(0,react.forwardRef)(((props,ref)=>{const{children,variant="title1",as="h1",...restProps}=props,{getResponsiveValue}=(0,canon.T)(),responsiveVariant=getResponsiveValue(variant);let Component=as;return"title2"===variant&&(Component="h2"),"title3"===variant&&(Component="h3"),"title4"===variant&&(Component="h4"),"title5"===variant&&(Component="h5"),as&&(Component=as),react.createElement(Component,{ref,...restProps,className:"text "+(responsiveVariant?`text-${responsiveVariant}`:"")},children)}));Heading.displayName="Heading",Heading.__docgenInfo={description:"",methods:[],displayName:"Heading",props:{children:{required:!0,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},variant:{required:!1,tsType:{name:"union",raw:"| 'display'\n| 'title1'\n| 'title2'\n| 'title3'\n| 'title4'\n| 'title5'\n| Partial<\n Record<\n Breakpoint,\n 'display' | 'title1' | 'title2' | 'title3' | 'title4' | 'title5'\n >\n >",elements:[{name:"literal",value:"'display'"},{name:"literal",value:"'title1'"},{name:"literal",value:"'title2'"},{name:"literal",value:"'title3'"},{name:"literal",value:"'title4'"},{name:"literal",value:"'title5'"},{name:"Partial",elements:[{name:"Record",elements:[{name:"union",raw:"'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'",elements:[{name:"literal",value:"'xs'"},{name:"literal",value:"'sm'"},{name:"literal",value:"'md'"},{name:"literal",value:"'lg'"},{name:"literal",value:"'xl'"},{name:"literal",value:"'2xl'"}]},{name:"union",raw:"'display' | 'title1' | 'title2' | 'title3' | 'title4' | 'title5'",elements:[{name:"literal",value:"'display'"},{name:"literal",value:"'title1'"},{name:"literal",value:"'title2'"},{name:"literal",value:"'title3'"},{name:"literal",value:"'title4'"},{name:"literal",value:"'title5'"}]}],raw:"Record<\n Breakpoint,\n 'display' | 'title1' | 'title2' | 'title3' | 'title4' | 'title5'\n>"}],raw:"Partial<\n Record<\n Breakpoint,\n 'display' | 'title1' | 'title2' | 'title3' | 'title4' | 'title5'\n >\n>"}]},description:""},as:{required:!1,tsType:{name:"union",raw:"'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",elements:[{name:"literal",value:"'h1'"},{name:"literal",value:"'h2'"},{name:"literal",value:"'h3'"},{name:"literal",value:"'h4'"},{name:"literal",value:"'h5'"},{name:"literal",value:"'h6'"}]},description:""}}};var Stack=__webpack_require__("./src/components/Stack/Stack.tsx");const Heading_stories={title:"Components/Heading",component:Heading},Default={args:{children:"Heading"}},Title1={args:{children:"Look mum, no hands!",variant:"title1"}},AllVariants={args:{children:"Heading"},render:()=>react.createElement(Stack.B,{gap:"md"},react.createElement(Heading,{variant:"display"},"Display"),react.createElement(Heading,{variant:"title1"},"Title 1"),react.createElement(Heading,{variant:"title2"},"Title 2"),react.createElement(Heading,{variant:"title3"},"Title 3"),react.createElement(Heading,{variant:"title4"},"Title 4"))},Responsive={args:{...Default.args,variant:{xs:"title4",md:"display"}}},CustomTag={args:{...Default.args,variant:"title5",as:"h2"}},__namedExportsOrder=["Default","Title1","AllVariants","Responsive","CustomTag"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"{\n args: {\n children: 'Heading'\n }\n}",...Default.parameters?.docs?.source}}},Title1.parameters={...Title1.parameters,docs:{...Title1.parameters?.docs,source:{originalSource:"{\n args: {\n children: 'Look mum, no hands!',\n variant: 'title1'\n }\n}",...Title1.parameters?.docs?.source}}},AllVariants.parameters={...AllVariants.parameters,docs:{...AllVariants.parameters?.docs,source:{originalSource:'{\n args: {\n children: \'Heading\'\n },\n render: () => <Stack gap="md">\n <Heading variant="display">Display</Heading>\n <Heading variant="title1">Title 1</Heading>\n <Heading variant="title2">Title 2</Heading>\n <Heading variant="title3">Title 3</Heading>\n <Heading variant="title4">Title 4</Heading>\n </Stack>\n}',...AllVariants.parameters?.docs?.source}}},Responsive.parameters={...Responsive.parameters,docs:{...Responsive.parameters?.docs,source:{originalSource:"{\n args: {\n ...Default.args,\n variant: {\n xs: 'title4',\n md: 'display'\n }\n }\n}",...Responsive.parameters?.docs?.source}}},CustomTag.parameters={...CustomTag.parameters,docs:{...CustomTag.parameters?.docs,source:{originalSource:"{\n args: {\n ...Default.args,\n variant: 'title5',\n as: 'h2'\n }\n}",...CustomTag.parameters?.docs?.source}}}}}]);