mimir-ui-kit 1.65.7 → 1.66.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.
@@ -1,6 +1,7 @@
1
1
  import { ElementType, ReactElement, ReactNode } from 'react';
2
2
  import { ELinkSize, ELinkVariant } from './constants';
3
3
  import { TIconProps } from '../../icons';
4
+ import { TDataTestIdReactMap } from '../../types';
4
5
  import { Props } from '../../types/propsWithAs';
5
6
 
6
7
  type TProps = {
@@ -13,6 +14,7 @@ type TProps = {
13
14
  children?: ReactNode;
14
15
  rel?: string;
15
16
  target?: string;
17
+ dataTestIdReactMap?: TDataTestIdReactMap<'link' | 'leftIcon' | 'rightIcon'>;
16
18
  };
17
19
  type TLinkComponent = <C extends ElementType = 'span'>(props: Props<C, TProps>) => ReactElement | ReactNode;
18
20
  export declare const Link: TLinkComponent;
@@ -1,57 +1,61 @@
1
- import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
- import { c as o } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as x } from "react";
4
- import { ELinkSize as L, ELinkVariant as I } from "./constants.js";
5
- import { Icon as t } from "../../icons/Icon.js";
6
- import '../../assets/Link.css';const g = "_link_1bc9a_2", j = "_sample_1bc9a_20", u = "_anchor_1bc9a_24", z = "_disabled_1bc9a_28", C = "_icon_1bc9a_38", E = "_xs_1bc9a_47", R = "_s_1bc9a_20", v = "_m_1bc9a_59", w = "_l_1bc9a_2", s = {
7
- link: g,
8
- sample: j,
9
- anchor: u,
10
- disabled: z,
11
- icon: C,
12
- xs: E,
13
- s: R,
14
- m: v,
15
- l: w
16
- }, V = x(
17
- (i, e) => {
1
+ import { jsxs as x, jsx as a } from "react/jsx-runtime";
2
+ import { c as i } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as L } from "react";
4
+ import { ELinkSize as g, ELinkVariant as j } from "./constants.js";
5
+ import { Icon as r } from "../../icons/Icon.js";
6
+ import '../../assets/Link.css';const u = "_link_1bc9a_2", z = "_sample_1bc9a_20", C = "_anchor_1bc9a_24", E = "_disabled_1bc9a_28", v = "_icon_1bc9a_38", w = "_xs_1bc9a_47", A = "_s_1bc9a_20", H = "_m_1bc9a_59", O = "_l_1bc9a_2", c = {
7
+ link: u,
8
+ sample: z,
9
+ anchor: C,
10
+ disabled: E,
11
+ icon: v,
12
+ xs: w,
13
+ s: A,
14
+ m: H,
15
+ l: O
16
+ }, B = L(
17
+ (l, t) => {
18
18
  const {
19
- as: l = "button",
20
- disabled: r,
21
- leftIcon: c,
22
- children: _,
23
- rightIcon: a,
24
- className: m,
25
- size: b = L.L,
26
- variant: d = I.ANCHOR,
27
- rel: p,
28
- target: f,
19
+ as: _ = "button",
20
+ disabled: e,
21
+ leftIcon: o,
22
+ children: m,
23
+ rightIcon: n,
24
+ className: b,
25
+ size: d = g.L,
26
+ variant: f = j.ANCHOR,
27
+ rel: h,
28
+ dataTestIdReactMap: s,
29
+ target: k,
29
30
  ...N
30
- } = i, h = o(s.link, m, s[d], s[b], {
31
- [s.disabled]: r
31
+ } = l, p = i(c.link, b, c[f], c[d], {
32
+ [c.disabled]: e
32
33
  });
33
- return /* @__PURE__ */ k(
34
- l,
34
+ return /* @__PURE__ */ x(
35
+ _,
35
36
  {
36
- ref: e,
37
- className: h,
38
- rel: p,
39
- target: f,
37
+ "data-testid-react": s == null ? void 0 : s.link,
38
+ ref: t,
39
+ className: p,
40
+ rel: h,
41
+ target: k,
40
42
  ...N,
41
43
  children: [
42
- c && /* @__PURE__ */ n(
43
- t,
44
+ o && /* @__PURE__ */ a(
45
+ r,
44
46
  {
45
- ...c,
46
- className: o(s.icon, c.className)
47
+ "data-testid-react": s == null ? void 0 : s.leftIcon,
48
+ ...o,
49
+ className: i(c.icon, o.className)
47
50
  }
48
51
  ),
49
- _,
50
- a && /* @__PURE__ */ n(
51
- t,
52
+ m,
53
+ n && /* @__PURE__ */ a(
54
+ r,
52
55
  {
53
- ...a,
54
- className: o(s.icon, a.className)
56
+ "data-testid-react": s == null ? void 0 : s.rightIcon,
57
+ ...n,
58
+ className: i(c.icon, n.className)
55
59
  }
56
60
  )
57
61
  ]
@@ -60,5 +64,5 @@ import '../../assets/Link.css';const g = "_link_1bc9a_2", j = "_sample_1bc9a_20"
60
64
  }
61
65
  );
62
66
  export {
63
- V as Link
67
+ B as Link
64
68
  };
@@ -1,4 +1,5 @@
1
1
  import { EMergedButtonVariantRound } from './constants';
2
+ import { TDataTestIdReactMap } from '../../types';
2
3
  import { TButtonProps, EButtonSize } from '../Button';
3
4
 
4
5
  export type TButtonPropsWithoutStyles = Omit<TButtonProps, 'clear' | 'variant' | 'form' | 'size'> & {
@@ -15,8 +16,12 @@ export type TProps = {
15
16
  * Класс, применяемый к списку карточек (ul).
16
17
  */
17
18
  buttonsWrapperClassName?: string;
19
+ /**
20
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
21
+ */
22
+ dataTestIdReactMap?: TDataTestIdReactMap<'buttons' | 'btn'>;
18
23
  };
19
24
  /**
20
25
  * Компонент объединенных кнопок, с округлением у первой и последней кнопки, а так же с другими variant, нежели у обычного Button.
21
26
  */
22
- export declare const MergedButton: import('react').MemoExoticComponent<({ buttons, buttonsWrapperClassName }: TProps) => import("react/jsx-runtime").JSX.Element>;
27
+ export declare const MergedButton: import('react').MemoExoticComponent<({ buttons, buttonsWrapperClassName, dataTestIdReactMap }: TProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,59 +1,69 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { c as r } from "../../index-DIxK0V-G.js";
3
- import { memo as l } from "react";
4
- import { EMergedButtonVariantRound as g } from "./constants.js";
5
- import { Button as b } from "../Button/Button.js";
6
- import '../../assets/MergedButton.css';const d = "_buttons_12jbn_2", h = "_gray_12jbn_28", j = "_white_12jbn_36", B = "_transparent_12jbn_44", I = "_asphalt_12jbn_53", f = "_s_12jbn_66", N = "_m_12jbn_6", t = {
7
- buttons: d,
1
+ import { jsx as _ } from "react/jsx-runtime";
2
+ import { c } from "../../index-DIxK0V-G.js";
3
+ import { memo as h } from "react";
4
+ import { EMergedButtonVariantRound as j } from "./constants.js";
5
+ import { Button as B } from "../Button/Button.js";
6
+ import '../../assets/MergedButton.css';const f = "_buttons_12jbn_2", p = "_gray_12jbn_28", N = "_white_12jbn_36", v = "_transparent_12jbn_44", y = "_asphalt_12jbn_53", w = "_s_12jbn_66", a = "_m_12jbn_6", o = {
7
+ buttons: f,
8
8
  "merged-button": "_merged-button_12jbn_6",
9
- gray: h,
10
- white: j,
11
- transparent: B,
12
- asphalt: I,
9
+ gray: p,
10
+ white: N,
11
+ transparent: v,
12
+ asphalt: y,
13
13
  "is-icon": "_is-icon_12jbn_61",
14
- s: f,
15
- m: N,
14
+ s: w,
15
+ m: a,
16
16
  "one-button": "_one-button_12jbn_74"
17
- }, v = l(
18
- ({ buttons: s, buttonsWrapperClassName: c }) => /* @__PURE__ */ e("div", { className: r(t.buttons, c), children: s.map(
19
- ({
20
- variant: a = g.White,
21
- disabled: o,
22
- className: i,
23
- size: _ = "m",
24
- ...n
25
- }, m) => {
26
- const u = {
27
- ...n,
28
- isIconButton: n.isIconButton ?? !1,
29
- iconName: n.isIconButton ? n.iconName : void 0,
30
- leftIcon: n.isIconButton ? void 0 : n.leftIcon,
31
- rightIcon: n.isIconButton ? void 0 : n.rightIcon
32
- }, p = r(
33
- t["merged-button"],
34
- t[_ ?? "m"],
35
- i,
36
- {
37
- [t[a]]: !o,
38
- [t.disabled]: o,
39
- [t["is-icon"]]: n.isIconButton,
40
- [t["one-button"]]: s.length === 1
17
+ }, I = h(
18
+ ({ buttons: r, buttonsWrapperClassName: m, dataTestIdReactMap: t }) => /* @__PURE__ */ _(
19
+ "div",
20
+ {
21
+ "data-testid-react": t == null ? void 0 : t.buttons,
22
+ className: c(o.buttons, m),
23
+ children: r.map(
24
+ ({
25
+ variant: e = j.White,
26
+ disabled: s,
27
+ className: u,
28
+ size: b = "m",
29
+ ...n
30
+ }, i) => {
31
+ const l = {
32
+ ...n,
33
+ isIconButton: n.isIconButton ?? !1,
34
+ iconName: n.isIconButton ? n.iconName : void 0,
35
+ leftIcon: n.isIconButton ? void 0 : n.leftIcon,
36
+ rightIcon: n.isIconButton ? void 0 : n.rightIcon
37
+ }, g = c(
38
+ o["merged-button"],
39
+ o[b ?? "m"],
40
+ u,
41
+ {
42
+ [o[e]]: !s,
43
+ [o.disabled]: s,
44
+ [o["is-icon"]]: n.isIconButton,
45
+ [o["one-button"]]: r.length === 1
46
+ }
47
+ );
48
+ return /* @__PURE__ */ _(
49
+ B,
50
+ {
51
+ clear: !0,
52
+ disabled: s,
53
+ dataTestIdReactMap: {
54
+ button: `${t == null ? void 0 : t.btn}-${i}`
55
+ },
56
+ className: g,
57
+ ...l
58
+ },
59
+ i
60
+ );
41
61
  }
42
- );
43
- return /* @__PURE__ */ e(
44
- b,
45
- {
46
- clear: !0,
47
- disabled: o,
48
- className: p,
49
- ...u
50
- },
51
- m
52
- );
62
+ )
53
63
  }
54
- ) })
64
+ )
55
65
  );
56
- v.displayName = "MergedButton";
66
+ I.displayName = "MergedButton";
57
67
  export {
58
- v as MergedButton
68
+ I as MergedButton
59
69
  };
@@ -1,3 +1,4 @@
1
+ import { TDataTestIdReactMap } from '../../types';
1
2
  import { TInputProps } from '../Input';
2
3
 
3
4
  /**
@@ -24,4 +25,8 @@ export declare const OtpInput: import('react').ForwardRefExoticComponent<Omit<TI
24
25
  * Позиции полей, после которых отображаются разделители.
25
26
  */
26
27
  separatorPositions?: number[];
28
+ /**
29
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
30
+ */
31
+ dataTestIdReactMap?: TDataTestIdReactMap<"otp">;
27
32
  } & import('react').RefAttributes<unknown>>;
@@ -1,77 +1,86 @@
1
- import { jsx as r, jsxs as v } from "react/jsx-runtime";
2
- import { c as u } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as R, useImperativeHandle as T, Fragment as y } from "react";
4
- import { DEFAULT_VALUE_LENGTH as z, ITEMS_PER_SEPARATOR as A } from "./constants.js";
5
- import { useOTPInput as C } from "./hooks.js";
6
- import { getValidSeparatorPositions as D, getDefaultSeparatorPositions as F } from "./utils.js";
7
- import { I as L } from "../../Input-JwHUiwVK.js";
8
- import '../../assets/OtpInput.css';const O = "_otp_1ncuz_2", j = "_input_1ncuz_13", x = "_separator_1ncuz_27", o = {
9
- otp: O,
1
+ import { jsx as p, jsxs as A } from "react/jsx-runtime";
2
+ import { c as i } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as C, useImperativeHandle as D, Fragment as F } from "react";
4
+ import { DEFAULT_VALUE_LENGTH as L, ITEMS_PER_SEPARATOR as O } from "./constants.js";
5
+ import { useOTPInput as d } from "./hooks.js";
6
+ import { getValidSeparatorPositions as x, getDefaultSeparatorPositions as j } from "./utils.js";
7
+ import { I as H } from "../../Input-JwHUiwVK.js";
8
+ import '../../assets/OtpInput.css';const K = "_otp_1ncuz_2", U = "_input_1ncuz_13", V = "_separator_1ncuz_27", e = {
9
+ otp: K,
10
10
  "input-wrapper": "_input-wrapper_1ncuz_13",
11
- input: j,
12
- separator: x
13
- }, H = R(
11
+ input: U,
12
+ separator: V
13
+ }, G = C(
14
14
  ({
15
- value: c = "",
16
- valueLength: i = z,
17
- needSeparator: m = !0,
18
- onChange: l,
19
- className: d,
20
- separatorPositions: _,
21
- ...f
22
- }, h) => {
15
+ value: m = "",
16
+ valueLength: l = L,
17
+ needSeparator: c = !0,
18
+ onChange: _,
19
+ className: f,
20
+ separatorPositions: h,
21
+ dataTestIdReactMap: t,
22
+ ...g
23
+ }, P) => {
23
24
  const {
24
- data: { inputRefs: s, valueItems: n },
25
- handlers: { handleChange: g, handleFocus: I, handleKeyDown: P, handlePaste: w }
26
- } = C({
27
- onChange: l,
28
- value: c,
29
- valueLength: i
25
+ data: { inputRefs: a, valueItems: s },
26
+ handlers: { handleChange: w, handleFocus: N, handleKeyDown: S, handlePaste: E }
27
+ } = d({
28
+ onChange: _,
29
+ value: m,
30
+ valueLength: l
30
31
  });
31
- T(h, () => ({
32
+ D(P, () => ({
32
33
  focus: () => {
33
- var a;
34
- (a = s.current[0]) == null || a.focus();
34
+ var n;
35
+ (n = a.current[0]) == null || n.focus();
35
36
  }
36
37
  }));
37
- const p = D(
38
- _,
39
- n.length
40
- ), N = p.length ? p : F(n.length, A);
41
- return /* @__PURE__ */ r("div", { className: u(o.otp, d), children: n.map((a, e) => {
42
- const S = e + 1, E = m && N.includes(S);
43
- return /* @__PURE__ */ v(y, { children: [
44
- /* @__PURE__ */ r(
45
- L,
46
- {
47
- ref: (t) => s.current[e] = t,
48
- type: "text",
49
- inputMode: "numeric",
50
- autoComplete: "one-time-code",
51
- pattern: "\\d{1}",
52
- maxLength: 1,
53
- value: a,
54
- className: o.input,
55
- wrapperClassName: o["input-wrapper"],
56
- onChange: (t) => g(t, e),
57
- onKeyDown: (t) => P(t, e),
58
- onFocus: (t) => I(t, e),
59
- onPaste: w,
60
- ...f
61
- }
62
- ),
63
- E && /* @__PURE__ */ r(
64
- "span",
65
- {
66
- className: u(o.separator),
67
- "data-testid": "separator"
68
- }
69
- )
70
- ] }, e);
71
- }) });
38
+ const u = x(
39
+ h,
40
+ s.length
41
+ ), v = u.length ? u : j(s.length, O);
42
+ return /* @__PURE__ */ p(
43
+ "div",
44
+ {
45
+ "data-testid-react": t == null ? void 0 : t.otp,
46
+ className: i(e.otp, f),
47
+ children: s.map((n, r) => {
48
+ const y = r + 1, z = c && v.includes(y);
49
+ return /* @__PURE__ */ A(F, { children: [
50
+ /* @__PURE__ */ p(
51
+ H,
52
+ {
53
+ "data-testid-react": `${t == null ? void 0 : t.otp}-idx`,
54
+ ref: (o) => a.current[r] = o,
55
+ type: "text",
56
+ inputMode: "numeric",
57
+ autoComplete: "one-time-code",
58
+ pattern: "\\d{1}",
59
+ maxLength: 1,
60
+ value: n,
61
+ className: e.input,
62
+ wrapperClassName: e["input-wrapper"],
63
+ onChange: (o) => w(o, r),
64
+ onKeyDown: (o) => S(o, r),
65
+ onFocus: (o) => N(o, r),
66
+ onPaste: E,
67
+ ...g
68
+ }
69
+ ),
70
+ z && /* @__PURE__ */ p(
71
+ "span",
72
+ {
73
+ className: i(e.separator),
74
+ "data-testid": "separator"
75
+ }
76
+ )
77
+ ] }, r);
78
+ })
79
+ }
80
+ );
72
81
  }
73
82
  );
74
- H.displayName = "OtpInput";
83
+ G.displayName = "OtpInput";
75
84
  export {
76
- H as OtpInput
85
+ G as OtpInput
77
86
  };
@@ -1,10 +1,12 @@
1
1
  import { ECounterVariant } from './constants';
2
+ import { TDataTestIdReactMap } from '../../types';
2
3
 
3
4
  export type TBackProps = {
4
5
  currentPageNumber: number;
5
6
  onClick: (nextPage: number) => void;
6
7
  setCurrentPage: (nextPage: number) => void;
7
8
  disabled?: boolean;
9
+ dataTestIdReactMap?: TDataTestIdReactMap<'backButtons' | 'backBtn'>;
8
10
  };
9
11
  export type TNextProps = {
10
12
  currentPageNumber: number;
@@ -12,6 +14,7 @@ export type TNextProps = {
12
14
  onClick: (nextPage: number) => void;
13
15
  setCurrentPage: (nextPage: number) => void;
14
16
  disabled?: boolean;
17
+ dataTestIdReactMap?: TDataTestIdReactMap<'nextButtons' | 'nextBtn'>;
15
18
  };
16
19
  export type TPageData = {
17
20
  date?: string;
@@ -39,6 +42,7 @@ export type TItemProps = {
39
42
  disabled?: boolean;
40
43
  pageData?: TPageData;
41
44
  isDateMode?: boolean;
45
+ dataTestIdReactMap?: TDataTestIdReactMap<'paginationBtn'>;
42
46
  };
43
47
  export type TProps = {
44
48
  /**
@@ -89,5 +93,9 @@ export type TProps = {
89
93
  * Данные для каждой страницы (даты и счетчики)
90
94
  */
91
95
  pagesData?: TPageData[];
96
+ /**
97
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
98
+ */
99
+ dataTestIdReactMap?: TDataTestIdReactMap<'pagination' | 'backButtons' | 'backBtn' | 'nextButtons' | 'nextBtn' | 'paginationBtn'>;
92
100
  };
93
101
  export declare const Pagination: import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLElement>>;
@@ -1,244 +1,277 @@
1
- import { jsxs as x, jsx as i, Fragment as I } from "react/jsx-runtime";
2
- import { c as E } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as $, useState as j, useEffect as F } from "react";
4
- import { FIRST_PAGE_NUMBER as f, DEFAULT_PER_PAGE as L } from "./constants.js";
5
- import { PaginationDateButton as G } from "./PaginationDateButton/PaginationDateButton.js";
6
- import { useWindowSize as T } from "../../hooks/useWindowSize/index.js";
7
- import { MergedButton as y } from "../MergedButton/MergedButton.js";
8
- import '../../assets/Pagination.css';const U = "_container_1b4hk_27", z = "_ellipsis_1b4hk_48", O = "_disabled_1b4hk_53", p = {
1
+ import { jsxs as y, jsx as s, Fragment as F } from "react/jsx-runtime";
2
+ import { c as S } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as z, useState as O, useEffect as V } from "react";
4
+ import { FIRST_PAGE_NUMBER as g, DEFAULT_PER_PAGE as W } from "./constants.js";
5
+ import { PaginationDateButton as p } from "./PaginationDateButton/PaginationDateButton.js";
6
+ import { useWindowSize as q } from "../../hooks/useWindowSize/index.js";
7
+ import { MergedButton as j } from "../MergedButton/MergedButton.js";
8
+ import '../../assets/Pagination.css';const H = "_container_1b4hk_27", J = "_ellipsis_1b4hk_48", K = "_disabled_1b4hk_53", P = {
9
9
  "pagination-button": "_pagination-button_1b4hk_2",
10
10
  "is-active": "_is-active_1b4hk_23",
11
- container: U,
11
+ container: H,
12
12
  "container--date-mode": "_container--date-mode_1b4hk_37",
13
- ellipsis: z,
14
- disabled: O
15
- }, V = ({
16
- currentPageNumber: n,
13
+ ellipsis: J,
14
+ disabled: K
15
+ }, Q = ({
16
+ currentPageNumber: r,
17
17
  onClick: e,
18
- setCurrentPage: l,
19
- disabled: c
20
- }) => /* @__PURE__ */ i(
21
- y,
22
- {
23
- buttons: [
24
- {
25
- isIconButton: !0,
26
- variant: "white",
27
- onClick: () => {
28
- n !== f && (l(n - 1), e(n - 1));
29
- },
30
- iconName: "ArrowLeft16px",
31
- disabled: c || n === f,
32
- "data-testid": "back-button"
33
- }
34
- ]
35
- }
36
- ), W = ({
37
- currentPageNumber: n,
18
+ setCurrentPage: m,
19
+ disabled: b,
20
+ dataTestIdReactMap: t
21
+ }) => {
22
+ const n = () => {
23
+ r !== g && (m(r - 1), e(r - 1));
24
+ };
25
+ return /* @__PURE__ */ s(
26
+ j,
27
+ {
28
+ dataTestIdReactMap: {
29
+ btn: t == null ? void 0 : t.backBtn,
30
+ buttons: t == null ? void 0 : t.backButtons
31
+ },
32
+ buttons: [
33
+ {
34
+ isIconButton: !0,
35
+ variant: "white",
36
+ onClick: n,
37
+ iconName: "ArrowLeft16px",
38
+ disabled: b || r === g,
39
+ "data-testid": "back-button"
40
+ }
41
+ ]
42
+ }
43
+ );
44
+ }, X = ({
45
+ currentPageNumber: r,
38
46
  lastPageNumber: e,
39
- onClick: l,
40
- setCurrentPage: c,
41
- disabled: r
47
+ onClick: m,
48
+ setCurrentPage: b,
49
+ disabled: t,
50
+ dataTestIdReactMap: n
42
51
  }) => {
43
- const t = n >= e;
44
- return /* @__PURE__ */ i(
45
- y,
52
+ const i = r >= e, u = () => {
53
+ i || (b(r + 1), m(r + 1));
54
+ };
55
+ return /* @__PURE__ */ s(
56
+ j,
46
57
  {
58
+ dataTestIdReactMap: {
59
+ btn: n == null ? void 0 : n.nextBtn,
60
+ buttons: n == null ? void 0 : n.nextButtons
61
+ },
47
62
  buttons: [
48
63
  {
49
64
  isIconButton: !0,
50
65
  variant: "white",
51
- onClick: () => {
52
- t || (c(n + 1), l(n + 1));
53
- },
54
- disabled: r || t,
66
+ onClick: u,
67
+ disabled: t || i,
55
68
  iconName: "ArrowRight16px",
56
69
  "data-testid": "next-button"
57
70
  }
58
71
  ]
59
72
  }
60
73
  );
61
- }, M = () => /* @__PURE__ */ i(
62
- y,
74
+ }, L = () => /* @__PURE__ */ s(
75
+ j,
63
76
  {
64
77
  buttons: [
65
78
  {
66
79
  children: "...",
67
80
  variant: "transparent",
68
- className: E(p["pagination-button"], p.ellipsis)
81
+ className: S(P["pagination-button"], P.ellipsis)
69
82
  }
70
83
  ]
71
84
  }
72
- ), B = ({
73
- currentPageNumber: n,
85
+ ), w = ({
86
+ currentPageNumber: r,
74
87
  newPageNumber: e,
75
- onClick: l,
76
- setCurrentPage: c,
77
- disabled: r,
78
- pageData: t,
79
- isDateMode: o = !1
88
+ onClick: m,
89
+ setCurrentPage: b,
90
+ disabled: t,
91
+ pageData: n,
92
+ dataTestIdReactMap: i,
93
+ isDateMode: u = !1
80
94
  }) => {
81
- const a = n === e, h = () => {
82
- r || (c(e), l(e));
83
- }, s = e < 10 ? `0${e}` : e;
84
- return o && t ? /* @__PURE__ */ i(
85
- G,
95
+ const N = r === e, B = () => {
96
+ t || (b(e), m(e));
97
+ }, l = e < 10 ? `0${e}` : e;
98
+ return u && n ? /* @__PURE__ */ s(
99
+ p,
86
100
  {
87
- testId: `pagination-button-${s}`,
88
- disabled: r,
89
- isActive: a,
90
- onClick: h,
91
- date: t.date,
101
+ testId: `pagination-button-${l}`,
102
+ disabled: t,
103
+ isActive: N,
104
+ onClick: B,
105
+ date: n.date,
92
106
  counterProps: {
93
- value: t.count ?? 0,
94
- variant: t.counterVariant,
95
- color: t.counterColor,
96
- backgroundColor: t.counterBackgroundColor
107
+ value: n.count ?? 0,
108
+ variant: n.counterVariant,
109
+ color: n.counterColor,
110
+ backgroundColor: n.counterBackgroundColor
97
111
  }
98
112
  }
99
- ) : /* @__PURE__ */ i(
113
+ ) : /* @__PURE__ */ s(
100
114
  "button",
101
115
  {
102
- "data-testid": `pagination-button-${s}`,
116
+ "data-testid-react": `${i == null ? void 0 : i.paginationBtn}-${l}`,
117
+ "data-testid": `pagination-button-${l}`,
103
118
  type: "button",
104
- onClick: h,
105
- disabled: r,
106
- className: E(p["pagination-button"], {
107
- [p["is-active"]]: a
119
+ onClick: B,
120
+ disabled: t,
121
+ className: S(P["pagination-button"], {
122
+ [P["is-active"]]: N
108
123
  }),
109
- children: s
124
+ children: l
110
125
  }
111
126
  );
112
- }, q = ({
113
- start: n,
127
+ }, Y = ({
128
+ start: r,
114
129
  end: e,
115
- currentPageNumber: l,
116
- onClick: c,
117
- setCurrentPage: r,
118
- disabled: t,
119
- pagesData: o,
120
- isDateMode: a
130
+ currentPageNumber: m,
131
+ onClick: b,
132
+ setCurrentPage: t,
133
+ disabled: n,
134
+ pagesData: i,
135
+ isDateMode: u,
136
+ dataTestIdReactMap: N
121
137
  }) => {
122
- const h = [];
123
- for (let s = n; s <= e; s++) {
124
- const N = o == null ? void 0 : o[s - 1];
125
- h.push(
126
- /* @__PURE__ */ i(
127
- B,
138
+ const B = [];
139
+ for (let l = r; l <= e; l++) {
140
+ const c = i == null ? void 0 : i[l - 1];
141
+ B.push(
142
+ /* @__PURE__ */ s(
143
+ w,
128
144
  {
129
- currentPageNumber: l,
130
- setCurrentPage: r,
131
- newPageNumber: s,
132
- onClick: c,
133
- disabled: t,
134
- pageData: N,
135
- isDateMode: a
145
+ dataTestIdReactMap: N,
146
+ currentPageNumber: m,
147
+ setCurrentPage: t,
148
+ newPageNumber: l,
149
+ onClick: b,
150
+ disabled: n,
151
+ pageData: c,
152
+ isDateMode: u
136
153
  },
137
- s
154
+ l
138
155
  )
139
156
  );
140
157
  }
141
- return h;
142
- }, D = $(
143
- (n, e) => {
158
+ return B;
159
+ }, nn = z(
160
+ (r, e) => {
144
161
  const {
145
- rootClassName: l,
146
- total: c,
147
- perPage: r = L,
148
- currentPageNumber: t = f,
149
- onChange: o,
150
- disabled: a = !1,
151
- hidePrevButton: h = !1,
152
- hideNextButton: s = !1,
153
- siblingCount: N,
154
- boundaryCount: u = 1,
155
- isDateMode: v = !1,
156
- pagesData: C
157
- } = n, [d, g] = j(t), b = Math.ceil(c / r), { width: w } = T(), R = w <= 650 ? 1 : 2, P = N !== void 0 ? N : R;
158
- let k = 0, _ = 0;
159
- return F(() => {
160
- g(t);
161
- }, [t]), d <= u + P + 1 ? (k = f, _ = Math.min(
162
- u + P * 2 + 1,
163
- b
164
- )) : d >= b - u - P ? (k = Math.max(
165
- b - u - P * 2,
166
- f
167
- ), _ = b) : (k = d - P, _ = d + P), c <= r ? null : /* @__PURE__ */ x(
162
+ rootClassName: m,
163
+ total: b,
164
+ perPage: t = W,
165
+ currentPageNumber: n = g,
166
+ onChange: i,
167
+ disabled: u = !1,
168
+ hidePrevButton: N = !1,
169
+ hideNextButton: B = !1,
170
+ siblingCount: l,
171
+ boundaryCount: c = 1,
172
+ isDateMode: E = !1,
173
+ pagesData: _,
174
+ dataTestIdReactMap: o
175
+ } = r, [f, v] = O(n), h = Math.ceil(b / t), { width: G } = q(), U = G <= 650 ? 1 : 2, A = l !== void 0 ? l : U;
176
+ let C = 0, x = 0;
177
+ return V(() => {
178
+ v(n);
179
+ }, [n]), f <= c + A + 1 ? (C = g, x = Math.min(
180
+ c + A * 2 + 1,
181
+ h
182
+ )) : f >= h - c - A ? (C = Math.max(
183
+ h - c - A * 2,
184
+ g
185
+ ), x = h) : (C = f - A, x = f + A), b <= t ? null : /* @__PURE__ */ y(
168
186
  "nav",
169
187
  {
188
+ "data-testid-react": o == null ? void 0 : o.pagination,
170
189
  "aria-label": "Постраничная навигация",
171
- className: E(p.container, l, {
172
- [p.disabled]: a,
173
- [p["container--date-mode"]]: v
190
+ className: S(P.container, m, {
191
+ [P.disabled]: u,
192
+ [P["container--date-mode"]]: E
174
193
  }),
175
194
  ref: e,
176
195
  children: [
177
- !h && /* @__PURE__ */ i(
178
- V,
196
+ !N && /* @__PURE__ */ s(
197
+ Q,
179
198
  {
180
- currentPageNumber: d,
181
- onClick: o,
182
- setCurrentPage: g,
183
- disabled: a
199
+ dataTestIdReactMap: {
200
+ backBtn: o == null ? void 0 : o.backBtn,
201
+ backButtons: o == null ? void 0 : o.backButtons
202
+ },
203
+ currentPageNumber: f,
204
+ onClick: i,
205
+ setCurrentPage: v,
206
+ disabled: u
184
207
  }
185
208
  ),
186
- k > f && /* @__PURE__ */ x(I, { children: [
187
- Array.from({ length: u }).map((S, A) => {
188
- const m = f + A;
189
- return m >= k ? null : /* @__PURE__ */ i(
190
- B,
209
+ C > g && /* @__PURE__ */ y(F, { children: [
210
+ Array.from({ length: c }).map((a, $) => {
211
+ const k = g + $;
212
+ return k >= C ? null : /* @__PURE__ */ s(
213
+ w,
191
214
  {
192
- newPageNumber: m,
193
- currentPageNumber: d,
194
- onClick: o,
195
- setCurrentPage: g,
196
- disabled: a,
197
- pageData: C == null ? void 0 : C[m - 1],
198
- isDateMode: v
215
+ newPageNumber: k,
216
+ currentPageNumber: f,
217
+ onClick: i,
218
+ setCurrentPage: v,
219
+ disabled: u,
220
+ pageData: _ == null ? void 0 : _[k - 1],
221
+ isDateMode: E
199
222
  },
200
- `boundary-start-${m}`
223
+ `boundary-start-${k}`
201
224
  );
202
225
  }),
203
- k > u + f && /* @__PURE__ */ i(M, {})
226
+ C > c + g && /* @__PURE__ */ s(L, {})
204
227
  ] }),
205
- q({
206
- start: k,
207
- end: _,
208
- currentPageNumber: d,
209
- setCurrentPage: g,
210
- onClick: o,
211
- disabled: a,
212
- pagesData: C,
213
- isDateMode: v
228
+ Y({
229
+ start: C,
230
+ end: x,
231
+ currentPageNumber: f,
232
+ setCurrentPage: v,
233
+ onClick: i,
234
+ disabled: u,
235
+ pagesData: _,
236
+ isDateMode: E,
237
+ dataTestIdReactMap: {
238
+ paginationBtn: o == null ? void 0 : o.paginationBtn
239
+ }
214
240
  }),
215
- _ < b && /* @__PURE__ */ x(I, { children: [
216
- _ < b - u && /* @__PURE__ */ i(M, {}),
217
- Array.from({ length: u }).map((S, A) => {
218
- const m = b - u + 1 + A;
219
- return m <= _ ? null : /* @__PURE__ */ i(
220
- B,
241
+ x < h && /* @__PURE__ */ y(F, { children: [
242
+ x < h - c && /* @__PURE__ */ s(L, {}),
243
+ Array.from({ length: c }).map((a, $) => {
244
+ const k = h - c + 1 + $;
245
+ return k <= x ? null : /* @__PURE__ */ s(
246
+ w,
221
247
  {
222
- newPageNumber: m,
223
- currentPageNumber: d,
224
- onClick: o,
225
- setCurrentPage: g,
226
- disabled: a,
227
- pageData: C == null ? void 0 : C[m - 1],
228
- isDateMode: v
248
+ dataTestIdReactMap: {
249
+ paginationBtn: o == null ? void 0 : o.paginationBtn
250
+ },
251
+ newPageNumber: k,
252
+ currentPageNumber: f,
253
+ onClick: i,
254
+ setCurrentPage: v,
255
+ disabled: u,
256
+ pageData: _ == null ? void 0 : _[k - 1],
257
+ isDateMode: E
229
258
  },
230
- `boundary-end-${m}`
259
+ `boundary-end-${k}`
231
260
  );
232
261
  })
233
262
  ] }),
234
- !s && /* @__PURE__ */ i(
235
- W,
263
+ !B && /* @__PURE__ */ s(
264
+ X,
236
265
  {
237
- currentPageNumber: d,
238
- setCurrentPage: g,
239
- lastPageNumber: b,
240
- onClick: o,
241
- disabled: a
266
+ dataTestIdReactMap: {
267
+ nextBtn: o == null ? void 0 : o.nextBtn,
268
+ nextButtons: o == null ? void 0 : o.nextButtons
269
+ },
270
+ currentPageNumber: f,
271
+ setCurrentPage: v,
272
+ lastPageNumber: h,
273
+ onClick: i,
274
+ disabled: u
242
275
  }
243
276
  )
244
277
  ]
@@ -247,5 +280,5 @@ import '../../assets/Pagination.css';const U = "_container_1b4hk_27", z = "_elli
247
280
  }
248
281
  );
249
282
  export {
250
- D as Pagination
283
+ nn as Pagination
251
284
  };
@@ -1,3 +1,5 @@
1
+ import { TDataTestIdReactMap } from '../../types';
2
+
1
3
  type TProps = {
2
4
  /**
3
5
  * число, которое представляет собой временную метку, указывающую время, когда истекает таймер.
@@ -16,9 +18,13 @@ type TProps = {
16
18
  * Дополнительный класс.
17
19
  */
18
20
  className?: string;
21
+ /**
22
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
23
+ */
24
+ dataTestIdReactMap?: TDataTestIdReactMap<'timer'>;
19
25
  };
20
26
  /**
21
27
  * Компонент Timer отображает таймер с отсчетом времени в минутах и секундах.
22
28
  */
23
- export declare const Timer: import('react').MemoExoticComponent<({ expiryTimestamp, autoStart, onTimerEnd, className }: TProps) => import("react/jsx-runtime").JSX.Element>;
29
+ export declare const Timer: import('react').MemoExoticComponent<({ expiryTimestamp, autoStart, onTimerEnd, className, dataTestIdReactMap }: TProps) => import("react/jsx-runtime").JSX.Element>;
24
30
  export {};
@@ -1,23 +1,36 @@
1
- import { jsxs as c } from "react/jsx-runtime";
2
- import { c as a } from "../../index-DIxK0V-G.js";
1
+ import { jsxs as f } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-DIxK0V-G.js";
3
3
  import { memo as p } from "react";
4
- import { useTimer as d } from "../../hooks/useTimer/index.js";
5
- import '../../assets/Timer.css';const f = "_timer_1gps8_2", l = {
6
- timer: f
7
- }, _ = p(
8
- ({ expiryTimestamp: t, autoStart: r = !1, onTimerEnd: s, className: e }) => {
9
- const { minutes: m, seconds: o } = d({
10
- expiryTimestamp: t,
11
- onExpire: s,
12
- autoStart: r
13
- }), i = String(m).padStart(2, "0"), n = String(o).padStart(2, "0");
14
- return /* @__PURE__ */ c("div", { className: a(l.timer, e), children: [
15
- i,
16
- ":",
17
- n
18
- ] });
4
+ import { useTimer as S } from "../../hooks/useTimer/index.js";
5
+ import '../../assets/Timer.css';const u = "_timer_1gps8_2", g = {
6
+ timer: u
7
+ }, h = p(
8
+ ({
9
+ expiryTimestamp: m,
10
+ autoStart: o = !1,
11
+ onTimerEnd: t,
12
+ className: s,
13
+ dataTestIdReactMap: r
14
+ }) => {
15
+ const { minutes: i, seconds: e } = S({
16
+ expiryTimestamp: m,
17
+ onExpire: t,
18
+ autoStart: o
19
+ }), n = String(i).padStart(2, "0"), c = String(e).padStart(2, "0");
20
+ return /* @__PURE__ */ f(
21
+ "div",
22
+ {
23
+ "data-testid-react": r == null ? void 0 : r.timer,
24
+ className: l(g.timer, s),
25
+ children: [
26
+ n,
27
+ ":",
28
+ c
29
+ ]
30
+ }
31
+ );
19
32
  }
20
33
  );
21
34
  export {
22
- _ as Timer
35
+ h as Timer
23
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.65.7",
4
+ "version": "1.66.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {