@sima-land/ui-nucleons 42.0.0 → 43.0.0
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.
- package/_internal/custom-scrollbar/custom-scrollbar.module.scss +2 -2
- package/alert/alert.module.scss +1 -1
- package/arrow-button/arrow-button.module.scss +2 -2
- package/autocomplete/index.js +10 -12
- package/avatar/index.js +1 -1
- package/avatar/user.js +2 -3
- package/box/index.d.ts +0 -24
- package/box/index.js +0 -28
- package/button/button.module.scss +6 -6
- package/carousel/index.d.ts +9 -12
- package/carousel/index.js +66 -47
- package/checkbox-field/checkbox-field.module.scss +3 -3
- package/chips/chips.module.scss +10 -10
- package/clean-buttons/clean-buttons.module.scss +1 -1
- package/colors.d.ts +29 -34
- package/colors.js +28 -35
- package/colors.scss +28 -37
- package/dot-nav/dot-nav.module.scss +2 -2
- package/dropdown-item/dropdown-item.module.scss +2 -2
- package/file-icon/index.js +2 -2
- package/helpers/find-child-element.d.ts +1 -1
- package/hint/hint.module.scss +5 -5
- package/hooks/index.js +3 -6
- package/link/index.d.ts +1 -1
- package/link/index.js +1 -1
- package/link/link.module.scss +7 -7
- package/nav-bar/index.js +1 -1
- package/nav-bar/nav-bar.module.scss +3 -3
- package/package.json +3 -1
- package/pagination/pagination.module.scss +4 -4
- package/panel/index.js +1 -1
- package/phone-input/index.d.ts +1 -1
- package/phone-input/index.js +24 -17
- package/phone-input/phone-input.module.scss +11 -4
- package/plate/index.js +1 -1
- package/price/price.module.scss +1 -1
- package/rating/rating.module.scss +1 -1
- package/select/index.d.ts +9 -2
- package/select/index.js +16 -8
- package/spinner/index.d.ts +3 -2
- package/spinner/index.js +2 -2
- package/spinner/spinner.module.scss +1 -0
- package/stepper/stepper.module.scss +8 -8
- package/stroked-svg/index.d.ts +2 -2
- package/stroked-svg/index.js +1 -1
- package/styling/borders.module.scss +3 -3
- package/styling/colors.d.ts +5 -5
- package/tabs/tabs.module.scss +12 -12
- package/text-field/index.d.ts +1 -1
- package/text-field/index.js +13 -7
- package/text-field/text-field.module.scss +18 -18
- package/toggle/toggle.module.scss +3 -3
- package/tooltip/tooltip.module.scss +1 -1
- package/top-bar/top-bar.module.scss +3 -3
- package/unknown-content/unknown-content.module.scss +14 -14
- package/upload/area.js +1 -1
- package/upload/area.module.scss +4 -4
package/colors.d.ts
CHANGED
|
@@ -1,46 +1,41 @@
|
|
|
1
1
|
declare const collection: {
|
|
2
|
-
readonly
|
|
3
|
-
readonly
|
|
4
|
-
readonly '
|
|
5
|
-
readonly '
|
|
6
|
-
readonly '
|
|
7
|
-
readonly '
|
|
8
|
-
readonly '
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly gray24: "#c2c2c2";
|
|
15
|
-
readonly gray12: "#e0e0e0";
|
|
16
|
-
readonly gray8: "#ebebeb";
|
|
17
|
-
readonly gray4: "#f5f5f5";
|
|
18
|
-
readonly gray2: "#fafafa";
|
|
19
|
-
readonly 'additional-amber': "#ffab00";
|
|
20
|
-
readonly 'additional-blue-gray': "#607d8b";
|
|
21
|
-
readonly 'additional-blue': "#2962ff";
|
|
22
|
-
readonly 'additional-brown': "#795548";
|
|
23
|
-
readonly 'additional-cyan': "#00b8d4";
|
|
24
|
-
readonly 'additional-deep-orange': "#ff7200";
|
|
25
|
-
readonly 'additional-deep-purple': "#634bdf";
|
|
2
|
+
readonly 'basic-blue': "#1f84db";
|
|
3
|
+
readonly 'basic-gray87': "#212121";
|
|
4
|
+
readonly 'basic-gray76': "#3a3a3b";
|
|
5
|
+
readonly 'basic-gray66': "#545455";
|
|
6
|
+
readonly 'basic-gray54': "#757575";
|
|
7
|
+
readonly 'basic-gray38': "#9e9e9e";
|
|
8
|
+
readonly 'basic-gray24': "#c2c2c2";
|
|
9
|
+
readonly 'basic-gray12': "#e0e0e0";
|
|
10
|
+
readonly 'basic-gray8': "#ebebeb";
|
|
11
|
+
readonly 'basic-gray4': "#f5f5f5";
|
|
12
|
+
readonly 'basic-gray2': "#fafafa";
|
|
13
|
+
readonly 'basic-white': "#ffffff";
|
|
26
14
|
readonly 'additional-deep-red': "#d50000";
|
|
27
|
-
readonly 'additional-
|
|
28
|
-
readonly 'additional-
|
|
29
|
-
readonly 'additional-
|
|
30
|
-
readonly 'additional-grass': "#66cb2f";
|
|
15
|
+
readonly 'additional-red': "#fb3a2f";
|
|
16
|
+
readonly 'additional-light-red': "#feebea";
|
|
17
|
+
readonly 'additional-teal': "#09ab8b";
|
|
31
18
|
readonly 'additional-green': "#00c853";
|
|
32
|
-
readonly 'additional-light-blue': "#0091ea";
|
|
33
19
|
readonly 'additional-light-green': "#64dd17";
|
|
34
|
-
readonly 'additional-light-red': "#feebea";
|
|
35
20
|
readonly 'additional-lime': "#aeea00";
|
|
21
|
+
readonly 'additional-faded-green': "#eff9ea";
|
|
36
22
|
readonly 'additional-pink': "#e82e5c";
|
|
37
23
|
readonly 'additional-purple': "#b52ea8";
|
|
38
|
-
readonly 'additional-red': "#fb3a2f";
|
|
39
|
-
readonly 'additional-sand': "#f6f5ed";
|
|
40
|
-
readonly 'additional-teal': "#09ab8b";
|
|
41
24
|
readonly 'additional-violet': "#902bd0";
|
|
25
|
+
readonly 'additional-deep-purple': "#634bdf";
|
|
26
|
+
readonly 'additional-electric-blue': "#2962ff";
|
|
27
|
+
readonly 'additional-light-blue': "#0091ea";
|
|
28
|
+
readonly 'additional-cyan': "#00b8d4";
|
|
29
|
+
readonly 'additional-sky': "#e4f1f9";
|
|
30
|
+
readonly 'additional-deep-orange': "#ff7200";
|
|
31
|
+
readonly 'additional-amber': "#ffab00";
|
|
42
32
|
readonly 'additional-yellow': "#ffd600";
|
|
33
|
+
readonly 'additional-gold': "#d5a43b";
|
|
34
|
+
readonly 'additional-brown': "#795548";
|
|
35
|
+
readonly 'additional-blue-gray': "#607d8b";
|
|
36
|
+
readonly 'additional-deep-blue': "#00599d";
|
|
37
|
+
readonly 'additional-dark-blue': "#002b41";
|
|
43
38
|
};
|
|
44
39
|
export declare type Token = keyof typeof collection;
|
|
45
|
-
export declare const COLORS: Map<"
|
|
40
|
+
export declare const COLORS: Map<"basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue", string>;
|
|
46
41
|
export {};
|
package/colors.js
CHANGED
|
@@ -3,49 +3,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.COLORS = void 0;
|
|
4
4
|
const collection = {
|
|
5
5
|
// basic
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
gray54: '#757575',
|
|
19
|
-
gray38: '#9e9e9e',
|
|
20
|
-
gray24: '#c2c2c2',
|
|
21
|
-
gray12: '#e0e0e0',
|
|
22
|
-
gray8: '#ebebeb',
|
|
23
|
-
gray4: '#f5f5f5',
|
|
24
|
-
gray2: '#fafafa',
|
|
6
|
+
'basic-blue': '#1f84db',
|
|
7
|
+
'basic-gray87': '#212121',
|
|
8
|
+
'basic-gray76': '#3a3a3b',
|
|
9
|
+
'basic-gray66': '#545455',
|
|
10
|
+
'basic-gray54': '#757575',
|
|
11
|
+
'basic-gray38': '#9e9e9e',
|
|
12
|
+
'basic-gray24': '#c2c2c2',
|
|
13
|
+
'basic-gray12': '#e0e0e0',
|
|
14
|
+
'basic-gray8': '#ebebeb',
|
|
15
|
+
'basic-gray4': '#f5f5f5',
|
|
16
|
+
'basic-gray2': '#fafafa',
|
|
17
|
+
'basic-white': '#ffffff',
|
|
25
18
|
// additional
|
|
26
|
-
'additional-amber': '#ffab00',
|
|
27
|
-
'additional-blue-gray': '#607d8b',
|
|
28
|
-
'additional-blue': '#2962ff',
|
|
29
|
-
'additional-brown': '#795548',
|
|
30
|
-
'additional-cyan': '#00b8d4',
|
|
31
|
-
'additional-deep-orange': '#ff7200',
|
|
32
|
-
'additional-deep-purple': '#634bdf',
|
|
33
19
|
'additional-deep-red': '#d50000',
|
|
34
|
-
'additional-
|
|
35
|
-
'additional-
|
|
36
|
-
'additional-
|
|
37
|
-
'additional-grass': '#66cb2f',
|
|
20
|
+
'additional-red': '#fb3a2f',
|
|
21
|
+
'additional-light-red': '#feebea',
|
|
22
|
+
'additional-teal': '#09ab8b',
|
|
38
23
|
'additional-green': '#00c853',
|
|
39
|
-
'additional-light-blue': '#0091ea',
|
|
40
24
|
'additional-light-green': '#64dd17',
|
|
41
|
-
'additional-light-red': '#feebea',
|
|
42
25
|
'additional-lime': '#aeea00',
|
|
26
|
+
'additional-faded-green': '#eff9ea',
|
|
43
27
|
'additional-pink': '#e82e5c',
|
|
44
28
|
'additional-purple': '#b52ea8',
|
|
45
|
-
'additional-red': '#fb3a2f',
|
|
46
|
-
'additional-sand': '#f6f5ed',
|
|
47
|
-
'additional-teal': '#09ab8b',
|
|
48
29
|
'additional-violet': '#902bd0',
|
|
30
|
+
'additional-deep-purple': '#634bdf',
|
|
31
|
+
'additional-electric-blue': '#2962ff',
|
|
32
|
+
'additional-light-blue': '#0091ea',
|
|
33
|
+
'additional-cyan': '#00b8d4',
|
|
34
|
+
'additional-sky': '#e4f1f9',
|
|
35
|
+
'additional-deep-orange': '#ff7200',
|
|
36
|
+
'additional-amber': '#ffab00',
|
|
49
37
|
'additional-yellow': '#ffd600',
|
|
38
|
+
'additional-gold': '#d5a43b',
|
|
39
|
+
'additional-brown': '#795548',
|
|
40
|
+
'additional-blue-gray': '#607d8b',
|
|
41
|
+
'additional-deep-blue': '#00599d',
|
|
42
|
+
'additional-dark-blue': '#002b41',
|
|
50
43
|
};
|
|
51
44
|
exports.COLORS = new Map(Object.entries(collection));
|
package/colors.scss
CHANGED
|
@@ -1,48 +1,39 @@
|
|
|
1
1
|
// basic
|
|
2
|
-
$
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
$
|
|
7
|
-
$
|
|
8
|
-
$
|
|
9
|
-
$
|
|
10
|
-
$
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
$
|
|
14
|
-
$gray76: #3a3a3b;
|
|
15
|
-
$gray66: #545455;
|
|
16
|
-
$gray54: #757575;
|
|
17
|
-
$gray38: #9e9e9e;
|
|
18
|
-
$gray24: #c2c2c2;
|
|
19
|
-
$gray12: #e0e0e0;
|
|
20
|
-
$gray8: #ebebeb;
|
|
21
|
-
$gray4: #f5f5f5;
|
|
22
|
-
$gray2: #fafafa;
|
|
2
|
+
$basic-blue: #1f84db;
|
|
3
|
+
$basic-gray87: #212121;
|
|
4
|
+
$basic-gray76: #3a3a3b;
|
|
5
|
+
$basic-gray66: #545455;
|
|
6
|
+
$basic-gray54: #757575;
|
|
7
|
+
$basic-gray38: #9e9e9e;
|
|
8
|
+
$basic-gray24: #c2c2c2;
|
|
9
|
+
$basic-gray12: #e0e0e0;
|
|
10
|
+
$basic-gray8: #ebebeb;
|
|
11
|
+
$basic-gray4: #f5f5f5;
|
|
12
|
+
$basic-gray2: #fafafa;
|
|
13
|
+
$basic-white: #fff;
|
|
23
14
|
|
|
24
15
|
// additional
|
|
25
|
-
$additional-amber: #ffab00;
|
|
26
|
-
$additional-blue-gray: #607d8b;
|
|
27
|
-
$additional-blue: #2962ff;
|
|
28
|
-
$additional-brown: #795548;
|
|
29
|
-
$additional-cyan: #00b8d4;
|
|
30
|
-
$additional-deep-orange: #ff7200;
|
|
31
|
-
$additional-deep-purple: #634bdf;
|
|
32
16
|
$additional-deep-red: #d50000;
|
|
33
|
-
$additional-
|
|
34
|
-
$additional-
|
|
35
|
-
$additional-
|
|
36
|
-
$additional-grass: #66cb2f;
|
|
17
|
+
$additional-red: #fb3a2f;
|
|
18
|
+
$additional-light-red: #feebea;
|
|
19
|
+
$additional-teal: #09ab8b;
|
|
37
20
|
$additional-green: #00c853;
|
|
38
|
-
$additional-light-blue: #0091ea;
|
|
39
21
|
$additional-light-green: #64dd17;
|
|
40
|
-
$additional-light-red: #feebea;
|
|
41
22
|
$additional-lime: #aeea00;
|
|
23
|
+
$additional-faded-green: #eff9ea;
|
|
42
24
|
$additional-pink: #e82e5c;
|
|
43
25
|
$additional-purple: #b52ea8;
|
|
44
|
-
$additional-red: #fb3a2f;
|
|
45
|
-
$additional-sand: #f6f5ed;
|
|
46
|
-
$additional-teal: #09ab8b;
|
|
47
26
|
$additional-violet: #902bd0;
|
|
27
|
+
$additional-deep-purple: #634bdf;
|
|
28
|
+
$additional-electric-blue: #2962ff;
|
|
29
|
+
$additional-light-blue: #0091ea;
|
|
30
|
+
$additional-cyan: #00b8d4;
|
|
31
|
+
$additional-sky: #e4f1f9;
|
|
32
|
+
$additional-deep-orange: #ff7200;
|
|
33
|
+
$additional-amber: #ffab00;
|
|
48
34
|
$additional-yellow: #ffd600;
|
|
35
|
+
$additional-gold: #d5a43b;
|
|
36
|
+
$additional-brown: #795548;
|
|
37
|
+
$additional-blue-gray: #607d8b;
|
|
38
|
+
$additional-deep-blue: #00599d;
|
|
39
|
+
$additional-dark-blue: #002b41;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
top: 50%;
|
|
38
38
|
left: 50%;
|
|
39
39
|
border-radius: 50%;
|
|
40
|
-
background: colors.$gray12;
|
|
40
|
+
background: colors.$basic-gray12;
|
|
41
41
|
|
|
42
42
|
// используем 10 чтобы проще считать коэффициенты масштабирования
|
|
43
43
|
// ВАЖНО: не надо использовать здесь число больше чем размер родителя с overflow:hidden - моргает в Safari
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
transition: transform 0.3s, background 0.3s;
|
|
50
50
|
}
|
|
51
51
|
&.active::after {
|
|
52
|
-
background: colors.$gray38;
|
|
52
|
+
background: colors.$basic-gray38;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -16,12 +16,12 @@ $sizes: (
|
|
|
16
16
|
&:not(.disabled):not(.no-hover).checked,
|
|
17
17
|
&:not(.disabled):not(.no-hover):hover {
|
|
18
18
|
cursor: pointer;
|
|
19
|
-
background: colors.$gray4;
|
|
19
|
+
background: colors.$basic-gray4;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.disabled {
|
|
24
|
-
color: colors.$gray24;
|
|
24
|
+
color: colors.$basic-gray24;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
@each $key, $size in $sizes {
|
package/file-icon/index.js
CHANGED
|
@@ -19,8 +19,8 @@ const react_1 = __importDefault(require("react"));
|
|
|
19
19
|
const colors_1 = require("../colors");
|
|
20
20
|
const unknown_svg_1 = __importDefault(require("./unknown.svg"));
|
|
21
21
|
const VARIANTS = {
|
|
22
|
-
doc: { fill: colors_1.COLORS.get('additional-blue') },
|
|
23
|
-
xls: { fill: colors_1.COLORS.get('additional-
|
|
22
|
+
doc: { fill: colors_1.COLORS.get('additional-electric-blue') },
|
|
23
|
+
xls: { fill: colors_1.COLORS.get('additional-light-green') },
|
|
24
24
|
pdf: { fill: colors_1.COLORS.get('additional-deep-red') },
|
|
25
25
|
jpg: { fill: colors_1.COLORS.get('additional-deep-orange') },
|
|
26
26
|
xml: { fill: colors_1.COLORS.get('additional-deep-purple') },
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @return Родственный элемент.
|
|
11
11
|
*/
|
|
12
12
|
declare const findChildElement: ({ target, startIndex, increment, defaultResult, isSuitable, needBreakLoop, }: {
|
|
13
|
-
target
|
|
13
|
+
target?: HTMLElement | null | undefined;
|
|
14
14
|
startIndex?: number | undefined;
|
|
15
15
|
increment?: number | undefined;
|
|
16
16
|
defaultResult?: number | undefined;
|
package/hint/hint.module.scss
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
height: 0;
|
|
16
16
|
border-style: solid;
|
|
17
17
|
border-width: 4px 4px 0;
|
|
18
|
-
border-color: colors.$gray76 transparent transparent transparent;
|
|
18
|
+
border-color: colors.$basic-gray76 transparent transparent transparent;
|
|
19
19
|
}
|
|
20
20
|
&.right::before {
|
|
21
21
|
content: '';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
height: 0;
|
|
25
25
|
border-style: solid;
|
|
26
26
|
border-width: 4px 4px 4px 0;
|
|
27
|
-
border-color: transparent colors.$gray76 transparent transparent;
|
|
27
|
+
border-color: transparent colors.$basic-gray76 transparent transparent;
|
|
28
28
|
}
|
|
29
29
|
&.bottom::before {
|
|
30
30
|
content: '';
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
height: 0;
|
|
34
34
|
border-style: solid;
|
|
35
35
|
border-width: 0 4px 4px;
|
|
36
|
-
border-color: transparent transparent colors.$gray76 transparent;
|
|
36
|
+
border-color: transparent transparent colors.$basic-gray76 transparent;
|
|
37
37
|
}
|
|
38
38
|
&.left::after {
|
|
39
39
|
content: '';
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
height: 0;
|
|
43
43
|
border-style: solid;
|
|
44
44
|
border-width: 4px 0 4px 4px;
|
|
45
|
-
border-color: transparent transparent transparent colors.$gray76;
|
|
45
|
+
border-color: transparent transparent transparent colors.$basic-gray76;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.body {
|
|
50
50
|
align-items: center;
|
|
51
|
-
background: colors.$gray76;
|
|
51
|
+
background: colors.$basic-gray76;
|
|
52
52
|
border-radius: 4px;
|
|
53
53
|
color: #fff;
|
|
54
54
|
display: flex;
|
package/hooks/index.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.useIsomorphicLayoutEffect = exports.useOutsideClick = exports.useInfiniteScroll = exports.useIsTouchDevice = void 0;
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const is_touch_device_1 = require("../helpers/is-touch-device");
|
|
9
|
-
const lodash_1 = require("lodash");
|
|
10
9
|
const on_1 = __importDefault(require("../helpers/on"));
|
|
11
10
|
const identity_1 = require("./identity");
|
|
12
11
|
/**
|
|
@@ -51,16 +50,14 @@ exports.useInfiniteScroll = useInfiniteScroll;
|
|
|
51
50
|
* @param callback Сработает при клике вне элемента.
|
|
52
51
|
*/
|
|
53
52
|
const useOutsideClick = (elementRef, callback) => {
|
|
54
|
-
const callbackRef = (0,
|
|
55
|
-
|
|
56
|
-
(0, react_1.useEffect)(() => (0, on_1.default)(document.documentElement, 'click', (event) => {
|
|
53
|
+
const callbackRef = (0, identity_1.useIdentityRef)(callback);
|
|
54
|
+
(0, react_1.useEffect)(() => (0, on_1.default)(document.documentElement, 'click', event => {
|
|
57
55
|
const { current: element } = elementRef;
|
|
58
56
|
const { current: handleClick } = callbackRef;
|
|
59
57
|
element &&
|
|
60
58
|
element !== event.target &&
|
|
61
59
|
!element.contains(event.target) &&
|
|
62
|
-
(0
|
|
63
|
-
handleClick(event);
|
|
60
|
+
(handleClick === null || handleClick === void 0 ? void 0 : handleClick(event));
|
|
64
61
|
}), []);
|
|
65
62
|
};
|
|
66
63
|
exports.useOutsideClick = useOutsideClick;
|
package/link/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Token } from '../colors';
|
|
3
3
|
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
4
|
/** Цвет (название токена). */
|
|
5
|
-
color?: Extract<Token, '
|
|
5
|
+
color?: Extract<Token, 'basic-blue' | 'basic-gray87' | 'basic-gray38'>;
|
|
6
6
|
/** Нужно ли оборачивать содержимое комментариями no-index. */
|
|
7
7
|
noIndex?: boolean;
|
|
8
8
|
/** Выводить как псевдо-ссылку. */
|
package/link/index.js
CHANGED
|
@@ -43,7 +43,7 @@ const cx = bind_1.default.bind(link_module_scss_1.default);
|
|
|
43
43
|
* Возвращает объект со свойствами, формирующими содержимое.
|
|
44
44
|
* @param children Содержимое линка.
|
|
45
45
|
* @param noIndex Флаг запрета индексации.
|
|
46
|
-
* @return Объект со свойствами, формирующими
|
|
46
|
+
* @return Объект со свойствами, формирующими содержимое.
|
|
47
47
|
*/
|
|
48
48
|
const getContentProps = (children, noIndex) => noIndex ? { dangerouslySetInnerHTML: (0, get_no_index_1.getNoIndex)(children) } : { children };
|
|
49
49
|
/**
|
package/link/link.module.scss
CHANGED
|
@@ -17,27 +17,27 @@
|
|
|
17
17
|
|
|
18
18
|
// ниже двойные классы для высокой специфичности в монолите
|
|
19
19
|
.link.disabled {
|
|
20
|
-
color: colors.$gray24;
|
|
20
|
+
color: colors.$basic-gray24;
|
|
21
21
|
pointer-events: none;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.link:not(.disabled).brand-blue {
|
|
25
|
-
color: colors.$
|
|
25
|
+
color: colors.$basic-blue;
|
|
26
26
|
&:hover {
|
|
27
|
-
color: colors.$
|
|
27
|
+
color: colors.$additional-deep-blue;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.link:not(.disabled).gray87 {
|
|
32
|
-
color: colors.$gray87;
|
|
32
|
+
color: colors.$basic-gray87;
|
|
33
33
|
&:hover {
|
|
34
|
-
color: colors.$gray54;
|
|
34
|
+
color: colors.$basic-gray54;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.link:not(.disabled).gray38 {
|
|
39
|
-
color: colors.$gray38;
|
|
39
|
+
color: colors.$basic-gray38;
|
|
40
40
|
&:hover {
|
|
41
|
-
color: colors.$gray54;
|
|
41
|
+
color: colors.$basic-gray54;
|
|
42
42
|
}
|
|
43
43
|
}
|
package/nav-bar/index.js
CHANGED
|
@@ -71,6 +71,6 @@ exports.NavBar = NavBar;
|
|
|
71
71
|
*/
|
|
72
72
|
const NavButton = (_a) => {
|
|
73
73
|
var { text, icon: Icon, stub = false, shift, className } = _a, buttonProps = __rest(_a, ["text", "icon", "stub", "shift", "className"]);
|
|
74
|
-
return (react_1.default.createElement("button", Object.assign({}, (!stub && buttonProps), { type: 'button', className: cx('button', Icon && 'icon', shift === 'left' && 'shift-left', shift === 'right' && 'shift-right', stub && 'stub', className), "aria-hidden": stub }), Icon && !stub ? (react_1.default.createElement(Icon, { fill: colors_1.COLORS.get('gray87'), className: cx('svg'), "aria-hidden": 'true' })) : (text)));
|
|
74
|
+
return (react_1.default.createElement("button", Object.assign({}, (!stub && buttonProps), { type: 'button', className: cx('button', Icon && 'icon', shift === 'left' && 'shift-left', shift === 'right' && 'shift-right', stub && 'stub', className), "aria-hidden": stub }), Icon && !stub ? (react_1.default.createElement(Icon, { fill: colors_1.COLORS.get('basic-gray87'), className: cx('svg'), "aria-hidden": 'true' })) : (text)));
|
|
75
75
|
};
|
|
76
76
|
exports.NavButton = NavButton;
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.title {
|
|
24
|
-
color: colors.$gray87;
|
|
24
|
+
color: colors.$basic-gray87;
|
|
25
25
|
font-size: 16px;
|
|
26
26
|
font-weight: 600;
|
|
27
27
|
line-height: 24px;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.subtitle {
|
|
31
|
-
color: colors.$gray38;
|
|
31
|
+
color: colors.$basic-gray38;
|
|
32
32
|
font-size: 12px;
|
|
33
33
|
line-height: 16px;
|
|
34
34
|
margin-top: -4px;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
background: transparent;
|
|
61
61
|
border: 0;
|
|
62
62
|
box-sizing: border-box;
|
|
63
|
-
color: colors.$
|
|
63
|
+
color: colors.$basic-blue;
|
|
64
64
|
font-family: inherit;
|
|
65
65
|
font-size: 14px;
|
|
66
66
|
font-weight: 600;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sima-land/ui-nucleons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "43.0.0",
|
|
4
4
|
"repository": "ssh://git@github.com:sima-land/ui-nucleons.git",
|
|
5
5
|
"author": "www.sima-land.ru team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"enzyme-to-json": "^3.6.2",
|
|
60
60
|
"eslint": "^7.31.0",
|
|
61
61
|
"file-loader": "^6.2.0",
|
|
62
|
+
"handlebars": "^4.7.7",
|
|
62
63
|
"husky": "^7.0.4",
|
|
63
64
|
"jest": "^27.3.1",
|
|
64
65
|
"jest-css-modules-transform": "^4.3.0",
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
},
|
|
84
85
|
"scripts": {
|
|
85
86
|
"prepare": "",
|
|
87
|
+
"export:colors": "node .template/build.mjs",
|
|
86
88
|
"build:before": "rimraf build",
|
|
87
89
|
"build:main": "tsc --project tsconfig.build.json",
|
|
88
90
|
"build:after": "node dist.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
width: 38px;
|
|
24
24
|
height: 38px;
|
|
25
25
|
background: #fff;
|
|
26
|
-
border: 1px solid colors.$gray12;
|
|
26
|
+
border: 1px solid colors.$basic-gray12;
|
|
27
27
|
font-size: 14px;
|
|
28
28
|
outline: 0;
|
|
29
29
|
box-sizing: border-box;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
&:disabled {
|
|
46
|
-
color: colors.$gray24;
|
|
46
|
+
color: colors.$basic-gray24;
|
|
47
47
|
}
|
|
48
48
|
&:not(.rounds-all) {
|
|
49
49
|
margin-right: -1px;
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
}
|
|
55
55
|
&.selected {
|
|
56
56
|
position: relative;
|
|
57
|
-
background: colors.$gray87;
|
|
58
|
-
border-color: colors.$gray87;
|
|
57
|
+
background: colors.$basic-gray87;
|
|
58
|
+
border-color: colors.$basic-gray87;
|
|
59
59
|
color: #fff;
|
|
60
60
|
cursor: default;
|
|
61
61
|
&::after {
|
package/panel/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const cx = bind_1.default.bind(panel_module_scss_1.default);
|
|
|
15
15
|
* @param props Свойства.
|
|
16
16
|
* @return Элемент.
|
|
17
17
|
*/
|
|
18
|
-
const Panel = ({ color: panelColor = 'gray4', contentColor = 'gray87', inline = false, icon: Icon, className, children, html, 'data-testid': testId = 'panel', }) => {
|
|
18
|
+
const Panel = ({ color: panelColor = 'basic-gray4', contentColor = 'basic-gray87', inline = false, icon: Icon, className, children, html, 'data-testid': testId = 'panel', }) => {
|
|
19
19
|
const contentProps = html ? { dangerouslySetInnerHTML: { __html: html } } : { children };
|
|
20
20
|
return (react_1.default.createElement("div", { className: cx('panel', inline && 'inline', (0, colors_1.bgColor)(panelColor), className), "data-testid": testId },
|
|
21
21
|
Icon && (react_1.default.createElement(Icon, { fill: colors_2.COLORS.get(contentColor), width: 16, height: 20, className: cx('icon'), "aria-hidden": 'true' })),
|
package/phone-input/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Country } from './presets';
|
|
|
5
5
|
interface PhoneInputStyle extends React.CSSProperties {
|
|
6
6
|
'--phone-input-width'?: number | string;
|
|
7
7
|
}
|
|
8
|
-
export interface PhoneInputProps extends Omit<TextFieldProps, 'onChange' | 'onBlur' | 'value' | 'ref' | 'style'> {
|
|
8
|
+
export interface PhoneInputProps extends Omit<TextFieldProps, 'onChange' | 'onBlur' | 'value' | 'ref' | 'style' | 'multiline'> {
|
|
9
9
|
/** Сработает при "blur". */
|
|
10
10
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>, s: MaskState & {
|
|
11
11
|
ready?: boolean;
|
package/phone-input/index.js
CHANGED
|
@@ -35,7 +35,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.PhoneInput = void 0;
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
39
38
|
const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
|
|
40
39
|
const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
|
|
41
40
|
const dropdown_1 = require("../dropdown");
|
|
@@ -44,10 +43,9 @@ const text_field_1 = require("../text-field");
|
|
|
44
43
|
const masked_field_1 = require("../masked-field");
|
|
45
44
|
const hooks_1 = require("../hooks");
|
|
46
45
|
const presets_1 = require("./presets");
|
|
47
|
-
const sizes_1 = require("../styling/sizes");
|
|
48
|
-
const colors_1 = require("../colors");
|
|
49
|
-
const phone_input_module_scss_1 = __importDefault(require("./phone-input.module.scss"));
|
|
50
46
|
const utils_1 = require("./utils");
|
|
47
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
48
|
+
const phone_input_module_scss_1 = __importDefault(require("./phone-input.module.scss"));
|
|
51
49
|
const cx = bind_1.default.bind(phone_input_module_scss_1.default);
|
|
52
50
|
/**
|
|
53
51
|
* Удаляет из значения код переданной страны.
|
|
@@ -66,23 +64,32 @@ const PhoneInput = (_a) => {
|
|
|
66
64
|
// маску определяем автоматически только при старте
|
|
67
65
|
const [country, setCountry] = (0, react_1.useState)((0, utils_1.defineCountry)(value));
|
|
68
66
|
const [cleanValue, setCleanValue] = (0, react_1.useState)(formatValue(value, country));
|
|
69
|
-
const [
|
|
70
|
-
const
|
|
67
|
+
const [withMenu, toggleMenu] = (0, react_1.useState)(false);
|
|
68
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
69
|
+
const openerRef = (0, react_1.useRef)(null);
|
|
71
70
|
(0, react_1.useEffect)(() => {
|
|
72
71
|
setCleanValue(formatValue(value, country));
|
|
73
72
|
}, [value]);
|
|
74
|
-
(0, hooks_1.useOutsideClick)(
|
|
75
|
-
|
|
76
|
-
togglePopup(false);
|
|
73
|
+
(0, hooks_1.useOutsideClick)(rootRef, () => {
|
|
74
|
+
toggleMenu(false);
|
|
77
75
|
});
|
|
78
|
-
const AdornmentSVG =
|
|
79
|
-
const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: (react_1.default.createElement("div", { className: cx('adornment'), "data-testid": 'phone-input:dropdown-opener', onClick:
|
|
80
|
-
|
|
81
|
-
togglePopup(true);
|
|
76
|
+
const AdornmentSVG = withMenu ? up_1.default : down_1.default;
|
|
77
|
+
const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: (react_1.default.createElement("div", { ref: openerRef, className: cx('adornment'), "data-testid": 'phone-input:dropdown-opener', onClick: () => {
|
|
78
|
+
toggleMenu(a => !a);
|
|
82
79
|
} },
|
|
83
80
|
react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: country.imageSrc }),
|
|
84
|
-
react_1.default.createElement(AdornmentSVG, {
|
|
85
|
-
|
|
81
|
+
react_1.default.createElement(AdornmentSVG, { className: cx('arrow') }))), onClick: event => {
|
|
82
|
+
const opener = openerRef.current;
|
|
83
|
+
if (opener instanceof Node &&
|
|
84
|
+
event.target instanceof Node &&
|
|
85
|
+
(opener === event.target || opener.contains(event.target))) {
|
|
86
|
+
event.preventDefault(); // чтобы не фокусировалось на поле
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
toggleMenu(false);
|
|
90
|
+
}
|
|
91
|
+
} });
|
|
92
|
+
return (react_1.default.createElement("div", { ref: rootRef, "data-testid": testId, style: style, className: cx('root', className) },
|
|
86
93
|
country.id === presets_1.IDS.other ? (react_1.default.createElement(text_field_1.TextField, Object.assign({}, commonFieldProps, { onChange: (e) => {
|
|
87
94
|
e.target.value = e.target.value.replace(/\D/g, '').slice(0, 20);
|
|
88
95
|
onChange && onChange(e);
|
|
@@ -101,8 +108,8 @@ const PhoneInput = (_a) => {
|
|
|
101
108
|
// вставляем код страны обратно в чистое значение
|
|
102
109
|
cleanValue: `${country.codeChars}${state.cleanValue}` }));
|
|
103
110
|
} }))),
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
withMenu && (react_1.default.createElement(dropdown_1.Dropdown, { role: 'menu', className: cx('menu'), "data-testid": 'phone-input:dropdown' }, presets_1.countriesList.map((item, index) => item.id === country.id ? null : (react_1.default.createElement(dropdown_item_1.DropdownItem, { key: index, size: 'l', role: 'menuitem', className: cx('menu-item'), onClick: () => {
|
|
112
|
+
toggleMenu(false);
|
|
106
113
|
setCountry(item);
|
|
107
114
|
onCountrySelect && onCountrySelect(item);
|
|
108
115
|
} },
|
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.arrow {
|
|
21
|
+
display: block;
|
|
22
|
+
fill: colors.$basic-gray38;
|
|
23
|
+
margin-left: 4px;
|
|
24
|
+
pointer-events: none; // игнорируем клики т.к. после них элемент стрелки подменяется и считается что он сработал вне элемента родителя
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.menu {
|
|
21
28
|
position: absolute;
|
|
22
29
|
width: 100%;
|
|
23
30
|
top: 56px;
|
|
@@ -25,15 +32,15 @@
|
|
|
25
32
|
z-index: 2;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
.
|
|
35
|
+
.menu-item {
|
|
29
36
|
font-size: 16px;
|
|
30
37
|
line-height: 24px;
|
|
31
38
|
.item-name {
|
|
32
|
-
color: colors.$gray87;
|
|
39
|
+
color: colors.$basic-gray87;
|
|
33
40
|
flex-grow: 1;
|
|
34
41
|
margin-left: 16px;
|
|
35
42
|
}
|
|
36
43
|
.item-code {
|
|
37
|
-
color: colors.$gray38;
|
|
44
|
+
color: colors.$basic-gray38;
|
|
38
45
|
}
|
|
39
46
|
}
|