@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 2.05 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["Flexbox"],"sources":["../../../src/storybook/StoryBook/index.tsx"],"sourcesContent":["'use client';\n\nimport { cx, useResponsive } from 'antd-style';\nimport { LevaPanel } from 'leva';\nimport { memo, type Ref } from 'react';\n\nimport DraggablePanel from '@/DraggablePanel';\nimport { Center, Flexbox, type FlexboxProps } from '@/Flex';\n\nimport { styles } from './style';\n\nexport interface StoryBookProps extends FlexboxProps {\n levaStore: any;\n noPadding?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StoryBook = memo<StoryBookProps>(\n ({ ref, levaStore, noPadding, className, children, ...rest }) => {\n const { mobile } = useResponsive();\n\n return (\n <Flexbox\n align={'stretch'}\n className={cx(styles.editor, className)}\n horizontal={!mobile}\n justify={'stretch'}\n ref={ref}\n >\n <Center className={cx(noPadding ? styles.left : styles.leftWithPadding)} flex={1} {...rest}>\n {children}\n </Center>\n <DraggablePanel\n className={styles.right}\n minWidth={280}\n placement={mobile ? 'bottom' : 'right'}\n >\n <div className={styles.leva}>\n <LevaPanel fill flat store={levaStore} titleBar={false} />{' '}\n </div>\n </DraggablePanel>\n </Flexbox>\n );\n },\n);\n\nStoryBook.displayName = 'StoryBook';\n\nexport default StoryBook;\n\nexport { useControls, useCreateStore } from 'leva';\n"],"mappings":";;;;;;;;;;AAiBA,MAAa,YAAY,MACtB,EAAE,KAAK,WAAW,WAAW,WAAW,UAAU,GAAG,WAAW;CAC/D,MAAM,EAAE,WAAW,eAAe;AAElC,QACE,qBAACA,mBAAD;EACE,OAAO;EACP,WAAW,GAAG,OAAO,QAAQ,UAAU;EACvC,YAAY,CAAC;EACb,SAAS;EACJ;YALP,CAOE,oBAAC,QAAD;GAAQ,WAAW,GAAG,YAAY,OAAO,OAAO,OAAO,gBAAgB;GAAE,MAAM;GAAG,GAAI;GACnF;GACM,CAAA,EACT,oBAAC,gBAAD;GACE,WAAW,OAAO;GAClB,UAAU;GACV,WAAW,SAAS,WAAW;aAE/B,qBAAC,OAAD;IAAK,WAAW,OAAO;cAAvB,CACE,oBAAC,WAAD;KAAW,MAAA;KAAK,MAAA;KAAK,OAAO;KAAW,UAAU;KAAS,CAAA,EAAC,IACvD;;GACS,CAAA,CACT;;EAGf;AAED,UAAU,cAAc"}