/
kaws
/
ui-kit-ce
Обзор
Документация
Войти
/
kaws
/
ui-kit-ce
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/theme/src/comp/inlineNotification.ts
155 строк
5 KB
Denis Svyatovets
feat: добавлены токены толщины обводки
02 июл 2025, 10:08
02 июл 2025, 10:08
f23965f
Код
Авторство
О чём код?
import { Theme } from '../interface' // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const createInlineNotification = ( theme: Theme, compatibilityMode?: boolean ) => ({ //#region shared widthBorder: compatibilityMode ? theme.shape.borderWidth : theme.sys.shape.borderWidthBase, shapeBorderRadiusTopLeft: compatibilityMode ? 8 : theme.sys.shape.borderRadiusXl, shapeBorderRadiusTopRight: compatibilityMode ? 8 : theme.sys.shape.borderRadiusXl, shapeBorderRadiusBottomLeft: compatibilityMode ? 8 : theme.sys.shape.borderRadiusXl, shapeBorderRadiusBottomRight: compatibilityMode ? 8 : theme.sys.shape.borderRadiusXl, indicatorColorBackgroundNeutral: compatibilityMode ? theme.colourway.support : theme.sys.color.neutralAlpha, indicatorColorBackgroundSuccess: compatibilityMode ? theme.colourway.success : theme.sys.color.successAlpha, indicatorColorBackgroundInfo: compatibilityMode ? theme.colourway.info : theme.sys.color.infoAlpha, indicatorColorBackgroundWarning: compatibilityMode ? theme.colourway.warning : theme.sys.color.warningAlpha, indicatorColorBackgroundError: compatibilityMode ? theme.colourway.error : theme.sys.color.errorAlpha, iconColorTextNeutral: compatibilityMode ? theme.colourway.support : theme.sys.color.neutralAlpha, iconColorTextSuccess: compatibilityMode ? theme.colourway.success : theme.sys.color.successAlpha, iconColorTextInfo: compatibilityMode ? theme.colourway.info : theme.sys.color.infoAlpha, iconColorTextWarning: compatibilityMode ? theme.colourway.warning : theme.sys.color.warningAlpha, iconColorTextError: compatibilityMode ? theme.colourway.error : theme.sys.color.errorAlpha, titleColorTextError: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, titleColorTextWarning: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, titleColorTextSuccess: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, titleColorTextNeutral: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, titleColorTextInfo: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, titleTypographyFontFamily: compatibilityMode ? theme.typography.fontFamily.text : theme.sys.typography.bodyMd.fontFamily, titleTypographyFontWeight: compatibilityMode ? theme.typography.fontWeight.semibold : theme.ref.typography.fontWeight.semiBold, titleTypographyFontSize: compatibilityMode ? theme.typography.fontSize.body2 : theme.sys.typography.bodyMd.fontSize, titleTypographyLineHeight: compatibilityMode ? theme.typography.lineHeight.body2 : theme.sys.typography.bodyMd.lineHeight, titleTypographyLetterSpacing: compatibilityMode ? theme.typography.letterSpacing.body2 : theme.sys.typography.bodyMd.letterSpacing, contentColorTextError: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, contentColorTextWarning: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, contentColorTextSuccess: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, contentColorTextNeutral: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, contentColorTextInfo: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, contentTypographyFontFamily: compatibilityMode ? theme.typography.fontFamily.text : theme.sys.typography.bodyMd.fontFamily, contentTypographyFontWeight: compatibilityMode ? theme.typography.fontWeight.regular : theme.sys.typography.bodyMd.fontWeight, contentTypographyFontSize: compatibilityMode ? theme.typography.fontSize.body2 : theme.sys.typography.bodyMd.fontSize, contentTypographyLineHeight: compatibilityMode ? theme.typography.lineHeight.body2 : theme.sys.typography.bodyMd.lineHeight, contentTypographyLetterSpacing: compatibilityMode ? theme.typography.letterSpacing.body2 : theme.sys.typography.bodyMd.letterSpacing, //#endregion shared //#region outlined colorBackgroundOutlined: 'transparent', colorBorderOutlinedError: compatibilityMode ? theme.colourway.error : theme.sys.color.errorAlpha, colorBorderOutlinedWarning: compatibilityMode ? theme.colourway.warning : theme.sys.color.warningAlpha, colorBorderOutlinedSuccess: compatibilityMode ? theme.colourway.success : theme.sys.color.successAlpha, colorBorderOutlinedInfo: compatibilityMode ? theme.colourway.info : theme.sys.color.infoAlpha, colorBorderOutlinedNeutral: compatibilityMode ? theme.colourway.mono05 : theme.sys.color.neutralAlpha, //#endregion outlined //#region filled colorBackgroundFilledError: '#FDDFDD', colorBackgroundFilledWarning: '#FEF2C0', colorBackgroundFilledSuccess: '#DCFAE2', colorBackgroundFilledInfo: '#E8F5FE', colorBackgroundFilledNeutral: '#F3F3F3', colorBorderFilledError: 'transparent', colorBorderFilledWarning: 'transparent', colorBorderFilledSuccess: 'transparent', colorBorderFilledInfo: 'transparent', colorBorderFilledNeutral: 'transparent', elevationShadowFilled: '', //#endregion filled })