@alfalab/core-components-switch 4.5.6 → 4.5.7-snapshot-1393ffa

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 (92) hide show
  1. package/Component.js +18 -23
  2. package/Component.js.map +1 -0
  3. package/cssm/Component.js +3 -2
  4. package/cssm/Component.js.map +1 -0
  5. package/cssm/default.module.css +2 -35
  6. package/cssm/index.js +1 -0
  7. package/cssm/index.js.map +1 -0
  8. package/cssm/index.module.css +12 -43
  9. package/cssm/inverted.module.css +2 -35
  10. package/{Component.d.ts → cssm/src/Component.d.ts} +6 -8
  11. package/cssm/src/index.d.ts +1 -0
  12. package/cssm/src/types/colors.d.ts +1 -0
  13. package/cssm/types/colors.js +1 -0
  14. package/cssm/types/colors.js.map +1 -0
  15. package/default.css +13 -47
  16. package/default.module.css.js +8 -0
  17. package/default.module.css.js.map +1 -0
  18. package/esm/Component.js +4 -9
  19. package/esm/Component.js.map +1 -0
  20. package/esm/default.css +13 -47
  21. package/esm/default.module.css.js +6 -0
  22. package/esm/default.module.css.js.map +1 -0
  23. package/esm/index.css +27 -59
  24. package/esm/index.js +1 -0
  25. package/esm/index.js.map +1 -0
  26. package/esm/index.module.css.js +6 -0
  27. package/esm/index.module.css.js.map +1 -0
  28. package/esm/inverted.css +13 -47
  29. package/esm/inverted.module.css.js +6 -0
  30. package/esm/inverted.module.css.js.map +1 -0
  31. package/{cssm → esm/src}/Component.d.ts +6 -8
  32. package/esm/src/index.d.ts +1 -0
  33. package/esm/src/types/colors.d.ts +1 -0
  34. package/esm/types/colors.js +1 -0
  35. package/esm/types/colors.js.map +1 -0
  36. package/index.css +27 -59
  37. package/index.js +1 -0
  38. package/index.js.map +1 -0
  39. package/index.module.css.js +8 -0
  40. package/index.module.css.js.map +1 -0
  41. package/inverted.css +13 -47
  42. package/inverted.module.css.js +8 -0
  43. package/inverted.module.css.js.map +1 -0
  44. package/modern/Component.js +4 -9
  45. package/modern/Component.js.map +1 -0
  46. package/modern/default.css +13 -47
  47. package/modern/default.module.css.js +6 -0
  48. package/modern/default.module.css.js.map +1 -0
  49. package/modern/index.css +27 -59
  50. package/modern/index.js +1 -0
  51. package/modern/index.js.map +1 -0
  52. package/modern/index.module.css.js +6 -0
  53. package/modern/index.module.css.js.map +1 -0
  54. package/modern/inverted.css +13 -47
  55. package/modern/inverted.module.css.js +6 -0
  56. package/modern/inverted.module.css.js.map +1 -0
  57. package/{esm → modern/src}/Component.d.ts +6 -8
  58. package/modern/src/index.d.ts +1 -0
  59. package/modern/src/types/colors.d.ts +1 -0
  60. package/modern/types/colors.js +1 -0
  61. package/modern/types/colors.js.map +1 -0
  62. package/moderncssm/Component.js +1 -0
  63. package/moderncssm/Component.js.map +1 -0
  64. package/moderncssm/default.module.css +0 -13
  65. package/moderncssm/index.js +1 -0
  66. package/moderncssm/index.js.map +1 -0
  67. package/moderncssm/index.module.css +0 -18
  68. package/moderncssm/inverted.module.css +0 -13
  69. package/{modern → moderncssm/src}/Component.d.ts +6 -8
  70. package/moderncssm/src/index.d.ts +1 -0
  71. package/moderncssm/src/types/colors.d.ts +1 -0
  72. package/moderncssm/types/colors.js +1 -0
  73. package/moderncssm/types/colors.js.map +1 -0
  74. package/package.json +4 -4
  75. package/src/Component.d.ts +124 -0
  76. package/src/index.d.ts +1 -0
  77. package/src/types/colors.d.ts +1 -0
  78. package/types/colors.js +1 -0
  79. package/types/colors.js.map +1 -0
  80. package/cssm/index.d.ts +0 -1
  81. package/cssm/types/colors.d.ts +0 -2
  82. package/cssm/vars.css +0 -14
  83. package/esm/index.d.ts +0 -1
  84. package/esm/types/colors.d.ts +0 -2
  85. package/index.d.ts +0 -1
  86. package/modern/index.d.ts +0 -1
  87. package/modern/types/colors.d.ts +0 -2
  88. package/moderncssm/Component.d.ts +0 -126
  89. package/moderncssm/index.d.ts +0 -1
  90. package/moderncssm/types/colors.d.ts +0 -2
  91. package/moderncssm/vars.css +0 -14
  92. package/types/colors.d.ts +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,19 +1,6 @@
1
- /* */
2
1
  :root {
3
2
  --switch-border-color: transparent;
4
3
  --switch-error-color: var(--color-light-text-negative);
5
-
6
- /* inverted */
7
-
8
- /* hover */
9
-
10
- /* checked */
11
-
12
- /* disabled */
13
-
14
- /* disabled checked */
15
-
16
- /* icon */
17
4
  --switch-icon-color: var(--color-static-neutral-0);
18
5
  }
19
6
  .component {
@@ -92,7 +79,6 @@
92
79
  font-weight: 400;
93
80
  display: block;
94
81
  }
95
- /* Reversed state */
96
82
  .component.reversed {
97
83
  flex-direction: row-reverse;
98
84
  }
@@ -106,16 +92,12 @@
106
92
  margin-right: auto;
107
93
  padding-right: var(--gap-16);
108
94
  }
109
- /* Checked state */
110
95
  .checked .switch:before {
111
- /* ширина компонента(36px + 2*2px) - отступы(2 * 2px) - размер кружка(20px) */
112
96
  transform: translateX(16px);
113
97
  }
114
- /* Disabled state */
115
98
  .disabled {
116
99
  cursor: var(--disabled-cursor);
117
100
  }
118
- /* Focused state */
119
101
  .focused .switch {
120
102
  outline: 2px solid var(--focus-color);
121
103
  outline-offset: 2px;
@@ -1,26 +1,13 @@
1
- /* */
2
1
  :root {
3
-
4
- /* inverted */
5
2
  --switch-label-inverted-color: var(--color-light-text-primary-inverted);
6
3
  --switch-hint-inverted-color: var(--color-light-text-secondary-inverted);
7
4
  --switch-checked-bg-inverted-color: var(--color-light-status-positive-inverted);
8
5
  --switch-checked-hover-bg-inverted-color: var(--color-light-status-positive-inverted-hover);
9
6
  --switch-bg-inverted-color: var(--color-light-neutral-translucent-700-inverted);
10
-
11
- /* hover */
12
7
  --switch-hover-bg-inverted-color: var(--color-light-neutral-translucent-700-inverted-hover);
13
-
14
- /* checked */
15
-
16
- /* disabled */
17
8
  --switch-disabled-inverted-color: var(--color-light-text-secondary-inverted);
18
9
  --switch-disabled-bg-inverted-color: var(--color-light-neutral-translucent-200-inverted);
19
-
20
- /* disabled checked */
21
10
  --switch-disabled-checked-bg-inverted-color: var(--switch-disabled-bg-inverted-color);
22
-
23
- /* icon */
24
11
  --switch-icon-disabled-inverted-color: var(--color-light-neutral-translucent-500-inverted);
25
12
  }
26
13
  .switch {
@@ -1,9 +1,7 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { ChangeEvent, InputHTMLAttributes, ReactNode } from "react";
4
- import { Colors } from "./types/colors";
5
- type Align = 'start' | 'center';
6
- type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' | 'onChange' | 'disabled' | 'enterKeyHint'> & {
1
+ import React, { ChangeEvent, InputHTMLAttributes, ReactNode } from 'react';
2
+ import { Colors } from './types/colors';
3
+ declare type Align = 'start' | 'center';
4
+ export declare type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' | 'onChange' | 'disabled' | 'enterKeyHint'> & {
7
5
  /**
8
6
  * Управление состоянием вкл/выкл компонента
9
7
  */
@@ -63,7 +61,7 @@ type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' |
63
61
  */
64
62
  colors?: Colors;
65
63
  };
66
- declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "hint" | "onChange" | "disabled" | "enterKeyHint"> & {
64
+ export declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "hint" | "onChange" | "disabled" | "enterKeyHint"> & {
67
65
  /**
68
66
  * Управление состоянием вкл/выкл компонента
69
67
  */
@@ -123,4 +121,4 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttrib
123
121
  */
124
122
  colors?: Colors | undefined;
125
123
  } & React.RefAttributes<HTMLLabelElement>>;
126
- export { SwitchProps, Switch };
124
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Component';
@@ -0,0 +1 @@
1
+ export declare type Colors = 'default' | 'inverted';
@@ -1 +1,2 @@
1
1
 
2
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-switch",
3
- "version": "4.5.6",
3
+ "version": "4.5.7-snapshot-1393ffa",
4
4
  "description": "",
5
5
  "gitHead": "f054fef20200664c65e2501ef1f916c555cdf05d",
6
6
  "keywords": [],
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@alfalab/hooks": "^1.13.1",
20
- "@alfalab/core-components-shared": "^0.16.0",
20
+ "@alfalab/core-components-shared": "0.16.1-snapshot-1393ffa",
21
21
  "classnames": "^2.5.1",
22
22
  "react-merge-refs": "^1.1.0",
23
23
  "tslib": "^2.4.0"
24
24
  },
25
- "themesVersion": "13.7.1",
26
- "varsVersion": "9.18.0"
25
+ "themesVersion": "14.0.0-snapshot-1393ffa",
26
+ "varsVersion": "9.20.1-snapshot-1393ffa"
27
27
  }
@@ -0,0 +1,124 @@
1
+ import React, { ChangeEvent, InputHTMLAttributes, ReactNode } from 'react';
2
+ import { Colors } from './types/colors';
3
+ declare type Align = 'start' | 'center';
4
+ export declare type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' | 'onChange' | 'disabled' | 'enterKeyHint'> & {
5
+ /**
6
+ * Управление состоянием вкл/выкл компонента
7
+ */
8
+ checked?: boolean;
9
+ /**
10
+ * Текст подписи к переключателю
11
+ */
12
+ label?: ReactNode;
13
+ /**
14
+ * Текст подсказки снизу
15
+ */
16
+ hint?: ReactNode;
17
+ /**
18
+ * Переключатель будет отрисован справа от контента
19
+ */
20
+ reversed?: boolean;
21
+ /**
22
+ * Выравнивание
23
+ */
24
+ align?: Align;
25
+ /**
26
+ * Дополнительный слот
27
+ */
28
+ addons?: React.ReactNode;
29
+ /**
30
+ * Растягивать ли компонент на всю ширину
31
+ */
32
+ block?: boolean;
33
+ /**
34
+ * Управление состоянием включен / выключен
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
39
+ * Используйте props disabled
40
+ * Управление состоянием активен / неактивен
41
+ */
42
+ inactive?: boolean;
43
+ /**
44
+ * Отображение ошибки
45
+ */
46
+ error?: ReactNode | boolean;
47
+ /**
48
+ * Обработчик переключения компонента
49
+ */
50
+ onChange?: (event: ChangeEvent<HTMLInputElement>, payload: {
51
+ checked: boolean;
52
+ name: InputHTMLAttributes<HTMLInputElement>['name'];
53
+ }) => void;
54
+ /**
55
+ * Идентификатор для систем автоматизированного тестирования
56
+ */
57
+ dataTestId?: string;
58
+ /**
59
+ * Набор цветов для компонента
60
+ * @default default
61
+ */
62
+ colors?: Colors;
63
+ };
64
+ export declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "hint" | "onChange" | "disabled" | "enterKeyHint"> & {
65
+ /**
66
+ * Управление состоянием вкл/выкл компонента
67
+ */
68
+ checked?: boolean | undefined;
69
+ /**
70
+ * Текст подписи к переключателю
71
+ */
72
+ label?: ReactNode;
73
+ /**
74
+ * Текст подсказки снизу
75
+ */
76
+ hint?: ReactNode;
77
+ /**
78
+ * Переключатель будет отрисован справа от контента
79
+ */
80
+ reversed?: boolean | undefined;
81
+ /**
82
+ * Выравнивание
83
+ */
84
+ align?: Align | undefined;
85
+ /**
86
+ * Дополнительный слот
87
+ */
88
+ addons?: React.ReactNode;
89
+ /**
90
+ * Растягивать ли компонент на всю ширину
91
+ */
92
+ block?: boolean | undefined;
93
+ /**
94
+ * Управление состоянием включен / выключен
95
+ */
96
+ disabled?: boolean | undefined;
97
+ /**
98
+ * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
99
+ * Используйте props disabled
100
+ * Управление состоянием активен / неактивен
101
+ */
102
+ inactive?: boolean | undefined;
103
+ /**
104
+ * Отображение ошибки
105
+ */
106
+ error?: ReactNode | boolean;
107
+ /**
108
+ * Обработчик переключения компонента
109
+ */
110
+ onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
111
+ checked: boolean;
112
+ name: InputHTMLAttributes<HTMLInputElement>['name'];
113
+ }) => void) | undefined;
114
+ /**
115
+ * Идентификатор для систем автоматизированного тестирования
116
+ */
117
+ dataTestId?: string | undefined;
118
+ /**
119
+ * Набор цветов для компонента
120
+ * @default default
121
+ */
122
+ colors?: Colors | undefined;
123
+ } & React.RefAttributes<HTMLLabelElement>>;
124
+ export {};
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './Component';
@@ -0,0 +1 @@
1
+ export declare type Colors = 'default' | 'inverted';
package/types/colors.js CHANGED
@@ -1,2 +1,3 @@
1
1
  'use strict';
2
2
 
3
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/cssm/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,2 +0,0 @@
1
- type Colors = 'default' | 'inverted';
2
- export { Colors };
package/cssm/vars.css DELETED
@@ -1,14 +0,0 @@
1
- :root {
2
-
3
- /* inverted */
4
-
5
- /* hover */
6
-
7
- /* checked */
8
-
9
- /* disabled */
10
-
11
- /* disabled checked */
12
-
13
- /* icon */
14
- }
package/esm/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,2 +0,0 @@
1
- type Colors = 'default' | 'inverted';
2
- export { Colors };
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./Component";
package/modern/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,2 +0,0 @@
1
- type Colors = 'default' | 'inverted';
2
- export { Colors };
@@ -1,126 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { ChangeEvent, InputHTMLAttributes, ReactNode } from "react";
4
- import { Colors } from "./types/colors";
5
- type Align = 'start' | 'center';
6
- type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' | 'onChange' | 'disabled' | 'enterKeyHint'> & {
7
- /**
8
- * Управление состоянием вкл/выкл компонента
9
- */
10
- checked?: boolean;
11
- /**
12
- * Текст подписи к переключателю
13
- */
14
- label?: ReactNode;
15
- /**
16
- * Текст подсказки снизу
17
- */
18
- hint?: ReactNode;
19
- /**
20
- * Переключатель будет отрисован справа от контента
21
- */
22
- reversed?: boolean;
23
- /**
24
- * Выравнивание
25
- */
26
- align?: Align;
27
- /**
28
- * Дополнительный слот
29
- */
30
- addons?: React.ReactNode;
31
- /**
32
- * Растягивать ли компонент на всю ширину
33
- */
34
- block?: boolean;
35
- /**
36
- * Управление состоянием включен / выключен
37
- */
38
- disabled?: boolean;
39
- /**
40
- * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
41
- * Используйте props disabled
42
- * Управление состоянием активен / неактивен
43
- */
44
- inactive?: boolean;
45
- /**
46
- * Отображение ошибки
47
- */
48
- error?: ReactNode | boolean;
49
- /**
50
- * Обработчик переключения компонента
51
- */
52
- onChange?: (event: ChangeEvent<HTMLInputElement>, payload: {
53
- checked: boolean;
54
- name: InputHTMLAttributes<HTMLInputElement>['name'];
55
- }) => void;
56
- /**
57
- * Идентификатор для систем автоматизированного тестирования
58
- */
59
- dataTestId?: string;
60
- /**
61
- * Набор цветов для компонента
62
- * @default default
63
- */
64
- colors?: Colors;
65
- };
66
- declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "hint" | "onChange" | "disabled" | "enterKeyHint"> & {
67
- /**
68
- * Управление состоянием вкл/выкл компонента
69
- */
70
- checked?: boolean | undefined;
71
- /**
72
- * Текст подписи к переключателю
73
- */
74
- label?: ReactNode;
75
- /**
76
- * Текст подсказки снизу
77
- */
78
- hint?: ReactNode;
79
- /**
80
- * Переключатель будет отрисован справа от контента
81
- */
82
- reversed?: boolean | undefined;
83
- /**
84
- * Выравнивание
85
- */
86
- align?: Align | undefined;
87
- /**
88
- * Дополнительный слот
89
- */
90
- addons?: React.ReactNode;
91
- /**
92
- * Растягивать ли компонент на всю ширину
93
- */
94
- block?: boolean | undefined;
95
- /**
96
- * Управление состоянием включен / выключен
97
- */
98
- disabled?: boolean | undefined;
99
- /**
100
- * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
101
- * Используйте props disabled
102
- * Управление состоянием активен / неактивен
103
- */
104
- inactive?: boolean | undefined;
105
- /**
106
- * Отображение ошибки
107
- */
108
- error?: ReactNode | boolean;
109
- /**
110
- * Обработчик переключения компонента
111
- */
112
- onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
113
- checked: boolean;
114
- name: InputHTMLAttributes<HTMLInputElement>['name'];
115
- }) => void) | undefined;
116
- /**
117
- * Идентификатор для систем автоматизированного тестирования
118
- */
119
- dataTestId?: string | undefined;
120
- /**
121
- * Набор цветов для компонента
122
- * @default default
123
- */
124
- colors?: Colors | undefined;
125
- } & React.RefAttributes<HTMLLabelElement>>;
126
- export { SwitchProps, Switch };
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,2 +0,0 @@
1
- type Colors = 'default' | 'inverted';
2
- export { Colors };
@@ -1,14 +0,0 @@
1
- :root {
2
-
3
- /* inverted */
4
-
5
- /* hover */
6
-
7
- /* checked */
8
-
9
- /* disabled */
10
-
11
- /* disabled checked */
12
-
13
- /* icon */
14
- }
package/types/colors.d.ts DELETED
@@ -1,2 +0,0 @@
1
- type Colors = 'default' | 'inverted';
2
- export { Colors };