mimir-ui-kit 1.42.1 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProgressBar-COdzy3fY.js +67 -0
- package/dist/assets/CardTrail.css +1 -1
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Switcher.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/hooks.css +1 -0
- package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
- package/dist/components/Accordion/Accordion.d.ts +6 -0
- package/dist/components/Accordion/Accordion.js +202 -182
- package/dist/components/AnchorLink/Link.d.ts +2 -0
- package/dist/components/AnchorLink/Link.js +54 -42
- package/dist/components/CardTrail/CardTrail.js +47 -46
- package/dist/components/CardTrail/utils.d.ts +0 -1
- package/dist/components/CardTrail/utils.js +7 -8
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.js +125 -111
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerModal.js +97 -75
- package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/MonthPickerModal.js +96 -58
- package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/YearPickerModal.js +75 -57
- package/dist/components/Drawer/Drawer.d.ts +7 -1
- package/dist/components/Drawer/Drawer.js +122 -106
- package/dist/components/Drawer/hooks.d.ts +9 -0
- package/dist/components/Drawer/hooks.js +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/components/Dropdown/Dropdown.js +361 -343
- package/dist/components/Dropdown/constants.d.ts +11 -0
- package/dist/components/Dropdown/constants.js +5 -0
- package/dist/components/Dropdown/hooks.d.ts +19 -0
- package/dist/components/Dropdown/hooks.js +11 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +5 -2
- package/dist/components/Image/Image.d.ts +16 -0
- package/dist/components/Image/Image.js +65 -37
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
- package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -5
- package/dist/components/MultiSelectSearch/index.d.ts +1 -1
- package/dist/components/MultiSelectSearch/index.js +5 -4
- package/dist/components/MultiSelectSearch/types.d.ts +33 -1
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
- package/dist/components/MultiSelectSearch/utils.js +31 -17
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/Pagination.js +137 -99
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
- package/dist/components/SelectSearch/SelectSearch.js +381 -220
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +3 -2
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +32 -1
- package/dist/components/SelectSearch/utils.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +28 -14
- package/dist/components/Switcher/Switcher.js +66 -59
- package/dist/components/Switcher/types.d.ts +1 -0
- package/dist/components/TabTrail/TabTrail.d.ts +9 -0
- package/dist/components/TabTrail/TabTrail.js +198 -190
- package/dist/components/Toasts/ProgressBar.d.ts +4 -2
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.d.ts +5 -1
- package/dist/components/Toasts/Toast.js +59 -44
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +154 -149
- package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
- package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
- package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
- package/dist/hooks/useTimer/index.d.ts +2 -1
- package/dist/hooks/useTimer/index.js +55 -41
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/index.js +182 -177
- package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
- package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
- package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
- package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
- package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
- package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
- package/package.json +3 -1
- package/dist/ProgressBar-DEFs1tWq.js +0 -55
- package/dist/assets/Dropdown.css +0 -1
- package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,6 +1,7 @@
|
|
1
|
-
import { SelectSearch as
|
2
|
-
import { ESelectSearchSize as
|
1
|
+
import { SelectSearch as c } from "./SelectSearch.js";
|
2
|
+
import { ELoadingIndicatorPlacement as r, ESelectSearchSize as t } from "./constants.js";
|
3
3
|
export {
|
4
|
-
|
5
|
-
|
4
|
+
r as ESSLoadingPlacement,
|
5
|
+
t as ESelectSearchSize,
|
6
|
+
c as SelectSearch
|
6
7
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { ESelectSearchSize } from './constants';
|
2
|
+
import { ELoadingIndicatorPlacement, ESelectSearchSize } from './constants';
|
3
3
|
import { TInputProps } from '../Input';
|
4
4
|
|
5
5
|
export type TSelectOption = {
|
@@ -56,4 +56,35 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
|
|
56
56
|
autocomplete?: 'on' | 'off';
|
57
57
|
/** Показывать список при фокусе или нет */
|
58
58
|
immediate?: boolean;
|
59
|
+
/**
|
60
|
+
* Текст, отображаемый при отсутствии опций для выбора
|
61
|
+
*/
|
62
|
+
noOptionsText?: string | ReactNode;
|
63
|
+
/**
|
64
|
+
* Текст, отображаемый при отсутствии результатов поиска
|
65
|
+
*/
|
66
|
+
noMatchText?: string | ReactNode;
|
67
|
+
/**
|
68
|
+
* Функция обратного вызова, вызываемая при открытии выпадающего списка
|
69
|
+
* Можно использовать для загрузки данных
|
70
|
+
*/
|
71
|
+
loadOnOpen?: () => void;
|
72
|
+
/**
|
73
|
+
* Флаг состояния загрузки
|
74
|
+
*/
|
75
|
+
loading?: boolean;
|
76
|
+
/**
|
77
|
+
* Положение индикатора загрузки
|
78
|
+
*/
|
79
|
+
loadingIndicatorPlacement?: ELoadingIndicatorPlacement | `${ELoadingIndicatorPlacement}`;
|
80
|
+
/**
|
81
|
+
* Ключ объекта TSelectOption, по которому нужно группировать элементы
|
82
|
+
*/
|
83
|
+
groupBy?: string;
|
84
|
+
/**
|
85
|
+
* Функция для получения заголовка группы из значения группировки
|
86
|
+
* @param groupValue Значение поля группировки
|
87
|
+
* @returns Строка для отображения в заголовке группы
|
88
|
+
*/
|
89
|
+
getGroupTitle?: (groupValue: string) => string;
|
59
90
|
};
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { ESelectSearchSize } from './constants';
|
2
|
+
import { TSelectOption } from './types';
|
2
3
|
import { EInputSize } from '../Input';
|
3
4
|
|
4
5
|
export declare const mapSizeToInputSize: (size: ESelectSearchSize) => EInputSize;
|
5
6
|
export declare const getDropdownArrowIcon: (isOpen: boolean, size: ESelectSearchSize) => "DropdownArrowBottom16px" | "DropdownArrowUp16px" | "DropdownArrowUp24px" | "DropdownArrowDown24px";
|
7
|
+
export declare const prepareGroupedItems: (items: TSelectOption[], groupBy: string, getGroupTitle: (value: string) => string) => TSelectOption[];
|
@@ -1,19 +1,33 @@
|
|
1
|
-
import { ESelectSearchSize as
|
1
|
+
import { ESelectSearchSize as t } from "./constants.js";
|
2
2
|
import "../../Input-BU_6U1CW.js";
|
3
|
-
import { EInputSize as
|
4
|
-
const
|
5
|
-
switch (
|
6
|
-
case
|
7
|
-
return
|
8
|
-
case
|
9
|
-
return
|
10
|
-
case
|
11
|
-
return
|
3
|
+
import { EInputSize as n } from "../Input/constants.js";
|
4
|
+
const w = (r) => {
|
5
|
+
switch (r) {
|
6
|
+
case t.S:
|
7
|
+
return n.S;
|
8
|
+
case t.M:
|
9
|
+
return n.M;
|
10
|
+
case t.L:
|
11
|
+
return n.L;
|
12
12
|
default:
|
13
|
-
return
|
13
|
+
return n.M;
|
14
14
|
}
|
15
|
-
},
|
15
|
+
}, S = (r, o) => r ? o === t.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : o === t.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", f = (r, o, a) => {
|
16
|
+
if (!r.length || !o) return r;
|
17
|
+
const p = [], u = /* @__PURE__ */ new Set();
|
18
|
+
for (const s of r) {
|
19
|
+
const e = String(s[o] || "Без группы");
|
20
|
+
u.has(e) || (u.add(e), p.push({
|
21
|
+
id: `group-header-${e}`,
|
22
|
+
name: a(e),
|
23
|
+
isGroupHeader: !0,
|
24
|
+
originalValue: e
|
25
|
+
})), p.push(s);
|
26
|
+
}
|
27
|
+
return p;
|
28
|
+
};
|
16
29
|
export {
|
17
|
-
|
18
|
-
|
30
|
+
S as getDropdownArrowIcon,
|
31
|
+
w as mapSizeToInputSize,
|
32
|
+
f as prepareGroupedItems
|
19
33
|
};
|
@@ -1,97 +1,104 @@
|
|
1
|
-
import { jsxs as L, jsx as
|
2
|
-
import { H as te } from "../../field-
|
3
|
-
import { K as I, w as re, z as
|
4
|
-
import { W as
|
5
|
-
import
|
6
|
-
import { w as Ce } from "../../use-active-press-
|
1
|
+
import { jsxs as L, jsx as x } from "react/jsx-runtime";
|
2
|
+
import { H as te } from "../../field-BLi5834s.js";
|
3
|
+
import { K as I, w as re, z as ae, U as le, u as se, a as ce, b as ie, T as oe, I as ne, G as ue, j as de, p as he } from "../../label-BmphTIGY.js";
|
4
|
+
import { W as me, H as j, y as pe, p as fe, o as g, $ as be, b as we, D as _e, c as H } from "../../keyboard-wis2TUql.js";
|
5
|
+
import h, { createContext as ge, useState as y, useMemo as G, useId as ke, useContext as $e, useRef as ve, useCallback as xe, Fragment as ye, forwardRef as Pe } from "react";
|
6
|
+
import { w as Ce } from "../../use-active-press-CnDeVvQq.js";
|
7
7
|
import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
|
8
8
|
import { r as Fe } from "../../bugs-diTMAGNw.js";
|
9
|
-
import { c as
|
9
|
+
import { c as k } from "../../index-DIxK0V-G.js";
|
10
10
|
import { ELabelPositions as Ee } from "./constants.js";
|
11
|
-
import '../../assets/Switcher.css';let
|
12
|
-
|
11
|
+
import '../../assets/Switcher.css';let P = ge(null);
|
12
|
+
P.displayName = "GroupContext";
|
13
13
|
let Se = ye;
|
14
|
-
function Te(
|
15
|
-
var
|
16
|
-
let [e,
|
17
|
-
return
|
18
|
-
e && (
|
19
|
-
} } },
|
14
|
+
function Te(a) {
|
15
|
+
var o;
|
16
|
+
let [e, u] = y(null), [m, p] = ae(), [f, t] = le(), s = G(() => ({ switch: e, setSwitch: u }), [e, u]), c = {}, n = a;
|
17
|
+
return h.createElement(t, { name: "Switch.Description", value: f }, h.createElement(p, { name: "Switch.Label", value: m, props: { htmlFor: (o = s.switch) == null ? void 0 : o.id, onClick(i) {
|
18
|
+
e && (i.currentTarget instanceof HTMLLabelElement && i.preventDefault(), e.click(), e.focus({ preventScroll: !0 }));
|
19
|
+
} } }, h.createElement(P.Provider, { value: s }, j({ ourProps: c, theirProps: n, slot: {}, defaultTag: Se, name: "Switch.Group" }))));
|
20
20
|
}
|
21
|
-
let
|
22
|
-
function
|
21
|
+
let Ne = "button";
|
22
|
+
function Le(a, o) {
|
23
23
|
var e;
|
24
|
-
let
|
25
|
-
|
26
|
-
|
24
|
+
let u = ke(), m = se(), p = ce(), { id: f = m || `headlessui-switch-${u}`, disabled: t = p || !1, checked: s, defaultChecked: c, onChange: n, name: i, value: $, form: v, autoFocus: d = !1, ...K } = a, C = $e(P), [R, M] = y(null), U = ve(null), O = pe(U, o, C === null ? null : C.setSwitch, M), b = ie(c), [w, _] = oe(s, n, b ?? !1), V = fe(), [D, F] = y(!1), E = g(() => {
|
25
|
+
F(!0), _ == null || _(!w), V.nextFrame(() => {
|
26
|
+
F(!1);
|
27
27
|
});
|
28
|
-
}), W =
|
28
|
+
}), W = g((r) => {
|
29
29
|
if (Fe(r.currentTarget)) return r.preventDefault();
|
30
|
-
r.preventDefault(),
|
31
|
-
}), q =
|
32
|
-
r.key === H.Space ? (r.preventDefault(),
|
33
|
-
}), z =
|
34
|
-
if (
|
35
|
-
}, [
|
36
|
-
return
|
30
|
+
r.preventDefault(), E();
|
31
|
+
}), q = g((r) => {
|
32
|
+
r.key === H.Space ? (r.preventDefault(), E()) : r.key === H.Enter && he(r.currentTarget);
|
33
|
+
}), z = g((r) => r.preventDefault()), A = ne(), B = ue(), { isFocusVisible: S, focusProps: J } = be({ autoFocus: d }), { isHovered: T, hoverProps: Q } = we({ isDisabled: t }), { pressed: N, pressProps: X } = Ce({ disabled: t }), Y = G(() => ({ checked: w, disabled: t, hover: T, focus: S, active: N, autofocus: d, changing: D }), [w, T, S, N, t, D, d]), Z = _e({ id: f, ref: O, role: "switch", type: De(a, R), tabIndex: a.tabIndex === -1 ? 0 : (e = a.tabIndex) != null ? e : 0, "aria-checked": w, "aria-labelledby": A, "aria-describedby": B, disabled: t || void 0, autoFocus: d, onClick: W, onKeyUp: q, onKeyPress: z }, J, Q, X), ee = xe(() => {
|
34
|
+
if (b !== void 0) return _ == null ? void 0 : _(b);
|
35
|
+
}, [_, b]);
|
36
|
+
return h.createElement(h.Fragment, null, i != null && h.createElement(de, { disabled: t, data: { [i]: $ || "on" }, overrides: { type: "checkbox", checked: w }, form: v, onReset: ee }), j({ ourProps: Z, theirProps: K, slot: Y, defaultTag: Ne, name: "Switch" }));
|
37
37
|
}
|
38
|
-
let He =
|
39
|
-
const Re = "
|
40
|
-
"switcher-wrapper": "_switcher-
|
38
|
+
let He = me(Le), Ie = Te, je = I, Ge = re, Ke = Object.assign(He, { Group: Ie, Label: je, Description: Ge });
|
39
|
+
const Re = "_left_15kgl_15", Me = "_right_15kgl_18", Ue = "_label_15kgl_22", Oe = "_switcher_15kgl_2", l = {
|
40
|
+
"switcher-wrapper": "_switcher-wrapper_15kgl_2",
|
41
41
|
left: Re,
|
42
42
|
right: Me,
|
43
43
|
label: Ue,
|
44
44
|
switcher: Oe,
|
45
|
-
"switcher-checked": "_switcher-
|
46
|
-
"switcher-thumb": "_switcher-
|
47
|
-
"switcher-checked-thumb": "_switcher-checked-
|
45
|
+
"switcher-checked": "_switcher-checked_15kgl_47",
|
46
|
+
"switcher-thumb": "_switcher-thumb_15kgl_57",
|
47
|
+
"switcher-checked-thumb": "_switcher-checked-thumb_15kgl_67",
|
48
|
+
"switcher-loading": "_switcher-loading_15kgl_70",
|
49
|
+
"loading-indicator": "_loading-indicator_15kgl_85",
|
50
|
+
"loading-rotate": "_loading-rotate_15kgl_1"
|
48
51
|
}, Ze = Pe(
|
49
52
|
({
|
50
|
-
id:
|
51
|
-
label:
|
53
|
+
id: a,
|
54
|
+
label: o,
|
52
55
|
hasLabel: e = !1,
|
53
|
-
labelPosition:
|
54
|
-
className:
|
55
|
-
labelClassName:
|
56
|
-
switcherThumbClassName:
|
56
|
+
labelPosition: u = Ee.LEFT,
|
57
|
+
className: m,
|
58
|
+
labelClassName: p,
|
59
|
+
switcherThumbClassName: f,
|
57
60
|
wrapperClassName: t,
|
58
|
-
children:
|
61
|
+
children: s,
|
59
62
|
checked: c,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
loading: n = !1,
|
64
|
+
...i
|
65
|
+
}, $) => {
|
66
|
+
const v = (d) => typeof s == "function" ? s({ ...d, checked: c }) : s;
|
63
67
|
return /* @__PURE__ */ L(
|
64
68
|
te,
|
65
69
|
{
|
66
|
-
className:
|
67
|
-
|
70
|
+
className: k(
|
71
|
+
l["switcher-wrapper"],
|
68
72
|
t,
|
69
|
-
|
73
|
+
l[u]
|
70
74
|
),
|
71
75
|
children: [
|
72
|
-
|
76
|
+
o && e && /* @__PURE__ */ x(I, { className: k(l.label, p), htmlFor: a, children: o }),
|
73
77
|
/* @__PURE__ */ L(
|
74
78
|
Ke,
|
75
79
|
{
|
76
|
-
...
|
77
|
-
id:
|
78
|
-
ref:
|
79
|
-
|
80
|
-
|
80
|
+
...i,
|
81
|
+
id: a,
|
82
|
+
ref: $,
|
83
|
+
disabled: n || i.disabled,
|
84
|
+
className: k(l.switcher, m, {
|
85
|
+
[l["switcher-checked"]]: c
|
81
86
|
}),
|
82
87
|
children: [
|
83
88
|
v({ checked: c }),
|
84
|
-
/* @__PURE__ */
|
89
|
+
/* @__PURE__ */ x(
|
85
90
|
"span",
|
86
91
|
{
|
87
92
|
"aria-hidden": "true",
|
88
|
-
className:
|
89
|
-
|
90
|
-
|
93
|
+
className: k(
|
94
|
+
l["switcher-thumb"],
|
95
|
+
f,
|
91
96
|
{
|
92
|
-
[
|
97
|
+
[l["switcher-checked-thumb"]]: c,
|
98
|
+
[l["switcher-loading"]]: n
|
93
99
|
}
|
94
|
-
)
|
100
|
+
),
|
101
|
+
children: n && /* @__PURE__ */ x("span", { className: l["loading-indicator"] })
|
95
102
|
}
|
96
103
|
)
|
97
104
|
]
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ETabTrailSize } from './constants';
|
2
2
|
import { ETabTrailButtonVariant } from './TabButtons/constants';
|
3
|
+
import { TIcon } from '../../icons';
|
3
4
|
|
4
5
|
export type TCategoryTab = {
|
5
6
|
/**
|
@@ -64,5 +65,13 @@ export type TTabTrailProps = {
|
|
64
65
|
* Дополнительный класс для контейнера кнопок навигации.
|
65
66
|
*/
|
66
67
|
buttonsClassName?: string;
|
68
|
+
/**
|
69
|
+
* Цвет индикатора активной вкладки
|
70
|
+
*/
|
71
|
+
indicatorColor?: string;
|
72
|
+
/**
|
73
|
+
* Иконки для табов. Ключи - индексы табов, значения - названия иконок.
|
74
|
+
*/
|
75
|
+
tabIcons?: Record<number, TIcon>;
|
67
76
|
};
|
68
77
|
export declare const TabTrail: import('react').ForwardRefExoticComponent<TTabTrailProps & import('react').RefAttributes<HTMLElement>>;
|