armtek-uikit-react 1.0.49 → 1.0.52
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/Avatar.scss +4 -1
- package/assets/BackDrop.scss +17 -0
- package/assets/Button.scss +10 -4
- package/assets/ButtonIcon.scss +3 -0
- package/assets/FormControls.scss +16 -0
- package/assets/Modal.scss +33 -0
- package/package.json +1 -1
- package/ui/Avatar/Avatar.js +2 -1
- package/ui/BackDrop/BackDrop.d.ts +3 -0
- package/ui/BackDrop/BackDrop.js +21 -0
- package/ui/BackDrop/BackDrop.module.scss +1 -0
- package/ui/BackDrop/BackDropBase.d.ts +6 -0
- package/ui/BackDrop/BackDropBase.js +22 -0
- package/ui/BackDrop/index.d.ts +3 -0
- package/ui/BackDrop/index.js +2 -0
- package/ui/Form/FormControls/FormControls.d.ts +14 -0
- package/ui/Form/FormControls/FormControls.js +43 -0
- package/ui/Form/FormControls/FormControls.module.scss +1 -0
- package/ui/Form/FormControls/index.d.ts +2 -0
- package/ui/Form/FormControls/index.js +2 -0
- package/ui/Modal/BaseModal.d.ts +6 -0
- package/ui/Modal/BaseModal.js +57 -0
- package/ui/Modal/Modal.d.ts +7 -0
- package/ui/Modal/Modal.js +22 -0
- package/ui/Modal/Modal.module.scss +1 -0
- package/ui/Modal/index.d.ts +2 -0
- package/ui/Modal/index.js +2 -0
package/assets/Avatar.scss
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
.avatar__photo{
|
|
13
13
|
background: none;
|
|
14
14
|
}
|
|
15
|
+
.avatar__icon{
|
|
16
|
+
background: $color-gray-400;
|
|
17
|
+
}
|
|
15
18
|
.avatar__inner{
|
|
16
19
|
overflow: hidden;
|
|
17
20
|
border-radius: 50%;
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
font-size: 24px;
|
|
67
70
|
}
|
|
68
71
|
.avatar__icon{
|
|
69
|
-
font-size:
|
|
72
|
+
font-size: 38px;
|
|
70
73
|
}
|
|
71
74
|
.avatar__img{
|
|
72
75
|
display: block;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.BackDropBase {
|
|
4
|
+
position: fixed;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
z-index: 1000;
|
|
8
|
+
background: rgba(0, 0, 0, 0.25);
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.BackDropBase__inner{
|
|
15
|
+
max-width: 500px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
package/assets/Button.scss
CHANGED
|
@@ -20,10 +20,16 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
.button__iconWrapper{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
//font-size: 0;
|
|
30
|
+
//& > span{
|
|
31
|
+
// font-size: initial;
|
|
32
|
+
//}
|
|
27
33
|
}
|
|
28
34
|
.button_radius_none{
|
|
29
35
|
border-radius: 0;
|
package/assets/ButtonIcon.scss
CHANGED
|
@@ -11,14 +11,17 @@
|
|
|
11
11
|
&.button_icon_large{
|
|
12
12
|
width: $size-large;
|
|
13
13
|
font-size: 24px;
|
|
14
|
+
& .material_icon {font-size: 24px}
|
|
14
15
|
}
|
|
15
16
|
&.button_icon_medium{
|
|
16
17
|
width: $size-medium;
|
|
17
18
|
font-size: 20px;
|
|
19
|
+
& .material_icon {font-size: 20px}
|
|
18
20
|
}
|
|
19
21
|
&.button_icon_small{
|
|
20
22
|
width: $size-small;
|
|
21
23
|
padding: calc($size-step / 2);
|
|
22
24
|
font-size: 16px;
|
|
25
|
+
& .material_icon {font-size: 16px}
|
|
23
26
|
}
|
|
24
27
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.FormControls{
|
|
4
|
+
border-top: 1px solid $color-gray-200;
|
|
5
|
+
padding-top: calc($size-step * 4);
|
|
6
|
+
display: flex;
|
|
7
|
+
margin:0 -$size-step;
|
|
8
|
+
}
|
|
9
|
+
.FormControls__button{
|
|
10
|
+
flex: 0 0 50%;
|
|
11
|
+
max-width: 50%;
|
|
12
|
+
padding:0 $size-step;
|
|
13
|
+
}
|
|
14
|
+
.FormControls__btn{
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.Modal{
|
|
4
|
+
border-radius: $radius;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: #fff;
|
|
7
|
+
}
|
|
8
|
+
.Modal__header{
|
|
9
|
+
background: $color-gray-200;
|
|
10
|
+
min-height: 78px;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding: $size-step calc($size-step * 4);
|
|
14
|
+
border-top-left-radius:$radius;
|
|
15
|
+
border-top-right-radius:$radius;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
.Modal__title{
|
|
19
|
+
font-size: 20px;
|
|
20
|
+
color: $color-gray-900;
|
|
21
|
+
}
|
|
22
|
+
.Modal__body{
|
|
23
|
+
padding: calc($size-step * 4)
|
|
24
|
+
}
|
|
25
|
+
.Modal__footer{
|
|
26
|
+
padding: 0 calc($size-step * 4) calc($size-step * 4) calc($size-step * 4)
|
|
27
|
+
}
|
|
28
|
+
.Modal__close{
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: calc($size-step * 4);
|
|
31
|
+
top: 50%;
|
|
32
|
+
transform: translateY(-50%);
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.52","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"@tinymce/tinymce-react":"^4.3.2","build":"^0.1.4","clsx":"^2.0.0","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/Avatar/Avatar.js
CHANGED
|
@@ -41,7 +41,8 @@ const Avatar = props => {
|
|
|
41
41
|
children: /*#__PURE__*/_jsxs("div", {
|
|
42
42
|
...divProps,
|
|
43
43
|
className: clsx('Arm-avatar', className, {
|
|
44
|
-
[css.avatar__photo]: !!photo
|
|
44
|
+
[css.avatar__photo]: !!photo,
|
|
45
|
+
[css.avatar__icon]: !!displayIcon
|
|
45
46
|
}, css.avatar, css['avatar_' + size]),
|
|
46
47
|
children: [/*#__PURE__*/_jsx("div", {
|
|
47
48
|
className: css.avatar__inner,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isValidElement } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { BackDropBase } from "./BackDropBase";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
+
const BackDrop = props => {
|
|
7
|
+
const {
|
|
8
|
+
children,
|
|
9
|
+
width
|
|
10
|
+
} = props;
|
|
11
|
+
const childrenProp = /*#__PURE__*/isValidElement(children) ? children : /*#__PURE__*/_jsx("span", {
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
15
|
+
children: /*#__PURE__*/createPortal( /*#__PURE__*/_jsx(BackDropBase, {
|
|
16
|
+
width: width,
|
|
17
|
+
children: childrenProp
|
|
18
|
+
}), document.body)
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default BackDrop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./../../assets/BackDrop";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import css from "./BackDrop.module.scss";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export const BackDropBase = props => {
|
|
6
|
+
const {
|
|
7
|
+
children,
|
|
8
|
+
width
|
|
9
|
+
} = props;
|
|
10
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
11
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
12
|
+
className: clsx('Arm-BackDropBase', css.BackDropBase),
|
|
13
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
14
|
+
className: css.BackDropBase__inner,
|
|
15
|
+
style: {
|
|
16
|
+
maxWidth: width + 'px'
|
|
17
|
+
},
|
|
18
|
+
children: children
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../ui/Button';
|
|
2
|
+
import { ComponentPropsWithoutRef, MouseEvent } from 'react';
|
|
3
|
+
export type FormControlsProps = {
|
|
4
|
+
onSubmit: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
onCancel?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
submitProps?: Omit<ButtonProps, 'children'> & {
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
cancelProps?: Omit<ButtonProps, 'children'> & {
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
13
|
+
declare const FormControls: (props: FormControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FormControls;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import css from "./FormControls.module.scss";
|
|
3
|
+
import Button from "../../Button";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
const FormControls = props => {
|
|
8
|
+
const {
|
|
9
|
+
onSubmit,
|
|
10
|
+
onCancel,
|
|
11
|
+
submitProps,
|
|
12
|
+
cancelProps,
|
|
13
|
+
className,
|
|
14
|
+
...divProps
|
|
15
|
+
} = props;
|
|
16
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
17
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
18
|
+
className: clsx('Arm-FormControls', css.FormControls),
|
|
19
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
20
|
+
className: clsx('Arm-FormControls__button', css.FormControls__button),
|
|
21
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
22
|
+
variant: 'contained',
|
|
23
|
+
color: 'primary',
|
|
24
|
+
onClick: onSubmit,
|
|
25
|
+
...submitProps,
|
|
26
|
+
className: clsx('Arm-FormControls__btn', css.FormControls__btn),
|
|
27
|
+
children: submitProps == null ? void 0 : submitProps.text
|
|
28
|
+
})
|
|
29
|
+
}), onCancel && /*#__PURE__*/_jsx("div", {
|
|
30
|
+
className: clsx('Arm-FormControls__button', css.FormControls__button),
|
|
31
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
32
|
+
variant: 'outlined',
|
|
33
|
+
color: 'primary',
|
|
34
|
+
onClick: onCancel,
|
|
35
|
+
...cancelProps,
|
|
36
|
+
className: clsx('Arm-FormControls__btn', css.FormControls__btn),
|
|
37
|
+
children: cancelProps == null ? void 0 : cancelProps.text
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default FormControls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./../../../assets/FormControls";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEvent } from 'react';
|
|
2
|
+
import { FormControlsProps } from '../../ui/Form/FormControls';
|
|
3
|
+
export type BaseModalProps = ComponentPropsWithoutRef<'div'> & FormControlsProps & {
|
|
4
|
+
onClose: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const BaseModal: (props: BaseModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import css from "./Modal.module.scss";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import FormControls from "../Form/FormControls";
|
|
4
|
+
import ButtonIcon from "../ButtonIcon";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
export const BaseModal = props => {
|
|
9
|
+
const {
|
|
10
|
+
className,
|
|
11
|
+
title,
|
|
12
|
+
children,
|
|
13
|
+
onSubmit,
|
|
14
|
+
onClose,
|
|
15
|
+
onCancel,
|
|
16
|
+
submitProps,
|
|
17
|
+
cancelProps,
|
|
18
|
+
...divProps
|
|
19
|
+
} = props;
|
|
20
|
+
const showControls = !!onSubmit || !!onCancel;
|
|
21
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
22
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
23
|
+
...divProps,
|
|
24
|
+
className: clsx(className, 'Arm-Modal', css.Modal),
|
|
25
|
+
children: [title && /*#__PURE__*/_jsx("div", {
|
|
26
|
+
className: clsx('Arm-Modal__header', css.Modal__header),
|
|
27
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
28
|
+
className: clsx('Arm-Modal__title', css.Modal__title),
|
|
29
|
+
children: [title, onClose && /*#__PURE__*/_jsx(ButtonIcon, {
|
|
30
|
+
variant: 'transparent',
|
|
31
|
+
onClick: onClose,
|
|
32
|
+
className: clsx('Arm-Modal__close', css.Modal__close),
|
|
33
|
+
color: 'neutral',
|
|
34
|
+
size: 'medium',
|
|
35
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
36
|
+
className: 'material_icon',
|
|
37
|
+
children: "close"
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
42
|
+
className: clsx('Arm-Modal__body', css.Modal__body),
|
|
43
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
}), showControls && /*#__PURE__*/_jsx("div", {
|
|
47
|
+
className: clsx('Arm-Modal__footer', css.Modal__footer),
|
|
48
|
+
children: /*#__PURE__*/_jsx(FormControls, {
|
|
49
|
+
onSubmit: onSubmit,
|
|
50
|
+
onCancel: onCancel,
|
|
51
|
+
submitProps: submitProps,
|
|
52
|
+
cancelProps: cancelProps
|
|
53
|
+
})
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseModal } from "./BaseModal";
|
|
2
|
+
import BackDrop from "../BackDrop";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
const Modal = props => {
|
|
6
|
+
const {
|
|
7
|
+
open,
|
|
8
|
+
width = 500,
|
|
9
|
+
...modalProps
|
|
10
|
+
} = props;
|
|
11
|
+
if (!open) return null;
|
|
12
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(BackDrop, {
|
|
14
|
+
width: width,
|
|
15
|
+
children: /*#__PURE__*/_jsx(BaseModal, {
|
|
16
|
+
...modalProps,
|
|
17
|
+
className: 'moasda'
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export default Modal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../../assets/Modal";
|