mimir-ui-kit 1.4.0 → 1.4.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.
@@ -1,7 +1,7 @@
1
1
  import { EStepsPrimaryColor, EStepsSecondaryColor } from './constants';
2
- import { TCommonStepProps } from './types';
2
+ import { TCommonStepsProps } from './types';
3
3
 
4
- export type TProps = TCommonStepProps & {
4
+ export type TProps = TCommonStepsProps & {
5
5
  /**
6
6
  * Класс, применяемый к корневому элементу
7
7
  */
@@ -39,7 +39,7 @@ export type TProps = TCommonStepProps & {
39
39
  */
40
40
  secondaryColor?: EStepsSecondaryColor;
41
41
  };
42
- export declare const Steps: import('react').ForwardRefExoticComponent<TCommonStepProps & {
42
+ export declare const Steps: import('react').ForwardRefExoticComponent<TCommonStepsProps & {
43
43
  /**
44
44
  * Класс, применяемый к корневому элементу
45
45
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { forwardRef, useId, useState, useEffect } from "react";
3
+ import { forwardRef, useId, useState, useRef, useEffect } from "react";
4
4
  import { ZERO_STEP, EStepsSize, EStepsPrimaryColor, ID_SEPARATOR, EStepsColorType, StepSize, DIFF_BETWEEN_STEP_AND_INDEX } from "./constants.js";
5
5
  import { Icon } from "../../icons/Icon.js";
6
6
  import '../../assets/Steps.css';const container = "_container_j31xr_2";
@@ -46,16 +46,21 @@ const Steps = forwardRef(
46
46
  const idPrefix = useId();
47
47
  const [step2, setStep] = useState(current);
48
48
  const [hoveredStep, setHoveredStep] = useState(null);
49
+ const stepWasChangedRef = useRef(null);
49
50
  useEffect(() => {
50
51
  setStep(current);
51
52
  }, [current]);
52
- useEffect(() => {
53
- onClick && onClick(step2);
54
- }, [onClick, step2]);
55
53
  const handleClick = (idx) => {
56
54
  const clickedStep = idx + DIFF_BETWEEN_STEP_AND_INDEX;
55
+ stepWasChangedRef.current = true;
57
56
  setStep(clickedStep !== step2 ? clickedStep : ZERO_STEP);
58
57
  };
58
+ useEffect(() => {
59
+ if (stepWasChangedRef.current === true) {
60
+ onClick && onClick(step2);
61
+ stepWasChangedRef.current = false;
62
+ }
63
+ }, [onClick, step2]);
59
64
  const handleMouseEnter = (evt) => {
60
65
  const hoveredIdx = Number(evt.currentTarget.id.split(ID_SEPARATOR)[1]);
61
66
  setHoveredStep(hoveredIdx);
@@ -0,0 +1,3 @@
1
+ export { Steps } from './Steps';
2
+ export { EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize } from './constants';
3
+ export type { TCommonStepsProps } from './types';
@@ -0,0 +1,8 @@
1
+ import { Steps } from "./Steps.js";
2
+ import { EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize } from "./constants.js";
3
+ export {
4
+ EStepsPrimaryColor,
5
+ EStepsSecondaryColor,
6
+ EStepsSize,
7
+ Steps
8
+ };
@@ -1,6 +1,6 @@
1
1
  import { EStepsSize } from './constants';
2
2
 
3
3
  export type TSize = `${EStepsSize}` | EStepsSize;
4
- export type TCommonStepProps = {
4
+ export type TCommonStepsProps = {
5
5
  size?: TSize;
6
6
  };
@@ -1,7 +1,7 @@
1
- import { TCommonStepProps } from './types';
1
+ import { TCommonVoteProps } from './types';
2
2
  import { EStepsPrimaryColor, EStepsSecondaryColor } from '../Steps/constants';
3
3
 
4
- export type TProps = TCommonStepProps & {
4
+ export type TProps = TCommonVoteProps & {
5
5
  /**
6
6
  * Класс, применяемый к корневому элементу
7
7
  */
@@ -59,7 +59,7 @@ export type TProps = TCommonStepProps & {
59
59
  */
60
60
  needChangeFirstHalfColor?: boolean;
61
61
  };
62
- export declare const Vote: import('react').ForwardRefExoticComponent<TCommonStepProps & {
62
+ export declare const Vote: import('react').ForwardRefExoticComponent<TCommonVoteProps & {
63
63
  /**
64
64
  * Класс, применяемый к корневому элементу
65
65
  */
@@ -0,0 +1,3 @@
1
+ export { Vote } from './Vote';
2
+ export { EVoteSize } from './constants';
3
+ export type { TCommonVoteProps, TSize } from './types';
@@ -0,0 +1,6 @@
1
+ import { Vote } from "./Vote.js";
2
+ import { EVoteSize } from "./constants.js";
3
+ export {
4
+ EVoteSize,
5
+ Vote
6
+ };
@@ -1,6 +1,6 @@
1
1
  import { EVoteSize } from './constants';
2
2
 
3
3
  export type TSize = `${EVoteSize}` | EVoteSize;
4
- export type TCommonStepProps = {
4
+ export type TCommonVoteProps = {
5
5
  size?: TSize;
6
6
  };
@@ -14,3 +14,6 @@ export { Image } from './Image';
14
14
  export { Loader } from './Loader';
15
15
  export { Slider } from './Slider';
16
16
  export { Drawer } from './Drawer';
17
+ export { EDrawerPosition } from './Drawer';
18
+ export { Steps, EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize, type TCommonStepsProps } from './Steps';
19
+ export { Vote, EVoteSize, type TCommonVoteProps } from './Vote';
@@ -13,6 +13,11 @@ import { AppImage } from "./Image/Image.js";
13
13
  import { Loader } from "./Loader/Loader.js";
14
14
  import { Slider } from "./Slider/Slider.js";
15
15
  import { Drawer } from "./Drawer/Drawer.js";
16
+ import { EDrawerPosition } from "./Drawer/constants.js";
17
+ import { Steps } from "./Steps/Steps.js";
18
+ import { EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize } from "./Steps/constants.js";
19
+ import { Vote } from "./Vote/Vote.js";
20
+ import { EVoteSize } from "./Vote/constants.js";
16
21
  export {
17
22
  Button,
18
23
  Drawer,
@@ -20,9 +25,14 @@ export {
20
25
  EButtonSize,
21
26
  EButtonVariantDefault,
22
27
  EButtonVariantRound,
28
+ EDrawerPosition,
23
29
  EInputSize,
24
30
  EInputVariant,
25
31
  EMergedButtonVariantRound,
32
+ EStepsPrimaryColor,
33
+ EStepsSecondaryColor,
34
+ EStepsSize,
35
+ EVoteSize,
26
36
  AppImage as Image,
27
37
  Input,
28
38
  InputPassword,
@@ -32,6 +42,8 @@ export {
32
42
  OtpInput,
33
43
  RadioGroup,
34
44
  Slider,
45
+ Steps,
46
+ Vote,
35
47
  getMaskedInputPhoneValue,
36
48
  getUnmaskedInputValue
37
49
  };
package/dist/index.js CHANGED
@@ -13,6 +13,11 @@ import { AppImage } from "./components/Image/Image.js";
13
13
  import { Loader } from "./components/Loader/Loader.js";
14
14
  import { Slider } from "./components/Slider/Slider.js";
15
15
  import { Drawer } from "./components/Drawer/Drawer.js";
16
+ import { EDrawerPosition } from "./components/Drawer/constants.js";
17
+ import { Steps } from "./components/Steps/Steps.js";
18
+ import { EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize } from "./components/Steps/constants.js";
19
+ import { Vote } from "./components/Vote/Vote.js";
20
+ import { EVoteSize } from "./components/Vote/constants.js";
16
21
  import { useMediaQuery } from "./hooks/useMediaQuery/useMediaQuery.js";
17
22
  import { EMediaQuery } from "./hooks/useMediaQuery/constants.js";
18
23
  import { useLockBodyScroll } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
@@ -24,10 +29,15 @@ import './assets/index.css';export {
24
29
  EButtonSize,
25
30
  EButtonVariantDefault,
26
31
  EButtonVariantRound,
32
+ EDrawerPosition,
27
33
  EInputSize,
28
34
  EInputVariant,
29
35
  EMediaQuery,
30
36
  EMergedButtonVariantRound,
37
+ EStepsPrimaryColor,
38
+ EStepsSecondaryColor,
39
+ EStepsSize,
40
+ EVoteSize,
31
41
  Icon,
32
42
  AppImage as Image,
33
43
  Input,
@@ -38,6 +48,8 @@ import './assets/index.css';export {
38
48
  OtpInput,
39
49
  RadioGroup,
40
50
  Slider,
51
+ Steps,
52
+ Vote,
41
53
  getMaskedInputPhoneValue,
42
54
  getUnmaskedInputValue,
43
55
  useLockBodyScroll,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {