mimir-ui-kit 1.40.0 → 1.41.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.
- package/dist/assets/CardTrail.css +1 -0
- package/dist/components/CardTrail/CardTrail.d.ts +50 -0
- package/dist/components/CardTrail/CardTrail.js +139 -0
- package/dist/components/CardTrail/constants.d.ts +2 -0
- package/dist/components/CardTrail/constants.js +5 -0
- package/dist/components/CardTrail/index.d.ts +1 -0
- package/dist/components/CardTrail/index.js +4 -0
- package/dist/components/CardTrail/types.d.ts +1 -0
- package/dist/components/CardTrail/utils.d.ts +9 -0
- package/dist/components/CardTrail/utils.js +9 -0
- package/dist/components/MergedButton/MergedButton.d.ts +5 -1
- package/dist/components/MergedButton/MergedButton.js +44 -42
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +12 -10
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +17 -13
- package/dist/hooks/useCallbackRef/index.d.ts +1 -0
- package/dist/hooks/useCallbackRef/index.js +13 -0
- package/dist/hooks/useThrottledCallback/index.d.ts +2 -0
- package/dist/hooks/useThrottledCallback/index.js +27 -0
- package/dist/index.js +154 -148
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
._card-trail_pmokd_3{display:flex;flex-direction:column}._card-trail-header_pmokd_7{display:flex;align-items:flex-end;justify-content:space-between}._card-trail-header_pmokd_7:not(:last-child){margin-bottom:var(--mimir-space-xs)}._card-trail-header-title_pmokd_15{font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-l);font-family:var(--mimir-font-montserrat);line-height:var(--mimir-line-height-text-s1);letter-spacing:calc(var(--mimir-size-text-l) * -.02)}@media (max-width: 600px){._card-trail-header-title_pmokd_15{font-size:var(--mimir-size-text-m);letter-spacing:calc(var(--mimir-size-text-m) * -.02)}}._card-trail-header-merged-button_pmokd_28{margin-left:auto}._card-trail-list_pmokd_31{display:flex;padding:0;overflow:auto;white-space:nowrap;scroll-behavior:smooth;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}._card-trail-list_pmokd_31::-webkit-scrollbar{display:none}._card-trail-list-item_pmokd_43{scroll-snap-align:start;white-space:normal;white-space:initial}._card-trail-list-item_pmokd_43._pointer_pmokd_47{cursor:pointer}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { TButtonPropsWithoutStyles } from '../MergedButton';
|
2
|
+
|
3
|
+
export type TProps = {
|
4
|
+
/**
|
5
|
+
* Заголовок списка.
|
6
|
+
*/
|
7
|
+
title?: string;
|
8
|
+
/**
|
9
|
+
* Расстояние между карточками.
|
10
|
+
*/
|
11
|
+
spaceBetween?: number;
|
12
|
+
/**
|
13
|
+
* Количество карточек для перелистывания.
|
14
|
+
*/
|
15
|
+
scrollStep?: number;
|
16
|
+
/**
|
17
|
+
* Флаг, определяющий, нужно ли при клике на карточку скроллиться до нее.
|
18
|
+
*/
|
19
|
+
scrollToCard?: boolean;
|
20
|
+
/**
|
21
|
+
* Дополнительные пропсы для кнопок переключения.
|
22
|
+
*/
|
23
|
+
mergedButtonProps?: {
|
24
|
+
leftButton?: TButtonPropsWithoutStyles;
|
25
|
+
rightButton?: TButtonPropsWithoutStyles;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* Класс, применяемый к обертке списка (section).
|
29
|
+
*/
|
30
|
+
cardTrailClassName?: string;
|
31
|
+
/**
|
32
|
+
* Класс, применяемый к заголовку списка (header).
|
33
|
+
*/
|
34
|
+
cardTrailHeaderClassName?: string;
|
35
|
+
/**
|
36
|
+
* Класс, применяемый к списку карточек (ul).
|
37
|
+
*/
|
38
|
+
cardTrailListClassName?: string;
|
39
|
+
/**
|
40
|
+
* Класс, применяемый к кнопкам переключения (MergedButton).
|
41
|
+
*/
|
42
|
+
cardTrailMergedButtonClassName?: string;
|
43
|
+
/**
|
44
|
+
* Класс, применяемый к карточке.
|
45
|
+
*/
|
46
|
+
cardClassName?: string;
|
47
|
+
};
|
48
|
+
export declare const CardTrail: import('react').ForwardRefExoticComponent<TProps & {
|
49
|
+
children?: import('react').ReactNode | undefined;
|
50
|
+
} & import('react').RefAttributes<HTMLUListElement>>;
|
@@ -0,0 +1,139 @@
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { c as i } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as D, useRef as I, useState as p, useEffect as x, Children as H } from "react";
|
4
|
+
import { DEFAULT_SPACE_BETWEEN as R, DEFAULT_SCROLL_STEP as j } from "./constants.js";
|
5
|
+
import { hasHorizontalScroll as _, isScrollAtEdge as C } from "./utils.js";
|
6
|
+
import { useMergeRefs as F } from "../../hooks/useMergeRefs/useMergeRefs.js";
|
7
|
+
import { useThrottledCallback as U } from "../../hooks/useThrottledCallback/index.js";
|
8
|
+
import { MergedButton as $ } from "../MergedButton/MergedButton.js";
|
9
|
+
import '../../assets/CardTrail.css';const q = "_pointer_pmokd_47", l = {
|
10
|
+
"card-trail": "_card-trail_pmokd_3",
|
11
|
+
"card-trail-header": "_card-trail-header_pmokd_7",
|
12
|
+
"card-trail-header-title": "_card-trail-header-title_pmokd_15",
|
13
|
+
"card-trail-header-merged-button": "_card-trail-header-merged-button_pmokd_28",
|
14
|
+
"card-trail-list": "_card-trail-list_pmokd_31",
|
15
|
+
"card-trail-list-item": "_card-trail-list-item_pmokd_43",
|
16
|
+
pointer: q
|
17
|
+
}, Y = D((g, B) => {
|
18
|
+
const {
|
19
|
+
cardClassName: k,
|
20
|
+
cardTrailClassName: N,
|
21
|
+
cardTrailHeaderClassName: b,
|
22
|
+
cardTrailListClassName: S,
|
23
|
+
cardTrailMergedButtonClassName: E,
|
24
|
+
children: d,
|
25
|
+
title: m,
|
26
|
+
spaceBetween: s = R,
|
27
|
+
scrollStep: h = j,
|
28
|
+
mergedButtonProps: c,
|
29
|
+
scrollToCard: u = !1
|
30
|
+
} = g, t = I(null), [o, T] = p({
|
31
|
+
leftButton: !0,
|
32
|
+
rightButton: !1
|
33
|
+
}), [L, v] = p(
|
34
|
+
() => _(t == null ? void 0 : t.current)
|
35
|
+
), y = F(t, B), A = U(() => {
|
36
|
+
const e = !C(t.current, "left"), r = !C(t.current, "right");
|
37
|
+
T({
|
38
|
+
leftButton: !e,
|
39
|
+
rightButton: !r
|
40
|
+
});
|
41
|
+
}, 300), W = (e) => () => {
|
42
|
+
var a;
|
43
|
+
if (!u)
|
44
|
+
return;
|
45
|
+
const r = (a = t == null ? void 0 : t.current) == null ? void 0 : a.querySelector(
|
46
|
+
`[data-active-card='${e}']`
|
47
|
+
);
|
48
|
+
r && (r == null || r.scrollIntoView({
|
49
|
+
behavior: "smooth",
|
50
|
+
block: "nearest",
|
51
|
+
inline: "center"
|
52
|
+
}));
|
53
|
+
}, w = () => {
|
54
|
+
var a;
|
55
|
+
if (!t.current || o.leftButton) return;
|
56
|
+
const e = t.current, r = ((a = e.children[0]) == null ? void 0 : a.clientWidth) ?? 0;
|
57
|
+
e.scrollBy({
|
58
|
+
left: -(r + s) * h,
|
59
|
+
behavior: "smooth"
|
60
|
+
});
|
61
|
+
}, M = () => {
|
62
|
+
var a;
|
63
|
+
if (!t.current || o.rightButton) return;
|
64
|
+
const e = t.current, r = ((a = e.children[0]) == null ? void 0 : a.clientWidth) ?? 0;
|
65
|
+
e.scrollBy({
|
66
|
+
left: (r + s) * h,
|
67
|
+
behavior: "smooth"
|
68
|
+
});
|
69
|
+
};
|
70
|
+
return x(() => {
|
71
|
+
v(_(t == null ? void 0 : t.current));
|
72
|
+
}, [d]), /* @__PURE__ */ f("section", { className: i(l["card-trail"], N), children: [
|
73
|
+
/* @__PURE__ */ f(
|
74
|
+
"header",
|
75
|
+
{
|
76
|
+
className: i(
|
77
|
+
l["card-trail-header"],
|
78
|
+
b
|
79
|
+
),
|
80
|
+
children: [
|
81
|
+
m && /* @__PURE__ */ n("h3", { className: l["card-trail-header-title"], children: m }),
|
82
|
+
L && /* @__PURE__ */ n(
|
83
|
+
$,
|
84
|
+
{
|
85
|
+
buttonsWrapperClassName: i(
|
86
|
+
l["card-trail-header-merged-button"],
|
87
|
+
E
|
88
|
+
),
|
89
|
+
buttons: [
|
90
|
+
{
|
91
|
+
isIconButton: !0,
|
92
|
+
iconName: "ArrowLeft16px",
|
93
|
+
variant: "gray",
|
94
|
+
onClick: w,
|
95
|
+
disabled: o.leftButton,
|
96
|
+
...c == null ? void 0 : c.leftButton
|
97
|
+
},
|
98
|
+
{
|
99
|
+
isIconButton: !0,
|
100
|
+
iconName: "ArrowRight16px",
|
101
|
+
variant: "gray",
|
102
|
+
onClick: M,
|
103
|
+
disabled: o.rightButton,
|
104
|
+
...c == null ? void 0 : c.rightButton
|
105
|
+
}
|
106
|
+
]
|
107
|
+
}
|
108
|
+
)
|
109
|
+
]
|
110
|
+
}
|
111
|
+
),
|
112
|
+
/* @__PURE__ */ n(
|
113
|
+
"ul",
|
114
|
+
{
|
115
|
+
onScroll: A,
|
116
|
+
style: { gap: s },
|
117
|
+
className: i(l["card-trail-list"], S),
|
118
|
+
ref: y,
|
119
|
+
children: H.map(d, (e, r) => /* @__PURE__ */ n(
|
120
|
+
"li",
|
121
|
+
{
|
122
|
+
onClick: W(r),
|
123
|
+
"data-active-card": r,
|
124
|
+
"data-testid": `card-trail-item-${r}`,
|
125
|
+
className: i(
|
126
|
+
l["card-trail-list-item"],
|
127
|
+
{ [l.pointer]: u },
|
128
|
+
k
|
129
|
+
),
|
130
|
+
children: e
|
131
|
+
}
|
132
|
+
))
|
133
|
+
}
|
134
|
+
)
|
135
|
+
] });
|
136
|
+
});
|
137
|
+
export {
|
138
|
+
Y as CardTrail
|
139
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { CardTrail } from './CardTrail';
|
@@ -0,0 +1 @@
|
|
1
|
+
export type TSpaceBetween = '3xs' | '2xs' | '1xs' | 'xs' | 'xss' | 's' | '2s' | 'm' | '2m' | 'l' | '2l' | 'xl' | '1xl' | '2xl' | '2xxl' | 'xxl' | '3xl' | '4xl' | '5xl' | '4xxl' | '5xxl' | '6xl';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Проверяет, достигнут ли край скролла в контейнере
|
3
|
+
* @param container Элемент контейнера
|
4
|
+
* @param direction Направление проверки ('left' или 'right')
|
5
|
+
* @param tolerance Допустимая погрешность в пикселях (по умолчанию 1)
|
6
|
+
* @returns true, если скроллить дальше некуда
|
7
|
+
*/
|
8
|
+
export declare const isScrollAtEdge: (container: HTMLElement | null, direction: "left" | "right", tolerance?: number) => boolean;
|
9
|
+
export declare const hasHorizontalScroll: (element: HTMLElement | null) => boolean;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
const c = (r, i, t = 1) => {
|
2
|
+
if (!r) return !0;
|
3
|
+
const { scrollLeft: l, scrollWidth: s, clientWidth: o } = r;
|
4
|
+
return i === "left" ? l <= t : l >= s - o - t;
|
5
|
+
}, e = (r) => r ? r.scrollWidth > r.clientWidth : !1;
|
6
|
+
export {
|
7
|
+
e as hasHorizontalScroll,
|
8
|
+
c as isScrollAtEdge
|
9
|
+
};
|
@@ -10,9 +10,13 @@ type TProps = {
|
|
10
10
|
* Массив кнопок, который отрисуется в контейнере
|
11
11
|
* */
|
12
12
|
buttons: TButtonPropsWithoutStyles[];
|
13
|
+
/**
|
14
|
+
* Класс, применяемый к списку карточек (ul).
|
15
|
+
*/
|
16
|
+
buttonsWrapperClassName?: string;
|
13
17
|
};
|
14
18
|
/**
|
15
19
|
* Компонент объединенных кнопок, с округлением у первой и последней кнопки, а так же с другими variant, нежели у обычного Button.
|
16
20
|
*/
|
17
|
-
export declare const MergedButton: import('react').MemoExoticComponent<({ buttons }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
21
|
+
export declare const MergedButton: import('react').MemoExoticComponent<({ buttons, buttonsWrapperClassName }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
18
22
|
export {};
|
@@ -1,48 +1,50 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { c as
|
3
|
-
import { memo as
|
4
|
-
import { EMergedButtonVariantRound as
|
5
|
-
import { Button as
|
6
|
-
import '../../assets/MergedButton.css';const
|
7
|
-
buttons:
|
2
|
+
import { c as s } from "../../index-DIxK0V-G.js";
|
3
|
+
import { memo as u } from "react";
|
4
|
+
import { EMergedButtonVariantRound as g } from "./constants.js";
|
5
|
+
import { Button as p } from "../Button/Button.js";
|
6
|
+
import '../../assets/MergedButton.css';const d = "_buttons_l320r_2", B = "_gray_l320r_28", I = "_white_l320r_36", f = "_transparent_l320r_44", o = {
|
7
|
+
buttons: d,
|
8
8
|
"merged-button": "_merged-button_l320r_6",
|
9
|
-
gray:
|
10
|
-
white:
|
11
|
-
transparent:
|
9
|
+
gray: B,
|
10
|
+
white: I,
|
11
|
+
transparent: f,
|
12
12
|
"is-icon": "_is-icon_l320r_53",
|
13
13
|
"one-button": "_one-button_l320r_57"
|
14
|
-
},
|
15
|
-
({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
14
|
+
}, h = u(
|
15
|
+
({ buttons: r, buttonsWrapperClassName: c }) => /* @__PURE__ */ e("div", { className: s(o.buttons, c), children: r.map(
|
16
|
+
({
|
17
|
+
variant: i = g.White,
|
18
|
+
disabled: n,
|
19
|
+
className: a,
|
20
|
+
...t
|
21
|
+
}, m) => {
|
22
|
+
const _ = {
|
23
|
+
...t,
|
24
|
+
isIconButton: t.isIconButton ?? !1,
|
25
|
+
iconName: t.isIconButton ? t.iconName : void 0,
|
26
|
+
leftIcon: t.isIconButton ? void 0 : t.leftIcon,
|
27
|
+
rightIcon: t.isIconButton ? void 0 : t.rightIcon
|
28
|
+
}, l = s(o["merged-button"], a, {
|
29
|
+
[o[i]]: !n,
|
30
|
+
[o.disabled]: n,
|
31
|
+
[o["is-icon"]]: t.isIconButton,
|
32
|
+
[o["one-button"]]: r.length === 1
|
33
|
+
});
|
34
|
+
return /* @__PURE__ */ e(
|
35
|
+
p,
|
36
|
+
{
|
37
|
+
clear: !0,
|
38
|
+
disabled: n,
|
39
|
+
className: l,
|
40
|
+
..._
|
41
|
+
},
|
42
|
+
m
|
43
|
+
);
|
44
|
+
}
|
45
|
+
) })
|
46
|
+
);
|
47
|
+
h.displayName = "MergedButton";
|
46
48
|
export {
|
47
|
-
|
49
|
+
h as MergedButton
|
48
50
|
};
|
@@ -71,3 +71,4 @@ export { EMessageShortReplyVariant, type TMessageShortReplyProps } from './Messa
|
|
71
71
|
export { Table } from './Table';
|
72
72
|
export { ESortDirection, ETableVariant, ETableDisplayMode, ETableScrollButtonVariant, ETableScrollIconName } from './Table';
|
73
73
|
export { PromoSlider } from './PromoSlider';
|
74
|
+
export { CardTrail } from './CardTrail';
|
package/dist/components/index.js
CHANGED
@@ -11,7 +11,7 @@ import { OtpInput as L } from "./OtpInput/OtpInput.js";
|
|
11
11
|
import { RadioGroup as A } from "./RadioGroup/RadioGroup.js";
|
12
12
|
import { DatePicker as U } from "./DatePicker/DatePicker.js";
|
13
13
|
import { MergedButton as y } from "./MergedButton/MergedButton.js";
|
14
|
-
import { EMergedButtonVariantRound as
|
14
|
+
import { EMergedButtonVariantRound as D } from "./MergedButton/constants.js";
|
15
15
|
import { AppImage as v } from "./Image/Image.js";
|
16
16
|
import { Loader as N } from "./Loader/Loader.js";
|
17
17
|
import { ELoaderSize as O } from "./Loader/constants.js";
|
@@ -36,7 +36,7 @@ import { TabTrail as bo } from "./TabTrail/TabTrail.js";
|
|
36
36
|
import { ETabTrailSize as Mo } from "./TabTrail/constants.js";
|
37
37
|
import { Pagination as Ro } from "./Pagination/Pagination.js";
|
38
38
|
import { ToastProvider as wo } from "./Toasts/ToastsProvider.js";
|
39
|
-
import { useToast as
|
39
|
+
import { useToast as Co } from "./Toasts/hooks.js";
|
40
40
|
import { EToastPosition as Fo, EToastVariant as vo } from "./Toasts/constants.js";
|
41
41
|
import { UploaderPhotos as No } from "./UploaderPhotos/UploaderPhotos.js";
|
42
42
|
import { UploaderFiles as Oo } from "./UploaderFiles/UploaderFiles.js";
|
@@ -61,7 +61,7 @@ import { SkeletonBrick as Lr } from "./Skeleton/SkeletonBrick/SkeletonBrick.js";
|
|
61
61
|
import { SkeletonText as Ar } from "./Skeleton/SkeletonText/SkeletonText.js";
|
62
62
|
import { SkeletonCircle as Ur } from "./Skeleton/SkeletonCircle/SkeletonCircle.js";
|
63
63
|
import { ESkeletonVariant as yr } from "./Skeleton/constants.js";
|
64
|
-
import { Avatar as
|
64
|
+
import { Avatar as Dr } from "./Avatar/Avatar.js";
|
65
65
|
import { EAvatarSize as vr } from "./Avatar/constants.js";
|
66
66
|
import { MultiSelectSearch as Nr } from "./MultiSelectSearch/MultiSelectSearch.js";
|
67
67
|
import { EMultiSelectSearchSize as Or } from "./MultiSelectSearch/constants.js";
|
@@ -73,13 +73,15 @@ import { EMessageShortReplyVariant as _r } from "./MessageShortReply/constants.j
|
|
73
73
|
import { Table as oe } from "./Table/Table.js";
|
74
74
|
import { ESortDirection as ee, ETableDisplayMode as te, ETableScrollButtonVariant as pe, ETableScrollIconName as ae, ETableVariant as ie } from "./Table/constants.js";
|
75
75
|
import { PromoSlider as fe } from "./PromoSlider/PromoSlider.js";
|
76
|
-
import {
|
77
|
-
import {
|
76
|
+
import { CardTrail as ne } from "./CardTrail/CardTrail.js";
|
77
|
+
import { default as Ee } from "./Slider/Slider.js";
|
78
|
+
import { EProgressBarPosition as se } from "./Slider/constants.js";
|
78
79
|
export {
|
79
80
|
go as Accordion,
|
80
81
|
ko as AccordionItem,
|
81
|
-
|
82
|
+
Dr as Avatar,
|
82
83
|
e as Button,
|
84
|
+
ne as CardTrail,
|
83
85
|
lo as CheckboxMimir,
|
84
86
|
tr as Chip,
|
85
87
|
U as DatePicker,
|
@@ -108,11 +110,11 @@ export {
|
|
108
110
|
Xo as ELinkSize,
|
109
111
|
Yo as ELinkVariant,
|
110
112
|
O as ELoaderSize,
|
111
|
-
|
113
|
+
D as EMergedButtonVariantRound,
|
112
114
|
_r as EMessageShortReplyVariant,
|
113
115
|
Or as EMultiSelectSearchSize,
|
114
116
|
rr as ENotificationBadgeSize,
|
115
|
-
|
117
|
+
se as EProgressBarPosition,
|
116
118
|
xo as ESelectSearchSize,
|
117
119
|
yr as ESkeletonVariant,
|
118
120
|
ee as ESortDirection,
|
@@ -153,7 +155,7 @@ export {
|
|
153
155
|
Lr as SkeletonBrick,
|
154
156
|
Ur as SkeletonCircle,
|
155
157
|
Ar as SkeletonText,
|
156
|
-
|
158
|
+
Ee as Slider,
|
157
159
|
q as SliderLazy,
|
158
160
|
_ as Steps,
|
159
161
|
zr as Switcher,
|
@@ -171,5 +173,5 @@ export {
|
|
171
173
|
to as Vote,
|
172
174
|
k as getMaskedInputPhoneValue,
|
173
175
|
P as getUnmaskedInputValue,
|
174
|
-
|
176
|
+
Co as useToast
|
175
177
|
};
|
package/dist/hooks/index.d.ts
CHANGED
@@ -5,3 +5,5 @@ export { useTimer } from './useTimer';
|
|
5
5
|
export { useCopyToClipboard } from './useCopyToClipboard';
|
6
6
|
export { useMergeRefs } from './useMergeRefs';
|
7
7
|
export { useResizeObserver } from './useResizeObserver';
|
8
|
+
export { useCallbackRef } from './useCallbackRef';
|
9
|
+
export { useThrottledCallback } from './useThrottledCallback';
|
package/dist/hooks/index.js
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
import { useMediaQuery as o } from "./useMediaQuery/useMediaQuery.js";
|
2
|
-
import { EMediaQuery as
|
3
|
-
import { useLockBodyScroll as
|
2
|
+
import { EMediaQuery as f, EMinMediaQuery as p } from "./useMediaQuery/constants.js";
|
3
|
+
import { useLockBodyScroll as u } from "./useLockBodyScroll/useLockBodyScroll.js";
|
4
4
|
import { useInterval as x } from "./useInterval/useInterval.js";
|
5
|
-
import { useTimer as
|
6
|
-
import { useCopyToClipboard as
|
7
|
-
import { useMergeRefs as
|
8
|
-
import { useResizeObserver as
|
5
|
+
import { useTimer as l } from "./useTimer/index.js";
|
6
|
+
import { useCopyToClipboard as d } from "./useCopyToClipboard/useCopyToClipboard.js";
|
7
|
+
import { useMergeRefs as M } from "./useMergeRefs/useMergeRefs.js";
|
8
|
+
import { useResizeObserver as c } from "./useResizeObserver/useResizeObserver.js";
|
9
|
+
import { useCallbackRef as k } from "./useCallbackRef/index.js";
|
10
|
+
import { useThrottledCallback as R } from "./useThrottledCallback/index.js";
|
9
11
|
export {
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
f as EMediaQuery,
|
13
|
+
p as EMinMediaQuery,
|
14
|
+
k as useCallbackRef,
|
15
|
+
d as useCopyToClipboard,
|
13
16
|
x as useInterval,
|
14
|
-
|
17
|
+
u as useLockBodyScroll,
|
15
18
|
o as useMediaQuery,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
M as useMergeRefs,
|
20
|
+
c as useResizeObserver,
|
21
|
+
R as useThrottledCallback,
|
22
|
+
l as useTimer
|
19
23
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useCallbackRef<T extends (...args: unknown[]) => unknown>(callback: T | undefined): T;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { useRef as n, useEffect as o, useMemo as f } from "react";
|
2
|
+
function m(r) {
|
3
|
+
const e = n(r);
|
4
|
+
return o(() => {
|
5
|
+
e.current = r;
|
6
|
+
}), f(() => (...u) => {
|
7
|
+
var t;
|
8
|
+
return (t = e.current) == null ? void 0 : t.call(e, ...u);
|
9
|
+
}, []);
|
10
|
+
}
|
11
|
+
export {
|
12
|
+
m as useCallbackRef
|
13
|
+
};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export declare function useThrottledCallbackWithClearTimeout<T extends (...args: unknown[]) => unknown>(callback: T, wait: number): readonly [(...args: Parameters<T>) => void, () => void];
|
2
|
+
export declare function useThrottledCallback<T extends (...args: unknown[]) => unknown>(callback: T, wait: number): (...args: Parameters<T>) => void;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { useRef as c, useCallback as i, useEffect as T } from "react";
|
2
|
+
import { useCallbackRef as b } from "../useCallbackRef/index.js";
|
3
|
+
function k(u, e) {
|
4
|
+
const f = b(u), r = c(null), m = c(null), l = c(!0), o = c(e), s = c(-1), d = () => window.clearTimeout(s.current), n = i(
|
5
|
+
(...t) => {
|
6
|
+
f(...t), r.current = t, m.current = t, l.current = !1;
|
7
|
+
},
|
8
|
+
[f]
|
9
|
+
), a = i(() => {
|
10
|
+
r.current && r.current !== m.current ? (n(...r.current), s.current = window.setTimeout(a, o.current)) : l.current = !0;
|
11
|
+
}, [n]), C = i(
|
12
|
+
(...t) => {
|
13
|
+
l.current ? (n(...t), s.current = window.setTimeout(a, o.current)) : r.current = t;
|
14
|
+
},
|
15
|
+
[n, a]
|
16
|
+
);
|
17
|
+
return T(() => {
|
18
|
+
o.current = e;
|
19
|
+
}, [e]), [C, d];
|
20
|
+
}
|
21
|
+
function w(u, e) {
|
22
|
+
return k(u, e)[0];
|
23
|
+
}
|
24
|
+
export {
|
25
|
+
w as useThrottledCallback,
|
26
|
+
k as useThrottledCallbackWithClearTimeout
|
27
|
+
};
|
package/dist/index.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Button as e } from "./components/Button/Button.js";
|
2
2
|
import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as m, EButtonVariantDefault as i, EButtonVariantOutline as f, EButtonVariantRound as x } from "./components/Button/constants.js";
|
3
3
|
import { I as l } from "./Input-DAmc_HxO.js";
|
4
|
-
import { EInputSize as
|
4
|
+
import { EInputSize as u, EInputStatus as E, EInputVariant as S } from "./components/Input/constants.js";
|
5
5
|
import { TextArea as c } from "./components/TextArea/TextArea.js";
|
6
6
|
import { ETextAreaInputSize as I } from "./components/TextArea/constants.js";
|
7
7
|
import { InputPassword as V } from "./components/InputPassword/InputPassword.js";
|
8
|
-
import { InputPhoneNumber as
|
9
|
-
import { getMaskedInputPhoneValue as
|
10
|
-
import { OtpInput as
|
11
|
-
import { RadioGroup as
|
12
|
-
import { DatePicker as
|
8
|
+
import { InputPhoneNumber as z } from "./components/InputPhoneNumber/InputPhoneNumber.js";
|
9
|
+
import { getMaskedInputPhoneValue as B, getUnmaskedInputValue as P } from "./components/InputPhoneNumber/utils.js";
|
10
|
+
import { OtpInput as M } from "./components/OtpInput/OtpInput.js";
|
11
|
+
import { RadioGroup as C } from "./components/RadioGroup/RadioGroup.js";
|
12
|
+
import { DatePicker as L } from "./components/DatePicker/DatePicker.js";
|
13
13
|
import { MergedButton as D } from "./components/MergedButton/MergedButton.js";
|
14
14
|
import { EMergedButtonVariantRound as w } from "./components/MergedButton/constants.js";
|
15
15
|
import { AppImage as F } from "./components/Image/Image.js";
|
@@ -20,179 +20,185 @@ import { Drawer as H } from "./components/Drawer/Drawer.js";
|
|
20
20
|
import { EDrawerPosition as K } from "./components/Drawer/constants.js";
|
21
21
|
import { Dropdown as X } from "./components/Dropdown/Dropdown.js";
|
22
22
|
import { Steps as _ } from "./components/Steps/Steps.js";
|
23
|
-
import { EStepColor as
|
24
|
-
import { Vote as
|
25
|
-
import { EVoteSize as
|
26
|
-
import { SelectSearch as
|
27
|
-
import { ESelectSearchSize as
|
28
|
-
import { CheckboxMimir as
|
29
|
-
import { Tag as
|
30
|
-
import { ETagSize as
|
31
|
-
import { Timer as
|
32
|
-
import { Accordion as
|
33
|
-
import { EAccordionSize as
|
34
|
-
import { AccordionItem as
|
35
|
-
import { TabTrail as
|
36
|
-
import { ETabTrailSize as
|
37
|
-
import { Pagination as
|
38
|
-
import { ToastProvider as
|
39
|
-
import { useToast as
|
40
|
-
import { EToastPosition as
|
41
|
-
import { UploaderPhotos as
|
42
|
-
import { UploaderFiles as
|
43
|
-
import { EUploaderFilesVariant as
|
44
|
-
import { Uploader as
|
45
|
-
import { Link as
|
46
|
-
import { ELinkSize as
|
47
|
-
import { NotificationBadge as
|
48
|
-
import { ENotificationBadgeSize as
|
49
|
-
import { Chip as
|
50
|
-
import { EChipSize as
|
51
|
-
import { UniversalUploader as
|
52
|
-
import { EUploaderType as
|
53
|
-
import { InputRangeSlider as
|
54
|
-
import { EInputRangeSliderBorderState as
|
55
|
-
import { GosZnak as
|
56
|
-
import { EGosZnakSize as
|
57
|
-
import { Switcher as
|
58
|
-
import { ELabelPositions as
|
59
|
-
import { TwinSwitcher as
|
60
|
-
import { SkeletonBrick as
|
61
|
-
import { SkeletonText as
|
62
|
-
import { SkeletonCircle as
|
63
|
-
import { ESkeletonVariant as
|
64
|
-
import { Avatar as
|
65
|
-
import { EAvatarSize as
|
66
|
-
import { MultiSelectSearch as
|
67
|
-
import { EMultiSelectSearchSize as
|
68
|
-
import { ListFiles as
|
69
|
-
import { EFileItemVariant as
|
70
|
-
import { ListPhotos as
|
71
|
-
import { MessageShortReply as
|
72
|
-
import { EMessageShortReplyVariant as
|
73
|
-
import { Table as
|
23
|
+
import { EStepColor as rr, EStepsSize as or } from "./components/Steps/constants.js";
|
24
|
+
import { Vote as tr } from "./components/Vote/Vote.js";
|
25
|
+
import { EVoteSize as ar } from "./components/Vote/constants.js";
|
26
|
+
import { SelectSearch as ir } from "./components/SelectSearch/SelectSearch.js";
|
27
|
+
import { ESelectSearchSize as xr } from "./components/SelectSearch/constants.js";
|
28
|
+
import { CheckboxMimir as lr } from "./components/CheckboxMimir/CheckboxMimir.js";
|
29
|
+
import { Tag as ur } from "./components/Tag/Tag.js";
|
30
|
+
import { ETagSize as Sr, ETagType as dr } from "./components/Tag/constants.js";
|
31
|
+
import { Timer as Tr } from "./components/Timer/Timer.js";
|
32
|
+
import { Accordion as gr } from "./components/Accordion/Accordion.js";
|
33
|
+
import { EAccordionSize as kr } from "./components/Accordion/constants.js";
|
34
|
+
import { AccordionItem as hr } from "./components/Accordion/AccordionItem/AccordionItem.js";
|
35
|
+
import { TabTrail as Pr } from "./components/TabTrail/TabTrail.js";
|
36
|
+
import { ETabTrailSize as Mr } from "./components/TabTrail/constants.js";
|
37
|
+
import { Pagination as Cr } from "./components/Pagination/Pagination.js";
|
38
|
+
import { ToastProvider as Lr } from "./components/Toasts/ToastsProvider.js";
|
39
|
+
import { useToast as Dr } from "./components/Toasts/hooks.js";
|
40
|
+
import { EToastPosition as wr, EToastVariant as vr } from "./components/Toasts/constants.js";
|
41
|
+
import { UploaderPhotos as Gr } from "./components/UploaderPhotos/UploaderPhotos.js";
|
42
|
+
import { UploaderFiles as Or } from "./components/UploaderFiles/UploaderFiles.js";
|
43
|
+
import { EUploaderFilesVariant as Zr } from "./components/UploaderFiles/constants.js";
|
44
|
+
import { Uploader as qr } from "./components/Uploader/Uploader.js";
|
45
|
+
import { Link as Jr } from "./components/AnchorLink/Link.js";
|
46
|
+
import { ELinkSize as Wr, ELinkVariant as Xr } from "./components/AnchorLink/constants.js";
|
47
|
+
import { NotificationBadge as _r } from "./components/NotificationBadge/NotificationBadge.js";
|
48
|
+
import { ENotificationBadgeSize as ro } from "./components/NotificationBadge/constants.js";
|
49
|
+
import { Chip as eo } from "./components/Chip/Chip.js";
|
50
|
+
import { EChipSize as po, EChipVariant as ao } from "./components/Chip/constants.js";
|
51
|
+
import { UniversalUploader as io } from "./components/UniversalUploader/UniversalUploader.js";
|
52
|
+
import { EUploaderType as xo } from "./components/UniversalUploader/constants.js";
|
53
|
+
import { InputRangeSlider as lo } from "./components/InputRangeSlider/InputRangeSlider.js";
|
54
|
+
import { EInputRangeSliderBorderState as uo, EInputRangeSliderPositions as Eo } from "./components/InputRangeSlider/constants.js";
|
55
|
+
import { GosZnak as co } from "./components/GosZnak/GosZnak.js";
|
56
|
+
import { EGosZnakSize as Io, EGosZnakType as go } from "./components/GosZnak/constants.js";
|
57
|
+
import { Switcher as ko } from "./components/Switcher/Switcher.js";
|
58
|
+
import { ELabelPositions as ho } from "./components/Switcher/constants.js";
|
59
|
+
import { TwinSwitcher as Po } from "./components/TwinSwitcher/TwinSwitcher.js";
|
60
|
+
import { SkeletonBrick as Mo } from "./components/Skeleton/SkeletonBrick/SkeletonBrick.js";
|
61
|
+
import { SkeletonText as Co } from "./components/Skeleton/SkeletonText/SkeletonText.js";
|
62
|
+
import { SkeletonCircle as Lo } from "./components/Skeleton/SkeletonCircle/SkeletonCircle.js";
|
63
|
+
import { ESkeletonVariant as Do } from "./components/Skeleton/constants.js";
|
64
|
+
import { Avatar as wo } from "./components/Avatar/Avatar.js";
|
65
|
+
import { EAvatarSize as Fo } from "./components/Avatar/constants.js";
|
66
|
+
import { MultiSelectSearch as No } from "./components/MultiSelectSearch/MultiSelectSearch.js";
|
67
|
+
import { EMultiSelectSearchSize as Qo } from "./components/MultiSelectSearch/constants.js";
|
68
|
+
import { ListFiles as jo } from "./components/ListFiles/ListFiles.js";
|
69
|
+
import { EFileItemVariant as Ho } from "./components/ListFiles/constants.js";
|
70
|
+
import { ListPhotos as Ko } from "./components/ListPhotos/ListPhotos.js";
|
71
|
+
import { MessageShortReply as Xo } from "./components/MessageShortReply/MessageShortReply.js";
|
72
|
+
import { EMessageShortReplyVariant as _o } from "./components/MessageShortReply/constants.js";
|
73
|
+
import { Table as re } from "./components/Table/Table.js";
|
74
74
|
import { ESortDirection as ee, ETableDisplayMode as te, ETableScrollButtonVariant as pe, ETableScrollIconName as ae, ETableVariant as me } from "./components/Table/constants.js";
|
75
75
|
import { PromoSlider as fe } from "./components/PromoSlider/PromoSlider.js";
|
76
|
-
import {
|
77
|
-
import {
|
78
|
-
import {
|
79
|
-
import {
|
80
|
-
import {
|
81
|
-
import {
|
76
|
+
import { CardTrail as ne } from "./components/CardTrail/CardTrail.js";
|
77
|
+
import { useMediaQuery as se } from "./hooks/useMediaQuery/useMediaQuery.js";
|
78
|
+
import { EMediaQuery as Ee, EMinMediaQuery as Se } from "./hooks/useMediaQuery/constants.js";
|
79
|
+
import { useLockBodyScroll as ce } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
|
80
|
+
import { useInterval as Ie } from "./hooks/useInterval/useInterval.js";
|
81
|
+
import { useTimer as Ve } from "./hooks/useTimer/index.js";
|
82
|
+
import { useCopyToClipboard as ze } from "./hooks/useCopyToClipboard/useCopyToClipboard.js";
|
82
83
|
import { useMergeRefs as Be } from "./hooks/useMergeRefs/useMergeRefs.js";
|
83
|
-
import { useResizeObserver as
|
84
|
-
import {
|
85
|
-
import {
|
86
|
-
import {
|
87
|
-
import {
|
88
|
-
import {
|
84
|
+
import { useResizeObserver as be } from "./hooks/useResizeObserver/useResizeObserver.js";
|
85
|
+
import { useCallbackRef as ye } from "./hooks/useCallbackRef/index.js";
|
86
|
+
import { useThrottledCallback as Re } from "./hooks/useThrottledCallback/index.js";
|
87
|
+
import { Icon as Ae } from "./icons/Icon.js";
|
88
|
+
import { formating as Ue } from "./utils/index.js";
|
89
|
+
import { default as ve } from "./components/Slider/Slider.js";
|
90
|
+
import { EProgressBarPosition as Ge } from "./components/Slider/constants.js";
|
91
|
+
import { parseDate as Oe } from "./utils/formating/Date.js";
|
89
92
|
import './assets/index.css';export {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
+
gr as Accordion,
|
94
|
+
hr as AccordionItem,
|
95
|
+
wo as Avatar,
|
93
96
|
e as Button,
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
ne as CardTrail,
|
98
|
+
lr as CheckboxMimir,
|
99
|
+
eo as Chip,
|
100
|
+
L as DatePicker,
|
97
101
|
H as Drawer,
|
98
102
|
X as Dropdown,
|
99
|
-
|
100
|
-
|
103
|
+
kr as EAccordionSize,
|
104
|
+
Fo as EAvatarSize,
|
101
105
|
p as EButtonForm,
|
102
106
|
a as EButtonSize,
|
103
107
|
m as EButtonVariantBorderless,
|
104
108
|
i as EButtonVariantDefault,
|
105
109
|
f as EButtonVariantOutline,
|
106
110
|
x as EButtonVariantRound,
|
107
|
-
|
108
|
-
|
111
|
+
po as EChipSize,
|
112
|
+
ao as EChipVariant,
|
109
113
|
K as EDrawerPosition,
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
114
|
+
Ho as EFileItemVariant,
|
115
|
+
Io as EGosZnakSize,
|
116
|
+
go as EGosZnakType,
|
117
|
+
uo as EInputRangeSliderBorderState,
|
118
|
+
Eo as EInputRangeSliderPositions,
|
119
|
+
u as EInputSize,
|
120
|
+
E as EInputStatus,
|
121
|
+
S as EInputVariant,
|
122
|
+
ho as ELabelPositions,
|
123
|
+
Wr as ELinkSize,
|
124
|
+
Xr as ELinkVariant,
|
121
125
|
Q as ELoaderSize,
|
122
|
-
|
126
|
+
Ee as EMediaQuery,
|
123
127
|
w as EMergedButtonVariantRound,
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
128
|
+
_o as EMessageShortReplyVariant,
|
129
|
+
Se as EMinMediaQuery,
|
130
|
+
Qo as EMultiSelectSearchSize,
|
131
|
+
ro as ENotificationBadgeSize,
|
132
|
+
Ge as EProgressBarPosition,
|
133
|
+
xr as ESelectSearchSize,
|
134
|
+
Do as ESkeletonVariant,
|
131
135
|
ee as ESortDirection,
|
132
|
-
|
133
|
-
|
134
|
-
|
136
|
+
rr as EStepColor,
|
137
|
+
or as EStepsSize,
|
138
|
+
Mr as ETabTrailSize,
|
135
139
|
te as ETableDisplayMode,
|
136
140
|
pe as ETableScrollButtonVariant,
|
137
141
|
ae as ETableScrollIconName,
|
138
142
|
me as ETableVariant,
|
139
|
-
|
140
|
-
|
143
|
+
Sr as ETagSize,
|
144
|
+
dr as ETagType,
|
141
145
|
I as ETextAreaInputSize,
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
146
|
+
wr as EToastPosition,
|
147
|
+
vr as EToastVariant,
|
148
|
+
Zr as EUploaderFilesVariant,
|
149
|
+
xo as EUploaderType,
|
150
|
+
ar as EVoteSize,
|
151
|
+
co as GosZnak,
|
152
|
+
Ae as Icon,
|
149
153
|
F as Image,
|
150
154
|
l as Input,
|
151
155
|
V as InputPassword,
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
156
|
+
z as InputPhoneNumber,
|
157
|
+
lo as InputRangeSlider,
|
158
|
+
Jr as Link,
|
159
|
+
jo as ListFiles,
|
160
|
+
Ko as ListPhotos,
|
157
161
|
N as Loader,
|
158
162
|
D as MergedButton,
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
163
|
+
Xo as MessageShortReply,
|
164
|
+
No as MultiSelectSearch,
|
165
|
+
_r as NotificationBadge,
|
166
|
+
M as OtpInput,
|
167
|
+
Cr as Pagination,
|
164
168
|
fe as PromoSlider,
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
169
|
+
C as RadioGroup,
|
170
|
+
ir as SelectSearch,
|
171
|
+
Mo as SkeletonBrick,
|
172
|
+
Lo as SkeletonCircle,
|
173
|
+
Co as SkeletonText,
|
174
|
+
ve as Slider,
|
171
175
|
j as SliderLazy,
|
172
176
|
_ as Steps,
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
+
ko as Switcher,
|
178
|
+
Pr as TabTrail,
|
179
|
+
re as Table,
|
180
|
+
ur as Tag,
|
177
181
|
c as TextArea,
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
182
|
+
Tr as Timer,
|
183
|
+
Lr as ToastProvider,
|
184
|
+
Po as TwinSwitcher,
|
185
|
+
io as UniversalUploader,
|
186
|
+
qr as Uploader,
|
187
|
+
Or as UploaderFiles,
|
188
|
+
Gr as UploaderPhotos,
|
189
|
+
tr as Vote,
|
190
|
+
Ue as formating,
|
191
|
+
B as getMaskedInputPhoneValue,
|
188
192
|
P as getUnmaskedInputValue,
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
193
|
+
Oe as parseDate,
|
194
|
+
ye as useCallbackRef,
|
195
|
+
ze as useCopyToClipboard,
|
196
|
+
Ie as useInterval,
|
197
|
+
ce as useLockBodyScroll,
|
198
|
+
se as useMediaQuery,
|
194
199
|
Be as useMergeRefs,
|
195
|
-
|
196
|
-
|
197
|
-
|
200
|
+
be as useResizeObserver,
|
201
|
+
Re as useThrottledCallback,
|
202
|
+
Ve as useTimer,
|
203
|
+
Dr as useToast
|
198
204
|
};
|