@dss-kit/ui-kit 1.0.0 → 1.0.1

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.
Files changed (46) hide show
  1. package/README.md +29 -29
  2. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
  3. package/dist/components/controls/Switch/Switch.d.ts +3 -3
  4. package/dist/components/controls/Switch/styles.d.ts +1 -0
  5. package/dist/components/controls/Switch/styles.js +44 -34
  6. package/dist/components/controls/Tabs/TabItem/TabItem.d.ts +5 -0
  7. package/dist/components/controls/Tabs/TabItem/TabItem.js +68 -49
  8. package/dist/components/controls/Tabs/Tabs.d.ts +6 -1
  9. package/dist/components/controls/Tabs/Tabs.js +31 -28
  10. package/dist/components/shared/Counter/Counter.const.d.ts +6 -0
  11. package/dist/components/shared/Counter/Counter.const.js +16 -0
  12. package/dist/components/shared/Counter/Counter.d.ts +11 -0
  13. package/dist/components/shared/Counter/Counter.js +58 -0
  14. package/dist/components/shared/Counter/Counter.types.d.ts +29 -0
  15. package/dist/components/shared/Counter/Counter.utils.d.ts +2 -0
  16. package/dist/components/shared/Counter/Counter.utils.js +6 -0
  17. package/dist/components/shared/Counter/index.d.ts +2 -0
  18. package/dist/components/shared/Counter/styles.d.ts +2 -0
  19. package/dist/components/shared/Counter/styles.js +11 -0
  20. package/dist/components/shared/Dot/Dot.const.d.ts +5 -0
  21. package/dist/components/shared/Dot/Dot.const.js +15 -0
  22. package/dist/components/shared/Dot/Dot.d.ts +10 -0
  23. package/dist/components/shared/Dot/Dot.js +32 -0
  24. package/dist/components/shared/Dot/Dot.types.d.ts +17 -0
  25. package/dist/components/shared/Dot/index.d.ts +2 -0
  26. package/dist/components/shared/Dot/styles.d.ts +1 -0
  27. package/dist/components/shared/Dot/styles.js +7 -0
  28. package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
  29. package/dist/components/shared/index.d.ts +2 -0
  30. package/dist/index.js +52 -48
  31. package/dist/styles/utils/breakpoints/base.scss +11 -11
  32. package/dist/styles/utils/breakpoints/index.scss +3 -3
  33. package/dist/styles/utils/breakpoints/screen.scss +61 -61
  34. package/dist/styles/utils/breakpoints/semantic.scss +31 -31
  35. package/dist/styles/utils/fonts/font-family.scss +3 -3
  36. package/dist/styles/utils/fonts/index.scss +1 -1
  37. package/dist/styles/utils/index.scss +5 -5
  38. package/dist/styles/utils/size/index.scss +1 -1
  39. package/dist/styles/utils/size/modifiers.scss +40 -40
  40. package/dist/styles/utils/style/index.scss +1 -1
  41. package/dist/styles/utils/style/variants.scss +34 -34
  42. package/dist/styles/utils/typography/_font-weight.scss +33 -33
  43. package/dist/styles/utils/typography/_variants.scss +85 -85
  44. package/dist/styles/utils/typography/index.scss +2 -2
  45. package/dist/ui-kit.cjs +8 -8
  46. package/package.json +94 -94
package/README.md CHANGED
@@ -1,29 +1,29 @@
1
- # Storybook
2
-
3
- Storybook для библиотеки React-компонентов **UI Kit** (`@dss-kit/ui-kit`) с дизайн-системой.
4
- Репозиторий хранит исходники компонентов и их Storybook, собирает контейнерный образ и
5
- разворачивает Storybook в Kubernetes.
6
-
7
- ## Включает:
8
-
9
- - React компоненты и дизайн-систему (CSS переменные и токены, SCSS утилиты, TypeScript типы, SVG иконки)
10
- - Провайдеры тем (ThemeProviderScoped)
11
- - Storybook как витрину компонентов
12
- - CI/CD для сборки образа и деплоя в Kubernetes
13
-
14
- ## Деплой
15
-
16
- - **Stable** — на merge в `main` создаётся релизный тег, собирается образ
17
- `harbor.infra.dssnet.tech/dssnet/storybook` и разворачивается через ArgoCD.
18
- - **Trial-превью** — кнопка в CI (`deploy:trial`) на любой ветке кроме `main` публикует Storybook
19
- этой ветки на `storybook-trials-<id>.staging.dssnet.tech` (живёт 7 дней, продлевается при
20
- повторном деплое).
21
-
22
- ## Документация
23
-
24
- Ссылки на более подробную документацию по разделам
25
-
26
- - **[Сборка](./docs/build/index.md)** — команды сборки, конфигурации Vite и т.д.
27
- - **[Использование](./docs/usage/index.md)** — подключение стилей, примеры компонентов
28
- - **[Стили](./docs/styles/index.md)** — подключение шрифтов, CSS переменных, базовые стили и миксины
29
- - **[Утилиты](./docs/utils/index.md)** — функции хелперы
1
+ # Storybook
2
+
3
+ Storybook для библиотеки React-компонентов **UI Kit** (`@dss-kit/ui-kit`) с дизайн-системой.
4
+ Репозиторий хранит исходники компонентов и их Storybook, собирает контейнерный образ и
5
+ разворачивает Storybook в Kubernetes.
6
+
7
+ ## Включает:
8
+
9
+ - React компоненты и дизайн-систему (CSS переменные и токены, SCSS утилиты, TypeScript типы, SVG иконки)
10
+ - Провайдеры тем (ThemeProviderScoped)
11
+ - Storybook как витрину компонентов
12
+ - CI/CD для сборки образа и деплоя в Kubernetes
13
+
14
+ ## Деплой
15
+
16
+ - **Stable** — на merge в `main` создаётся релизный тег, собирается образ
17
+ `harbor.infra.dssnet.tech/dssnet/storybook` и разворачивается через ArgoCD.
18
+ - **Trial-превью** — кнопка в CI (`deploy:trial`) на любой ветке кроме `main` публикует Storybook
19
+ этой ветки на `storybook-trials-<id>.staging.dssnet.tech` (живёт 7 дней, продлевается при
20
+ повторном деплое).
21
+
22
+ ## Документация
23
+
24
+ Ссылки на более подробную документацию по разделам
25
+
26
+ - **[Сборка](./docs/build/index.md)** — команды сборки, конфигурации Vite и т.д.
27
+ - **[Использование](./docs/usage/index.md)** — подключение стилей, примеры компонентов
28
+ - **[Стили](./docs/styles/index.md)** — подключение шрифтов, CSS переменных, базовые стили и миксины
29
+ - **[Утилиты](./docs/utils/index.md)** — функции хелперы
@@ -8,10 +8,10 @@ import { MarkdownShortcutPlugin as U } from "@lexical/react/LexicalMarkdownShort
8
8
  import { OnChangePlugin as W } from "@lexical/react/LexicalOnChangePlugin";
9
9
  import { TablePlugin as H } from "@lexical/react/LexicalTablePlugin";
10
10
  import { useState as u, useMemo as a, useCallback as p } from "react";
11
- import { MARKDOWN_TOOLBAR_DEFAULT_ACTIONS as K } from "./MarkdownTextEditor.const.js";
12
- import { MarkdownTextEditorLocaleProvider as q } from "./MarkdownTextEditor.locale.js";
11
+ import { getEditorConfig as K } from "./configs/editor.config.js";
12
+ import { MARKDOWN_TOOLBAR_DEFAULT_ACTIONS as q } from "./MarkdownTextEditor.const.js";
13
+ import { MarkdownTextEditorLocaleProvider as z } from "./MarkdownTextEditor.locale.js";
13
14
  import { EDITOR_TRANSFORMERS as g } from "./transformers/index.js";
14
- import { getEditorConfig as z } from "./configs/editor.config.js";
15
15
  import { EditorStateContext as G } from "./contexts/EditorStateContext/EditorStateContext.js";
16
16
  import { ToolbarContext as J } from "./contexts/ToolbarContext/ToolbarContext.js";
17
17
  import { EditorToolbar as Q } from "./components/EditorToolbar/EditorToolbar.js";
@@ -40,7 +40,7 @@ function Ao({
40
40
  fieldClassName: R,
41
41
  previewClassName: v
42
42
  }) {
43
- const [d, N] = u(""), [i, A] = u(!1), { availableActions: s, onImagesUpload: _ } = b || {}, O = a(() => z(), []), I = a(
43
+ const [d, N] = u(""), [i, A] = u(!1), { availableActions: s, onImagesUpload: _ } = b || {}, O = a(() => K(), []), I = a(
44
44
  () => ({
45
45
  isEditable: !m,
46
46
  isPreviewMode: i,
@@ -49,7 +49,7 @@ function Ao({
49
49
  }),
50
50
  [m, i, d]
51
51
  ), L = a(() => ({
52
- availableActions: s || K
52
+ availableActions: s || q
53
53
  }), [s]), f = p(
54
54
  (t) => {
55
55
  N(t), r.onMarkdownChange && r.onMarkdownChange(t);
@@ -64,7 +64,7 @@ function Ao({
64
64
  },
65
65
  [f, r]
66
66
  );
67
- return /* @__PURE__ */ o(q, { locale: M, children: /* @__PURE__ */ o(V, { initialConfig: O, children: /* @__PURE__ */ o(G.Provider, { value: I, children: /* @__PURE__ */ c(J.Provider, { value: L, children: [
67
+ return /* @__PURE__ */ o(z, { locale: M, children: /* @__PURE__ */ o(V, { initialConfig: O, children: /* @__PURE__ */ o(G.Provider, { value: I, children: /* @__PURE__ */ c(J.Provider, { value: L, children: [
68
68
  /* @__PURE__ */ c(
69
69
  h,
70
70
  {
@@ -1,7 +1,7 @@
1
- import { AccentType, SecondaryType, Size } from '../../../types/tokens.types';
1
+ import { AccentType, PositiveType, SecondaryType, Size } from '../../../types/tokens.types';
2
2
  type SwitchSizes = Extract<Size, "sm" | "md" | "lg">;
3
3
  type ThemeType = "theme";
4
- export type SwitchVariant = AccentType | SecondaryType | ThemeType;
4
+ export type SwitchVariant = AccentType | SecondaryType | PositiveType | ThemeType;
5
5
  export interface SwitchRef {
6
6
  /** Фокус на переключателе */
7
7
  focus: () => void;
@@ -33,7 +33,7 @@ interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
33
33
  size?: SwitchSizes;
34
34
  /**
35
35
  * Вариант переключателя.
36
- * Доступны: `accent`, `secondary`, `theme`.
36
+ * Доступны: `accent`, `secondary`, `positive`, `theme`.
37
37
  * @default "accent"
38
38
  */
39
39
  variant?: SwitchVariant;
@@ -5,6 +5,7 @@ export declare const styles: {
5
5
  switchContainer: string;
6
6
  variant_accent: string;
7
7
  variant_secondary: string;
8
+ variant_positive: string;
8
9
  variant_theme: string;
9
10
  size_sm: string;
10
11
  size_md: string;
@@ -1,14 +1,14 @@
1
- import { css as t } from "@emotion/css";
2
- import { theme as s } from "../../../utils/theme/index.js";
3
- const { color: i, cornerRadius: e, height: h, spacing: c, transition: r } = s, l = {
4
- container: t({
1
+ import { css as i } from "@emotion/css";
2
+ import { theme as c } from "../../../utils/theme/index.js";
3
+ const { color: t, cornerRadius: r, height: h, spacing: s, transition: e } = c, l = {
4
+ container: i({
5
5
  width: "100%",
6
6
  cursor: "pointer",
7
7
  outline: "none",
8
8
  userSelect: "none",
9
9
  display: "flex",
10
10
  justifyContent: "space-between",
11
- gap: c.md,
11
+ gap: s.md,
12
12
  "&.disabled": {
13
13
  cursor: "not-allowed",
14
14
  opacity: 0.5
@@ -17,14 +17,14 @@ const { color: i, cornerRadius: e, height: h, spacing: c, transition: r } = s, l
17
17
  flexDirection: "row-reverse"
18
18
  }
19
19
  }),
20
- disabled: t({
20
+ disabled: i({
21
21
  cursor: "not-allowed",
22
22
  opacity: 0.5
23
23
  }),
24
- reverse: t({
24
+ reverse: i({
25
25
  flexDirection: "row-reverse"
26
26
  }),
27
- switchContainer: t({
27
+ switchContainer: i({
28
28
  "--width-switch-sm": "34px",
29
29
  "--width-switch-md": "40px",
30
30
  "--width-switch-lg": "52px",
@@ -37,82 +37,92 @@ const { color: i, cornerRadius: e, height: h, spacing: c, transition: r } = s, l
37
37
  }
38
38
  }),
39
39
  // Variant classes — each handles both checked and unchecked states
40
- variant_accent: t({
40
+ variant_accent: i({
41
41
  "&:has(input:not(:checked))": {
42
- "--switch-bg-color": i.fill.bg_tertiary,
43
- "--thumb-bg-color": i.fill.bg_primary
42
+ "--switch-bg-color": t.fill.bg_tertiary,
43
+ "--thumb-bg-color": t.fill.bg_primary
44
44
  },
45
45
  "&:has(input:checked)": {
46
- "--switch-bg-color": i.fill.accent_primary,
47
- "--thumb-bg-color": i.fill.bg_primary
46
+ "--switch-bg-color": t.fill.accent_primary,
47
+ "--thumb-bg-color": t.fill.bg_primary
48
48
  }
49
49
  }),
50
- variant_secondary: t({
50
+ variant_secondary: i({
51
51
  "&:has(input:not(:checked))": {
52
- "--switch-bg-color": i.fill.bg_tertiary,
53
- "--thumb-bg-color": i.fill.bg_primary
52
+ "--switch-bg-color": t.fill.bg_tertiary,
53
+ "--thumb-bg-color": t.fill.bg_primary
54
54
  },
55
55
  "&:has(input:checked)": {
56
- "--switch-bg-color": i.fill.accent_secondary,
57
- "--thumb-bg-color": i.fill.accent_primary
56
+ "--switch-bg-color": t.fill.accent_secondary,
57
+ "--thumb-bg-color": t.fill.accent_primary
58
58
  }
59
59
  }),
60
- variant_theme: t({
60
+ variant_positive: i({
61
61
  "&:has(input:not(:checked))": {
62
- "--switch-bg-color": i.fill.bg_tertiary,
63
- "--thumb-bg-color": i.fill.bg_primary
62
+ "--switch-bg-color": t.fill.bg_tertiary,
63
+ "--thumb-bg-color": t.fill.bg_primary
64
64
  },
65
65
  "&:has(input:checked)": {
66
- "--switch-bg-color": i.fill.bg_secondary,
67
- "--thumb-bg-color": i.fill.bg_tertiary
66
+ "--switch-bg-color": t.fill.positive_primary,
67
+ "--thumb-bg-color": t.fill.bg_primary
68
+ }
69
+ }),
70
+ variant_theme: i({
71
+ "&:has(input:not(:checked))": {
72
+ "--switch-bg-color": t.fill.bg_tertiary,
73
+ "--thumb-bg-color": t.fill.bg_primary
74
+ },
75
+ "&:has(input:checked)": {
76
+ "--switch-bg-color": t.fill.bg_secondary,
77
+ "--thumb-bg-color": t.fill.bg_tertiary
68
78
  }
69
79
  }),
70
80
  // Size classes
71
- size_sm: t({
81
+ size_sm: i({
72
82
  "--switch-width": "var(--width-switch-sm)",
73
83
  "--switch-height": h.switch.sm,
74
84
  "--thumb-width": "var(--size-thumb-sm)",
75
85
  "--thumb-height": "var(--size-thumb-sm)"
76
86
  }),
77
- size_md: t({
87
+ size_md: i({
78
88
  "--switch-width": "var(--width-switch-md)",
79
89
  "--switch-height": h.switch.md,
80
90
  "--thumb-width": "var(--size-thumb-md)",
81
91
  "--thumb-height": "var(--size-thumb-md)"
82
92
  }),
83
- size_lg: t({
93
+ size_lg: i({
84
94
  "--switch-width": "var(--width-switch-lg)",
85
95
  "--switch-height": h.switch.lg,
86
96
  "--thumb-width": "var(--size-thumb-lg)",
87
97
  "--thumb-height": "var(--size-thumb-lg)"
88
98
  }),
89
- switch: t({
99
+ switch: i({
90
100
  width: "var(--switch-width)",
91
101
  height: "var(--switch-height)",
92
- transition: r.general,
102
+ transition: e.general,
93
103
  display: "flex",
94
104
  alignItems: "center",
95
105
  padding: 2,
96
106
  backgroundColor: "var(--switch-bg-color)",
97
- borderRadius: e.xl
107
+ borderRadius: r.xl
98
108
  }),
99
- thumb: t({
109
+ thumb: i({
100
110
  display: "flex",
101
111
  alignItems: "center",
102
112
  justifyContent: "center",
103
113
  padding: 4,
104
- transition: r.general,
114
+ transition: e.general,
105
115
  transform: "translateX(var(--thumb-translate, 0))",
106
116
  width: "var(--thumb-width)",
107
117
  height: "var(--thumb-height)",
108
118
  backgroundColor: "var(--thumb-bg-color)",
109
- borderRadius: e.fullRound
119
+ borderRadius: r.fullRound
110
120
  }),
111
- moon: t({
121
+ moon: i({
112
122
  width: "100%",
113
123
  height: "100%"
114
124
  }),
115
- fire: t({
125
+ fire: i({
116
126
  width: "100%",
117
127
  height: "100%"
118
128
  })
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  interface TabItemProps {
2
3
  label: string;
3
4
  selected: boolean;
@@ -10,6 +11,10 @@ interface TabItemProps {
10
11
  activeClassName?: string;
11
12
  /** Класс для текста внутри таба (`Text`). */
12
13
  textClassName?: string;
14
+ /** Элемент справа от подписи, например `Counter`. */
15
+ endSlot?: ReactNode;
16
+ /** Класс для обёртки `endSlot`. */
17
+ endSlotClassName?: string;
13
18
  }
14
19
  export declare const TabItem: import('react').ForwardRefExoticComponent<TabItemProps & import('react').RefAttributes<HTMLDivElement>>;
15
20
  export {};
@@ -1,58 +1,77 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { cx as e, css as t } from "@emotion/css";
3
- import { forwardRef as d } from "react";
4
- import { Box as y } from "../../../builders/Box/Box.js";
5
- import { theme as x } from "../../../../utils/theme/index.js";
6
- import { Text as u } from "../../../builders/Text/Text.js";
7
- const { spacing: s } = x, h = t({
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import { cx as i, css as o } from "@emotion/css";
3
+ import { forwardRef as g } from "react";
4
+ import { Box as m } from "../../../builders/Box/Box.js";
5
+ import { theme as w } from "../../../../utils/theme/index.js";
6
+ import { Text as S } from "../../../builders/Text/Text.js";
7
+ const { spacing: t } = w, N = o({
8
8
  cursor: "pointer",
9
9
  userSelect: "none"
10
- }), S = t({
10
+ }), b = o({
11
11
  cursor: "not-allowed",
12
12
  opacity: 0.5
13
- }), b = t({
13
+ }), j = o({
14
14
  transition: "color 0.2s ease"
15
- }), T = d(
15
+ }), E = g(
16
16
  ({
17
- label: i,
18
- selected: o,
19
- disabled: m,
20
- fullWidth: n,
21
- onClick: c,
22
- className: a,
23
- activeClassName: l,
24
- textClassName: p
25
- }, f) => /* @__PURE__ */ r(
26
- y,
27
- {
28
- w: n ? "full" : void 0,
29
- justifyContent: "center",
30
- alignItems: "center",
31
- ref: f,
32
- py: s.md,
33
- px: s.xl,
34
- onClick: c,
35
- className: e(
36
- h,
37
- {
38
- [S]: m
39
- },
40
- a,
41
- o && l
42
- ),
43
- children: /* @__PURE__ */ r(
44
- u,
45
- {
46
- className: e(b, p),
47
- colorName: o ? "primary" : "tertiary",
48
- fontWeight: "medium",
49
- variant: "body-2",
50
- children: i
51
- }
52
- )
53
- }
54
- )
17
+ label: a,
18
+ selected: r,
19
+ disabled: c,
20
+ fullWidth: l,
21
+ onClick: p,
22
+ className: f,
23
+ activeClassName: x,
24
+ textClassName: d,
25
+ endSlot: e,
26
+ endSlotClassName: y
27
+ }, u) => {
28
+ const s = !!e;
29
+ return /* @__PURE__ */ h(
30
+ m,
31
+ {
32
+ row: s,
33
+ gap: t.xs,
34
+ w: l ? "full" : void 0,
35
+ justifyContent: "center",
36
+ alignItems: "center",
37
+ ref: u,
38
+ py: t.md,
39
+ px: t.xl,
40
+ onClick: p,
41
+ className: i(
42
+ N,
43
+ {
44
+ [b]: c
45
+ },
46
+ f,
47
+ r && x
48
+ ),
49
+ children: [
50
+ /* @__PURE__ */ n(
51
+ S,
52
+ {
53
+ className: i(j, d),
54
+ colorName: r ? "primary" : "tertiary",
55
+ fontWeight: "medium",
56
+ variant: "body-2",
57
+ children: a
58
+ }
59
+ ),
60
+ s && /* @__PURE__ */ n(
61
+ m,
62
+ {
63
+ row: !0,
64
+ alignItems: "center",
65
+ flexShrink: 0,
66
+ className: y,
67
+ children: e
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ );
73
+ }
55
74
  );
56
75
  export {
57
- T as TabItem
76
+ E as TabItem
58
77
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface TabOption<T extends string | number> {
2
3
  /** Текстовая метка опции */
3
4
  label: string;
@@ -5,6 +6,8 @@ export interface TabOption<T extends string | number> {
5
6
  value: T;
6
7
  /** Флаг отключения опции */
7
8
  disabled?: boolean;
9
+ /** Элемент справа от подписи, например `Counter` */
10
+ endSlot?: ReactNode;
8
11
  }
9
12
  export interface TabsProps<T extends string | number> {
10
13
  /** Текущее выбранное значение */
@@ -25,6 +28,8 @@ export interface TabsProps<T extends string | number> {
25
28
  activeTabClassName?: string;
26
29
  /** Класс для текста внутри табов. */
27
30
  tabTextClassName?: string;
31
+ /** Класс для обёртки `endSlot` внутри табов. */
32
+ endSlotClassName?: string;
28
33
  /** Класс для индикатора выбранного таба. */
29
34
  indicatorClassName?: string;
30
35
  }
@@ -41,7 +46,7 @@ export interface TabsProps<T extends string | number> {
41
46
  * ```
42
47
  */
43
48
  declare const Tabs: {
44
- <T extends string | number>({ value, onChange, options, fullWidth, className, tabClassName, activeTabClassName, tabTextClassName, indicatorClassName, }: TabsProps<T>): import("react/jsx-runtime").JSX.Element;
49
+ <T extends string | number>({ value, onChange, options, fullWidth, className, tabClassName, activeTabClassName, tabTextClassName, endSlotClassName, indicatorClassName, }: TabsProps<T>): import("react/jsx-runtime").JSX.Element;
45
50
  displayName: string;
46
51
  };
47
52
  export { Tabs };
@@ -1,12 +1,12 @@
1
- import { jsxs as y, jsx as c } from "react/jsx-runtime";
2
- import { cx as f, css as i } from "@emotion/css";
3
- import { useState as C, useRef as I, useEffect as S } from "react";
4
- import { TabItem as k } from "./TabItem/TabItem.js";
5
- import { Box as d } from "../../builders/Box/Box.js";
6
- import { theme as R } from "../../../utils/theme/index.js";
7
- const { color: m } = R, _ = i({
8
- borderBottom: `1px solid ${m.border.neutral_alpha_basic}`
9
- }), g = ({
1
+ import { jsxs as C, jsx as c } from "react/jsx-runtime";
2
+ import { cx as d, css as m } from "@emotion/css";
3
+ import { useState as p, useRef as I, useEffect as k } from "react";
4
+ import { TabItem as R } from "./TabItem/TabItem.js";
5
+ import { Box as f } from "../../builders/Box/Box.js";
6
+ import { theme as _ } from "../../../utils/theme/index.js";
7
+ const { color: i } = _, g = m({
8
+ borderBottom: `1px solid ${i.border.neutral_alpha_basic}`
9
+ }), j = ({
10
10
  value: a,
11
11
  onChange: n,
12
12
  options: s,
@@ -15,59 +15,62 @@ const { color: m } = R, _ = i({
15
15
  tabClassName: u,
16
16
  activeTabClassName: h,
17
17
  tabTextClassName: x,
18
- indicatorClassName: w
18
+ endSlotClassName: w,
19
+ indicatorClassName: v
19
20
  }) => {
20
- const [l, v] = C({
21
+ const [l, N] = p({
21
22
  left: 0,
22
23
  width: 0
23
- }), o = I([]), N = (e) => (t) => {
24
+ }), o = I([]), S = (e) => (t) => {
24
25
  o.current[e] = t;
25
26
  };
26
- S(() => {
27
- const e = s.findIndex((p) => p.value === a), t = o.current[e];
28
- t && v({
27
+ k(() => {
28
+ const e = s.findIndex((y) => y.value === a), t = o.current[e];
29
+ t && N({
29
30
  left: t.offsetLeft,
30
31
  width: t.offsetWidth
31
32
  });
32
33
  }, [a, s]);
33
34
  const T = (e, t = !1) => () => !t && n(e);
34
- return /* @__PURE__ */ y(
35
- d,
35
+ return /* @__PURE__ */ C(
36
+ f,
36
37
  {
37
38
  row: !0,
38
39
  w: r ? "full" : "auto",
39
40
  relative: !0,
40
- className: f(_, b),
41
+ className: d(g, b),
41
42
  children: [
42
43
  s.map((e, t) => /* @__PURE__ */ c(
43
- k,
44
+ R,
44
45
  {
45
46
  selected: a === e.value,
46
47
  onClick: T(e.value, e.disabled),
47
- ref: N(t),
48
+ ref: S(t),
48
49
  label: e.label,
49
50
  disabled: e.disabled,
50
51
  fullWidth: r,
51
52
  className: u,
52
53
  activeClassName: h,
53
- textClassName: x
54
+ textClassName: x,
55
+ endSlot: e.endSlot,
56
+ endSlotClassName: w
54
57
  },
55
58
  e.value
56
59
  )),
57
60
  /* @__PURE__ */ c(
58
- d,
61
+ f,
59
62
  {
60
63
  h: 2,
61
64
  w: l.width,
62
65
  absolute: !0,
63
66
  bottom: -1,
64
67
  left: l.left,
65
- backgroundColor: m.border.accent_primary,
66
- className: f(
67
- i({
68
+ backgroundColor: i.border.accent_primary,
69
+ className: d(
70
+ m({
68
71
  transition: "left 0.2s ease, width 0.2s ease"
69
72
  }),
70
- w
73
+ v
71
74
  )
72
75
  }
73
76
  )
@@ -75,7 +78,7 @@ const { color: m } = R, _ = i({
75
78
  }
76
79
  );
77
80
  };
78
- g.displayName = "Tabs";
81
+ j.displayName = "Tabs";
79
82
  export {
80
- g as Tabs
83
+ j as Tabs
81
84
  };
@@ -0,0 +1,6 @@
1
+ import { CounterColorName, CounterSize } from './Counter.types';
2
+ export declare const DEFAULT_MAX_NUMBER = 99;
3
+ export declare const COUNTER_CUTOUT_WIDTH = 1;
4
+ export declare const COUNTER_CUTOUT_COLOR: "var(--fill-bg-primary)";
5
+ export declare const COUNTER_BACKGROUND: Record<CounterColorName, string>;
6
+ export declare const COUNTER_HEIGHT: Record<CounterSize, number>;
@@ -0,0 +1,16 @@
1
+ import { theme as o } from "../../../utils/theme/index.js";
2
+ const { color: t } = o, n = 99, c = 1, e = t.fill.bg_primary, T = {
3
+ negative: t.status.negative,
4
+ accent: t.status.accent,
5
+ neutral: t.status.neutral
6
+ }, U = {
7
+ sm: 16,
8
+ md: 20
9
+ };
10
+ export {
11
+ T as COUNTER_BACKGROUND,
12
+ e as COUNTER_CUTOUT_COLOR,
13
+ c as COUNTER_CUTOUT_WIDTH,
14
+ U as COUNTER_HEIGHT,
15
+ n as DEFAULT_MAX_NUMBER
16
+ };
@@ -0,0 +1,11 @@
1
+ import { CounterProps } from './Counter.types';
2
+ /**
3
+ * Счётчик: число или короткий текст в цветной капсуле.
4
+ * @example
5
+ * ```tsx
6
+ * <Counter value={5} />
7
+ * <Counter value={120} maxNumber={99} colorName="accent" size="sm" />
8
+ * <Counter value="New" />
9
+ * ```
10
+ */
11
+ export declare function Counter({ value, maxNumber, colorName, size, withBorder, className, }: CounterProps): import("react/jsx-runtime").JSX.Element;