armtek-uikit-react 1.0.41 → 1.0.43
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/assets/Alert.scss +1 -1
- package/assets/Avatar.scss +5 -1
- package/assets/Button.scss +3 -0
- package/assets/Chip.scss +70 -10
- package/assets/variables.scss +7 -3
- package/package.json +1 -1
- package/ui/Avatar/Avatar.d.ts +2 -2
- package/ui/Avatar/Avatar.js +25 -13
package/assets/Alert.scss
CHANGED
package/assets/Avatar.scss
CHANGED
package/assets/Button.scss
CHANGED
package/assets/Chip.scss
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
padding: calc($size-step / 1.5) calc($size-step * 1.5);
|
|
6
6
|
border-radius: 20px;
|
|
7
7
|
font-size: 13px;
|
|
8
|
-
display: inline-
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.chip_square{
|
|
@@ -50,8 +51,12 @@
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
.chip_small{
|
|
54
|
+
height: 24px;
|
|
53
55
|
padding: 4px $size-step;
|
|
54
56
|
}
|
|
57
|
+
.chip_medium{
|
|
58
|
+
height: 32px;
|
|
59
|
+
}
|
|
55
60
|
.chip__icon_small{
|
|
56
61
|
font-size: 18px;
|
|
57
62
|
margin-left: 0;
|
|
@@ -66,12 +71,7 @@
|
|
|
66
71
|
border: 1px solid $color-gray-400;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
button.chip{
|
|
71
|
-
&:hover{
|
|
72
|
-
background: $color-gray-300;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
74
|
+
|
|
75
75
|
a.chip_outlined,
|
|
76
76
|
button.chip_outlined{
|
|
77
77
|
&:hover{
|
|
@@ -82,65 +82,114 @@ button.chip_outlined{
|
|
|
82
82
|
.chip_secondary{
|
|
83
83
|
color: #fff;
|
|
84
84
|
background-color: $color-secondary;
|
|
85
|
+
&.chip_outlined{
|
|
86
|
+
border-color: $color-secondary;
|
|
87
|
+
background: transparent;
|
|
88
|
+
color: $color-secondary;
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
a.chip_secondary,
|
|
87
92
|
button.chip_secondary{
|
|
88
93
|
&:hover{
|
|
89
94
|
background-color: $color-secondary-dark;
|
|
90
95
|
}
|
|
96
|
+
&.chip_outlined:hover{
|
|
97
|
+
background-color: $color-orange-100;
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
.chip_success{
|
|
94
102
|
background-color: $color-success;
|
|
103
|
+
&.chip_outlined{
|
|
104
|
+
border-color: $color-success;
|
|
105
|
+
background: transparent;
|
|
106
|
+
color: $color-success;
|
|
107
|
+
}
|
|
95
108
|
}
|
|
96
109
|
a.chip_success,
|
|
97
110
|
button.chip_success{
|
|
98
111
|
&:hover{
|
|
99
112
|
background-color: $color-success-dark;
|
|
100
113
|
}
|
|
114
|
+
&.chip_outlined:hover{
|
|
115
|
+
background-color: $color-green-100;
|
|
116
|
+
}
|
|
101
117
|
}
|
|
102
118
|
|
|
119
|
+
|
|
120
|
+
|
|
103
121
|
.chip_error{
|
|
104
122
|
background-color: $color-error;
|
|
123
|
+
&.chip_outlined{
|
|
124
|
+
border-color: $color-error;
|
|
125
|
+
background: transparent;
|
|
126
|
+
color: $color-error;
|
|
127
|
+
}
|
|
105
128
|
}
|
|
106
129
|
a.chip_error,
|
|
107
130
|
button.chip_error{
|
|
108
131
|
&:hover{
|
|
109
|
-
color: #fff;
|
|
110
132
|
background-color: $color-error-dark;
|
|
111
133
|
}
|
|
134
|
+
&.chip_outlined:hover{
|
|
135
|
+
background: $color-red-100;
|
|
136
|
+
}
|
|
112
137
|
}
|
|
113
138
|
|
|
114
139
|
.chip_warning{
|
|
115
140
|
background-color: $color-warning;
|
|
141
|
+
&.chip_outlined{
|
|
142
|
+
border-color: $color-warning;
|
|
143
|
+
background: transparent;
|
|
144
|
+
color: $color-warning;
|
|
145
|
+
}
|
|
116
146
|
}
|
|
117
147
|
a.chip_warning,
|
|
118
148
|
button.chip_warning{
|
|
119
149
|
&:hover{
|
|
120
150
|
background-color: $color-warning-dark;
|
|
121
151
|
}
|
|
152
|
+
&.chip_outlined:hover{
|
|
153
|
+
background: $color-orange-100;
|
|
154
|
+
}
|
|
122
155
|
}
|
|
123
156
|
|
|
124
157
|
.chip_info{
|
|
125
158
|
color: #fff;
|
|
126
159
|
background-color: $color-info;
|
|
160
|
+
&.chip_outlined{
|
|
161
|
+
border-color: $color-info;
|
|
162
|
+
background: transparent;
|
|
163
|
+
color: $color-info;
|
|
164
|
+
}
|
|
127
165
|
}
|
|
128
166
|
a.chip_info,
|
|
129
167
|
button.chip_info{
|
|
130
168
|
&:hover{
|
|
131
169
|
background-color: $color-info-dark;
|
|
132
170
|
}
|
|
171
|
+
&.chip_outlined:hover{
|
|
172
|
+
background: $color-blue-100;
|
|
173
|
+
}
|
|
133
174
|
}
|
|
134
175
|
|
|
135
176
|
.chip_black{
|
|
136
177
|
color: #fff;
|
|
137
178
|
background-color: $color-neutral;
|
|
179
|
+
&.chip_outlined{
|
|
180
|
+
border-color: $color-neutral;
|
|
181
|
+
background: transparent;
|
|
182
|
+
color: $color-neutral;
|
|
183
|
+
}
|
|
138
184
|
}
|
|
139
|
-
a.
|
|
140
|
-
button.
|
|
185
|
+
a.chip_black,
|
|
186
|
+
button.chip_black{
|
|
141
187
|
&:hover{
|
|
142
188
|
background-color: $color-neutral-dark;
|
|
143
189
|
}
|
|
190
|
+
&.chip_outlined:hover{
|
|
191
|
+
background: $color-gray-100;
|
|
192
|
+
}
|
|
144
193
|
}
|
|
145
194
|
|
|
146
195
|
.chip_white{
|
|
@@ -152,9 +201,17 @@ button.chip_white{
|
|
|
152
201
|
background-color: $color-gray-100;
|
|
153
202
|
}
|
|
154
203
|
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
155
207
|
.chip_primary{
|
|
156
208
|
color: #fff;
|
|
157
209
|
background-color: $color-primary;
|
|
210
|
+
&.chip_outlined{
|
|
211
|
+
border-color: $color-primary;
|
|
212
|
+
background: transparent;
|
|
213
|
+
color: $color-primary;
|
|
214
|
+
}
|
|
158
215
|
}
|
|
159
216
|
|
|
160
217
|
a.chip_primary,
|
|
@@ -162,6 +219,9 @@ button.chip_primary{
|
|
|
162
219
|
&:hover{
|
|
163
220
|
background-color: $color-primary-dark;
|
|
164
221
|
}
|
|
222
|
+
&.chip_outlined:hover{
|
|
223
|
+
background: $color-blue-100;
|
|
224
|
+
}
|
|
165
225
|
}
|
|
166
226
|
|
|
167
227
|
|
package/assets/variables.scss
CHANGED
|
@@ -10,9 +10,10 @@ $radius: 4px;
|
|
|
10
10
|
$color-primary: #0D46FF;
|
|
11
11
|
$color-primary-dark: #0B3CD9;
|
|
12
12
|
$color-primary-light: #0B3CD9;
|
|
13
|
-
$color-blue-800: #406DFF;
|
|
14
13
|
$color-blue-A100: #D9E2FF;
|
|
15
14
|
$color-blue-50: #F2F5FF;
|
|
15
|
+
$color-blue-100: #DFF0FF;
|
|
16
|
+
$color-blue-800: #406DFF;
|
|
16
17
|
|
|
17
18
|
$color-info: #0D46FF;
|
|
18
19
|
$color-info-dark: #0B3CD9;
|
|
@@ -40,7 +41,9 @@ $color-gray-200: #DFE2E6;
|
|
|
40
41
|
$color-gray-100: #E9ECEF;
|
|
41
42
|
$color-gray-50: #F8F9FA;
|
|
42
43
|
|
|
43
|
-
$color-
|
|
44
|
+
$color-green-50: #F2FFFB;
|
|
45
|
+
$color-green-100: #DEFDEE;
|
|
46
|
+
$color-green-300: #ACF7D6;
|
|
44
47
|
|
|
45
48
|
$color-success: #0BD998;
|
|
46
49
|
$color-success-dark: #08996B;
|
|
@@ -50,6 +53,7 @@ $color-warning: #FFC61A;
|
|
|
50
53
|
$color-warning-dark: #F7B519;
|
|
51
54
|
|
|
52
55
|
$color-red-50: #FFF0F1;
|
|
56
|
+
$color-red-100: #FCE1E1;
|
|
53
57
|
|
|
54
58
|
$box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.1);
|
|
55
59
|
|
|
@@ -95,7 +99,7 @@ $box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.1);
|
|
|
95
99
|
--color-gray-100: #E9ECEF;
|
|
96
100
|
--color-gray-50: #F8F9FA;
|
|
97
101
|
|
|
98
|
-
--color-
|
|
102
|
+
--color-green-50: #F2FFFB;
|
|
99
103
|
|
|
100
104
|
--color-success: #0BD998;
|
|
101
105
|
--color-success-dark: #08996B;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.43","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","clsx":"^2.0.0"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/Avatar/Avatar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, HTMLAttributes } from 'react';
|
|
2
2
|
import { ColorStatusType, SizeType } from '../../types/theme';
|
|
3
3
|
export type AvatarProps = {
|
|
4
4
|
photo?: string;
|
|
@@ -8,7 +8,7 @@ export type AvatarProps = {
|
|
|
8
8
|
icon?: string;
|
|
9
9
|
size?: Exclude<SizeType, 'extraLarge'>;
|
|
10
10
|
status?: Exclude<ColorStatusType, 'info'>;
|
|
11
|
-
}
|
|
11
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
12
12
|
export declare const getLetters: (name: string) => string;
|
|
13
13
|
declare const Avatar: (props: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default Avatar;
|
package/ui/Avatar/Avatar.js
CHANGED
|
@@ -12,10 +12,21 @@ export const getLetters = name => {
|
|
|
12
12
|
return nameParts[0].split('')[0] + (nameParts[1] ? nameParts[1].split('')[0] : '');
|
|
13
13
|
};
|
|
14
14
|
const Avatar = props => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const {
|
|
16
|
+
photo,
|
|
17
|
+
name,
|
|
18
|
+
href,
|
|
19
|
+
linkProps,
|
|
20
|
+
icon,
|
|
21
|
+
size,
|
|
22
|
+
status,
|
|
23
|
+
className,
|
|
24
|
+
...divProps
|
|
25
|
+
} = props;
|
|
26
|
+
let displayIcon = icon;
|
|
27
|
+
if (!props.icon && !props.name && !photo) displayIcon = 'person';
|
|
28
|
+
let content = photo ? /*#__PURE__*/_jsx("img", {
|
|
29
|
+
src: photo,
|
|
19
30
|
className: css.avatar__img,
|
|
20
31
|
alt: props.name,
|
|
21
32
|
title: props.name
|
|
@@ -24,26 +35,27 @@ const Avatar = props => {
|
|
|
24
35
|
children: getLetters(props.name)
|
|
25
36
|
}) : /*#__PURE__*/_jsx("span", {
|
|
26
37
|
className: clsx(css.avatar__icon, 'material_icon_solid'),
|
|
27
|
-
children:
|
|
38
|
+
children: displayIcon
|
|
28
39
|
});
|
|
29
40
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
30
41
|
children: /*#__PURE__*/_jsxs("div", {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
...divProps,
|
|
43
|
+
className: clsx('Arm-avatar', className, {
|
|
44
|
+
[css.avatar__photo]: !!photo
|
|
45
|
+
}, css.avatar, css['avatar_' + size]),
|
|
34
46
|
children: [/*#__PURE__*/_jsx("div", {
|
|
35
47
|
className: css.avatar__inner,
|
|
36
|
-
children:
|
|
37
|
-
href:
|
|
38
|
-
...
|
|
48
|
+
children: href ? /*#__PURE__*/_jsx("a", {
|
|
49
|
+
href: href,
|
|
50
|
+
...linkProps,
|
|
39
51
|
className: css.avatar__innerText,
|
|
40
52
|
children: content
|
|
41
53
|
}) : /*#__PURE__*/_jsx("span", {
|
|
42
54
|
className: css.avatar__innerText,
|
|
43
55
|
children: content
|
|
44
56
|
})
|
|
45
|
-
}),
|
|
46
|
-
className: clsx(css.avatar__status, css['avatar__status_' +
|
|
57
|
+
}), status && /*#__PURE__*/_jsx("span", {
|
|
58
|
+
className: clsx(css.avatar__status, css['avatar__status_' + status])
|
|
47
59
|
})]
|
|
48
60
|
})
|
|
49
61
|
});
|