From a249087aed9832d18945f39dde856cdf9dce938e Mon Sep 17 00:00:00 2001 From: Maxim Kolesnikov <44449561+N1MBER@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:18:12 +0300 Subject: [PATCH] chore(utils): added status classNames (#87) closes consta-design-system/uikit#2658 --- src/utils/bem.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/bem.ts b/src/utils/bem.ts index 16e3dcb..b081b80 100644 --- a/src/utils/bem.ts +++ b/src/utils/bem.ts @@ -1,3 +1,12 @@ import { withNaming } from '@bem-react/classname'; -export const cn = withNaming({ n: 'cw--', e: '-', m: '_' }); +const reactBemNaming = { n: 'cw--', e: '-', m: '_', v: '_' }; + +export const cn = withNaming(reactBemNaming); + +export const withPrefix = (prefix: string) => + withNaming({ ...reactBemNaming, n: prefix + reactBemNaming.n }); + +export const cnCanary = withPrefix('canary'); + +export const cnDeprecated = withPrefix('deprecated');