-
Notifications
You must be signed in to change notification settings - Fork 0
/
stories-BCAccordion-stories.84c5b0e6.iframe.bundle.js
1 lines (1 loc) · 7.58 KB
/
stories-BCAccordion-stories.84c5b0e6.iframe.bundle.js
1
"use strict";(self.webpackChunkbuildcorp_uikits=self.webpackChunkbuildcorp_uikits||[]).push([[928],{"./src/stories/BCAccordion.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,MultipleOpen:()=>MultipleOpen,__namedExportsOrder:()=>__namedExportsOrder,default:()=>BCAccordion_stories});var react=__webpack_require__("./node_modules/react/index.js"),Icon=__webpack_require__("./node_modules/@fluentui/react/lib/components/Icon/Icon.js"),Text=__webpack_require__("./node_modules/@fluentui/react/lib/components/Text/Text.js"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),BCAccordion=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./src/components/Accordion/BCAccordion.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(BCAccordion.A,options);BCAccordion.A&&BCAccordion.A.locals&&BCAccordion.A.locals;const BCAccordion_BCAccordion=({data,multiOpen=!1})=>{const[activeIndex,setActiveIndex]=(0,react.useState)([]);return react.createElement("div",{className:"accodison-container"},data.map(((item,index)=>react.createElement("div",null,react.createElement("div",{onClick:()=>(index=>{multiOpen?activeIndex.includes(index)?setActiveIndex(activeIndex.filter((i=>i!==index))):setActiveIndex([...activeIndex,index]):setActiveIndex(activeIndex[0]===index?[]:[index])})(index),className:"accodison-item"},react.createElement("div",{className:"accodison-item-title"},item.icon&&react.createElement(Icon.I,{iconName:item.icon,styles:{root:{marginRight:10,fontSize:14}}}),react.createElement("div",null,item.title)),react.createElement(Icon.I,{iconName:"ChevronLeftMed",className:activeIndex.includes(index)?"rotated-open":"rotated-close"})),activeIndex.includes(index)&&item.children&&react.createElement("div",{className:"accdison-children"},react.createElement(Text.E,null,item.children))))))},components_Accordion_BCAccordion=BCAccordion_BCAccordion;BCAccordion_BCAccordion.__docgenInfo={description:"",methods:[],displayName:"BCAccordion",props:{data:{required:!0,tsType:{name:"Array",elements:[{name:"AccordionProps"}],raw:"AccordionProps[]"},description:""},multiOpen:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};const BCAccordion_stories={title:"Components/BCAccordion",component:components_Accordion_BCAccordion,argTypes:{multiOpen:{control:"boolean"}}},sampleData=[{title:"Accordion 1",children:"Content for Accordion 1",icon:"Mail"},{title:"Accordion 2",children:"Content for Accordion 2",icon:"Calendar"},{title:"Accordion 3",children:"Content for Accordion 3",icon:"People"}],Template=args=>react.createElement(components_Accordion_BCAccordion,args),Default=Template.bind({});Default.args={data:sampleData,multiOpen:!1};const MultipleOpen=Template.bind({});MultipleOpen.args={data:sampleData,multiOpen:!0};const __namedExportsOrder=["Default","MultipleOpen"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"(args: IAccordionProps) => <BCAccordion {...args} />",...Default.parameters?.docs?.source}}},MultipleOpen.parameters={...MultipleOpen.parameters,docs:{...MultipleOpen.parameters?.docs,source:{originalSource:"(args: IAccordionProps) => <BCAccordion {...args} />",...MultipleOpen.parameters?.docs?.source}}}},"./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./src/components/Accordion/BCAccordion.css":(module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/css-loader/dist/runtime/sourceMaps.js"),_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js"),___CSS_LOADER_EXPORT___=__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());___CSS_LOADER_EXPORT___.push([module.id,".accodison-container{\n border-right: 1px solid #357C29;\n border-left: 1px solid #357C29;\n border-bottom: 1px solid #357C29;\n}\n\n.accodison-item{\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n background-color: #F5F5F5;\n padding: 6px 8px;\n border-top: 1px solid #357C29;\n font-size: 14px;\n font-weight: 600;\n}\n\n.accodison-item-title{\n display: flex;\n align-items: center;\n}\n\n.accdison-children{\n padding: 6px 8px;\n border-top: 1px solid #357C29;\n}\n\n.rotated-open {\n transform: rotate(-90deg);\n transition: transform 0.2s ease;\n}\n\n.rotated-close {\n transform: rotate(0deg);\n transition: transform 0.2s ease;\n}","",{version:3,sources:["webpack://./src/components/Accordion/BCAccordion.css"],names:[],mappings:"AAAA;IACI,+BAA+B;IAC/B,8BAA8B;IAC9B,gCAAgC;AACpC;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,8BAA8B;IAC9B,eAAe;IACf,yBAAyB;IACzB,gBAAgB;IAChB,6BAA6B;IAC7B,eAAe;IACf,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;IAChB,6BAA6B;AACjC;;AAEA;IACI,yBAAyB;IACzB,+BAA+B;AACnC;;AAEA;IACI,uBAAuB;IACvB,+BAA+B;AACnC",sourcesContent:[".accodison-container{\r\n border-right: 1px solid #357C29;\r\n border-left: 1px solid #357C29;\r\n border-bottom: 1px solid #357C29;\r\n}\r\n\r\n.accodison-item{\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n cursor: pointer;\r\n background-color: #F5F5F5;\r\n padding: 6px 8px;\r\n border-top: 1px solid #357C29;\r\n font-size: 14px;\r\n font-weight: 600;\r\n}\r\n\r\n.accodison-item-title{\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.accdison-children{\r\n padding: 6px 8px;\r\n border-top: 1px solid #357C29;\r\n}\r\n\r\n.rotated-open {\r\n transform: rotate(-90deg);\r\n transition: transform 0.2s ease;\r\n}\r\n\r\n.rotated-close {\r\n transform: rotate(0deg);\r\n transition: transform 0.2s ease;\r\n}"],sourceRoot:""}]);const __WEBPACK_DEFAULT_EXPORT__=___CSS_LOADER_EXPORT___}}]);