@snack-uikit/card 0.20.23 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 0.21.0 (2026-07-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * **FF-8766:** add color prop on promoBage card ([978b93f](https://github.com/cloud-ru-tech/snack-uikit/commit/978b93fb5d7e660fc6de9dc3a8e3fb62eda1608e))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.20.23 (2026-07-03)
7
18
 
8
19
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -66,7 +66,7 @@ function Example() {
66
66
  | multipleSelection | `boolean` | - | Отображение галочки для режима массового выделения карточек |
67
67
  | onClick | `(e: MouseEvent<HTMLDivElement \| HTMLAnchorElement, MouseEvent>) => void` | - | Колбек на клик по карточке |
68
68
  | size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
69
- | promoBadge | `string \| Pick<PromoTagProps, "text" \| "appearance">` | - | PromoBadge |
69
+ | promoBadge | `string \| Pick<PromoTagProps, "text" \| "appearance" \| "color">` | - | PromoBadge |
70
70
  | children | `ReactNode` | - | Вложенный контент |
71
71
  | header | `ReactElement<HeaderProps, string \| JSXElementConstructor<any>>` | - | Вложенный Header |
72
72
  | footer | `ReactNode` | - | Вложенный Footer |
@@ -19,7 +19,7 @@ export type CardProps = WithSupportProps<{
19
19
  /** Размер */
20
20
  size?: Size;
21
21
  /** PromoBadge */
22
- promoBadge?: Pick<PromoTagProps, 'text' | 'appearance'> | string;
22
+ promoBadge?: Pick<PromoTagProps, 'text' | 'appearance' | 'color'> | string;
23
23
  /** Вложенный контент */
24
24
  children?: ReactNode;
25
25
  /** Вложенный Header */
@@ -57,7 +57,7 @@ export declare const Card: import("react").ForwardRefExoticComponent<{
57
57
  /** Размер */
58
58
  size?: Size;
59
59
  /** PromoBadge */
60
- promoBadge?: Pick<PromoTagProps, "text" | "appearance"> | string;
60
+ promoBadge?: Pick<PromoTagProps, "text" | "appearance" | "color"> | string;
61
61
  /** Вложенный контент */
62
62
  children?: ReactNode;
63
63
  /** Вложенный Header */
@@ -1,3 +1,3 @@
1
1
  import { PromoTagProps } from '@snack-uikit/promo-tag';
2
- export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance'>;
3
- export declare function PromoBadge({ text, appearance }: PromoBadgeProps): import("react/jsx-runtime").JSX.Element;
2
+ export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance' | 'color'>;
3
+ export declare function PromoBadge({ text, appearance, color }: PromoBadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -16,12 +16,15 @@ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
16
16
  function PromoBadge(_ref) {
17
17
  let text = _ref.text,
18
18
  _ref$appearance = _ref.appearance,
19
- appearance = _ref$appearance === void 0 ? 'primary' : _ref$appearance;
19
+ appearance = _ref$appearance === void 0 ? 'primary' : _ref$appearance,
20
+ _ref$color = _ref.color,
21
+ color = _ref$color === void 0 ? 'accent' : _ref$color;
20
22
  return (0, jsx_runtime_1.jsx)("div", {
21
23
  className: styles_module_scss_1.default.promoBadge,
22
24
  children: (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, {
23
25
  appearance: appearance,
24
26
  text: text,
27
+ color: color,
25
28
  "data-test-id": constants_1.TEST_IDS.promoBadge,
26
29
  className: styles_module_scss_1.default.promoTag
27
30
  })
@@ -19,7 +19,7 @@ export type CardProps = WithSupportProps<{
19
19
  /** Размер */
20
20
  size?: Size;
21
21
  /** PromoBadge */
22
- promoBadge?: Pick<PromoTagProps, 'text' | 'appearance'> | string;
22
+ promoBadge?: Pick<PromoTagProps, 'text' | 'appearance' | 'color'> | string;
23
23
  /** Вложенный контент */
24
24
  children?: ReactNode;
25
25
  /** Вложенный Header */
@@ -57,7 +57,7 @@ export declare const Card: import("react").ForwardRefExoticComponent<{
57
57
  /** Размер */
58
58
  size?: Size;
59
59
  /** PromoBadge */
60
- promoBadge?: Pick<PromoTagProps, "text" | "appearance"> | string;
60
+ promoBadge?: Pick<PromoTagProps, "text" | "appearance" | "color"> | string;
61
61
  /** Вложенный контент */
62
62
  children?: ReactNode;
63
63
  /** Вложенный Header */
@@ -1,3 +1,3 @@
1
1
  import { PromoTagProps } from '@snack-uikit/promo-tag';
2
- export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance'>;
3
- export declare function PromoBadge({ text, appearance }: PromoBadgeProps): import("react/jsx-runtime").JSX.Element;
2
+ export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance' | 'color'>;
3
+ export declare function PromoBadge({ text, appearance, color }: PromoBadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PromoTag } from '@snack-uikit/promo-tag';
3
3
  import { TEST_IDS } from '../../constants';
4
4
  import styles from './styles.module.css';
5
- export function PromoBadge({ text, appearance = 'primary' }) {
6
- return (_jsx("div", { className: styles.promoBadge, children: _jsx(PromoTag, { appearance: appearance, text: text, "data-test-id": TEST_IDS.promoBadge, className: styles.promoTag }) }));
5
+ export function PromoBadge({ text, appearance = 'primary', color = 'accent' }) {
6
+ return (_jsx("div", { className: styles.promoBadge, children: _jsx(PromoTag, { appearance: appearance, text: text, color: color, "data-test-id": TEST_IDS.promoBadge, className: styles.promoTag }) }));
7
7
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Card",
7
- "version": "0.20.23",
7
+ "version": "0.21.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -48,5 +48,5 @@
48
48
  "classnames": "2.5.1",
49
49
  "merge-refs": "1.3.0"
50
50
  },
51
- "gitHead": "864821fceaa6bbb61080166d14f1682fa16e3f85"
51
+ "gitHead": "b09f293bd25165269ee4f5fa79535f716d9d4f1a"
52
52
  }
@@ -39,7 +39,7 @@ export type CardProps = WithSupportProps<{
39
39
  /** Размер */
40
40
  size?: Size;
41
41
  /** PromoBadge */
42
- promoBadge?: Pick<PromoTagProps, 'text' | 'appearance'> | string;
42
+ promoBadge?: Pick<PromoTagProps, 'text' | 'appearance' | 'color'> | string;
43
43
  /** Вложенный контент */
44
44
  children?: ReactNode;
45
45
  /** Вложенный Header */
@@ -3,12 +3,18 @@ import { PromoTag, PromoTagProps } from '@snack-uikit/promo-tag';
3
3
  import { TEST_IDS } from '../../constants';
4
4
  import styles from './styles.module.scss';
5
5
 
6
- export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance'>;
6
+ export type PromoBadgeProps = Pick<PromoTagProps, 'text' | 'appearance' | 'color'>;
7
7
 
8
- export function PromoBadge({ text, appearance = 'primary' }: PromoBadgeProps) {
8
+ export function PromoBadge({ text, appearance = 'primary', color = 'accent' }: PromoBadgeProps) {
9
9
  return (
10
10
  <div className={styles.promoBadge}>
11
- <PromoTag appearance={appearance} text={text} data-test-id={TEST_IDS.promoBadge} className={styles.promoTag} />
11
+ <PromoTag
12
+ appearance={appearance}
13
+ text={text}
14
+ color={color}
15
+ data-test-id={TEST_IDS.promoBadge}
16
+ className={styles.promoTag}
17
+ />
12
18
  </div>
13
19
  );
14
20
  }