armtek-uikit-react 1.0.50 → 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.
@@ -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
+ }
@@ -20,10 +20,16 @@
20
20
  }
21
21
  }
22
22
  .button__iconWrapper{
23
- font-size: 0;
24
- & > span{
25
- font-size: initial;
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;
@@ -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.50","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"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"}}
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"}}
@@ -0,0 +1,3 @@
1
+ import { BackDropProps } from '../../ui/BackDrop/BackDropBase';
2
+ declare const BackDrop: (props: BackDropProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default BackDrop;
@@ -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,6 @@
1
+ import { ReactNode } from 'react';
2
+ export type BackDropProps = {
3
+ children: ReactNode;
4
+ width: number;
5
+ };
6
+ export declare const BackDropBase: (props: BackDropProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,3 @@
1
+ export { default } from './BackDrop';
2
+ export { type BackDropProps } from './BackDropBase';
3
+ export * from './BackDrop';
@@ -0,0 +1,2 @@
1
+ export { default } from "./BackDrop";
2
+ export * from "./BackDrop";
@@ -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,2 @@
1
+ export { default } from './FormControls';
2
+ export * from './FormControls';
@@ -0,0 +1,2 @@
1
+ export { default } from "./FormControls";
2
+ export * from "./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,7 @@
1
+ import { BaseModalProps } from './BaseModal';
2
+ type ModalProps = BaseModalProps & {
3
+ open?: boolean;
4
+ width?: number;
5
+ };
6
+ declare const Modal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default Modal;
@@ -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";
@@ -0,0 +1,2 @@
1
+ export { default } from './Modal';
2
+ export * from './Modal';
@@ -0,0 +1,2 @@
1
+ export { default } from "./Modal";
2
+ export * from "./Modal";