mimir-ui-kit 1.13.7 → 1.14.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/README.md +62 -62
- package/dist/assets/Pagination.css +1 -0
- package/dist/components/Pagination/Pagination.d.ts +42 -0
- package/dist/components/Pagination/Pagination.js +220 -0
- package/dist/components/Pagination/constants.d.ts +2 -0
- package/dist/components/Pagination/constants.js +6 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +4 -0
- package/dist/components/Pagination/types.d.ts +0 -0
- package/dist/components/Pagination/types.js +1 -0
- package/dist/components/Tag/Tag.d.ts +3 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/hooks/useWindowSize/index.d.ts +4 -0
- package/dist/hooks/useWindowSize/index.js +26 -0
- package/dist/index.js +2 -0
- package/package.json +128 -128
package/README.md
CHANGED
@@ -1,62 +1,62 @@
|
|
1
|
-
# Mimir-ui
|
2
|
-
|
3
|
-
## Установка и запуск проекта
|
4
|
-
|
5
|
-
1. Установите зависимости:
|
6
|
-
```bash
|
7
|
-
npm install
|
8
|
-
```
|
9
|
-
2. Запуск storybook
|
10
|
-
```bash
|
11
|
-
npm run storybook
|
12
|
-
```
|
13
|
-
|
14
|
-
## Сборка проекта
|
15
|
-
|
16
|
-
1. Скрипт для сборки
|
17
|
-
```bash
|
18
|
-
npm run build
|
19
|
-
```
|
20
|
-
|
21
|
-
## Создание нового компонента
|
22
|
-
|
23
|
-
```bash
|
24
|
-
npm run create-component <ComponentName>
|
25
|
-
```
|
26
|
-
|
27
|
-
## Поднятие версии для публикации на npm
|
28
|
-
|
29
|
-
Для поднятия версии пакета перед публикацией на npm используем следующие скрипты:
|
30
|
-
|
31
|
-
1. `patch`: Этот скрипт увеличивает версию пакета на один патч (например, с версии 1.0.0 до 1.0.1). Он автоматически обновляет версию в файле package.json и создает коммит с обновленной версией.
|
32
|
-
|
33
|
-
```bash
|
34
|
-
npm version patch
|
35
|
-
```
|
36
|
-
|
37
|
-
2. `minor`: Этот скрипт увеличивает версию пакета на один минорный уровень (например, с версии 1.0.0 до 1.1.0). Также обновляет версию в package.json и создает коммит.
|
38
|
-
```bash
|
39
|
-
npm version minor
|
40
|
-
```
|
41
|
-
3. `major`: Этот скрипт увеличивает версию пакета на один мажорный уровень (например, с версии 1.0.0 до 2.0.0). Он также обновляет версию в package.json и создает коммит.
|
42
|
-
```bash
|
43
|
-
npm version major
|
44
|
-
```
|
45
|
-
|
46
|
-
## Публикация на npm
|
47
|
-
|
48
|
-
1. Скрипт для публикации на npm:
|
49
|
-
```bash
|
50
|
-
npm publish
|
51
|
-
```
|
52
|
-
|
53
|
-
## Ручная Генерация иконок
|
54
|
-
|
55
|
-
1. Экспортируем с фигмы иконку.
|
56
|
-
2. Добавляем ее в папку svgs.
|
57
|
-
3. Запускаем скрипт:
|
58
|
-
```bash
|
59
|
-
npm run icons
|
60
|
-
```
|
61
|
-
4. Смотрим в папку `icons/components`
|
62
|
-
5. Готово.
|
1
|
+
# Mimir-ui
|
2
|
+
|
3
|
+
## Установка и запуск проекта
|
4
|
+
|
5
|
+
1. Установите зависимости:
|
6
|
+
```bash
|
7
|
+
npm install
|
8
|
+
```
|
9
|
+
2. Запуск storybook
|
10
|
+
```bash
|
11
|
+
npm run storybook
|
12
|
+
```
|
13
|
+
|
14
|
+
## Сборка проекта
|
15
|
+
|
16
|
+
1. Скрипт для сборки
|
17
|
+
```bash
|
18
|
+
npm run build
|
19
|
+
```
|
20
|
+
|
21
|
+
## Создание нового компонента
|
22
|
+
|
23
|
+
```bash
|
24
|
+
npm run create-component <ComponentName>
|
25
|
+
```
|
26
|
+
|
27
|
+
## Поднятие версии для публикации на npm
|
28
|
+
|
29
|
+
Для поднятия версии пакета перед публикацией на npm используем следующие скрипты:
|
30
|
+
|
31
|
+
1. `patch`: Этот скрипт увеличивает версию пакета на один патч (например, с версии 1.0.0 до 1.0.1). Он автоматически обновляет версию в файле package.json и создает коммит с обновленной версией.
|
32
|
+
|
33
|
+
```bash
|
34
|
+
npm version patch
|
35
|
+
```
|
36
|
+
|
37
|
+
2. `minor`: Этот скрипт увеличивает версию пакета на один минорный уровень (например, с версии 1.0.0 до 1.1.0). Также обновляет версию в package.json и создает коммит.
|
38
|
+
```bash
|
39
|
+
npm version minor
|
40
|
+
```
|
41
|
+
3. `major`: Этот скрипт увеличивает версию пакета на один мажорный уровень (например, с версии 1.0.0 до 2.0.0). Он также обновляет версию в package.json и создает коммит.
|
42
|
+
```bash
|
43
|
+
npm version major
|
44
|
+
```
|
45
|
+
|
46
|
+
## Публикация на npm
|
47
|
+
|
48
|
+
1. Скрипт для публикации на npm:
|
49
|
+
```bash
|
50
|
+
npm publish
|
51
|
+
```
|
52
|
+
|
53
|
+
## Ручная Генерация иконок
|
54
|
+
|
55
|
+
1. Экспортируем с фигмы иконку.
|
56
|
+
2. Добавляем ее в папку svgs.
|
57
|
+
3. Запускаем скрипт:
|
58
|
+
```bash
|
59
|
+
npm run icons
|
60
|
+
```
|
61
|
+
4. Смотрим в папку `icons/components`
|
62
|
+
5. Готово.
|
@@ -0,0 +1 @@
|
|
1
|
+
._container_1s8aj_2{--pagination-active: #e5e5e5;display:flex;justify-content:center;gap:var(--space-2xl);margin:0 auto var(--space-xl);font-size:var(--size-text-l);font-family:Inter,sans-serif}._container_1s8aj_2 ._link_1s8aj_11{-webkit-text-decoration:none;text-decoration:none;height:40px;width:40px;color:var(--black-100);display:flex;justify-content:center;align-items:center;border-radius:var(--control-radius);font-family:monospace;font-feature-settings:"zero";font-variant-numeric:slashed-zero}._container_1s8aj_2 ._link_1s8aj_11:active{background-color:var(--pagination-active)}._container_1s8aj_2 ._link_1s8aj_11:focus,._container_1s8aj_2 ._link_1s8aj_11:hover{color:var(--sapphire-normal);-webkit-text-decoration:none;text-decoration:none}._container_1s8aj_2 ._link_1s8aj_11[rel=prev],._container_1s8aj_2 ._link_1s8aj_11[rel=next]{background-color:var(--white);-webkit-text-decoration:none;text-decoration:none;color:var(--black-100)}._container_1s8aj_2 ._link_1s8aj_11[rel=prev]:hover,._container_1s8aj_2 ._link_1s8aj_11[rel=next]:hover{color:var(--sapphire-normal)}._container_1s8aj_2 ._link_1s8aj_11[rel=prev]:active,._container_1s8aj_2 ._link_1s8aj_11[rel=next]:active{background-color:var(--black-80);color:var(--white)}._container_1s8aj_2 ._link_1s8aj_11[rel=prev] svg,._container_1s8aj_2 ._link_1s8aj_11[rel=next] svg{width:16px;height:16px}._container_1s8aj_2 ._item_1s8aj_46{display:inline-block;border-radius:var(--control-radius);text-align:center;vertical-align:top}._container_1s8aj_2 ._item_1s8aj_46._isActive_1s8aj_52 ._link_1s8aj_11{background-color:var(--pagination-active)}._container_1s8aj_2 ._item_1s8aj_46._isActive_1s8aj_52 ._link_1s8aj_11:hover{color:var(--black-100)}._container_1s8aj_2 ._item_1s8aj_46._disabled_1s8aj_58 ._link_1s8aj_11{pointer-events:none;color:var(--disabled-color);background-color:var(--white);cursor:default}._container_1s8aj_2 ._item_1s8aj_46._disabled_1s8aj_58 ._link_1s8aj_11:hover{color:var(--white)}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
|
3
|
+
export type TBackProps = {
|
4
|
+
currentPageNumber: number;
|
5
|
+
onClick: (nextPage: number) => void;
|
6
|
+
setCurrentPage: (nextPage: number) => void;
|
7
|
+
};
|
8
|
+
export type TNextProps = {
|
9
|
+
currentPageNumber: number;
|
10
|
+
lastPageNumber: number;
|
11
|
+
onClick: (nextPage: number) => void;
|
12
|
+
setCurrentPage: (nextPage: number) => void;
|
13
|
+
};
|
14
|
+
export type TItemProps = {
|
15
|
+
currentPageNumber: number;
|
16
|
+
newPageNumber: number;
|
17
|
+
onClick: (pageNumber: number) => void;
|
18
|
+
setCurrentPage: (pageNumber: number) => void;
|
19
|
+
};
|
20
|
+
export type TProps = {
|
21
|
+
/**
|
22
|
+
* Класс, применяемый к корневому элемент
|
23
|
+
*/
|
24
|
+
rootClassName?: string;
|
25
|
+
/**
|
26
|
+
* Выполнится при изменении страницы
|
27
|
+
*/
|
28
|
+
onChange: (page: number) => void;
|
29
|
+
/**
|
30
|
+
* Всего элементов
|
31
|
+
*/
|
32
|
+
total: number;
|
33
|
+
/**
|
34
|
+
* Элементов на странице
|
35
|
+
*/
|
36
|
+
perPage?: number;
|
37
|
+
/**
|
38
|
+
* Текущая страница
|
39
|
+
*/
|
40
|
+
currentPageNumber?: number;
|
41
|
+
};
|
42
|
+
export declare const Pagination: React.ForwardRefExoticComponent<TProps & React.RefAttributes<HTMLElement>>;
|
@@ -0,0 +1,220 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import { forwardRef, useState, useEffect } from "react";
|
4
|
+
import { FIRST_PAGE_NUMBER, DEFAULT_PER_PAGE } from "./constants.js";
|
5
|
+
import { useWindowSize } from "../../hooks/useWindowSize/index.js";
|
6
|
+
import { Icon } from "../../icons/Icon.js";
|
7
|
+
import '../../assets/Pagination.css';const container = "_container_1s8aj_2";
|
8
|
+
const link = "_link_1s8aj_11";
|
9
|
+
const item = "_item_1s8aj_46";
|
10
|
+
const isActive = "_isActive_1s8aj_52";
|
11
|
+
const disabled = "_disabled_1s8aj_58";
|
12
|
+
const cls = {
|
13
|
+
container,
|
14
|
+
link,
|
15
|
+
item,
|
16
|
+
isActive,
|
17
|
+
disabled
|
18
|
+
};
|
19
|
+
const Back = ({
|
20
|
+
currentPageNumber,
|
21
|
+
onClick,
|
22
|
+
setCurrentPage
|
23
|
+
}) => {
|
24
|
+
const handleClick = (event) => {
|
25
|
+
event.preventDefault();
|
26
|
+
if (currentPageNumber === FIRST_PAGE_NUMBER) return;
|
27
|
+
setCurrentPage(currentPageNumber - 1);
|
28
|
+
onClick(currentPageNumber - 1);
|
29
|
+
};
|
30
|
+
return /* @__PURE__ */ jsx(
|
31
|
+
"span",
|
32
|
+
{
|
33
|
+
className: classNames(cls.item, cls.prev, {
|
34
|
+
[cls.disabled]: currentPageNumber === FIRST_PAGE_NUMBER
|
35
|
+
}),
|
36
|
+
children: /* @__PURE__ */ jsx(
|
37
|
+
"a",
|
38
|
+
{
|
39
|
+
className: cls.link,
|
40
|
+
onClick: handleClick,
|
41
|
+
href: "#",
|
42
|
+
"aria-label": "Назад",
|
43
|
+
rel: "prev",
|
44
|
+
children: /* @__PURE__ */ jsx(Icon, { iconName: "ArrowLeft16px" })
|
45
|
+
}
|
46
|
+
)
|
47
|
+
}
|
48
|
+
);
|
49
|
+
};
|
50
|
+
const Next = ({
|
51
|
+
currentPageNumber,
|
52
|
+
lastPageNumber,
|
53
|
+
onClick,
|
54
|
+
setCurrentPage
|
55
|
+
}) => {
|
56
|
+
const isOnLastPage = currentPageNumber >= lastPageNumber;
|
57
|
+
const handleClick = (event) => {
|
58
|
+
event.preventDefault();
|
59
|
+
if (isOnLastPage) return;
|
60
|
+
setCurrentPage(currentPageNumber + 1);
|
61
|
+
onClick == null ? void 0 : onClick(currentPageNumber + 1);
|
62
|
+
};
|
63
|
+
return /* @__PURE__ */ jsx(
|
64
|
+
"span",
|
65
|
+
{
|
66
|
+
className: classNames(cls.item, cls.next, {
|
67
|
+
[cls.disabled]: isOnLastPage
|
68
|
+
}),
|
69
|
+
children: /* @__PURE__ */ jsx(
|
70
|
+
"a",
|
71
|
+
{
|
72
|
+
className: cls.link,
|
73
|
+
onClick: handleClick,
|
74
|
+
href: "#",
|
75
|
+
"aria-label": "Вперед",
|
76
|
+
rel: "next",
|
77
|
+
children: /* @__PURE__ */ jsx(Icon, { iconName: "ArrowRight16px" })
|
78
|
+
}
|
79
|
+
)
|
80
|
+
}
|
81
|
+
);
|
82
|
+
};
|
83
|
+
const Ellipsis = () => {
|
84
|
+
const handleClick = (event) => {
|
85
|
+
event.preventDefault();
|
86
|
+
};
|
87
|
+
return /* @__PURE__ */ jsx("span", { className: cls.item, children: /* @__PURE__ */ jsx("a", { className: cls.link, href: "#", onClick: handleClick, children: /* @__PURE__ */ jsx("span", { children: "..." }) }) });
|
88
|
+
};
|
89
|
+
const Item = ({
|
90
|
+
currentPageNumber,
|
91
|
+
newPageNumber,
|
92
|
+
onClick,
|
93
|
+
setCurrentPage
|
94
|
+
}) => {
|
95
|
+
const isActive2 = currentPageNumber === newPageNumber;
|
96
|
+
const handleClick = (event) => {
|
97
|
+
event.preventDefault();
|
98
|
+
setCurrentPage(newPageNumber);
|
99
|
+
onClick == null ? void 0 : onClick(newPageNumber);
|
100
|
+
};
|
101
|
+
const formattedPageNumber = newPageNumber < 10 ? `0${newPageNumber}` : newPageNumber;
|
102
|
+
return /* @__PURE__ */ jsx("span", { className: classNames(cls.item, { [cls.isActive]: isActive2 }), children: !isActive2 ? /* @__PURE__ */ jsx("a", { href: "#", className: cls.link, onClick: handleClick, children: formattedPageNumber }) : /* @__PURE__ */ jsx("span", { className: cls.link, children: formattedPageNumber }) });
|
103
|
+
};
|
104
|
+
const renderItems = ({
|
105
|
+
start,
|
106
|
+
end,
|
107
|
+
currentPageNumber,
|
108
|
+
onClick,
|
109
|
+
setCurrentPage
|
110
|
+
}) => {
|
111
|
+
const items = [];
|
112
|
+
for (let i = start; i <= end; i++) {
|
113
|
+
items.push(
|
114
|
+
/* @__PURE__ */ jsx(
|
115
|
+
Item,
|
116
|
+
{
|
117
|
+
currentPageNumber,
|
118
|
+
setCurrentPage,
|
119
|
+
newPageNumber: i,
|
120
|
+
onClick
|
121
|
+
},
|
122
|
+
i
|
123
|
+
)
|
124
|
+
);
|
125
|
+
}
|
126
|
+
return items;
|
127
|
+
};
|
128
|
+
const Pagination = forwardRef(
|
129
|
+
(props, ref) => {
|
130
|
+
const {
|
131
|
+
rootClassName,
|
132
|
+
total,
|
133
|
+
perPage = DEFAULT_PER_PAGE,
|
134
|
+
currentPageNumber = FIRST_PAGE_NUMBER,
|
135
|
+
onChange
|
136
|
+
} = props;
|
137
|
+
const [currentPage, setCurrentPage] = useState(currentPageNumber);
|
138
|
+
const lastPageNumber = Math.ceil(total / perPage);
|
139
|
+
const { width } = useWindowSize();
|
140
|
+
const adjacentCount = width <= 650 ? 2 : 4;
|
141
|
+
let firstAdjacentPage = 0;
|
142
|
+
let lastAdjacentPage = 0;
|
143
|
+
useEffect(() => {
|
144
|
+
setCurrentPage(currentPageNumber);
|
145
|
+
}, [currentPageNumber]);
|
146
|
+
if (currentPage <= adjacentCount) {
|
147
|
+
firstAdjacentPage = FIRST_PAGE_NUMBER;
|
148
|
+
lastAdjacentPage = Math.min(
|
149
|
+
FIRST_PAGE_NUMBER + adjacentCount,
|
150
|
+
lastPageNumber
|
151
|
+
);
|
152
|
+
} else if (currentPage > lastPageNumber - adjacentCount) {
|
153
|
+
firstAdjacentPage = lastPageNumber - adjacentCount;
|
154
|
+
lastAdjacentPage = lastPageNumber;
|
155
|
+
} else {
|
156
|
+
firstAdjacentPage = currentPage - adjacentCount / 2;
|
157
|
+
lastAdjacentPage = currentPage + adjacentCount / 2;
|
158
|
+
}
|
159
|
+
if (total <= perPage) {
|
160
|
+
return null;
|
161
|
+
}
|
162
|
+
return /* @__PURE__ */ jsxs(
|
163
|
+
"nav",
|
164
|
+
{
|
165
|
+
"aria-label": "Постраничная навигация",
|
166
|
+
className: classNames(cls.container, rootClassName),
|
167
|
+
ref,
|
168
|
+
children: [
|
169
|
+
/* @__PURE__ */ jsx(
|
170
|
+
Back,
|
171
|
+
{
|
172
|
+
currentPageNumber: currentPage,
|
173
|
+
onClick: onChange,
|
174
|
+
setCurrentPage
|
175
|
+
}
|
176
|
+
),
|
177
|
+
firstAdjacentPage > FIRST_PAGE_NUMBER && /* @__PURE__ */ jsx(
|
178
|
+
Item,
|
179
|
+
{
|
180
|
+
newPageNumber: FIRST_PAGE_NUMBER,
|
181
|
+
currentPageNumber: currentPage,
|
182
|
+
onClick: onChange,
|
183
|
+
setCurrentPage
|
184
|
+
}
|
185
|
+
),
|
186
|
+
firstAdjacentPage > FIRST_PAGE_NUMBER + 1 && /* @__PURE__ */ jsx(Ellipsis, {}),
|
187
|
+
renderItems({
|
188
|
+
start: firstAdjacentPage,
|
189
|
+
end: lastAdjacentPage,
|
190
|
+
currentPageNumber: currentPage,
|
191
|
+
setCurrentPage,
|
192
|
+
onClick: onChange
|
193
|
+
}),
|
194
|
+
lastAdjacentPage < lastPageNumber - 1 && /* @__PURE__ */ jsx(Ellipsis, {}),
|
195
|
+
lastAdjacentPage < lastPageNumber && /* @__PURE__ */ jsx(
|
196
|
+
Item,
|
197
|
+
{
|
198
|
+
newPageNumber: lastPageNumber,
|
199
|
+
currentPageNumber: currentPage,
|
200
|
+
setCurrentPage,
|
201
|
+
onClick: onChange
|
202
|
+
}
|
203
|
+
),
|
204
|
+
/* @__PURE__ */ jsx(
|
205
|
+
Next,
|
206
|
+
{
|
207
|
+
currentPageNumber: currentPage,
|
208
|
+
setCurrentPage,
|
209
|
+
lastPageNumber,
|
210
|
+
onClick: onChange
|
211
|
+
}
|
212
|
+
)
|
213
|
+
]
|
214
|
+
}
|
215
|
+
);
|
216
|
+
}
|
217
|
+
);
|
218
|
+
export {
|
219
|
+
Pagination
|
220
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Pagination } from './Pagination';
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { ETagSize, ETagType } from './constants';
|
2
3
|
|
3
4
|
export type TProps = {
|
4
5
|
/**
|
@@ -12,7 +13,7 @@ export type TProps = {
|
|
12
13
|
/**
|
13
14
|
* Класс, применяемый к контентному элементу
|
14
15
|
*/
|
15
|
-
size?:
|
16
|
+
size?: ETagSize;
|
16
17
|
/**
|
17
18
|
* Класс, применяемый к корневому элемент
|
18
19
|
*/
|
@@ -24,7 +25,7 @@ export type TProps = {
|
|
24
25
|
/**
|
25
26
|
* Определяет какой тип элемента будет создан, по умолчанию - button
|
26
27
|
*/
|
27
|
-
elementType?:
|
28
|
+
elementType?: ETagType;
|
28
29
|
/**
|
29
30
|
* Цвет фона, при outline и текста
|
30
31
|
*/
|
@@ -29,3 +29,4 @@ export { Accordion, AccordionItem, EAccordionSize } from './Accordion';
|
|
29
29
|
export type { TAccordionProps, TAccordionItemProps } from './Accordion';
|
30
30
|
export { TabTrail, ETabTrailSize } from './TabTrail';
|
31
31
|
export type { TTabTrailProps, TCategoryTab } from './TabTrail';
|
32
|
+
export { Pagination } from './Pagination';
|
package/dist/components/index.js
CHANGED
@@ -30,6 +30,7 @@ import { EAccordionSize } from "./Accordion/constants.js";
|
|
30
30
|
import { AccordionItem } from "./Accordion/AccordionItem/AccordionItem.js";
|
31
31
|
import { TabTrail } from "./TabTrail/TabTrail.js";
|
32
32
|
import { ETabTrailSize } from "./TabTrail/constants.js";
|
33
|
+
import { Pagination } from "./Pagination/Pagination.js";
|
33
34
|
export {
|
34
35
|
Accordion,
|
35
36
|
AccordionItem,
|
@@ -60,6 +61,7 @@ export {
|
|
60
61
|
Loader,
|
61
62
|
MergedButton,
|
62
63
|
OtpInput,
|
64
|
+
Pagination,
|
63
65
|
RadioGroup,
|
64
66
|
SelectSearch,
|
65
67
|
Slider,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { useState, useRef, useEffect } from "react";
|
2
|
+
function getWindowSize() {
|
3
|
+
const { innerWidth: width, innerHeight: height } = window;
|
4
|
+
return {
|
5
|
+
width,
|
6
|
+
height
|
7
|
+
};
|
8
|
+
}
|
9
|
+
function useWindowSize() {
|
10
|
+
const [windowSize, setWindowSize] = useState(getWindowSize());
|
11
|
+
const timeoutRef = useRef(null);
|
12
|
+
function handleResize() {
|
13
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
14
|
+
timeoutRef.current = setTimeout(() => setWindowSize(getWindowSize()), 500);
|
15
|
+
}
|
16
|
+
useEffect(() => {
|
17
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
18
|
+
window.addEventListener("resize", handleResize);
|
19
|
+
return () => window.removeEventListener("resize", handleResize);
|
20
|
+
}, []);
|
21
|
+
const { width, height } = windowSize;
|
22
|
+
return { width, height };
|
23
|
+
}
|
24
|
+
export {
|
25
|
+
useWindowSize
|
26
|
+
};
|
package/dist/index.js
CHANGED
@@ -30,6 +30,7 @@ import { EAccordionSize } from "./components/Accordion/constants.js";
|
|
30
30
|
import { AccordionItem } from "./components/Accordion/AccordionItem/AccordionItem.js";
|
31
31
|
import { TabTrail } from "./components/TabTrail/TabTrail.js";
|
32
32
|
import { ETabTrailSize } from "./components/TabTrail/constants.js";
|
33
|
+
import { Pagination } from "./components/Pagination/Pagination.js";
|
33
34
|
import { useMediaQuery } from "./hooks/useMediaQuery/useMediaQuery.js";
|
34
35
|
import { EMediaQuery } from "./hooks/useMediaQuery/constants.js";
|
35
36
|
import { useLockBodyScroll } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
|
@@ -69,6 +70,7 @@ import './assets/index.css';export {
|
|
69
70
|
Loader,
|
70
71
|
MergedButton,
|
71
72
|
OtpInput,
|
73
|
+
Pagination,
|
72
74
|
RadioGroup,
|
73
75
|
SelectSearch,
|
74
76
|
Slider,
|
package/package.json
CHANGED
@@ -1,128 +1,128 @@
|
|
1
|
-
{
|
2
|
-
"name": "mimir-ui-kit",
|
3
|
-
"private": false,
|
4
|
-
"version": "1.
|
5
|
-
"type": "module",
|
6
|
-
"exports": {
|
7
|
-
".": {
|
8
|
-
"types": "./dist/index.d.ts",
|
9
|
-
"default": "./dist/index.js"
|
10
|
-
},
|
11
|
-
"./components": {
|
12
|
-
"types": "./dist/components/index.d.ts",
|
13
|
-
"default": "./dist/components/index.js"
|
14
|
-
},
|
15
|
-
"./hooks": {
|
16
|
-
"types": "./dist/hooks/index.d.ts",
|
17
|
-
"default": "./dist/hooks/index.js"
|
18
|
-
},
|
19
|
-
"./icons": {
|
20
|
-
"types": "./dist/icons/index.d.ts",
|
21
|
-
"default": "./dist/icons/index.js"
|
22
|
-
},
|
23
|
-
"./styles": {
|
24
|
-
"default": "./dist/assets/index.css"
|
25
|
-
}
|
26
|
-
},
|
27
|
-
"module": "./dist/index.js",
|
28
|
-
"types": "./dist/index.d.ts",
|
29
|
-
"files": [
|
30
|
-
"dist"
|
31
|
-
],
|
32
|
-
"sideEffects": [
|
33
|
-
"**/*.{css,scss}"
|
34
|
-
],
|
35
|
-
"scripts": {
|
36
|
-
"build": "tsc --p ./tsconfig-build.json && vite build",
|
37
|
-
"storybook": "storybook dev -p 6006",
|
38
|
-
"build-storybook": "storybook build",
|
39
|
-
"ts:check": "tsc -b",
|
40
|
-
"lint:fix": "eslint . --ext ts,tsx --fix",
|
41
|
-
"lint:prettier": "npx prettier . --write",
|
42
|
-
"lint:stylelint": "stylelint '**/*.module{.css,.scss}'",
|
43
|
-
"lint:stylelint:fix": "stylelint '**/*.module{.css,.scss}' --fix",
|
44
|
-
"icons": "svgr --expand-props start ./src/icons/svgs",
|
45
|
-
"prepare": "husky",
|
46
|
-
"create-component": "node createComponent.js"
|
47
|
-
},
|
48
|
-
"devDependencies": {
|
49
|
-
"@chromatic-com/storybook": "^1.6.1",
|
50
|
-
"@headlessui/react": "^2.1.2",
|
51
|
-
"@laynezh/vite-plugin-lib-assets": "^0.5.23",
|
52
|
-
"@loadable/component": "^5.15.2",
|
53
|
-
"@storybook/addon-essentials": "^8.2.2",
|
54
|
-
"@storybook/addon-interactions": "^8.2.2",
|
55
|
-
"@storybook/addon-links": "^8.2.2",
|
56
|
-
"@storybook/addon-onboarding": "^8.2.2",
|
57
|
-
"@storybook/blocks": "^8.2.2",
|
58
|
-
"@storybook/builder-vite": "^8.2.2",
|
59
|
-
"@storybook/react": "^8.2.2",
|
60
|
-
"@storybook/react-vite": "^8.2.2",
|
61
|
-
"@storybook/test": "^8.2.2",
|
62
|
-
"@svgr/cli": "^8.1.0",
|
63
|
-
"@svgr/core": "^8.1.0",
|
64
|
-
"@svgr/plugin-svgo": "^8.1.0",
|
65
|
-
"@types/node": "^20.14.10",
|
66
|
-
"@types/react": "^18.3.3",
|
67
|
-
"@types/react-dom": "^18.3.0",
|
68
|
-
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
69
|
-
"@typescript-eslint/parser": "^7.13.1",
|
70
|
-
"@vitejs/plugin-react": "^4.3.1",
|
71
|
-
"autoprefixer": "^10.4.19",
|
72
|
-
"chalk": "4.1.2",
|
73
|
-
"classnames": "^2.5.1",
|
74
|
-
"dotenv": "^16.4.5",
|
75
|
-
"eslint": "^8.57.0",
|
76
|
-
"eslint-config-prettier": "^9.1.0",
|
77
|
-
"eslint-plugin-import": "^2.29.1",
|
78
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
79
|
-
"eslint-plugin-react-refresh": "^0.4.7",
|
80
|
-
"eslint-plugin-storybook": "^0.8.0",
|
81
|
-
"glob": "10.3.10",
|
82
|
-
"husky": "^9.0.11",
|
83
|
-
"lint-staged": "^15.2.7",
|
84
|
-
"p-limit": "^6.1.0",
|
85
|
-
"postcss-preset-env": "^9.6.0",
|
86
|
-
"prettier": "^3.3.3",
|
87
|
-
"react": "^18.3.1",
|
88
|
-
"react-dom": "^18.3.1",
|
89
|
-
"sass": "^1.77.7",
|
90
|
-
"storybook": "^8.2.2",
|
91
|
-
"stylelint": "^16.7.0",
|
92
|
-
"stylelint-config-idiomatic-order": "^10.0.0",
|
93
|
-
"stylelint-config-rational-order": "^0.1.2",
|
94
|
-
"stylelint-config-standard": "^36.0.1",
|
95
|
-
"stylelint-order": "^6.0.4",
|
96
|
-
"stylelint-prettier": "^5.0.0",
|
97
|
-
"stylelint-scss": "^6.4.0",
|
98
|
-
"superagent": "^9.0.2",
|
99
|
-
"typescript": "^5.2.2",
|
100
|
-
"vite": "^5.3.1",
|
101
|
-
"vite-plugin-dts": "^3.9.1",
|
102
|
-
"vite-plugin-lib-inject-css": "^2.1.1",
|
103
|
-
"vite-plugin-svgr": "^4.2.0"
|
104
|
-
},
|
105
|
-
"peerDependencies": {
|
106
|
-
"@headlessui/react": "^2.1.2",
|
107
|
-
"react": "^18.3.1",
|
108
|
-
"react-dom": "^18.3.1"
|
109
|
-
},
|
110
|
-
"husky": {
|
111
|
-
"hooks": {
|
112
|
-
"pre-commit": "lint-staged"
|
113
|
-
}
|
114
|
-
},
|
115
|
-
"lint-staged": {
|
116
|
-
"**/*.{ts,tsx}": [
|
117
|
-
"eslint --ignore-path .eslintignore",
|
118
|
-
"prettier --write"
|
119
|
-
],
|
120
|
-
"**/*.{css,scss}": [
|
121
|
-
"stylelint --fix"
|
122
|
-
]
|
123
|
-
},
|
124
|
-
"dependencies": {
|
125
|
-
"swiper": "^11.1.5",
|
126
|
-
"use-clipboard-copy": "^0.2.0"
|
127
|
-
}
|
128
|
-
}
|
1
|
+
{
|
2
|
+
"name": "mimir-ui-kit",
|
3
|
+
"private": false,
|
4
|
+
"version": "1.14.1",
|
5
|
+
"type": "module",
|
6
|
+
"exports": {
|
7
|
+
".": {
|
8
|
+
"types": "./dist/index.d.ts",
|
9
|
+
"default": "./dist/index.js"
|
10
|
+
},
|
11
|
+
"./components": {
|
12
|
+
"types": "./dist/components/index.d.ts",
|
13
|
+
"default": "./dist/components/index.js"
|
14
|
+
},
|
15
|
+
"./hooks": {
|
16
|
+
"types": "./dist/hooks/index.d.ts",
|
17
|
+
"default": "./dist/hooks/index.js"
|
18
|
+
},
|
19
|
+
"./icons": {
|
20
|
+
"types": "./dist/icons/index.d.ts",
|
21
|
+
"default": "./dist/icons/index.js"
|
22
|
+
},
|
23
|
+
"./styles": {
|
24
|
+
"default": "./dist/assets/index.css"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"module": "./dist/index.js",
|
28
|
+
"types": "./dist/index.d.ts",
|
29
|
+
"files": [
|
30
|
+
"dist"
|
31
|
+
],
|
32
|
+
"sideEffects": [
|
33
|
+
"**/*.{css,scss}"
|
34
|
+
],
|
35
|
+
"scripts": {
|
36
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
37
|
+
"storybook": "storybook dev -p 6006",
|
38
|
+
"build-storybook": "storybook build",
|
39
|
+
"ts:check": "tsc -b",
|
40
|
+
"lint:fix": "eslint . --ext ts,tsx --fix",
|
41
|
+
"lint:prettier": "npx prettier . --write",
|
42
|
+
"lint:stylelint": "stylelint '**/*.module{.css,.scss}'",
|
43
|
+
"lint:stylelint:fix": "stylelint '**/*.module{.css,.scss}' --fix",
|
44
|
+
"icons": "svgr --expand-props start ./src/icons/svgs",
|
45
|
+
"prepare": "husky",
|
46
|
+
"create-component": "node createComponent.js"
|
47
|
+
},
|
48
|
+
"devDependencies": {
|
49
|
+
"@chromatic-com/storybook": "^1.6.1",
|
50
|
+
"@headlessui/react": "^2.1.2",
|
51
|
+
"@laynezh/vite-plugin-lib-assets": "^0.5.23",
|
52
|
+
"@loadable/component": "^5.15.2",
|
53
|
+
"@storybook/addon-essentials": "^8.2.2",
|
54
|
+
"@storybook/addon-interactions": "^8.2.2",
|
55
|
+
"@storybook/addon-links": "^8.2.2",
|
56
|
+
"@storybook/addon-onboarding": "^8.2.2",
|
57
|
+
"@storybook/blocks": "^8.2.2",
|
58
|
+
"@storybook/builder-vite": "^8.2.2",
|
59
|
+
"@storybook/react": "^8.2.2",
|
60
|
+
"@storybook/react-vite": "^8.2.2",
|
61
|
+
"@storybook/test": "^8.2.2",
|
62
|
+
"@svgr/cli": "^8.1.0",
|
63
|
+
"@svgr/core": "^8.1.0",
|
64
|
+
"@svgr/plugin-svgo": "^8.1.0",
|
65
|
+
"@types/node": "^20.14.10",
|
66
|
+
"@types/react": "^18.3.3",
|
67
|
+
"@types/react-dom": "^18.3.0",
|
68
|
+
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
69
|
+
"@typescript-eslint/parser": "^7.13.1",
|
70
|
+
"@vitejs/plugin-react": "^4.3.1",
|
71
|
+
"autoprefixer": "^10.4.19",
|
72
|
+
"chalk": "4.1.2",
|
73
|
+
"classnames": "^2.5.1",
|
74
|
+
"dotenv": "^16.4.5",
|
75
|
+
"eslint": "^8.57.0",
|
76
|
+
"eslint-config-prettier": "^9.1.0",
|
77
|
+
"eslint-plugin-import": "^2.29.1",
|
78
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
79
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
80
|
+
"eslint-plugin-storybook": "^0.8.0",
|
81
|
+
"glob": "10.3.10",
|
82
|
+
"husky": "^9.0.11",
|
83
|
+
"lint-staged": "^15.2.7",
|
84
|
+
"p-limit": "^6.1.0",
|
85
|
+
"postcss-preset-env": "^9.6.0",
|
86
|
+
"prettier": "^3.3.3",
|
87
|
+
"react": "^18.3.1",
|
88
|
+
"react-dom": "^18.3.1",
|
89
|
+
"sass": "^1.77.7",
|
90
|
+
"storybook": "^8.2.2",
|
91
|
+
"stylelint": "^16.7.0",
|
92
|
+
"stylelint-config-idiomatic-order": "^10.0.0",
|
93
|
+
"stylelint-config-rational-order": "^0.1.2",
|
94
|
+
"stylelint-config-standard": "^36.0.1",
|
95
|
+
"stylelint-order": "^6.0.4",
|
96
|
+
"stylelint-prettier": "^5.0.0",
|
97
|
+
"stylelint-scss": "^6.4.0",
|
98
|
+
"superagent": "^9.0.2",
|
99
|
+
"typescript": "^5.2.2",
|
100
|
+
"vite": "^5.3.1",
|
101
|
+
"vite-plugin-dts": "^3.9.1",
|
102
|
+
"vite-plugin-lib-inject-css": "^2.1.1",
|
103
|
+
"vite-plugin-svgr": "^4.2.0"
|
104
|
+
},
|
105
|
+
"peerDependencies": {
|
106
|
+
"@headlessui/react": "^2.1.2",
|
107
|
+
"react": "^18.3.1",
|
108
|
+
"react-dom": "^18.3.1"
|
109
|
+
},
|
110
|
+
"husky": {
|
111
|
+
"hooks": {
|
112
|
+
"pre-commit": "lint-staged"
|
113
|
+
}
|
114
|
+
},
|
115
|
+
"lint-staged": {
|
116
|
+
"**/*.{ts,tsx}": [
|
117
|
+
"eslint --ignore-path .eslintignore",
|
118
|
+
"prettier --write"
|
119
|
+
],
|
120
|
+
"**/*.{css,scss}": [
|
121
|
+
"stylelint --fix"
|
122
|
+
]
|
123
|
+
},
|
124
|
+
"dependencies": {
|
125
|
+
"swiper": "^11.1.5",
|
126
|
+
"use-clipboard-copy": "^0.2.0"
|
127
|
+
}
|
128
|
+
}
|