mimir-ui-kit 1.17.3 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +62 -62
- package/dist/{Input-D-FCB1FU.js → Input-BFFPzelg.js} +2 -2
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/Checkbox.css +0 -0
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/NotificationBadge.css +1 -0
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Steps.css +1 -1
- package/dist/assets/Switch.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/Vote.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +3 -1
- package/dist/components/Accordion/Accordion.js +32 -17
- package/dist/components/Accordion/constants.d.ts +8 -0
- package/dist/components/Accordion/constants.js +12 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Checkbox/Checkbox.js +24 -0
- package/dist/components/Checkbox/constants.d.ts +0 -0
- package/dist/components/Checkbox/constants.js +1 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +4 -0
- package/dist/components/Checkbox/types.d.ts +0 -0
- package/dist/components/Checkbox/types.js +1 -0
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.js +17 -15
- package/dist/components/Drawer/constants.d.ts +2 -1
- package/dist/components/Drawer/constants.js +1 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +1 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +3 -0
- package/dist/components/NotificationBadge/NotificationBadge.js +38 -0
- package/dist/components/NotificationBadge/constants.d.ts +4 -0
- package/dist/components/NotificationBadge/constants.js +8 -0
- package/dist/components/NotificationBadge/index.d.ts +3 -0
- package/dist/components/NotificationBadge/index.js +6 -0
- package/dist/components/NotificationBadge/types.d.ts +25 -0
- package/dist/components/NotificationBadge/types.js +1 -0
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/SelectSearch/SelectSearch.js +48 -29
- package/dist/components/SelectSearch/types.d.ts +8 -0
- package/dist/components/Steps/Steps.d.ts +9 -9
- package/dist/components/Steps/Steps.js +18 -34
- package/dist/components/Steps/constants.d.ts +6 -13
- package/dist/components/Steps/constants.js +9 -20
- package/dist/components/Steps/index.d.ts +2 -2
- package/dist/components/Steps/index.js +2 -3
- package/dist/components/Steps/types.d.ts +5 -1
- package/dist/components/Switch/Switch.d.ts +7 -2
- package/dist/components/Switch/Switch.js +24 -17
- package/dist/components/TabTrail/TabTrail.d.ts +24 -0
- package/dist/components/TabTrail/TabTrail.js +18 -17
- package/dist/components/TextArea/TextArea.js +3 -3
- package/dist/components/Vote/Vote.d.ts +19 -13
- package/dist/components/Vote/Vote.js +43 -64
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +7 -4
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +2 -2
- package/dist/index.js +7 -4
- package/package.json +1 -1
@@ -0,0 +1,38 @@
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import { ENotificationBadgeSize } from "./constants.js";
|
4
|
+
import '../../assets/NotificationBadge.css';const m = "_m_1rrs6_18";
|
5
|
+
const s = "_s_1rrs6_24";
|
6
|
+
const cls = {
|
7
|
+
"notification-badge": "_notification-badge_1rrs6_2",
|
8
|
+
"notification-badge-absolute": "_notification-badge-absolute_1rrs6_14",
|
9
|
+
m,
|
10
|
+
s
|
11
|
+
};
|
12
|
+
const NotificationBadge = ({
|
13
|
+
count,
|
14
|
+
position,
|
15
|
+
absolute,
|
16
|
+
size = ENotificationBadgeSize.M
|
17
|
+
}) => /* @__PURE__ */ jsx(
|
18
|
+
"div",
|
19
|
+
{
|
20
|
+
className: classNames(
|
21
|
+
cls["notification-badge"],
|
22
|
+
{
|
23
|
+
[cls["notification-badge-absolute"]]: absolute
|
24
|
+
},
|
25
|
+
cls[size]
|
26
|
+
),
|
27
|
+
style: {
|
28
|
+
top: position == null ? void 0 : position.top,
|
29
|
+
right: position == null ? void 0 : position.right,
|
30
|
+
bottom: position == null ? void 0 : position.bottom,
|
31
|
+
left: position == null ? void 0 : position.left
|
32
|
+
},
|
33
|
+
children: count
|
34
|
+
}
|
35
|
+
);
|
36
|
+
export {
|
37
|
+
NotificationBadge
|
38
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ENotificationBadgeSize } from './constants';
|
2
|
+
|
3
|
+
export type TNotificationBadgeProps = {
|
4
|
+
/**
|
5
|
+
* Значение количества уведомлений.
|
6
|
+
*/
|
7
|
+
count: number;
|
8
|
+
/**
|
9
|
+
* Позиция для абсолютного позиционирования.
|
10
|
+
*/
|
11
|
+
position?: {
|
12
|
+
top?: string;
|
13
|
+
right?: string;
|
14
|
+
bottom?: string;
|
15
|
+
left?: string;
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* Абсолютное позиционирование.
|
19
|
+
*/
|
20
|
+
absolute?: boolean;
|
21
|
+
/**
|
22
|
+
* Размер NotificationBadge.
|
23
|
+
*/
|
24
|
+
size?: `${ENotificationBadgeSize}` | ENotificationBadgeSize;
|
25
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -3,7 +3,7 @@ import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
3
|
import { forwardRef, useImperativeHandle, Fragment } from "react";
|
4
4
|
import { ITEMS_PER_SEPARATOR, DEFAULT_VALUE_LENGTH } from "./constants.js";
|
5
5
|
import { useOTPInput } from "./hooks.js";
|
6
|
-
import { I as Input } from "../../Input-
|
6
|
+
import { I as Input } from "../../Input-BFFPzelg.js";
|
7
7
|
import '../../assets/OtpInput.css';const otp = "_otp_196ev_3";
|
8
8
|
const input = "_input_196ev_14";
|
9
9
|
const separator = "_separator_196ev_28";
|
@@ -4,8 +4,8 @@ import * as React from "react";
|
|
4
4
|
import React__default, { useReducer, useMemo, useSyncExternalStore, useId as useId$1, useEffect, useCallback, useRef, useLayoutEffect, createContext, useContext, useState, Fragment, createRef, forwardRef } from "react";
|
5
5
|
import { ESelectSearchSize } from "./constants.js";
|
6
6
|
import { Icon } from "../../icons/Icon.js";
|
7
|
-
import { I as Input } from "../../Input-
|
8
|
-
import { EInputSize } from "../Input/constants.js";
|
7
|
+
import { I as Input } from "../../Input-BFFPzelg.js";
|
8
|
+
import { EInputVariant, EInputSize } from "../Input/constants.js";
|
9
9
|
import { n as n$2, u as u$3, d as o$1, s as s$3, o as o$2, p as p$1, t as t$3, e as s$4, W as W$1, y as y$3, T, H, M as M$1, a as u$5, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D as D$2, c as o$3 } from "../../keyboard-B256ZoM-.js";
|
10
10
|
import * as ReactDOM from "react-dom";
|
11
11
|
import { flushSync, createPortal } from "react-dom";
|
@@ -1991,13 +1991,13 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
1991
1991
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
1992
1992
|
const css = getComputedStyle$1(currentIFrame);
|
1993
1993
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
1994
|
-
const
|
1994
|
+
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
1995
1995
|
x2 *= iframeScale.x;
|
1996
1996
|
y2 *= iframeScale.y;
|
1997
1997
|
width *= iframeScale.x;
|
1998
1998
|
height *= iframeScale.y;
|
1999
1999
|
x2 += left;
|
2000
|
-
y2 +=
|
2000
|
+
y2 += top2;
|
2001
2001
|
currentWin = getWindow(currentIFrame);
|
2002
2002
|
currentIFrame = currentWin.frameElement;
|
2003
2003
|
}
|
@@ -2097,13 +2097,13 @@ function getViewportRect(element, strategy) {
|
|
2097
2097
|
}
|
2098
2098
|
function getInnerBoundingClientRect(element, strategy) {
|
2099
2099
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
2100
|
-
const
|
2100
|
+
const top2 = clientRect.top + element.clientTop;
|
2101
2101
|
const left = clientRect.left + element.clientLeft;
|
2102
2102
|
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
2103
2103
|
const width = element.clientWidth * scale.x;
|
2104
2104
|
const height = element.clientHeight * scale.y;
|
2105
2105
|
const x2 = left * scale.x;
|
2106
|
-
const y2 =
|
2106
|
+
const y2 = top2 * scale.y;
|
2107
2107
|
return {
|
2108
2108
|
width,
|
2109
2109
|
height,
|
@@ -2313,7 +2313,7 @@ function observeMove(element, onMove) {
|
|
2313
2313
|
cleanup();
|
2314
2314
|
const {
|
2315
2315
|
left,
|
2316
|
-
top,
|
2316
|
+
top: top2,
|
2317
2317
|
width,
|
2318
2318
|
height
|
2319
2319
|
} = element.getBoundingClientRect();
|
@@ -2323,9 +2323,9 @@ function observeMove(element, onMove) {
|
|
2323
2323
|
if (!width || !height) {
|
2324
2324
|
return;
|
2325
2325
|
}
|
2326
|
-
const insetTop = floor(
|
2326
|
+
const insetTop = floor(top2);
|
2327
2327
|
const insetRight = floor(root.clientWidth - (left + width));
|
2328
|
-
const insetBottom = floor(root.clientHeight - (
|
2328
|
+
const insetBottom = floor(root.clientHeight - (top2 + height));
|
2329
2329
|
const insetLeft = floor(left);
|
2330
2330
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
2331
2331
|
const options2 = {
|
@@ -3752,29 +3752,35 @@ function No(o2, r2) {
|
|
3752
3752
|
return H({ ourProps: { id: d2, ref: M2, role: "option", tabIndex: s2 === true ? void 0 : -1, "aria-disabled": s2 === true ? true : void 0, "aria-selected": C, disabled: void 0, onMouseDown: y2, onFocus: A2, onPointerEnter: h2, onMouseEnter: h2, onPointerMove: O, onMouseMove: O, onPointerLeave: G2, onMouseLeave: G2 }, theirProps: a3, slot: J2, defaultTag: ko, name: "Combobox.Option" });
|
3753
3753
|
}
|
3754
3754
|
let Uo = W$1(ho), Ho = W$1(Vo), Go = W$1(Mo), jo = K, zo = W$1(Bo), Ko = W$1(No), Nt = Object.assign(Uo, { Input: Go, Button: Ho, Label: jo, Options: zo, Option: Ko });
|
3755
|
-
const
|
3756
|
-
const
|
3757
|
-
const
|
3758
|
-
const
|
3759
|
-
const
|
3760
|
-
const
|
3761
|
-
const
|
3755
|
+
const disabled = "_disabled_3ezsa_5";
|
3756
|
+
const container = "_container_3ezsa_9";
|
3757
|
+
const full = "_full_3ezsa_22";
|
3758
|
+
const button = "_button_3ezsa_30";
|
3759
|
+
const options = "_options_3ezsa_42";
|
3760
|
+
const top = "_top_3ezsa_52";
|
3761
|
+
const bottom = "_bottom_3ezsa_57";
|
3762
|
+
const m = "_m_3ezsa_84";
|
3763
|
+
const l = "_l_3ezsa_95";
|
3764
|
+
const option = "_option_3ezsa_42";
|
3762
3765
|
const cls = {
|
3763
|
-
"select-search": "_select-
|
3766
|
+
"select-search": "_select-search_3ezsa_2",
|
3767
|
+
disabled,
|
3764
3768
|
container,
|
3765
|
-
"container-open": "_container-
|
3769
|
+
"container-open": "_container-open_3ezsa_18",
|
3766
3770
|
full,
|
3767
|
-
"selector-icon-open": "_selector-icon-
|
3771
|
+
"selector-icon-open": "_selector-icon-open_3ezsa_26",
|
3768
3772
|
button,
|
3769
3773
|
options,
|
3770
|
-
|
3774
|
+
top,
|
3775
|
+
bottom,
|
3776
|
+
"no-options": "_no-options_3ezsa_78",
|
3771
3777
|
m,
|
3772
3778
|
l,
|
3773
|
-
"custom-input-class": "_custom-input-
|
3779
|
+
"custom-input-class": "_custom-input-class_3ezsa_106",
|
3774
3780
|
option,
|
3775
|
-
"option-active": "_option-
|
3776
|
-
"option-inner": "_option-
|
3777
|
-
"selected-icon": "_selected-
|
3781
|
+
"option-active": "_option-active_3ezsa_122",
|
3782
|
+
"option-inner": "_option-inner_3ezsa_125",
|
3783
|
+
"selected-icon": "_selected-icon_3ezsa_132"
|
3778
3784
|
};
|
3779
3785
|
const SelectSearch = forwardRef(
|
3780
3786
|
(props, ref) => {
|
@@ -3789,7 +3795,10 @@ const SelectSearch = forwardRef(
|
|
3789
3795
|
classNameOption,
|
3790
3796
|
displayValue = "name",
|
3791
3797
|
filterOnSearch = true,
|
3792
|
-
onSearch
|
3798
|
+
onSearch,
|
3799
|
+
variant = EInputVariant.DefaultGray,
|
3800
|
+
menuPlacement = "bottom",
|
3801
|
+
disabled: disabled2 = false
|
3793
3802
|
} = props;
|
3794
3803
|
const [inputValue, setInputValue] = useState("");
|
3795
3804
|
const mapSizeToInputSize = (size22) => {
|
@@ -3828,9 +3837,13 @@ const SelectSearch = forwardRef(
|
|
3828
3837
|
{
|
3829
3838
|
as: "div",
|
3830
3839
|
value,
|
3831
|
-
className: classNames(cls["select-search"], {
|
3840
|
+
className: classNames(cls["select-search"], {
|
3841
|
+
[cls.full]: full2,
|
3842
|
+
[cls.disabled]: disabled2
|
3843
|
+
}),
|
3832
3844
|
onChange: handleOneChange,
|
3833
3845
|
ref,
|
3846
|
+
disabled: disabled2,
|
3834
3847
|
virtual: { options: filteredItems },
|
3835
3848
|
children: ({ open }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
3836
3849
|
/* @__PURE__ */ jsxs(
|
@@ -3848,10 +3861,12 @@ const SelectSearch = forwardRef(
|
|
3848
3861
|
size: mapSizeToInputSize(size2),
|
3849
3862
|
className: cls["custom-input-class"],
|
3850
3863
|
onChange: handleInputChange,
|
3851
|
-
value: inputValue
|
3864
|
+
value: inputValue,
|
3865
|
+
disabled: disabled2,
|
3866
|
+
variant
|
3852
3867
|
}
|
3853
3868
|
),
|
3854
|
-
showArrow && /* @__PURE__ */ jsx(Ho, { className: cls.button, children: /* @__PURE__ */ jsx(
|
3869
|
+
showArrow && /* @__PURE__ */ jsx(Ho, { className: cls.button, disabled: disabled2, children: /* @__PURE__ */ jsx(
|
3855
3870
|
Icon,
|
3856
3871
|
{
|
3857
3872
|
iconName: size2 == ESelectSearchSize.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
@@ -3886,7 +3901,11 @@ const SelectSearch = forwardRef(
|
|
3886
3901
|
) : /* @__PURE__ */ jsx(
|
3887
3902
|
zo,
|
3888
3903
|
{
|
3889
|
-
className: classNames(
|
3904
|
+
className: classNames(
|
3905
|
+
cls.options,
|
3906
|
+
cls[size2],
|
3907
|
+
cls[menuPlacement]
|
3908
|
+
),
|
3890
3909
|
children: ({ option: item }) => /* @__PURE__ */ jsx(
|
3891
3910
|
Ko,
|
3892
3911
|
{
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import { ESelectSearchSize } from './constants';
|
3
|
+
import { TVariant } from '../Input';
|
3
4
|
|
4
5
|
export type TSelectOption = {
|
5
6
|
name: string;
|
@@ -7,6 +8,7 @@ export type TSelectOption = {
|
|
7
8
|
bottom?: ReactNode;
|
8
9
|
[index: string]: unknown;
|
9
10
|
};
|
11
|
+
export type TMenuPlacement = 'top' | 'bottom';
|
10
12
|
export type TSelectSearchProps = {
|
11
13
|
/**
|
12
14
|
* Текущее выбранное значение.
|
@@ -42,4 +44,10 @@ export type TSelectSearchProps = {
|
|
42
44
|
items: TSelectOption[];
|
43
45
|
/** Класснейм для значения */
|
44
46
|
classNameOption?: string;
|
47
|
+
/** Варианты отображения ввода */
|
48
|
+
variant?: TVariant;
|
49
|
+
/** Варианты отображения выпадающего меню */
|
50
|
+
menuPlacement?: TMenuPlacement;
|
51
|
+
/** Отключает компонент SelectSearch */
|
52
|
+
disabled?: boolean;
|
45
53
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { EStepsPrimaryColor, EStepsSecondaryColor } from './constants';
|
2
1
|
import { TCommonStepsProps } from './types';
|
2
|
+
import { TStepsZone } from './types.ts';
|
3
3
|
|
4
4
|
export type TProps = TCommonStepsProps & {
|
5
5
|
/**
|
@@ -31,13 +31,13 @@ export type TProps = TCommonStepsProps & {
|
|
31
31
|
*/
|
32
32
|
disabled?: boolean;
|
33
33
|
/**
|
34
|
-
* Цвет
|
34
|
+
* Цвет оставшихся шагов
|
35
35
|
*/
|
36
|
-
|
36
|
+
zones?: TStepsZone[];
|
37
37
|
/**
|
38
|
-
* Цвет
|
38
|
+
* Цвет шага, если он не выбран
|
39
39
|
*/
|
40
|
-
|
40
|
+
unselectedColor?: string;
|
41
41
|
};
|
42
42
|
export declare const Steps: import('react').ForwardRefExoticComponent<TCommonStepsProps & {
|
43
43
|
/**
|
@@ -69,11 +69,11 @@ export declare const Steps: import('react').ForwardRefExoticComponent<TCommonSte
|
|
69
69
|
*/
|
70
70
|
disabled?: boolean;
|
71
71
|
/**
|
72
|
-
* Цвет
|
72
|
+
* Цвет оставшихся шагов
|
73
73
|
*/
|
74
|
-
|
74
|
+
zones?: TStepsZone[];
|
75
75
|
/**
|
76
|
-
* Цвет
|
76
|
+
* Цвет шага, если он не выбран
|
77
77
|
*/
|
78
|
-
|
78
|
+
unselectedColor?: string;
|
79
79
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
@@ -1,33 +1,15 @@
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
3
|
import { forwardRef, useId, useState, useRef, useEffect } from "react";
|
4
|
-
import { ZERO_STEP, EStepsSize,
|
4
|
+
import { ZERO_STEP, EStepsSize, ID_SEPARATOR, StepSize, DIFF_BETWEEN_STEP_AND_INDEX } from "./constants.js";
|
5
5
|
import { Icon } from "../../icons/Icon.js";
|
6
|
-
import '../../assets/Steps.css';const container = "
|
7
|
-
const step = "
|
8
|
-
const editable = "
|
9
|
-
const PRIMARY = "_PRIMARY_j31xr_12";
|
10
|
-
const GRAY = "_GRAY_j31xr_12";
|
11
|
-
const CITRINE = "_CITRINE_j31xr_15";
|
12
|
-
const SAPPHIRE = "_SAPPHIRE_j31xr_18";
|
13
|
-
const SECONDARY = "_SECONDARY_j31xr_21";
|
14
|
-
const WHITE = "_WHITE_j31xr_21";
|
15
|
-
const LIGHT_SAPPHIRE = "_LIGHT_SAPPHIRE_j31xr_24";
|
16
|
-
const LIGHT_GRAY = "_LIGHT_GRAY_j31xr_27";
|
17
|
-
const disabled = "_disabled_j31xr_27";
|
6
|
+
import '../../assets/Steps.css';const container = "_container_1qg9i_2";
|
7
|
+
const step = "_step_1qg9i_6";
|
8
|
+
const editable = "_editable_1qg9i_9";
|
18
9
|
const cls = {
|
19
10
|
container,
|
20
11
|
step,
|
21
|
-
editable
|
22
|
-
PRIMARY,
|
23
|
-
GRAY,
|
24
|
-
CITRINE,
|
25
|
-
SAPPHIRE,
|
26
|
-
SECONDARY,
|
27
|
-
WHITE,
|
28
|
-
LIGHT_SAPPHIRE,
|
29
|
-
LIGHT_GRAY,
|
30
|
-
disabled
|
12
|
+
editable
|
31
13
|
};
|
32
14
|
const Steps = forwardRef(
|
33
15
|
(props, ref) => {
|
@@ -39,9 +21,9 @@ const Steps = forwardRef(
|
|
39
21
|
editable: editable2 = false,
|
40
22
|
size = EStepsSize.M,
|
41
23
|
onClick,
|
42
|
-
disabled
|
43
|
-
|
44
|
-
|
24
|
+
disabled = false,
|
25
|
+
zones = [{ color: "#ff0000", to: quantity }],
|
26
|
+
unselectedColor = "#ffffff"
|
45
27
|
} = props;
|
46
28
|
const idPrefix = useId();
|
47
29
|
const [step2, setStep] = useState(current);
|
@@ -69,23 +51,24 @@ const Steps = forwardRef(
|
|
69
51
|
setHoveredStep(null);
|
70
52
|
};
|
71
53
|
const buttons = Array.from({ length: quantity }, (_, idx) => {
|
72
|
-
|
73
|
-
|
54
|
+
var _a, _b;
|
55
|
+
let currentZone = 0;
|
56
|
+
while (currentZone < zones.length && zones[currentZone].to <= idx) {
|
57
|
+
currentZone++;
|
58
|
+
}
|
59
|
+
const color = hoveredStep !== null && idx <= hoveredStep ? (_a = zones[currentZone]) == null ? void 0 : _a.color : step2 > idx && hoveredStep === null ? (_b = zones[currentZone]) == null ? void 0 : _b.color : unselectedColor;
|
74
60
|
return /* @__PURE__ */ jsx(
|
75
61
|
"button",
|
76
62
|
{
|
77
63
|
id: `${idPrefix}${ID_SEPARATOR}${idx}`,
|
78
64
|
className: classNames(cls.step, cls[size], stepClassName, {
|
79
|
-
[cls.editable]: editable2 && !
|
80
|
-
[cls.disabled]:
|
81
|
-
[cls[EStepsColorType.PRIMARY]]: isPrimary,
|
82
|
-
[cls[EStepsColorType.SECONDARY]]: isSecondary,
|
83
|
-
[cls[primaryColor]]: isPrimary,
|
84
|
-
[cls[secondaryColor]]: isSecondary
|
65
|
+
[cls.editable]: editable2 && !disabled,
|
66
|
+
[cls.disabled]: disabled || !editable2 && idx + 1 > step2
|
85
67
|
}),
|
86
68
|
onClick: () => handleClick(idx),
|
87
69
|
onMouseEnter: handleMouseEnter,
|
88
70
|
onMouseLeave: handleMouseLeave,
|
71
|
+
style: { color },
|
89
72
|
children: /* @__PURE__ */ jsx(Icon, { iconName: "Step", ...StepSize[size] })
|
90
73
|
},
|
91
74
|
idx
|
@@ -94,6 +77,7 @@ const Steps = forwardRef(
|
|
94
77
|
return /* @__PURE__ */ jsx("div", { className: classNames(cls.container, rootClassName), ref, children: buttons });
|
95
78
|
}
|
96
79
|
);
|
80
|
+
Steps.displayName = "Steps";
|
97
81
|
export {
|
98
82
|
Steps
|
99
83
|
};
|
@@ -25,17 +25,10 @@ export declare const StepSize: {
|
|
25
25
|
height: number;
|
26
26
|
};
|
27
27
|
};
|
28
|
-
export declare enum
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
CITRINE = "CITRINE",
|
35
|
-
SAPPHIRE = "SAPPHIRE"
|
36
|
-
}
|
37
|
-
export declare enum EStepsSecondaryColor {
|
38
|
-
LIGHT_GRAY = "LIGHT_GRAY",
|
39
|
-
LIGHT_SAPPHIRE = "LIGHT_SAPPHIRE",
|
40
|
-
WHITE = "WHITE"
|
28
|
+
export declare enum EStepColor {
|
29
|
+
ASPHALT = "#333333",
|
30
|
+
CITRINE = "#ff7900",
|
31
|
+
SAPPHIRE = "#2355d7",
|
32
|
+
GREEN = "#1b770c",
|
33
|
+
DISABLED = "#b2b2b2"
|
41
34
|
}
|
@@ -26,28 +26,17 @@ const StepSize = {
|
|
26
26
|
height: 28
|
27
27
|
}
|
28
28
|
};
|
29
|
-
var
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
EStepsPrimaryColor2["SAPPHIRE"] = "SAPPHIRE";
|
38
|
-
return EStepsPrimaryColor2;
|
39
|
-
})(EStepsPrimaryColor || {});
|
40
|
-
var EStepsSecondaryColor = /* @__PURE__ */ ((EStepsSecondaryColor2) => {
|
41
|
-
EStepsSecondaryColor2["LIGHT_GRAY"] = "LIGHT_GRAY";
|
42
|
-
EStepsSecondaryColor2["LIGHT_SAPPHIRE"] = "LIGHT_SAPPHIRE";
|
43
|
-
EStepsSecondaryColor2["WHITE"] = "WHITE";
|
44
|
-
return EStepsSecondaryColor2;
|
45
|
-
})(EStepsSecondaryColor || {});
|
29
|
+
var EStepColor = /* @__PURE__ */ ((EStepColor2) => {
|
30
|
+
EStepColor2["ASPHALT"] = "#333333";
|
31
|
+
EStepColor2["CITRINE"] = "#ff7900";
|
32
|
+
EStepColor2["SAPPHIRE"] = "#2355d7";
|
33
|
+
EStepColor2["GREEN"] = "#1b770c";
|
34
|
+
EStepColor2["DISABLED"] = "#b2b2b2";
|
35
|
+
return EStepColor2;
|
36
|
+
})(EStepColor || {});
|
46
37
|
export {
|
47
38
|
DIFF_BETWEEN_STEP_AND_INDEX,
|
48
|
-
|
49
|
-
EStepsPrimaryColor,
|
50
|
-
EStepsSecondaryColor,
|
39
|
+
EStepColor,
|
51
40
|
EStepsSize,
|
52
41
|
ID_SEPARATOR,
|
53
42
|
StepSize,
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export { Steps } from './Steps';
|
2
|
-
export {
|
3
|
-
export type { TCommonStepsProps } from './types';
|
2
|
+
export { EStepColor, EStepsSize } from './constants';
|
3
|
+
export type { TCommonStepsProps, TStepsZone } from './types';
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { Steps } from "./Steps.js";
|
2
|
-
import {
|
2
|
+
import { EStepColor, EStepsSize } from "./constants.js";
|
3
3
|
export {
|
4
|
-
|
5
|
-
EStepsSecondaryColor,
|
4
|
+
EStepColor,
|
6
5
|
EStepsSize,
|
7
6
|
Steps
|
8
7
|
};
|
@@ -1,6 +1,10 @@
|
|
1
|
-
import { EStepsSize } from './constants';
|
1
|
+
import { EStepColor, EStepsSize } from './constants';
|
2
2
|
|
3
3
|
export type TSize = `${EStepsSize}` | EStepsSize;
|
4
4
|
export type TCommonStepsProps = {
|
5
5
|
size?: TSize;
|
6
6
|
};
|
7
|
+
export type TStepsZone = {
|
8
|
+
color: EStepColor | string;
|
9
|
+
to: number;
|
10
|
+
};
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { CheckboxProps } from '@headlessui/react';
|
2
|
+
import { ReactNode } from 'react';
|
2
3
|
|
3
|
-
export type TSwitchProps = CheckboxProps
|
4
|
+
export type TSwitchProps = CheckboxProps & {
|
5
|
+
children?: ReactNode;
|
6
|
+
};
|
4
7
|
export declare const Switch: import('react').ForwardRefExoticComponent<{
|
5
8
|
suppressHydrationWarning?: boolean | undefined;
|
6
9
|
color?: string | undefined;
|
@@ -259,7 +262,7 @@ export declare const Switch: import('react').ForwardRefExoticComponent<{
|
|
259
262
|
is?: string | undefined;
|
260
263
|
} & {
|
261
264
|
as?: "span" | undefined;
|
262
|
-
children?:
|
265
|
+
children?: ReactNode | ((bag: {
|
263
266
|
checked: boolean;
|
264
267
|
changing: boolean;
|
265
268
|
focus: boolean;
|
@@ -291,4 +294,6 @@ export declare const Switch: import('react').ForwardRefExoticComponent<{
|
|
291
294
|
form?: string;
|
292
295
|
name?: string;
|
293
296
|
onChange?: (checked: boolean) => void;
|
297
|
+
} & {
|
298
|
+
children?: ReactNode;
|
294
299
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
3
|
import React__default, { useId, useState, useMemo, useCallback, forwardRef, useEffect } from "react";
|
4
4
|
import { Icon } from "../../icons/Icon.js";
|
@@ -23,14 +23,18 @@ function ie(T$1, h) {
|
|
23
23
|
return React__default.createElement(React__default.Fragment, null, d != null && React__default.createElement(j, { disabled: e, data: { [d]: D$1 || "on" }, overrides: { type: "checkbox", checked: a$1 }, form: R, onReset: G$1 }), H({ ourProps: O, theirProps: A, slot: X, defaultTag: se, name: "Checkbox" }));
|
24
24
|
}
|
25
25
|
let Re = W(ie);
|
26
|
-
const
|
26
|
+
const container = "_container_18cvn_2";
|
27
|
+
const label = "_label_18cvn_27";
|
28
|
+
const enabled = "_enabled_18cvn_31";
|
27
29
|
const cls = {
|
28
|
-
|
30
|
+
container,
|
31
|
+
"switch": "_switch_18cvn_8",
|
32
|
+
label,
|
29
33
|
enabled
|
30
34
|
};
|
31
35
|
const Switch = forwardRef(
|
32
36
|
(props, ref) => {
|
33
|
-
const { checked, onChange, ...restProps } = props;
|
37
|
+
const { checked, onChange, children, ...restProps } = props;
|
34
38
|
const [enabled2, setEnabled] = useState(checked);
|
35
39
|
const handleChange = (value) => {
|
36
40
|
setEnabled(value);
|
@@ -39,19 +43,22 @@ const Switch = forwardRef(
|
|
39
43
|
useEffect(() => {
|
40
44
|
setEnabled(!!checked);
|
41
45
|
}, [checked]);
|
42
|
-
return /* @__PURE__ */
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
return /* @__PURE__ */ jsxs("div", { className: cls.container, children: [
|
47
|
+
/* @__PURE__ */ jsx(
|
48
|
+
Re,
|
49
|
+
{
|
50
|
+
ref,
|
51
|
+
checked: enabled2,
|
52
|
+
onChange: handleChange,
|
53
|
+
className: classNames(cls.switch, {
|
54
|
+
[cls.enabled]: enabled2
|
55
|
+
}),
|
56
|
+
...restProps,
|
57
|
+
children: /* @__PURE__ */ jsx(Icon, { iconName: "Done16px" })
|
58
|
+
}
|
59
|
+
),
|
60
|
+
children && /* @__PURE__ */ jsx("div", { className: cls.label, children })
|
61
|
+
] });
|
55
62
|
}
|
56
63
|
);
|
57
64
|
export {
|
@@ -1,11 +1,35 @@
|
|
1
1
|
import { ETabTrailSize } from './constants';
|
2
2
|
|
3
3
|
export type TCategoryTab = {
|
4
|
+
/**
|
5
|
+
* Наименование таба.
|
6
|
+
*/
|
4
7
|
name: string;
|
8
|
+
/**
|
9
|
+
* Контент, который будет отображать таб.
|
10
|
+
*/
|
5
11
|
content: React.ReactNode;
|
12
|
+
/**
|
13
|
+
* Количество уведомлений для компонента NotificationBadge.
|
14
|
+
*/
|
15
|
+
notificationCount?: number;
|
6
16
|
};
|
7
17
|
export type TTabTrailProps = {
|
18
|
+
/**
|
19
|
+
* Массив категорий, каждая из которых содержит контент.
|
20
|
+
*/
|
8
21
|
categories: TCategoryTab[];
|
22
|
+
/**
|
23
|
+
* Размер TabTrail. Допустимые значения: M, S.
|
24
|
+
*/
|
9
25
|
size?: ETabTrailSize;
|
26
|
+
/**
|
27
|
+
* Показывать ли кнопки навигации.
|
28
|
+
*/
|
29
|
+
showButtons?: boolean;
|
30
|
+
/**
|
31
|
+
* Класснейм для TabTrail.
|
32
|
+
*/
|
33
|
+
className?: string;
|
10
34
|
};
|
11
35
|
export declare const TabTrail: import('react').ForwardRefExoticComponent<TTabTrailProps & import('react').RefAttributes<HTMLElement>>;
|