UNPKG

@lobehub/ui

Version:

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

1 lines 4.91 kB
{"version":3,"file":"style.mjs","names":["cssVar","lobeStaticStylish"],"sources":["../../src/CodeDiff/style.ts"],"sourcesContent":["import { createStaticStyles, cx } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nexport const prefix = 'lobe-code-diff';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n return {\n actions: css`\n position: absolute;\n z-index: 2;\n inset-block-start: 8px;\n inset-inline-end: 8px;\n\n opacity: 0;\n transition: opacity 0.2s ${cssVar.motionEaseInOut};\n `,\n additions: css`\n color: ${cssVar.colorSuccess};\n font-family: ${cssVar.fontFamilyCode};\n font-size: 12px;\n `,\n body: css`\n overflow: auto;\n\n width: 100%;\n\n font-family: ${cssVar.fontFamilyCode};\n font-size: 13px;\n line-height: 1.6;\n\n /* Override @pierre/diffs shadow DOM CSS variables */\n --pdiff-font-family: ${cssVar.fontFamilyCode};\n --pdiff-font-size: 13px;\n --pdiff-line-height: 1.6;\n --pdiff-bg-color: transparent;\n --pdiff-border-color: ${cssVar.colorBorderSecondary};\n --pdiff-gutter-bg: ${cssVar.colorFillQuaternary};\n --pdiff-gutter-color: ${cssVar.colorTextQuaternary};\n --pdiff-added-bg: ${cssVar.colorSuccessBgHover};\n --pdiff-added-highlight-bg: ${cssVar.colorSuccessBg};\n --pdiff-removed-bg: ${cssVar.colorErrorBgHover};\n --pdiff-removed-highlight-bg: ${cssVar.colorErrorBg};\n --pdiff-info-bg: ${cssVar.colorInfoBg};\n `,\n borderless: lobeStaticStylish.variantBorderlessWithoutHover,\n deletions: css`\n color: ${cssVar.colorError};\n font-family: ${cssVar.fontFamilyCode};\n font-size: 12px;\n `,\n filled: cx(\n lobeStaticStylish.variantFilledWithoutHover,\n css`\n background: ${cssVar.colorFillQuaternary};\n `,\n ),\n header: css`\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: space-between;\n\n padding: 8px 12px;\n\n font-family: ${cssVar.fontFamilyCode};\n font-size: 13px;\n color: ${cssVar.colorTextSecondary};\n\n border-block-end: 1px solid ${cssVar.colorBorderSecondary};\n `,\n headerBorderless: css`\n padding-inline: 0;\n border-block-end: none;\n `,\n headerFilled: css`\n background: transparent;\n `,\n headerOutlined: css`\n background: ${cssVar.colorFillQuaternary};\n `,\n outlined: lobeStaticStylish.variantOutlinedWithoutHover,\n root: cx(\n prefix,\n css`\n position: relative;\n\n overflow: hidden;\n\n width: 100%;\n border-radius: ${cssVar.borderRadius};\n\n transition: background-color 100ms ${cssVar.motionEaseOut};\n\n &:hover {\n .${prefix}-actions {\n opacity: 1;\n }\n }\n `,\n ),\n stats: css`\n display: flex;\n gap: 8px;\n align-items: center;\n `,\n };\n});\n\nexport const variants = cva(styles.root, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n});\n\nexport const headerVariants = cva(styles.header, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.headerFilled,\n outlined: styles.headerOutlined,\n borderless: styles.headerBorderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n});\n"],"mappings":";;;;;AAKA,MAAa,SAAS;AAEtB,MAAa,SAAS,oBAAoB,EAAE,YAAK,uBAAa;AAC5D,QAAO;EACL,SAAS,KAAG;;;;;;;iCAOiBA,SAAO,gBAAgB;;EAEpD,WAAW,KAAG;eACHA,SAAO,aAAa;qBACdA,SAAO,eAAe;;;EAGvC,MAAM,KAAG;;;;;qBAKQA,SAAO,eAAe;;;;;6BAKdA,SAAO,eAAe;;;;8BAIrBA,SAAO,qBAAqB;2BAC/BA,SAAO,oBAAoB;8BACxBA,SAAO,oBAAoB;0BAC/B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