@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 1.67 kB
Source Map (JSON)
{"version":3,"file":"SpotlightCardItem.mjs","names":["Flexbox"],"sources":["../../../src/awesome/SpotlightCard/SpotlightCardItem.tsx"],"sourcesContent":["'use client';\n\nimport { cx, useThemeMode } from 'antd-style';\nimport { memo, useMemo } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport { styles } from './style';\nimport type { SpotlightCardItemProps } from './type';\n\nconst SpotlightCardItem = memo<SpotlightCardItemProps>(\n ({ children, className, style, borderRadius, size, ...rest }) => {\n const { isDarkMode } = useThemeMode();\n\n const cssVariables = useMemo<Record<string, string>>(\n () => ({\n '--spotlight-card-border-radius': `${borderRadius}px`,\n '--spotlight-card-size': `${size}px`,\n }),\n [borderRadius, size],\n );\n\n return (\n <Flexbox\n className={cx(isDarkMode ? styles.itemContainerDark : styles.itemContainerLight, className)}\n style={{\n ...cssVariables,\n borderRadius,\n ...style,\n }}\n {...rest}\n >\n <Flexbox className={styles.content}>{children}</Flexbox>\n </Flexbox>\n );\n },\n);\n\nSpotlightCardItem.displayName = 'SpotlightCardItem';\n\nexport default SpotlightCardItem;\n"],"mappings":";;;;;;;;;AAUA,MAAM,oBAAoB,MACvB,EAAE,UAAU,WAAW,OAAO,cAAc,MAAM,GAAG,WAAW;CAC/D,MAAM,EAAE,eAAe,cAAc;CAErC,MAAM,eAAe,eACZ;EACL,kCAAkC,GAAG,aAAa;EAClD,yBAAyB,GAAG,KAAK;EAClC,GACD,CAAC,cAAc,KAAK,CACrB;AAED,QACE,oBAACA;EACC,WAAW,GAAG,aAAa,OAAO,oBAAoB,OAAO,oBAAoB,UAAU;EAC3F,OAAO;GACL,GAAG;GACH;GACA,GAAG;GACJ;EACD,GAAI;YAEJ,oBAACA;GAAQ,WAAW,OAAO;GAAU;IAAmB;GAChD;EAGf;AAED,kBAAkB,cAAc;AAEhC,gCAAe"}