UNPKG

@lobehub/ui

Version:

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

1 lines 10.4 kB
{"version":3,"file":"style.mjs","names":["cssVar","lobeStaticStylish"],"sources":["../../src/Alert/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nconst prefixCls = 'ant';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n return {\n banner: css`\n border: none !important;\n border-radius: 0 !important;\n `,\n borderless: css`\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n `,\n borderlessExtraHeaderNoTitle: css`\n margin-block-start: 8px;\n padding-inline: 0;\n `,\n borderlessExtraHeaderWithTitle: css`\n margin-block-start: 16px;\n padding-inline: 0;\n `,\n colorfulText: css`\n .${prefixCls}-alert-message,.${prefixCls}-alert-description {\n color: inherit;\n }\n `,\n expandText: css`\n padding-inline-end: 12px;\n\n &:hover {\n cursor: pointer;\n }\n `,\n extra: css`\n position: relative;\n\n overflow: hidden;\n\n max-width: 100%;\n border: 1px solid;\n border-block-start: none;\n border-end-start-radius: ${cssVar.borderRadiusLG};\n border-end-end-radius: ${cssVar.borderRadiusLG};\n `,\n extraHeader: css`\n border-block-start: 1px dashed;\n border-radius: 0;\n background: transparent !important;\n `,\n filled: css``,\n glass: lobeStaticStylish.blur,\n hasExtra: css`\n border-block-end: none;\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n `,\n outlined: css`\n background: transparent !important;\n `,\n // Root variants based on closable, hasTitle, showIcon combinations\n rootBase: css`\n position: relative;\n\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n max-width: 100%;\n\n .${prefixCls}-alert-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n .${prefixCls}-alert-close-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n `,\n rootNoTitleNoIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleNoIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootWithTitleNoIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleNoIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n };\n});\n\nexport const extraVariants = cva(styles.extra, {\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 banner: {\n false: null,\n true: styles.banner,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n});\n\nexport const rootVariants = cva(styles.rootBase, {\n compoundVariants: [\n {\n class: styles.rootNoTitleNoIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleNoIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleWithIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootNoTitleWithIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleNoIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleNoIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleWithIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleWithIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: true,\n },\n ],\n defaultVariants: {\n closable: false,\n colorfulText: true,\n glass: false,\n hasTitle: false,\n showIcon: false,\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n closable: {\n false: null,\n true: null,\n },\n colorfulText: {\n false: null,\n true: styles.colorfulText,\n },\n glass: {\n false: null,\n true: styles.glass,\n },\n hasTitle: {\n false: null,\n true: null,\n },\n showIcon: {\n false: null,\n true: null,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n },\n hasExtra: {\n false: null,\n true: styles.hasExtra,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n});\n\nexport const extraHeaderVariants = cva(styles.extraHeader, {\n compoundVariants: [\n {\n class: styles.borderlessExtraHeaderNoTitle,\n hasTitle: false,\n variant: 'borderless',\n },\n {\n class: styles.borderlessExtraHeaderWithTitle,\n hasTitle: true,\n variant: 'borderless',\n },\n ],\n defaultVariants: {\n hasTitle: false,\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n hasTitle: {\n false: null,\n true: null,\n },\n variant: {\n borderless: null,\n filled: null,\n outlined: null,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n});\n"],"mappings":";;;;;AAKA,MAAM,YAAY;AAElB,MAAa,SAAS,oBAAoB,EAAE,YAAK,uBAAa;AAC5D,QAAO;EACL,QAAQ,KAAG;;;;EAIX,YAAY,KAAG;;;;;EAKf,8BAA8B,KAAG;;;;EAIjC,gCAAgC,KAAG;;;;EAInC,cAAc,KAAG;SACZ,UAAU,kBAAkB,UAAU;;;;EAI3C,YAAY,KAAG;;;;;;;EAOf,OAAO,KAAG;;;;;;;;iCAQmBA,SAAO,eAAe;+BACxBA,SAAO,eAAe;;EAEjD,aAAa,KAAG;;;;;EAKhB,QAAQ,KAAG;EACX,OAAOC,cAAkB;EACzB,UAAU,KAAG;;;;;EAKb,UAAU,KAAG;;;EAIb,UAAU,KAAG;;;;;;;;;SASR,UAAU;;;;;;SAMV,UAAU;;;;;;;EAOf,6BAA6B,KAAG;;;;;SAK3B,UAAU;;;;;;;EAOf,+BAA+B,KAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,+BAA+B,KAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,iCAAiC,KAAG;;;;;SAK/B,UAAU;;;;;;;EAOf,+BAA+B,KAAG;;;;;SAK7B,UAAU;;;;;;SAMV,UAAU;;;;;;EAMf,iCAAiC,KAAG;;;;;SAK/B,UAAU;;;;;;SAMV,UAAU;;;;;;EAMf,iCAAiC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,UAAU;GACR,OAAO;GACP,MAAM,OAAO;GACd;EACF;CAEF,CAAC;AAEF,MAAa,sBAAsB,IAAI,OAAO,aAAa;CACzD,kBAAkB,CAChB;EACE,OAAO,OAAO;EACd,UAAU;EACV,SAAS;EACV,EACD;EACE,OAAO,OAAO;EACd,UAAU;EACV,SAAS;EACV,CACF;CACD,iBAAiB;EACf,UAAU;EACV,SAAS;EACV;CAED,UAAU;EACR,UAAU;GACR,OAAO;GACP,MAAM;GACP;EACD,SAAS;GACP,YAAY;GACZ,QAAQ;GACR,UAAU;GACX;EACF;CAEF,CAAC"}