UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.95 kB
{"version":3,"file":"VarRow.mjs","names":["Flexbox"],"sources":["../../../src/color/CssVar/VarRow.tsx"],"sourcesContent":["import { Space, message } from 'antd';\nimport { cssVar } from 'antd-style';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { copyToClipboard } from '@/utils/copyToClipboard';\n\nimport { styles } from './style';\n\nexport interface IScaleRow {\n name: string;\n}\n\nconst ScaleRow = memo<IScaleRow>(({ name }) => {\n return (\n <Space size={2}>\n <div className={styles.scaleRowTitle} key={name}>\n <div className={styles.text}>cssVar</div>\n </div>\n {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((color) => {\n return (\n <div\n className={styles.scaleBox}\n key={color}\n onClick={async () => {\n const content = (cssVar as any)[`${name}${color}`] as any;\n\n await copyToClipboard(content);\n message.success(content);\n }}\n title={(cssVar as any)[`${name}${color}`] as any}\n >\n <Flexbox\n align={'center'}\n className={styles.scaleItem}\n horizontal\n justify={'center'}\n style={{ backgroundColor: (cssVar as any)[`${name}${color}`] as any }}\n />\n </div>\n );\n })}\n </Space>\n );\n});\n\nexport default ScaleRow;\n"],"mappings":";;;;;;;;;AAaA,MAAM,WAAW,MAAiB,EAAE,WAAW;AAC7C,QACE,qBAAC;EAAM,MAAM;aACX,oBAAC;GAAI,WAAW,OAAO;aACrB,oBAAC;IAAI,WAAW,OAAO;cAAM;KAAY;KADA,KAErC,EACL;GAAC;GAAG;GAAG;GAAG;GAAG;GAAG;GAAG;GAAG;GAAG;GAAG;GAAG,CAAC,KAAK,UAAU;AAC9C,UACE,oBAAC;IACC,WAAW,OAAO;IAElB,SAAS,YAAY;KACnB,MAAM,UAAW,OAAe,GAAG,OAAO;AAE1C,WAAM,gBAAgB,QAAQ;AAC9B,aAAQ,QAAQ,QAAQ;;IAE1B,OAAQ,OAAe,GAAG,OAAO;cAEjC,oBAACA;KACC,OAAO;KACP,WAAW,OAAO;KAClB;KACA,SAAS;KACT,OAAO,EAAE,iBAAkB,OAAe,GAAG,OAAO,UAAiB;MACrE;MAfG,MAgBD;IAER;GACI;EAEV;AAEF,qBAAe"}