@alfalab/core-components-confirmation 13.1.5 → 13.1.7

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 (100) hide show
  1. package/Component-89f0cb07.d.ts +62 -0
  2. package/component.desktop.js +1 -1
  3. package/component.mobile.js +2 -2
  4. package/component.responsive.js +1 -1
  5. package/components/base-confirmation/component.js +2 -2
  6. package/components/base-confirmation/index.css +2 -2
  7. package/components/base-confirmation/index.js +1 -1
  8. package/components/countdown-loader/component.js +1 -1
  9. package/components/countdown-loader/index.css +2 -2
  10. package/components/header/component.js +1 -1
  11. package/components/header/index.css +7 -7
  12. package/components/index.js +1 -1
  13. package/components/screens/fatal-error/component.js +1 -1
  14. package/components/screens/fatal-error/index.css +6 -6
  15. package/components/screens/hint/component.js +3 -3
  16. package/components/screens/hint/index.css +12 -12
  17. package/components/screens/index.js +1 -1
  18. package/components/screens/initial/component.js +1 -1
  19. package/components/screens/initial/countdown-section.js +1 -1
  20. package/components/screens/initial/index.css +17 -17
  21. package/components/screens/initial/index.js +1 -1
  22. package/components/screens/temp-block/component.js +1 -1
  23. package/components/screens/temp-block/index.css +7 -7
  24. package/{countdown-section-abb12124.js → countdown-section-a7437221.js} +1 -1
  25. package/cssm/Component-89f0cb07.d.ts +62 -0
  26. package/cssm/components/header/index.module.css +3 -3
  27. package/cssm/components/screens/hint/component.js +2 -2
  28. package/cssm/typings-89f0cb07.d.ts +93 -0
  29. package/desktop.js +1 -1
  30. package/esm/Component-89f0cb07.d.ts +62 -0
  31. package/esm/component.desktop.js +1 -1
  32. package/esm/component.mobile.js +2 -2
  33. package/esm/component.responsive.js +1 -1
  34. package/esm/components/base-confirmation/component.js +2 -2
  35. package/esm/components/base-confirmation/index.css +2 -2
  36. package/esm/components/base-confirmation/index.js +1 -1
  37. package/esm/components/countdown-loader/component.js +1 -1
  38. package/esm/components/countdown-loader/index.css +2 -2
  39. package/esm/components/header/component.js +1 -1
  40. package/esm/components/header/index.css +7 -7
  41. package/esm/components/index.js +1 -1
  42. package/esm/components/screens/fatal-error/component.js +1 -1
  43. package/esm/components/screens/fatal-error/index.css +6 -6
  44. package/esm/components/screens/hint/component.js +3 -3
  45. package/esm/components/screens/hint/index.css +12 -12
  46. package/esm/components/screens/index.js +1 -1
  47. package/esm/components/screens/initial/component.js +1 -1
  48. package/esm/components/screens/initial/countdown-section.js +1 -1
  49. package/esm/components/screens/initial/index.css +17 -17
  50. package/esm/components/screens/initial/index.js +1 -1
  51. package/esm/components/screens/temp-block/component.js +1 -1
  52. package/esm/components/screens/temp-block/index.css +7 -7
  53. package/esm/{countdown-section-3a05f0f1.js → countdown-section-d5c7f116.js} +1 -1
  54. package/esm/desktop.js +1 -1
  55. package/esm/index.js +1 -1
  56. package/esm/mobile.css +2 -2
  57. package/esm/mobile.js +1 -1
  58. package/esm/shared.js +1 -1
  59. package/esm/typings-89f0cb07.d.ts +93 -0
  60. package/index.js +1 -1
  61. package/mobile.css +2 -2
  62. package/mobile.js +1 -1
  63. package/modern/Component-89f0cb07.d.ts +62 -0
  64. package/modern/component.desktop.js +1 -1
  65. package/modern/component.mobile.js +2 -2
  66. package/modern/component.responsive.js +1 -1
  67. package/modern/components/base-confirmation/component.js +2 -2
  68. package/modern/components/base-confirmation/index.css +2 -2
  69. package/modern/components/base-confirmation/index.js +1 -1
  70. package/modern/components/countdown-loader/component.js +1 -1
  71. package/modern/components/countdown-loader/index.css +2 -2
  72. package/modern/components/header/component.js +1 -1
  73. package/modern/components/header/index.css +7 -7
  74. package/modern/components/index.js +1 -1
  75. package/modern/components/screens/fatal-error/component.js +1 -1
  76. package/modern/components/screens/fatal-error/index.css +6 -6
  77. package/modern/components/screens/hint/component.js +3 -3
  78. package/modern/components/screens/hint/index.css +12 -12
  79. package/modern/components/screens/index.js +1 -1
  80. package/modern/components/screens/initial/component.js +1 -1
  81. package/modern/components/screens/initial/countdown-section.js +1 -1
  82. package/modern/components/screens/initial/index.css +17 -17
  83. package/modern/components/screens/initial/index.js +1 -1
  84. package/modern/components/screens/temp-block/component.js +1 -1
  85. package/modern/components/screens/temp-block/index.css +7 -7
  86. package/modern/{countdown-section-a714163e.js → countdown-section-ffce9cdb.js} +1 -1
  87. package/modern/desktop.js +1 -1
  88. package/modern/index.js +1 -1
  89. package/modern/mobile.css +2 -2
  90. package/modern/mobile.js +1 -1
  91. package/modern/shared.js +1 -1
  92. package/modern/typings-89f0cb07.d.ts +93 -0
  93. package/package.json +3 -3
  94. package/shared.js +1 -1
  95. package/src/components/screens/hint/component.tsx +2 -2
  96. package/src/vars.css +3 -3
  97. package/typings-89f0cb07.d.ts +93 -0
  98. /package/{countdown-section-abb12124.d.ts → countdown-section-a7437221.d.ts} +0 -0
  99. /package/esm/{countdown-section-3a05f0f1.d.ts → countdown-section-d5c7f116.d.ts} +0 -0
  100. /package/modern/{countdown-section-a714163e.d.ts → countdown-section-ffce9cdb.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: 17j7v */
1
+ /* hash: 1rc05 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e;
@@ -37,49 +37,49 @@
37
37
  --confirmation-text-color: var(--color-light-text-primary)
38
38
 
39
39
  /* header */
40
- } .confirmation__component_7mh7k {
40
+ } .confirmation__component_1wv7u {
41
41
  display: flex;
42
42
  flex-direction: column;
43
- } .confirmation__typographyTheme_7mh7k.confirmation__typographyTheme_7mh7k {
43
+ } .confirmation__typographyTheme_1wv7u.confirmation__typographyTheme_1wv7u {
44
44
  font-size: var(--confirmation-text-font-size);
45
45
  line-height: var(--confirmation-text-line-height);
46
46
  font-weight: var(--confirmation-text-font-weight);
47
47
  font-family: var(--confirmation-text-font-family);
48
48
  color: var(--confirmation-text-color);
49
- } .confirmation__phone_7mh7k.confirmation__phone_7mh7k {
49
+ } .confirmation__phone_1wv7u.confirmation__phone_1wv7u {
50
50
  color: var(--color-light-text-primary);
51
51
  margin-bottom: var(--gap-2xl);
52
- } .confirmation__compact_7mh7k {
52
+ } .confirmation__compact_1wv7u {
53
53
  margin-bottom: var(--gap-xl);
54
- } .confirmation__loaderWrap_7mh7k {
54
+ } .confirmation__loaderWrap_1wv7u {
55
55
  display: flex;
56
56
  align-items: center;
57
- } .confirmation__left_7mh7k {
57
+ } .confirmation__left_1wv7u {
58
58
  align-items: flex-start;
59
- } .confirmation__center_7mh7k {
59
+ } .confirmation__center_1wv7u {
60
60
  align-items: center;
61
61
  text-align: center
62
- } .confirmation__center_7mh7k .confirmation__loaderWrap_7mh7k {
62
+ } .confirmation__center_1wv7u .confirmation__loaderWrap_1wv7u {
63
63
  justify-content: center;
64
- } .confirmation__codeInput_7mh7k {
64
+ } .confirmation__codeInput_1wv7u {
65
65
  margin-bottom: var(--gap-s);
66
- } .confirmation__smsComeLink_7mh7k.confirmation__smsComeLink_7mh7k {
66
+ } .confirmation__smsComeLink_1wv7u.confirmation__smsComeLink_1wv7u {
67
67
  font-size: 14px;
68
68
  line-height: 20px;
69
69
  font-weight: 500;
70
- } .confirmation__countdownContainer_7mh7k.confirmation__countdownContainer_7mh7k {
70
+ } .confirmation__countdownContainer_1wv7u.confirmation__countdownContainer_1wv7u {
71
71
  color: var(--color-light-text-secondary);
72
72
  margin-bottom: var(--gap-xl);
73
- } .confirmation__countdownMobile_7mh7k.confirmation__countdownMobile_7mh7k {
73
+ } .confirmation__countdownMobile_1wv7u.confirmation__countdownMobile_1wv7u {
74
74
  margin-bottom: var(--gap-l);
75
- } .confirmation__countdownLoaderMobile_7mh7k.confirmation__countdownLoaderMobile_7mh7k {
75
+ } .confirmation__countdownLoaderMobile_1wv7u.confirmation__countdownLoaderMobile_1wv7u {
76
76
  margin-bottom: var(--gap-m);
77
- } .confirmation__getCodeButton_7mh7k {
77
+ } .confirmation__getCodeButton_1wv7u {
78
78
  position: relative;
79
79
  top: var(--gap-2xs-neg);
80
80
  margin-bottom: var(--gap-m);
81
- } .confirmation__getCodeButtonMobile_7mh7k {
81
+ } .confirmation__getCodeButtonMobile_1wv7u {
82
82
  margin-bottom: 0;
83
- } .confirmation__containerInput_7mh7k {
83
+ } .confirmation__containerInput_1wv7u {
84
84
  min-height: 80px;
85
85
  }
@@ -10,6 +10,6 @@ import '@alfalab/hooks';
10
10
  import '../../../context.js';
11
11
  import '../../../utils.js';
12
12
  import '../../header/component.js';
13
- import '../../../countdown-section-a714163e.js';
13
+ import '../../../countdown-section-ffce9cdb.js';
14
14
  import '@alfalab/core-components-button/modern';
15
15
  import '@alfalab/core-components-spinner/modern';
@@ -6,7 +6,7 @@ import { useCountdown, formatMsAsMinutes } from '../../../utils.js';
6
6
  import { CountdownLoader } from '../../countdown-loader/component.js';
7
7
  import { Header } from '../../header/component.js';
8
8
 
9
- const styles = {"component":"confirmation__component_1dw5e","center":"confirmation__center_1dw5e","typographyTheme":"confirmation__typographyTheme_1dw5e","description":"confirmation__description_1dw5e","countdownWrap":"confirmation__countdownWrap_1dw5e","loader":"confirmation__loader_1dw5e"};
9
+ const styles = {"component":"confirmation__component_tqagl","center":"confirmation__center_tqagl","typographyTheme":"confirmation__typographyTheme_tqagl","description":"confirmation__description_tqagl","countdownWrap":"confirmation__countdownWrap_tqagl","loader":"confirmation__loader_tqagl"};
10
10
  require('./index.css')
11
11
 
12
12
  const TempBlock = ({ mobile }) => {
@@ -1,4 +1,4 @@
1
- /* hash: rq7ps */
1
+ /* hash: 7xfg2 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -31,23 +31,23 @@
31
31
  --confirmation-text-color: var(--color-light-text-primary)
32
32
 
33
33
  /* header */
34
- } .confirmation__component_1dw5e {
34
+ } .confirmation__component_tqagl {
35
35
  display: flex;
36
36
  flex-direction: column;
37
- } .confirmation__center_1dw5e {
37
+ } .confirmation__center_tqagl {
38
38
  align-items: center;
39
39
  text-align: center;
40
- } .confirmation__typographyTheme_1dw5e.confirmation__typographyTheme_1dw5e {
40
+ } .confirmation__typographyTheme_tqagl.confirmation__typographyTheme_tqagl {
41
41
  font-size: var(--confirmation-text-font-size);
42
42
  line-height: var(--confirmation-text-line-height);
43
43
  font-weight: var(--confirmation-text-font-weight);
44
44
  font-family: var(--confirmation-text-font-family);
45
45
  color: var(--confirmation-text-color);
46
- } .confirmation__description_1dw5e.confirmation__description_1dw5e {
46
+ } .confirmation__description_tqagl.confirmation__description_tqagl {
47
47
  margin-bottom: var(--gap-xs);
48
- } .confirmation__countdownWrap_1dw5e {
48
+ } .confirmation__countdownWrap_tqagl {
49
49
  display: flex;
50
50
  align-items: center;
51
- } .confirmation__loader_1dw5e {
51
+ } .confirmation__loader_tqagl {
52
52
  margin-right: var(--gap-xs);
53
53
  }
@@ -6,7 +6,7 @@ import { Typography } from '@alfalab/core-components-typography/modern';
6
6
  import { ConfirmationContext } from './context.js';
7
7
  import { formatMsAsMinutes } from './utils.js';
8
8
 
9
- const styles = {"component":"confirmation__component_7mh7k","typographyTheme":"confirmation__typographyTheme_7mh7k","phone":"confirmation__phone_7mh7k","compact":"confirmation__compact_7mh7k","loaderWrap":"confirmation__loaderWrap_7mh7k","left":"confirmation__left_7mh7k","center":"confirmation__center_7mh7k","codeInput":"confirmation__codeInput_7mh7k","smsComeLink":"confirmation__smsComeLink_7mh7k","countdownContainer":"confirmation__countdownContainer_7mh7k","countdownMobile":"confirmation__countdownMobile_7mh7k","countdownLoaderMobile":"confirmation__countdownLoaderMobile_7mh7k","getCodeButton":"confirmation__getCodeButton_7mh7k","getCodeButtonMobile":"confirmation__getCodeButtonMobile_7mh7k","containerInput":"confirmation__containerInput_7mh7k"};
9
+ const styles = {"component":"confirmation__component_1wv7u","typographyTheme":"confirmation__typographyTheme_1wv7u","phone":"confirmation__phone_1wv7u","compact":"confirmation__compact_1wv7u","loaderWrap":"confirmation__loaderWrap_1wv7u","left":"confirmation__left_1wv7u","center":"confirmation__center_1wv7u","codeInput":"confirmation__codeInput_1wv7u","smsComeLink":"confirmation__smsComeLink_1wv7u","countdownContainer":"confirmation__countdownContainer_1wv7u","countdownMobile":"confirmation__countdownMobile_1wv7u","countdownLoaderMobile":"confirmation__countdownLoaderMobile_1wv7u","getCodeButton":"confirmation__getCodeButton_1wv7u","getCodeButtonMobile":"confirmation__getCodeButtonMobile_1wv7u","containerInput":"confirmation__containerInput_1wv7u"};
10
10
  require('./components/screens/initial/index.css')
11
11
 
12
12
  const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
package/modern/desktop.js CHANGED
@@ -13,7 +13,7 @@ import '@alfalab/core-components-code-input/modern/mobile';
13
13
  import '@alfalab/core-components-link/modern';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './components/header/component.js';
16
- import './countdown-section-a714163e.js';
16
+ import './countdown-section-ffce9cdb.js';
17
17
  import '@alfalab/core-components-button/modern';
18
18
  import '@alfalab/core-components-spinner/modern';
19
19
  import './components/screens/hint/component.js';
package/modern/index.js CHANGED
@@ -15,7 +15,7 @@ import '@alfalab/core-components-code-input/modern/mobile';
15
15
  import '@alfalab/core-components-link/modern';
16
16
  import '@alfalab/core-components-typography/modern';
17
17
  import './components/header/component.js';
18
- import './countdown-section-a714163e.js';
18
+ import './countdown-section-ffce9cdb.js';
19
19
  import '@alfalab/core-components-button/modern';
20
20
  import '@alfalab/core-components-spinner/modern';
21
21
  import './components/screens/hint/component.js';
package/modern/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1kd01 */
2
- .confirmation__container_17ab7 {
1
+ /* hash: 54o9q */
2
+ .confirmation__container_7c9vx {
3
3
  max-width: 288px;
4
4
  }
package/modern/mobile.js CHANGED
@@ -13,7 +13,7 @@ import '@alfalab/core-components-code-input/modern/mobile';
13
13
  import '@alfalab/core-components-link/modern';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './components/header/component.js';
16
- import './countdown-section-a714163e.js';
16
+ import './countdown-section-ffce9cdb.js';
17
17
  import '@alfalab/core-components-button/modern';
18
18
  import '@alfalab/core-components-spinner/modern';
19
19
  import './components/screens/hint/component.js';
package/modern/shared.js CHANGED
@@ -15,6 +15,6 @@ import '@alfalab/core-components-link/modern';
15
15
  import '@alfalab/core-components-typography/modern';
16
16
  import '@alfalab/hooks';
17
17
  import './components/header/component.js';
18
- import './countdown-section-a714163e.js';
18
+ import './countdown-section-ffce9cdb.js';
19
19
  import '@alfalab/core-components-button/modern';
20
20
  import '@alfalab/core-components-spinner/modern';
@@ -0,0 +1,93 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, ElementType, ReactNode } from 'react';
2
+ type StyleColors = {
3
+ default: {
4
+ [key: string]: string;
5
+ };
6
+ inverted: {
7
+ [key: string]: string;
8
+ };
9
+ };
10
+ type ComponentProps = {
11
+ /**
12
+ * Тип кнопки
13
+ * @default secondary
14
+ */
15
+ view?: 'accent' | 'primary' | 'secondary' | 'tertiary' | 'outlined' | 'filled' | 'transparent' | 'link' | 'ghost';
16
+ /**
17
+ * Слот слева
18
+ */
19
+ leftAddons?: ReactNode;
20
+ /**
21
+ * Слот справа
22
+ */
23
+ rightAddons?: ReactNode;
24
+ /**
25
+ * Размер компонента
26
+ * @default m
27
+ */
28
+ size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl';
29
+ /**
30
+ * Растягивает компонент на ширину контейнера
31
+ * @default false
32
+ */
33
+ block?: boolean;
34
+ /**
35
+ * Дополнительный класс
36
+ */
37
+ className?: string;
38
+ /**
39
+ * Дополнительный класс для спиннера
40
+ */
41
+ spinnerClassName?: string;
42
+ /**
43
+ * Выводит ссылку в виде кнопки
44
+ */
45
+ href?: string;
46
+ /**
47
+ * Позволяет использовать кастомный компонент для кнопки (например Link из роутера)
48
+ */
49
+ Component?: ElementType;
50
+ /**
51
+ * Идентификатор для систем автоматизированного тестирования
52
+ */
53
+ dataTestId?: string;
54
+ /**
55
+ * Показать лоадер
56
+ * @default false
57
+ */
58
+ loading?: boolean;
59
+ /**
60
+ * Не переносить текст кнопки на новую строку
61
+ * @default false
62
+ */
63
+ nowrap?: boolean;
64
+ /**
65
+ * Набор цветов для компонента
66
+ */
67
+ colors?: 'default' | 'inverted';
68
+ /**
69
+ * Дочерние элементы.
70
+ */
71
+ children?: ReactNode;
72
+ };
73
+ type PrivateButtonProps = {
74
+ /**
75
+ * Основные стили компонента.
76
+ */
77
+ styles: {
78
+ [key: string]: string;
79
+ };
80
+ /**
81
+ * Стили компонента для default и inverted режима.
82
+ */
83
+ colorStylesMap: StyleColors;
84
+ };
85
+ type CommonButtonProps = ComponentProps & Partial<AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement>>;
86
+ type ButtonProps = CommonButtonProps & {
87
+ /**
88
+ * Контрольная точка, с нее начинается desktop версия
89
+ * @default 1024
90
+ */
91
+ breakpoint?: number;
92
+ };
93
+ export { StyleColors, ComponentProps, PrivateButtonProps, CommonButtonProps, ButtonProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-confirmation",
3
- "version": "13.1.5",
3
+ "version": "13.1.7",
4
4
  "description": "Sms confirmation component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  "directory": "dist"
36
36
  },
37
37
  "dependencies": {
38
- "@alfalab/core-components-button": "^9.0.5",
39
- "@alfalab/core-components-code-input": "^3.0.0",
38
+ "@alfalab/core-components-button": "^9.0.6",
39
+ "@alfalab/core-components-code-input": "^3.0.1",
40
40
  "@alfalab/core-components-link": "^5.1.0",
41
41
  "@alfalab/core-components-spinner": "^3.1.0",
42
42
  "@alfalab/core-components-typography": "^4.1.0",
package/shared.js CHANGED
@@ -19,7 +19,7 @@ require('@alfalab/core-components-link');
19
19
  require('@alfalab/core-components-typography');
20
20
  require('@alfalab/hooks');
21
21
  require('./components/header/component.js');
22
- require('./countdown-section-abb12124.js');
22
+ require('./countdown-section-a7437221.js');
23
23
  require('@alfalab/core-components-button');
24
24
  require('@alfalab/core-components-spinner');
25
25
 
@@ -42,7 +42,7 @@ export const Hint: FC<HintProps> = ({ mobile }) => {
42
42
  <div className={styles.phonesWrap}>
43
43
  <div className={cn(styles.phoneWrap, { [styles.phoneContentMobile]: mobile })}>
44
44
  <Link href='tel:+78002000000' underline={false} className={styles.phoneLink}>
45
- 8 800 200-00-00
45
+ 8 800 200 00 00
46
46
  </Link>
47
47
  <Typography.Text
48
48
  view='primary-medium'
@@ -57,7 +57,7 @@ export const Hint: FC<HintProps> = ({ mobile }) => {
57
57
 
58
58
  <div className={cn(styles.phoneWrap, { [styles.phoneContentMobile]: mobile })}>
59
59
  <Link href='tel:+74957888878' underline={false} className={styles.phoneLink}>
60
- +7 495 78-888-78
60
+ +7 495 78 888 78
61
61
  </Link>
62
62
  <Typography.Text
63
63
  view='primary-medium'
package/src/vars.css CHANGED
@@ -8,9 +8,9 @@
8
8
  --confirmation-header-desktop-font-family: var(--font-family-system);
9
9
 
10
10
  /* mobile */
11
- --confirmation-header-mobile-font-size: 18px;
12
- --confirmation-header-mobile-line-height: 22px;
13
- --confirmation-header-mobile-font-weight: bold;
11
+ --confirmation-header-mobile-font-size: 20px;
12
+ --confirmation-header-mobile-line-height: 28px;
13
+ --confirmation-header-mobile-font-weight: 600;
14
14
  --confirmation-header-mobile-font-family: var(--font-family-system);
15
15
 
16
16
  /* text */
@@ -0,0 +1,93 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, ElementType, ReactNode } from 'react';
2
+ type StyleColors = {
3
+ default: {
4
+ [key: string]: string;
5
+ };
6
+ inverted: {
7
+ [key: string]: string;
8
+ };
9
+ };
10
+ type ComponentProps = {
11
+ /**
12
+ * Тип кнопки
13
+ * @default secondary
14
+ */
15
+ view?: 'accent' | 'primary' | 'secondary' | 'tertiary' | 'outlined' | 'filled' | 'transparent' | 'link' | 'ghost';
16
+ /**
17
+ * Слот слева
18
+ */
19
+ leftAddons?: ReactNode;
20
+ /**
21
+ * Слот справа
22
+ */
23
+ rightAddons?: ReactNode;
24
+ /**
25
+ * Размер компонента
26
+ * @default m
27
+ */
28
+ size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl';
29
+ /**
30
+ * Растягивает компонент на ширину контейнера
31
+ * @default false
32
+ */
33
+ block?: boolean;
34
+ /**
35
+ * Дополнительный класс
36
+ */
37
+ className?: string;
38
+ /**
39
+ * Дополнительный класс для спиннера
40
+ */
41
+ spinnerClassName?: string;
42
+ /**
43
+ * Выводит ссылку в виде кнопки
44
+ */
45
+ href?: string;
46
+ /**
47
+ * Позволяет использовать кастомный компонент для кнопки (например Link из роутера)
48
+ */
49
+ Component?: ElementType;
50
+ /**
51
+ * Идентификатор для систем автоматизированного тестирования
52
+ */
53
+ dataTestId?: string;
54
+ /**
55
+ * Показать лоадер
56
+ * @default false
57
+ */
58
+ loading?: boolean;
59
+ /**
60
+ * Не переносить текст кнопки на новую строку
61
+ * @default false
62
+ */
63
+ nowrap?: boolean;
64
+ /**
65
+ * Набор цветов для компонента
66
+ */
67
+ colors?: 'default' | 'inverted';
68
+ /**
69
+ * Дочерние элементы.
70
+ */
71
+ children?: ReactNode;
72
+ };
73
+ type PrivateButtonProps = {
74
+ /**
75
+ * Основные стили компонента.
76
+ */
77
+ styles: {
78
+ [key: string]: string;
79
+ };
80
+ /**
81
+ * Стили компонента для default и inverted режима.
82
+ */
83
+ colorStylesMap: StyleColors;
84
+ };
85
+ type CommonButtonProps = ComponentProps & Partial<AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement>>;
86
+ type ButtonProps = CommonButtonProps & {
87
+ /**
88
+ * Контрольная точка, с нее начинается desktop версия
89
+ * @default 1024
90
+ */
91
+ breakpoint?: number;
92
+ };
93
+ export { StyleColors, ComponentProps, PrivateButtonProps, CommonButtonProps, ButtonProps };