armtek-uikit-react 1.0.21 → 1.0.23
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/Button.scss +14 -1
- package/assets/ButtonGroup.scss +1 -1
- package/package.json +1 -1
- package/ui/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/ui/Button/Button.d.ts +1 -0
- package/ui/Button/Button.js +4 -1
- package/ui/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/ui/ButtonGroup/ButtonGroup.js +12 -4
package/assets/Button.scss
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
cursor: initial;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
.button_radius_none{
|
|
22
|
+
border-radius: 0;
|
|
23
|
+
}
|
|
24
|
+
.button_radius_full{
|
|
25
|
+
border-radius: 30px;
|
|
26
|
+
}
|
|
21
27
|
.button_contained {
|
|
22
28
|
&.button_primary{
|
|
23
29
|
color: #fff;
|
|
@@ -164,7 +170,10 @@
|
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
.button__adornment{
|
|
167
|
-
font-size:
|
|
173
|
+
font-size: 0;
|
|
174
|
+
& > * {
|
|
175
|
+
font-size: 20px;
|
|
176
|
+
}
|
|
168
177
|
}
|
|
169
178
|
.button__adornment_end{
|
|
170
179
|
margin-left: $size-step;
|
|
@@ -253,8 +262,12 @@
|
|
|
253
262
|
}
|
|
254
263
|
}
|
|
255
264
|
}
|
|
265
|
+
|
|
256
266
|
.button_grouped_column{
|
|
257
267
|
border-radius: 0;
|
|
268
|
+
&:not(:first-child){
|
|
269
|
+
border-top-color: transparent;
|
|
270
|
+
}
|
|
258
271
|
&:first-child{
|
|
259
272
|
border-top-left-radius: $radius;
|
|
260
273
|
border-top-right-radius: $radius;
|
package/assets/ButtonGroup.scss
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.23","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":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/Button/Button.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type OwnProps<T extends ElementType = ElementType> = {
|
|
|
8
8
|
startAdornment?: string | ReactNode;
|
|
9
9
|
endAdornment?: string | ReactNode;
|
|
10
10
|
group?: 'inline' | 'column';
|
|
11
|
+
radius?: boolean;
|
|
11
12
|
as?: T;
|
|
12
13
|
};
|
|
13
14
|
export type ButtonProps<T extends ElementType = ElementType<HTMLAttributes<HTMLButtonElement>>> = OwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof OwnProps>;
|
package/ui/Button/Button.js
CHANGED
|
@@ -17,6 +17,7 @@ const Button = props => {
|
|
|
17
17
|
children,
|
|
18
18
|
className,
|
|
19
19
|
group,
|
|
20
|
+
radius,
|
|
20
21
|
as,
|
|
21
22
|
...restProps
|
|
22
23
|
} = props;
|
|
@@ -25,7 +26,9 @@ const Button = props => {
|
|
|
25
26
|
children: /*#__PURE__*/_jsxs(Component, {
|
|
26
27
|
...restProps,
|
|
27
28
|
className: clsx(css.button, css['button_' + size], css['button_' + variant], css['button_' + color], className, {
|
|
28
|
-
[css['button_grouped_' + group]]: group
|
|
29
|
+
[css['button_grouped_' + group]]: group,
|
|
30
|
+
[css.button_radius_none]: radius === false,
|
|
31
|
+
[css.button_radius_full]: radius === true
|
|
29
32
|
}),
|
|
30
33
|
children: [startAdornment && /*#__PURE__*/_jsx("div", {
|
|
31
34
|
className: clsx(css.button__adornment, css.button__adornment_start),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonProps } from '../../ui/Button';
|
|
2
2
|
type PropsType = {
|
|
3
3
|
orientation?: 'column' | 'inline';
|
|
4
|
-
} &
|
|
4
|
+
} & ButtonProps;
|
|
5
5
|
declare const ButtonGroup: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ButtonGroup;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Children, cloneElement, isValidElement } from 'react';
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import css from "
|
|
3
|
+
import css from "./ButtonGroup.module.scss";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
6
|
const ButtonGroupClasses = ['button_group', 'button_group_inline', 'button_group_column'];
|
|
@@ -11,13 +12,20 @@ const ButtonGroup = props => {
|
|
|
11
12
|
orientation = 'inline',
|
|
12
13
|
className,
|
|
13
14
|
children,
|
|
14
|
-
...
|
|
15
|
+
...buttonProps
|
|
15
16
|
} = props;
|
|
17
|
+
let arrChildren = Children.toArray(children);
|
|
16
18
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
17
19
|
children: /*#__PURE__*/_jsx("div", {
|
|
18
|
-
...restProps,
|
|
19
20
|
className: clsx(css.button_group, css['button_group_' + orientation], className),
|
|
20
|
-
children:
|
|
21
|
+
children: arrChildren.map((item, index) => {
|
|
22
|
+
return /*#__PURE__*/isValidElement(item) && /*#__PURE__*/cloneElement(item, {
|
|
23
|
+
...item.props,
|
|
24
|
+
...buttonProps,
|
|
25
|
+
group: orientation,
|
|
26
|
+
key: index
|
|
27
|
+
});
|
|
28
|
+
})
|
|
21
29
|
})
|
|
22
30
|
});
|
|
23
31
|
};
|