/
kaws
/
ui-kit-ce
Обзор
Документация
Войти
/
kaws
/
ui-kit-ce
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/theme/src/comp/notification.ts
171 строка
7 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 createNotification = ( theme: Theme, compatibilityMode?: boolean ) => ({ /** @deprecated Используйте токены `titleColorText` и `contentColorText`. */ colorText: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, 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, contentColorTextError: '', contentColorTextWarning: '', contentColorTextSuccess: '', contentColorTextNeutral: '', contentColorTextInfo: '', widthBorder: compatibilityMode ? theme.shape.borderWidth : theme.sys.shape.borderWidthBase, colorBorderError: 'transparent', colorBorderWarning: 'transparent', colorBorderSuccess: 'transparent', colorBorderInfo: 'transparent', colorBorderNeutral: 'transparent', colorBackground: compatibilityMode ? theme.colourway.background01 : theme.sys.color.backgroundAlpha, elevationShadow: compatibilityMode ? theme.colourway.shadow01 : theme.sys.elevation.md, 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, /** @deprecated Используйте `comp.closeButton.colorText`. */ closeButtonColorText: compatibilityMode ? theme.colourway.onBackgroundHigh : theme.sys.color.onBackgroundHigh, /** @deprecated Используйте `comp.closeButton.colorTextHover`. */ closeButtonColorTextHover: compatibilityMode ? theme.colourway.onBackgroundMedium : theme.sys.color.onBackgroundMedium, /** @deprecated Используйте `comp.closeButton.colorTextActive`. */ closeButtonColorTextActive: compatibilityMode ? theme.colourway.onBackgroundLow : theme.sys.color.onBackgroundLow, /** @deprecated Используйте `comp.closeButton.colorBackgroundHover`. */ closeButtonColorBackgroundHover: compatibilityMode ? theme.colourway.mono02 : theme.sys.color.onBackgroundOverlayHover, /** @deprecated Используйте `comp.closeButton.colorBackgroundActive`. */ closeButtonColorBackgroundActive: compatibilityMode ? theme.colourway.mono04 : theme.sys.color.onBackgroundOverlayActive, /** @deprecated Используйте `comp.closeButton.colorShadowFocus`. */ closeButtonColorShadowFocus: compatibilityMode ? theme.colourway.focus : theme.sys.color.focus, 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, // Content typography tokens 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, next_contentTypographyFontFamily: compatibilityMode ? theme.typography.fontFamily.text : theme.sys.typography.bodyMd.fontFamily, next_contentTypographyFontWeight: compatibilityMode ? theme.typography.fontWeight.regular : theme.sys.typography.bodyMd.fontWeight, next_contentTypographyFontSize: compatibilityMode ? theme.typography.fontSize.body2 : theme.sys.typography.bodyMd.fontSize, next_contentTypographyLineHeight: compatibilityMode ? theme.typography.lineHeight.body2 : theme.sys.typography.bodyMd.lineHeight, next_contentTypographyLetterSpacing: compatibilityMode ? theme.typography.letterSpacing.body2 : theme.sys.typography.bodyMd.letterSpacing, /** @deprecated Рекомендуется использовать `next_contentTypographyFontFamily`. */ contentTypographyFontFamily: compatibilityMode ? theme.typography.fontFamily.text : theme.sys.typography.bodyMd.fontFamily, /** @deprecated Рекомендуется использовать `next_contentTypographyFontWeight`. */ contentTypographyFontWeight: compatibilityMode ? theme.typography.fontWeight.semibold : theme.ref.typography.fontWeight.semiBold, /** @deprecated Рекомендуется использовать `next_contentTypographyFontSize`. */ contentTypographyFontSize: compatibilityMode ? theme.typography.fontSize.body2 : theme.sys.typography.bodyMd.fontSize, /** @deprecated Рекомендуется использовать `next_contentTypographyLineHeight`. */ contentTypographyLineHeight: compatibilityMode ? theme.typography.lineHeight.body2 : theme.sys.typography.bodyMd.lineHeight, /** @deprecated Рекомендуется использовать `next_contentTypographyLetterSpacing`. */ contentTypographyLetterSpacing: compatibilityMode ? theme.typography.letterSpacing.body2 : theme.sys.typography.bodyMd.letterSpacing, })