@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 3.09 kB
Source Map (JSON)
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/base-ui/Badge/style.ts"],"sourcesContent":["import { createStaticStyles, cssVar, keyframes } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nconst pulse = keyframes`\n to {\n scale: 2.4;\n opacity: 0;\n }\n`;\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n pill: css`\n display: inline-block;\n\n box-sizing: border-box;\n min-width: 18px;\n height: 18px;\n padding-inline: 5px;\n border-radius: 999px;\n\n font-family: ${cssVar.fontFamilyCode};\n font-size: 11px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n line-height: 18px;\n color: ${cssVar.colorWhite};\n text-align: center;\n white-space: nowrap;\n\n background: ${cssVar.colorError};\n box-shadow: 0 0 0 1.5px ${cssVar.colorBgContainer};\n `,\n pillAbsolute: css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n translate: 50% -50%;\n `,\n pillDot: css`\n width: 8px;\n min-width: 0;\n height: 8px;\n padding: 0;\n\n box-shadow: none;\n `,\n pillSmall: css`\n min-width: 14px;\n height: 14px;\n font-size: 11px;\n line-height: 14px;\n `,\n statusDot: css`\n position: relative;\n\n flex-shrink: 0;\n\n width: 6px;\n height: 6px;\n border-radius: 50%;\n\n background: ${cssVar.colorTextQuaternary};\n `,\n statusDotProcessing: css`\n &::after {\n content: '';\n\n position: absolute;\n inset: -1px;\n\n border: 1px solid currentcolor;\n border-radius: 50%;\n\n animation: ${pulse} 1.2s ease-out infinite;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &::after {\n animation: none;\n }\n }\n `,\n statusRoot: css`\n display: inline-flex;\n gap: 8px;\n align-items: center;\n `,\n statusText: css`\n color: ${cssVar.colorText};\n `,\n wrapper: css`\n position: relative;\n display: inline-block;\n `,\n}));\n\nexport const statusColor: Record<string, string> = {\n default: cssVar.colorTextQuaternary,\n error: cssVar.colorError,\n processing: cssVar.colorInfo,\n success: cssVar.colorSuccess,\n warning: cssVar.colorWarning,\n};\n\nexport const pillSize = cva(styles.pill, {\n defaultVariants: {\n size: 'default',\n },\n variants: {\n size: {\n default: null,\n small: styles.pillSmall,\n },\n },\n});\n"],"mappings":";;;AAGA,MAAM,QAAQ,SAAS;;;;;;AAOvB,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,MAAM,GAAG;;;;;;;;;mBASQ,OAAO,eAAe;;;;;aAK5B,OAAO,WAAW;;;;kBAIb,OAAO,WAAW;8BACN,OAAO,iBAAiB;;CAEpD,cAAc,GAAG;;;;;;CAMjB,SAAS,GAAG;;;;;;;;CAQZ,WAAW,GAAG;;;;;;CAMd,WAAW,GAAG;;;;;;;;;kBASE,OAAO,oBAAoB;;CAE3C,qBAAqB,GAAG;;;;;;;;;;mBAUP,MAAM;;;;;;;;;CASvB,YAAY,GAAG;;;;;CAKf,YAAY,GAAG;aACJ,OAAO,UAAU;;CAE5B,SAAS,GAAG;;;;AAId,EAAE;AAEF,MAAa,cAAsC;CACjD,SAAS,OAAO;CAChB,OAAO,OAAO;CACd,YAAY,OAAO;CACnB,SAAS,OAAO;CAChB,SAAS,OAAO;AAClB;AAEA,MAAa,WAAW,IAAI,OAAO,MAAM;CACvC,iBAAiB,EACf,MAAM,UACR;CACA,UAAU,EACR,MAAM;EACJ,SAAS;EACT,OAAO,OAAO;CAChB,EACF;AACF,CAAC"}