@astral/ui 4.30.0 → 4.31.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.
Files changed (38) hide show
  1. package/components/CodeField/CodeField.js +1 -1
  2. package/components/CodeField/{Resend/320/241odeButton/Resend/320/241odeButton.d.ts → ResendCodeButton/ResendCodeButton.d.ts} +2 -2
  3. package/components/CodeField/{Resend/320/241odeButton/Resend/320/241odeButton.js → ResendCodeButton/ResendCodeButton.js} +1 -2
  4. package/components/CodeField/ResendCodeButton/index.d.ts +1 -0
  5. package/components/CodeField/ResendCodeButton/index.js +1 -0
  6. package/components/Stepper/StepButton/StepButton.d.ts +7 -1
  7. package/components/Stepper/StepButton/StepButton.js +4 -2
  8. package/components/Stepper/StepButton/styles.d.ts +2 -1
  9. package/components/Stepper/StepIcon/StepIcon.d.ts +6 -2
  10. package/components/Stepper/StepIcon/StepIcon.js +11 -7
  11. package/components/Stepper/StepIcon/styles.js +1 -0
  12. package/components/Stepper/StepLabel/StepLabel.d.ts +7 -1
  13. package/components/Stepper/StepLabel/StepLabel.js +2 -2
  14. package/components/Stepper/constants.d.ts +1 -0
  15. package/components/Stepper/constants.js +1 -0
  16. package/node/components/CodeField/CodeField.js +2 -5
  17. package/node/components/CodeField/{Resend/320/241odeButton/Resend/320/241odeButton.d.ts → ResendCodeButton/ResendCodeButton.d.ts} +2 -2
  18. package/node/components/CodeField/{Resend/320/241odeButton/Resend/320/241odeButton.js → ResendCodeButton/ResendCodeButton.js} +2 -1
  19. package/node/components/CodeField/ResendCodeButton/index.d.ts +1 -0
  20. package/node/components/CodeField/{Resend/320/241odeButton → ResendCodeButton}/index.js +1 -1
  21. package/node/components/Stepper/StepButton/StepButton.d.ts +7 -1
  22. package/node/components/Stepper/StepButton/StepButton.js +4 -2
  23. package/node/components/Stepper/StepButton/styles.d.ts +2 -1
  24. package/node/components/Stepper/StepIcon/StepIcon.d.ts +6 -2
  25. package/node/components/Stepper/StepIcon/StepIcon.js +11 -7
  26. package/node/components/Stepper/StepIcon/styles.js +1 -0
  27. package/node/components/Stepper/StepLabel/StepLabel.d.ts +7 -1
  28. package/node/components/Stepper/StepLabel/StepLabel.js +2 -2
  29. package/node/components/Stepper/constants.d.ts +1 -0
  30. package/node/components/Stepper/constants.js +1 -0
  31. package/package.json +1 -1
  32. package/components/CodeField/Resend/320/241odeButton/index.d.ts +0 -1
  33. package/components/CodeField/Resend/320/241odeButton/index.js +0 -1
  34. package/node/components/CodeField/Resend/320/241odeButton/index.d.ts +0 -1
  35. /package/components/CodeField/{Resend/320/241odeButton/styles.d.ts" → ResendCodeButton/styles.d.ts} +0 -0
  36. /package/components/CodeField/{Resend/320/241odeButton/styles.js" → ResendCodeButton/styles.js} +0 -0
  37. /package/node/components/CodeField/{Resend/320/241odeButton/styles.d.ts" → ResendCodeButton/styles.d.ts} +0 -0
  38. /package/node/components/CodeField/{Resend/320/241odeButton/styles.js" → ResendCodeButton/styles.js} +0 -0
@@ -4,7 +4,7 @@ import { useHidePersonalData } from '../personalDataSecurity';
4
4
  import { Skeleton } from '../Skeleton';
5
5
  import { ERROR_TEXT_DEFAULT, RESEND_TIMEOUT_DEFAULT } from './constants';
6
6
  import { useCodeState, useFocusInput } from './hooks';
7
- import ResendCodeButton from './ResendСodeButton/ResendСodeButton';
7
+ import { ResendCodeButton } from './ResendCodeButton';
8
8
  import { Digit, DigitsItem, DigitsWrapper, FieldLabel, StyledHelperText, Wrapper, } from './styles';
9
9
  /**
10
10
  * Поле для ввода кода подтверждения
@@ -20,5 +20,5 @@ type ResendCodeButtonProps = {
20
20
  */
21
21
  clearCodeValue: () => void;
22
22
  };
23
- declare const ResendCodeButton: ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }: ResendCodeButtonProps) => import("react/jsx-runtime").JSX.Element;
24
- export default ResendCodeButton;
23
+ export declare const ResendCodeButton: ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }: ResendCodeButtonProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -4,7 +4,7 @@ import { Button } from '../../Button';
4
4
  import { Typography } from '../../Typography';
5
5
  import { useSecondsCountdown } from '../../useSecondsCountDown';
6
6
  import { Wrapper } from './styles';
7
- const ResendCodeButton = ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }) => {
7
+ export const ResendCodeButton = ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }) => {
8
8
  const { isActive, textTime: time, restart, } = useSecondsCountdown({
9
9
  seconds: resendTimeout,
10
10
  });
@@ -31,4 +31,3 @@ const ResendCodeButton = ({ loading, disabled, resendTimeout, onResendCode, clea
31
31
  };
32
32
  return (_jsxs(Wrapper, { children: [_jsx(Button, { variant: "link", disabled: disableButton, onClick: onClick, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E" }), showTimer && (_jsx(Typography, { color: "grey", colorIntensity: "700", children: time }))] }));
33
33
  };
34
- export default ResendCodeButton;
@@ -0,0 +1 @@
1
+ export * from './ResendCodeButton';
@@ -0,0 +1 @@
1
+ export * from './ResendCodeButton';
@@ -1,5 +1,7 @@
1
1
  import type { StepLabelProps as MuiStepLabelProps } from '@mui/material/StepLabel';
2
+ import { type ReactNode } from 'react';
2
3
  import type { WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
+ import { type StepIconProps } from '../StepIcon';
3
5
  export type StepButtonProps = {
4
6
  /**
5
7
  * Если true, текущий шаг будет отображен как активный
@@ -9,5 +11,9 @@ export type StepButtonProps = {
9
11
  * Функция, вызываемая при клике на элемент
10
12
  */
11
13
  onClick: () => void;
12
- } & WithoutEmotionSpecific<MuiStepLabelProps>;
14
+ /**
15
+ * Кастомный компонент иконки
16
+ */
17
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
18
+ } & Omit<WithoutEmotionSpecific<MuiStepLabelProps>, 'icon'>;
13
19
  export declare const StepButton: (props: StepButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,9 @@ import { stepperClassnames } from '../constants';
4
4
  import { StepIcon } from '../StepIcon';
5
5
  import { Button, StyledStepLabel } from './styles';
6
6
  export const StepButton = (props) => {
7
- const { isSelected, onClick, ...restProps } = props;
8
- const stepIconRender = useCallback(({ active, completed, error, icon }) => (_jsx(StepIcon, { icon: icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
7
+ const { isSelected, onClick, icon: Icon, ...restProps } = props;
8
+ const stepIconRender = useCallback(({ active, completed, error }) => {
9
+ return (_jsx(StepIcon, { icon: Icon, isSelected: isSelected, active: active, completed: completed, error: error }));
10
+ }, [isSelected, Icon]);
9
11
  return (_jsx(Button, { onClick: onClick, tabIndex: 1, className: stepperClassnames.stepButton, children: _jsx(StyledStepLabel, { StepIconComponent: stepIconRender, ...restProps }) }));
10
12
  };
@@ -5,6 +5,7 @@ export declare const Button: import("../../styled").StyledComponent<{
5
5
  }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
6
6
  export declare const StyledStepLabel: import("../../styled").StyledComponent<{
7
7
  isSelected?: boolean | undefined;
8
- } & import("../..").WithoutEmotionSpecific<import("@mui/material/StepLabel").StepLabelProps> & {
8
+ icon?: ((props: Omit<import("../StepIcon").StepIconProps, "icon">) => import("react").ReactNode) | undefined;
9
+ } & Omit<import("../..").WithoutEmotionSpecific<import("@mui/material/StepLabel").StepLabelProps>, "icon"> & {
9
10
  theme?: import("@emotion/react").Theme | undefined;
10
11
  }, {}, {}>;
@@ -1,10 +1,14 @@
1
- /// <reference types="react" />
2
1
  import type { StepIconProps as MuiStepIconProps } from '@mui/material/StepIcon';
2
+ import { type ReactNode } from 'react';
3
3
  import { type WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
4
  export type StepIconProps = {
5
5
  /**
6
6
  * Является ли шаг в состоянии select
7
7
  */
8
8
  isSelected?: boolean;
9
- } & WithoutEmotionSpecific<MuiStepIconProps>;
9
+ /**
10
+ * Кастомный компонент иконки
11
+ */
12
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
13
+ } & Omit<WithoutEmotionSpecific<MuiStepIconProps>, 'icon'>;
10
14
  export declare const StepIcon: import("react").MemoExoticComponent<(props: StepIconProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,22 +1,26 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
+ import { stepperClassnames } from '../constants';
3
4
  import { ActiveIcon, DefaultIcon, ErrorIcon, SelectIcon, SuccessIcon, } from './styles';
4
5
  export const StepIcon = memo((props) => {
5
- const { active, completed, error, isSelected } = props;
6
+ const { active, completed, error, isSelected, icon: Icon } = props;
7
+ if (Icon) {
8
+ return (_jsx(Icon, { active: active, completed: completed, error: error, isSelected: isSelected, className: stepperClassnames.stepIcon }));
9
+ }
6
10
  if (completed && error && isSelected) {
7
- return _jsx(SelectIcon, { "$isError": true });
11
+ return _jsx(SelectIcon, { "$isError": true, className: stepperClassnames.stepIcon });
8
12
  }
9
13
  if (completed && isSelected) {
10
- return _jsx(SelectIcon, {});
14
+ return _jsx(SelectIcon, { className: stepperClassnames.stepIcon });
11
15
  }
12
16
  if (error) {
13
- return _jsx(ErrorIcon, {});
17
+ return _jsx(ErrorIcon, { className: stepperClassnames.stepIcon });
14
18
  }
15
19
  if (completed) {
16
- return _jsx(SuccessIcon, {});
20
+ return _jsx(SuccessIcon, { className: stepperClassnames.stepIcon });
17
21
  }
18
22
  if (active) {
19
- return _jsx(ActiveIcon, { color: "primary" });
23
+ return _jsx(ActiveIcon, { className: stepperClassnames.stepIcon });
20
24
  }
21
- return _jsx(DefaultIcon, {});
25
+ return _jsx(DefaultIcon, { className: stepperClassnames.stepIcon });
22
26
  });
@@ -29,4 +29,5 @@ export const DefaultIcon = styled(StepDefaultFillMd) `
29
29
  `;
30
30
  export const ActiveIcon = styled(StepDefaultFillMd) `
31
31
  ${({ theme }) => iconsSize(theme)};
32
+ color: ${({ theme }) => theme.palette.primary[800]};
32
33
  `;
@@ -1,9 +1,15 @@
1
1
  import type { StepLabelProps as MuiStepLabelProps } from '@mui/material/StepLabel';
2
+ import { type ReactNode } from 'react';
2
3
  import { type WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
+ import { type StepIconProps } from '../StepIcon';
3
5
  export type StepProps = {
4
6
  /**
5
7
  * Является ли шаг в состоянии select
6
8
  */
7
9
  isSelected?: boolean;
8
- } & WithoutEmotionSpecific<MuiStepLabelProps>;
10
+ /**
11
+ * Кастомный компонент иконки
12
+ */
13
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
14
+ } & Omit<WithoutEmotionSpecific<MuiStepLabelProps>, 'icon'>;
9
15
  export declare const StepLabel: (props: StepProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import MuiStepLabel from '@mui/material/StepLabel';
3
3
  import { useCallback } from 'react';
4
4
  import { StepIcon } from '../StepIcon';
5
5
  export const StepLabel = (props) => {
6
- const { isSelected, ...restProps } = props;
7
- const stepIconRender = useCallback(({ active, completed, error, icon }) => (_jsx(StepIcon, { icon: icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
6
+ const { isSelected, icon: Icon, ...restProps } = props;
7
+ const stepIconRender = useCallback(({ active, completed, error }) => (_jsx(StepIcon, { icon: Icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
8
8
  return _jsx(MuiStepLabel, { StepIconComponent: stepIconRender, ...restProps });
9
9
  };
@@ -1,3 +1,4 @@
1
1
  export declare const stepperClassnames: {
2
2
  stepButton: string;
3
+ stepIcon: string;
3
4
  };
@@ -1,4 +1,5 @@
1
1
  import { createUIKitClassname } from '../utils/createUIKitClassname';
2
2
  export const stepperClassnames = {
3
3
  stepButton: createUIKitClassname('stepper_stepButton'),
4
+ stepIcon: createUIKitClassname('stepper_stepIcon'),
4
5
  };
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.CodeField = void 0;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -10,7 +7,7 @@ const personalDataSecurity_1 = require("../personalDataSecurity");
10
7
  const Skeleton_1 = require("../Skeleton");
11
8
  const constants_1 = require("./constants");
12
9
  const hooks_1 = require("./hooks");
13
- const Resend_odeButton_1 = __importDefault(require("./Resend\u0421odeButton/Resend\u0421odeButton"));
10
+ const ResendCodeButton_1 = require("./ResendCodeButton");
14
11
  const styles_1 = require("./styles");
15
12
  /**
16
13
  * Поле для ввода кода подтверждения
@@ -29,5 +26,5 @@ exports.CodeField = (0, react_1.forwardRef)(({ label, resendTimeout = constants_
29
26
  });
30
27
  return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { ref: ref, children: [label && (0, jsx_runtime_1.jsx)(styles_1.FieldLabel, { children: label }), (0, jsx_runtime_1.jsx)(styles_1.DigitsWrapper, { children: codeValue.map((value, index) => (
31
28
  // biome-ignore lint/suspicious/noArrayIndexKey: Элементы статичны
32
- (0, jsx_runtime_1.jsx)(styles_1.DigitsItem, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 60, children: (0, jsx_runtime_1.jsx)(styles_1.Digit, { disabled: true }) })) : ((0, jsx_runtime_1.jsx)(styles_1.Digit, { className: hidePersonalDataClassname, "$isError": isError, type: "text", inputMode: "numeric", pattern: "[0-9]", disabled: disabled, value: value ?? '', ref: setRef(index), onKeyUp: (e) => onKeyUp(e, index), onKeyDown: (e) => onKeyDown(e, index), onChange: (e) => onChange(e, index), onPaste: (e) => !disabled && onPaste(e) })) }, index))) }), isError && (0, jsx_runtime_1.jsx)(styles_1.StyledHelperText, { error: true, children: errorText }), isAllowResendCode && ((0, jsx_runtime_1.jsx)(Resend_odeButton_1.default, { resendTimeout: resendTimeout, disabled: disabled, loading: loading, onResendCode: onResendCode, clearCodeValue: clearCodeValue }))] }));
29
+ (0, jsx_runtime_1.jsx)(styles_1.DigitsItem, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 60, children: (0, jsx_runtime_1.jsx)(styles_1.Digit, { disabled: true }) })) : ((0, jsx_runtime_1.jsx)(styles_1.Digit, { className: hidePersonalDataClassname, "$isError": isError, type: "text", inputMode: "numeric", pattern: "[0-9]", disabled: disabled, value: value ?? '', ref: setRef(index), onKeyUp: (e) => onKeyUp(e, index), onKeyDown: (e) => onKeyDown(e, index), onChange: (e) => onChange(e, index), onPaste: (e) => !disabled && onPaste(e) })) }, index))) }), isError && (0, jsx_runtime_1.jsx)(styles_1.StyledHelperText, { error: true, children: errorText }), isAllowResendCode && ((0, jsx_runtime_1.jsx)(ResendCodeButton_1.ResendCodeButton, { resendTimeout: resendTimeout, disabled: disabled, loading: loading, onResendCode: onResendCode, clearCodeValue: clearCodeValue }))] }));
33
30
  });
@@ -20,5 +20,5 @@ type ResendCodeButtonProps = {
20
20
  */
21
21
  clearCodeValue: () => void;
22
22
  };
23
- declare const ResendCodeButton: ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }: ResendCodeButtonProps) => import("react/jsx-runtime").JSX.Element;
24
- export default ResendCodeButton;
23
+ export declare const ResendCodeButton: ({ loading, disabled, resendTimeout, onResendCode, clearCodeValue, }: ResendCodeButtonProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResendCodeButton = void 0;
3
4
  const jsx_runtime_1 = require("react/jsx-runtime");
4
5
  const react_1 = require("react");
5
6
  const Button_1 = require("../../Button");
@@ -33,4 +34,4 @@ const ResendCodeButton = ({ loading, disabled, resendTimeout, onResendCode, clea
33
34
  };
34
35
  return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "link", disabled: disableButton, onClick: onClick, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E" }), showTimer && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { color: "grey", colorIntensity: "700", children: time }))] }));
35
36
  };
36
- exports.default = ResendCodeButton;
37
+ exports.ResendCodeButton = ResendCodeButton;
@@ -0,0 +1 @@
1
+ export * from './ResendCodeButton';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Resend\u0421odeButton"), exports);
17
+ __exportStar(require("./ResendCodeButton"), exports);
@@ -1,5 +1,7 @@
1
1
  import type { StepLabelProps as MuiStepLabelProps } from '@mui/material/StepLabel';
2
+ import { type ReactNode } from 'react';
2
3
  import type { WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
+ import { type StepIconProps } from '../StepIcon';
3
5
  export type StepButtonProps = {
4
6
  /**
5
7
  * Если true, текущий шаг будет отображен как активный
@@ -9,5 +11,9 @@ export type StepButtonProps = {
9
11
  * Функция, вызываемая при клике на элемент
10
12
  */
11
13
  onClick: () => void;
12
- } & WithoutEmotionSpecific<MuiStepLabelProps>;
14
+ /**
15
+ * Кастомный компонент иконки
16
+ */
17
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
18
+ } & Omit<WithoutEmotionSpecific<MuiStepLabelProps>, 'icon'>;
13
19
  export declare const StepButton: (props: StepButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -7,8 +7,10 @@ const constants_1 = require("../constants");
7
7
  const StepIcon_1 = require("../StepIcon");
8
8
  const styles_1 = require("./styles");
9
9
  const StepButton = (props) => {
10
- const { isSelected, onClick, ...restProps } = props;
11
- const stepIconRender = (0, react_1.useCallback)(({ active, completed, error, icon }) => ((0, jsx_runtime_1.jsx)(StepIcon_1.StepIcon, { icon: icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
10
+ const { isSelected, onClick, icon: Icon, ...restProps } = props;
11
+ const stepIconRender = (0, react_1.useCallback)(({ active, completed, error }) => {
12
+ return ((0, jsx_runtime_1.jsx)(StepIcon_1.StepIcon, { icon: Icon, isSelected: isSelected, active: active, completed: completed, error: error }));
13
+ }, [isSelected, Icon]);
12
14
  return ((0, jsx_runtime_1.jsx)(styles_1.Button, { onClick: onClick, tabIndex: 1, className: constants_1.stepperClassnames.stepButton, children: (0, jsx_runtime_1.jsx)(styles_1.StyledStepLabel, { StepIconComponent: stepIconRender, ...restProps }) }));
13
15
  };
14
16
  exports.StepButton = StepButton;
@@ -5,6 +5,7 @@ export declare const Button: import("@emotion/styled/dist/declarations/src/types
5
5
  }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
6
6
  export declare const StyledStepLabel: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
7
7
  isSelected?: boolean | undefined;
8
- } & import("../..").WithoutEmotionSpecific<import("@mui/material/StepLabel").StepLabelProps> & {
8
+ icon?: ((props: Omit<import("../StepIcon").StepIconProps, "icon">) => import("react").ReactNode) | undefined;
9
+ } & Omit<import("../..").WithoutEmotionSpecific<import("@mui/material/StepLabel").StepLabelProps>, "icon"> & {
9
10
  theme?: import("@emotion/react").Theme | undefined;
10
11
  }, {}, {}>;
@@ -1,10 +1,14 @@
1
- /// <reference types="react" />
2
1
  import type { StepIconProps as MuiStepIconProps } from '@mui/material/StepIcon';
2
+ import { type ReactNode } from 'react';
3
3
  import { type WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
4
  export type StepIconProps = {
5
5
  /**
6
6
  * Является ли шаг в состоянии select
7
7
  */
8
8
  isSelected?: boolean;
9
- } & WithoutEmotionSpecific<MuiStepIconProps>;
9
+ /**
10
+ * Кастомный компонент иконки
11
+ */
12
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
13
+ } & Omit<WithoutEmotionSpecific<MuiStepIconProps>, 'icon'>;
10
14
  export declare const StepIcon: import("react").MemoExoticComponent<(props: StepIconProps) => import("react/jsx-runtime").JSX.Element>;
@@ -3,23 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StepIcon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const constants_1 = require("../constants");
6
7
  const styles_1 = require("./styles");
7
8
  exports.StepIcon = (0, react_1.memo)((props) => {
8
- const { active, completed, error, isSelected } = props;
9
+ const { active, completed, error, isSelected, icon: Icon } = props;
10
+ if (Icon) {
11
+ return ((0, jsx_runtime_1.jsx)(Icon, { active: active, completed: completed, error: error, isSelected: isSelected, className: constants_1.stepperClassnames.stepIcon }));
12
+ }
9
13
  if (completed && error && isSelected) {
10
- return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, { "$isError": true });
14
+ return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, { "$isError": true, className: constants_1.stepperClassnames.stepIcon });
11
15
  }
12
16
  if (completed && isSelected) {
13
- return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, {});
17
+ return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, { className: constants_1.stepperClassnames.stepIcon });
14
18
  }
15
19
  if (error) {
16
- return (0, jsx_runtime_1.jsx)(styles_1.ErrorIcon, {});
20
+ return (0, jsx_runtime_1.jsx)(styles_1.ErrorIcon, { className: constants_1.stepperClassnames.stepIcon });
17
21
  }
18
22
  if (completed) {
19
- return (0, jsx_runtime_1.jsx)(styles_1.SuccessIcon, {});
23
+ return (0, jsx_runtime_1.jsx)(styles_1.SuccessIcon, { className: constants_1.stepperClassnames.stepIcon });
20
24
  }
21
25
  if (active) {
22
- return (0, jsx_runtime_1.jsx)(styles_1.ActiveIcon, { color: "primary" });
26
+ return (0, jsx_runtime_1.jsx)(styles_1.ActiveIcon, { className: constants_1.stepperClassnames.stepIcon });
23
27
  }
24
- return (0, jsx_runtime_1.jsx)(styles_1.DefaultIcon, {});
28
+ return (0, jsx_runtime_1.jsx)(styles_1.DefaultIcon, { className: constants_1.stepperClassnames.stepIcon });
25
29
  });
@@ -32,4 +32,5 @@ exports.DefaultIcon = (0, styled_1.styled)(StepDefaultFillMd_1.StepDefaultFillMd
32
32
  `;
33
33
  exports.ActiveIcon = (0, styled_1.styled)(StepDefaultFillMd_1.StepDefaultFillMd) `
34
34
  ${({ theme }) => iconsSize(theme)};
35
+ color: ${({ theme }) => theme.palette.primary[800]};
35
36
  `;
@@ -1,9 +1,15 @@
1
1
  import type { StepLabelProps as MuiStepLabelProps } from '@mui/material/StepLabel';
2
+ import { type ReactNode } from 'react';
2
3
  import { type WithoutEmotionSpecific } from '../../types/WithoutEmotionSpecific';
4
+ import { type StepIconProps } from '../StepIcon';
3
5
  export type StepProps = {
4
6
  /**
5
7
  * Является ли шаг в состоянии select
6
8
  */
7
9
  isSelected?: boolean;
8
- } & WithoutEmotionSpecific<MuiStepLabelProps>;
10
+ /**
11
+ * Кастомный компонент иконки
12
+ */
13
+ icon?: (props: Omit<StepIconProps, 'icon'>) => ReactNode;
14
+ } & Omit<WithoutEmotionSpecific<MuiStepLabelProps>, 'icon'>;
9
15
  export declare const StepLabel: (props: StepProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,8 +9,8 @@ const StepLabel_1 = __importDefault(require("@mui/material/StepLabel"));
9
9
  const react_1 = require("react");
10
10
  const StepIcon_1 = require("../StepIcon");
11
11
  const StepLabel = (props) => {
12
- const { isSelected, ...restProps } = props;
13
- const stepIconRender = (0, react_1.useCallback)(({ active, completed, error, icon }) => ((0, jsx_runtime_1.jsx)(StepIcon_1.StepIcon, { icon: icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
12
+ const { isSelected, icon: Icon, ...restProps } = props;
13
+ const stepIconRender = (0, react_1.useCallback)(({ active, completed, error }) => ((0, jsx_runtime_1.jsx)(StepIcon_1.StepIcon, { icon: Icon, isSelected: isSelected, active: active, completed: completed, error: error })), [isSelected]);
14
14
  return (0, jsx_runtime_1.jsx)(StepLabel_1.default, { StepIconComponent: stepIconRender, ...restProps });
15
15
  };
16
16
  exports.StepLabel = StepLabel;
@@ -1,3 +1,4 @@
1
1
  export declare const stepperClassnames: {
2
2
  stepButton: string;
3
+ stepIcon: string;
3
4
  };
@@ -4,4 +4,5 @@ exports.stepperClassnames = void 0;
4
4
  const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
5
  exports.stepperClassnames = {
6
6
  stepButton: (0, createUIKitClassname_1.createUIKitClassname)('stepper_stepButton'),
7
+ stepIcon: (0, createUIKitClassname_1.createUIKitClassname)('stepper_stepIcon'),
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.30.0",
3
+ "version": "4.31.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- export * from './ResendСodeButton';
@@ -1 +0,0 @@
1
- export * from './ResendСodeButton';
@@ -1 +0,0 @@
1
- export * from './ResendСodeButton';