@dilicorp/ui 0.2.33 → 0.2.35
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/dist/atoms/button.js +2 -14
- package/dist/atoms/checkbox.js +2 -14
- package/dist/atoms/col.js +2 -14
- package/dist/atoms/container.js +2 -14
- package/dist/atoms/icon.js +3 -15
- package/dist/atoms/image.js +2 -13
- package/dist/atoms/input.js +2 -14
- package/dist/atoms/label.js +2 -14
- package/dist/atoms/link.js +3 -14
- package/dist/atoms/radio.js +2 -14
- package/dist/atoms/row.js +1 -1
- package/dist/atoms/skeleton.js +1 -1
- package/dist/atoms/switcher.d.ts +7 -0
- package/dist/atoms/switcher.js +10 -0
- package/dist/atoms/typography.js +2 -14
- package/dist/components/accordion/accordion-body.d.ts +1 -1
- package/dist/components/accordion/accordion-body.js +1 -1
- package/dist/components/accordion/accordion-header.d.ts +1 -1
- package/dist/components/accordion/accordion-header.js +1 -1
- package/dist/components/accordion/accordion-item.d.ts +1 -1
- package/dist/components/accordion/accordion-item.js +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.js +4 -4
- package/dist/components/alert-modal/alert-context-provider.d.ts +17 -0
- package/dist/components/alert-modal/alert-context-provider.js +18 -0
- package/dist/components/alert-modal/alert-modal-content.d.ts +8 -0
- package/dist/components/alert-modal/alert-modal-content.js +57 -0
- package/dist/components/alert-modal/alert-modal-provider.d.ts +7 -0
- package/dist/components/alert-modal/alert-modal-provider.js +12 -0
- package/dist/components/alert-modal/alert-modal-template.d.ts +5 -0
- package/dist/components/alert-modal/alert-modal-template.js +16 -0
- package/dist/components/alert-template/alert-provider.js +2 -14
- package/dist/components/alert-template/alert-template.d.ts +1 -1
- package/dist/components/form-builder/components/button.js +2 -13
- package/dist/components/form-builder/components/checkbox.js +1 -1
- package/dist/components/form-builder/components/datepicker.js +2 -13
- package/dist/components/form-builder/components/dropzone.js +7 -3
- package/dist/components/form-builder/components/input-currency.js +2 -13
- package/dist/components/form-builder/components/input-mask.js +2 -13
- package/dist/components/form-builder/components/input-prefix-suffix.js +7 -18
- package/dist/components/form-builder/components/input.js +30 -22
- package/dist/components/form-builder/components/password.js +2 -13
- package/dist/components/form-builder/components/radio.js +1 -1
- package/dist/components/form-builder/form-builder-element.js +2 -13
- package/dist/components/form-builder/form-builder.js +8 -18
- package/dist/components/navbar/navbar.js +6 -3
- package/dist/components/page-list/column-management-components/modal-config.js +2 -1
- package/dist/components/page-list/filter-components/button-filter-clear.js +1 -1
- package/dist/components/page-list/filter-components/filter-form.js +2 -2
- package/dist/components/page-list/filters/filter-datepicker.js +1 -1
- package/dist/components/page-list/filters/filter-input.js +11 -15
- package/dist/components/page-list/page-list-config/page-list-config-column-management.js +1 -1
- package/dist/components/page-list/page-list-config/page-list-config-dropdown.js +16 -4
- package/dist/components/page-list/page-list-get-filters.js +7 -1
- package/dist/components/page-list/page-list.js +2 -2
- package/dist/components/page-show/page-show.js +2 -2
- package/dist/components/side-navigation-bar/side-navigation-bar-item.js +11 -22
- package/dist/components/side-navigation-bar/side-navigation-bar.js +8 -8
- package/dist/components/tabs/tabs.js +6 -2
- package/dist/css/style.min.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/molecules/card-summary/card-summary-container.js +1 -1
- package/dist/molecules/dropdown/dropdown-item.js +6 -17
- package/dist/molecules/dropdown/dropdown.js +10 -7
- package/dist/molecules/paginate.js +1 -1
- package/dist/molecules/table-column-management.js +2 -2
- package/dist/molecules/table.js +14 -21
- package/dist/utils/object-helper.js +1 -1
- package/dist/utils/window-helper.js +8 -7
- package/package.json +2 -2
package/dist/atoms/button.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
const ButtonLoader = () => {
|
|
@@ -17,8 +6,7 @@ const ButtonLoader = () => {
|
|
|
17
6
|
React.createElement("div", { className: "button-loader-item second" }),
|
|
18
7
|
React.createElement("div", { className: "button-loader-item third" })));
|
|
19
8
|
};
|
|
20
|
-
export const Button = (
|
|
21
|
-
var { children, active, block, className, color = 'primary', disabled, small = false, href, outline, innerRef, target, loading, 'aria-label': ariaLabel, id } = _a, props = __rest(_a, ["children", "active", "block", "className", "color", "disabled", "small", "href", "outline", "innerRef", "target", "loading", 'aria-label', "id"]);
|
|
9
|
+
export const Button = ({ children, active, block, className, color = 'primary', disabled, small = false, href, outline, innerRef, target, loading, 'aria-label': ariaLabel, id, ...props }) => {
|
|
22
10
|
let { tag: Tag = 'button' } = props;
|
|
23
11
|
const handleClick = (e) => {
|
|
24
12
|
if (disabled || loading) {
|
|
@@ -33,5 +21,5 @@ export const Button = (_a) => {
|
|
|
33
21
|
if (href && Tag === 'button') {
|
|
34
22
|
Tag = 'a';
|
|
35
23
|
}
|
|
36
|
-
return (React.createElement(Tag,
|
|
24
|
+
return (React.createElement(Tag, { ...(Tag === 'button' && props.onClick && { type: 'button' }), ...props, ...(href && { href }), ...(target && { target }), className: classes, ...(id && { id, 'data-testid': id }), ref: innerRef, onClick: handleClick, "aria-label": ariaLabel }, loading ? React.createElement(ButtonLoader, null) : children));
|
|
37
25
|
};
|
package/dist/atoms/checkbox.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { Input } from './input';
|
|
13
2
|
import React from 'react';
|
|
14
|
-
export const Checkout = (
|
|
15
|
-
|
|
16
|
-
return (React.createElement(Input, Object.assign({ type: "checkbox" }, props, { id: id, "data-testid": id, name: name })));
|
|
3
|
+
export const Checkout = ({ name, id = name, ...props }) => {
|
|
4
|
+
return (React.createElement(Input, { type: "checkbox", ...props, id: id, "data-testid": id, name: name }));
|
|
17
5
|
};
|
package/dist/atoms/col.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
const RESPONSIVE_FLAGS = ['', 'sm-', 'md-', 'lg-', 'xl-', 'xxl-'];
|
|
@@ -18,11 +7,10 @@ const sanitizeByNone = (value) => {
|
|
|
18
7
|
}
|
|
19
8
|
return value;
|
|
20
9
|
};
|
|
21
|
-
export const Col = (
|
|
22
|
-
var { children, size = false, className } = _a, props = __rest(_a, ["children", "size", "className"]);
|
|
10
|
+
export const Col = ({ children, size = false, className, ...props }) => {
|
|
23
11
|
const columns = !Array.isArray(size)
|
|
24
12
|
? (typeof size === 'boolean' ? 'col-auto' : `col-${size}`)
|
|
25
13
|
: size.map((value, key) => sanitizeByNone(`col-${RESPONSIVE_FLAGS[key]}${value}`)).join(' ');
|
|
26
14
|
const classes = classNames(className, columns);
|
|
27
|
-
return (React.createElement("div",
|
|
15
|
+
return (React.createElement("div", { ...props, className: classes }, children));
|
|
28
16
|
};
|
package/dist/atoms/container.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
|
-
export const Container = (
|
|
15
|
-
var { children, className, type } = _a, props = __rest(_a, ["children", "className", "type"]);
|
|
3
|
+
export const Container = ({ children, className, type, ...props }) => {
|
|
16
4
|
const classes = classNames((!!className && className), `container${type ? '-' + type : ''}`);
|
|
17
|
-
return (React.createElement("div",
|
|
5
|
+
return (React.createElement("div", { ...props, className: classes }, children));
|
|
18
6
|
};
|
package/dist/atoms/icon.js
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
2
|
import * as fab from '@fortawesome/free-brands-svg-icons';
|
|
14
3
|
import * as fa from '@fortawesome/free-solid-svg-icons';
|
|
15
4
|
import stringHelper from '../utils/string-helper';
|
|
16
5
|
import React from 'react';
|
|
17
6
|
import { PluxeeIcon } from './pluxee-icon/pluxee-icon';
|
|
18
|
-
export const Icon = (
|
|
19
|
-
var { pluxee, icon, brand, className = '', id, size } = _a, props = __rest(_a, ["pluxee", "icon", "brand", "className", "id", "size"]);
|
|
7
|
+
export const Icon = ({ pluxee, icon, brand, className = '', id, size, ...props }) => {
|
|
20
8
|
if (pluxee) {
|
|
21
|
-
return (React.createElement(PluxeeIcon,
|
|
9
|
+
return (React.createElement(PluxeeIcon, { icon: icon, size: size, ...props }));
|
|
22
10
|
}
|
|
23
11
|
const sanitize = stringHelper.toCamelCase(icon);
|
|
24
12
|
const ico = brand ? fab[sanitize] : fa[sanitize];
|
|
25
|
-
return (React.createElement(FontAwesomeIcon,
|
|
13
|
+
return (React.createElement(FontAwesomeIcon, { id: id, icon: ico, className: className, ...props }));
|
|
26
14
|
};
|
package/dist/atoms/image.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
function alignValue(align) {
|
|
@@ -37,7 +26,7 @@ function objectFitValue(attr) {
|
|
|
37
26
|
return 'object-fit-revert';
|
|
38
27
|
}
|
|
39
28
|
export const Image = (props) => {
|
|
40
|
-
const { src, alt, circle, rounded, thumbnail, align, objectFit, full, innerRef, className, width, height, lazy = false
|
|
29
|
+
const { src, alt, circle, rounded, thumbnail, align, objectFit, full, innerRef, className, width, height, lazy = false, ...attrs } = props;
|
|
41
30
|
const classes = classNames(className, circle && 'circle', rounded && 'rounded', thumbnail ? 'img-thumbnail' : 'img-fluid', full && 'w-100', objectFitValue(objectFit), alignValue(align));
|
|
42
31
|
const styleOptions = {
|
|
43
32
|
style: {
|
|
@@ -45,5 +34,5 @@ export const Image = (props) => {
|
|
|
45
34
|
height
|
|
46
35
|
}
|
|
47
36
|
};
|
|
48
|
-
return (React.createElement("img",
|
|
37
|
+
return (React.createElement("img", { src: src, alt: alt, ...attrs, ...styleOptions, ref: innerRef, className: classes, loading: lazy ? 'lazy' : 'eager' }));
|
|
49
38
|
};
|
package/dist/atoms/input.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
|
-
export const Input = (
|
|
15
|
-
var { className, type, tag, addon, valid, invalid, innerRef } = _a, props = __rest(_a, ["className", "type", "tag", "addon", "valid", "invalid", "innerRef"]);
|
|
3
|
+
export const Input = ({ className, type, tag, addon, valid, invalid, innerRef, ...props }) => {
|
|
16
4
|
const isCheck = ['switch', 'radio', 'checkbox'].indexOf(type) > -1;
|
|
17
5
|
const isTextarea = type === 'textarea';
|
|
18
6
|
const isSelect = type === 'select';
|
|
@@ -44,5 +32,5 @@ export const Input = (_a) => {
|
|
|
44
32
|
Reflect.deleteProperty(props, 'children');
|
|
45
33
|
}
|
|
46
34
|
// @ts-ignore
|
|
47
|
-
return React.createElement(Tag,
|
|
35
|
+
return React.createElement(Tag, { ...props, className: classes, ref: innerRef, type: type });
|
|
48
36
|
};
|
package/dist/atoms/label.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
|
-
export const Label = (
|
|
15
|
-
var { htmlFor, inline, innerRef, children, className } = _a, props = __rest(_a, ["htmlFor", "inline", "innerRef", "children", "className"]);
|
|
3
|
+
export const Label = ({ htmlFor, inline, innerRef, children, className, ...props }) => {
|
|
16
4
|
const classes = classNames(className, 'form-label', inline ? 'd-inline-block' : 'd-block');
|
|
17
|
-
return (React.createElement("label",
|
|
5
|
+
return (React.createElement("label", { ...props, htmlFor: htmlFor, ref: innerRef, className: classes }, children));
|
|
18
6
|
};
|
package/dist/atoms/link.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import { Link as RouterLink } from 'react-router-dom';
|
|
14
3
|
import { validationsHelper } from '../index';
|
|
15
4
|
export const Link = (props) => {
|
|
16
|
-
const { href = '', children, target
|
|
5
|
+
const { href = '', children, target, ...attrs } = props;
|
|
17
6
|
const validOptions = {
|
|
18
7
|
className: attrs.className,
|
|
19
8
|
title: attrs.title,
|
|
@@ -22,7 +11,7 @@ export const Link = (props) => {
|
|
|
22
11
|
};
|
|
23
12
|
const isLink = validationsHelper.isUrl(href);
|
|
24
13
|
if (isLink) {
|
|
25
|
-
return (React.createElement("a",
|
|
14
|
+
return (React.createElement("a", { ...validOptions, href: href, target: target || '_blank', rel: "noopener noreferrer" }, children));
|
|
26
15
|
}
|
|
27
|
-
return (React.createElement(RouterLink,
|
|
16
|
+
return (React.createElement(RouterLink, { ...validOptions, to: href, target: target || '_self' }, children));
|
|
28
17
|
};
|
package/dist/atoms/radio.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { Input } from './input';
|
|
13
2
|
import React from 'react';
|
|
14
|
-
export const Radio = (
|
|
15
|
-
|
|
16
|
-
return (React.createElement(Input, Object.assign({ type: "radio" }, props, { id: id, "data-testid": id, name: name })));
|
|
3
|
+
export const Radio = ({ name, id = name, ...props }) => {
|
|
4
|
+
return (React.createElement(Input, { type: "radio", ...props, id: id, "data-testid": id, name: name }));
|
|
17
5
|
};
|
package/dist/atoms/row.js
CHANGED
|
@@ -3,5 +3,5 @@ import classNames from 'classnames';
|
|
|
3
3
|
export const Row = (props) => {
|
|
4
4
|
const { children, className, justifyContent, alignItems, alignContent, alignSelf } = props;
|
|
5
5
|
const classes = classNames('row', !!className && className, !!justifyContent && `justify-content-${justifyContent}`, !!alignItems && `align-items-${alignItems}`, !!alignContent && `align-content-${alignContent}`, !!alignSelf && `align-self-${alignSelf}`);
|
|
6
|
-
return (React.createElement("div",
|
|
6
|
+
return (React.createElement("div", { ...props, className: classes }, children));
|
|
7
7
|
};
|
package/dist/atoms/skeleton.js
CHANGED
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import SkeletonReact from 'react-loading-skeleton';
|
|
3
3
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
4
4
|
export const Skeleton = (props) => {
|
|
5
|
-
return React.createElement(SkeletonReact,
|
|
5
|
+
return React.createElement(SkeletonReact, { ...props });
|
|
6
6
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const Switcher = (props) => {
|
|
3
|
+
return (React.createElement("label", { className: "switch" },
|
|
4
|
+
React.createElement("input", { type: "checkbox", className: "checkbox", ...props }),
|
|
5
|
+
React.createElement("span", { className: "toggle-thumb" },
|
|
6
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", viewBox: "0 0 24 24" },
|
|
7
|
+
React.createElement("path", { d: "M10 15.586L6.707 12.293 5.293 13.707 10 18.414 19.707 8.707 18.293 7.293z" })),
|
|
8
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", viewBox: "0 0 24 24" },
|
|
9
|
+
React.createElement("path", { d: "M16.192 6.344L11.949 10.586 7.707 6.344 6.293 7.758 10.535 12 6.293 16.242 7.707 17.656 11.949 13.414 16.192 17.656 17.606 16.242 13.364 12 17.606 7.758z" })))));
|
|
10
|
+
};
|
package/dist/atoms/typography.js
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import classNames from 'classnames';
|
|
14
|
-
export const Typography = (
|
|
15
|
-
var { variant = 'h1', lineBottom, full, children, tag: Tag = variant, innerRef, className, subTitle } = _a, props = __rest(_a, ["variant", "lineBottom", "full", "children", "tag", "innerRef", "className", "subTitle"]);
|
|
3
|
+
export const Typography = ({ variant = 'h1', lineBottom, full, children, tag: Tag = variant, innerRef, className, subTitle, ...props }) => {
|
|
16
4
|
const classes = classNames('typography', lineBottom && (full ? 'line-bottom-full' : 'line-bottom'), full && 'w-100');
|
|
17
5
|
const classeTag = classNames(className, variant);
|
|
18
6
|
return (React.createElement("div", { className: classes },
|
|
19
|
-
React.createElement(Tag,
|
|
7
|
+
React.createElement(Tag, { ...props, ref: innerRef, className: classeTag }, children),
|
|
20
8
|
subTitle && React.createElement("div", { className: "sub-title" }, subTitle)));
|
|
21
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { AccordionBody } from
|
|
3
|
-
import { AccordionHeader } from
|
|
4
|
-
import { AccordionItem } from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { AccordionBody } from './accordion-body';
|
|
3
|
+
import { AccordionHeader } from './accordion-header';
|
|
4
|
+
import { AccordionItem } from './accordion-item';
|
|
5
5
|
export const Accordion = ({ children }) => {
|
|
6
6
|
const [currentItem, setCurrentItem] = useState(-1);
|
|
7
7
|
const childrenWithProps = React.Children.map(children, (child, index) => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type UseAlertModalProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
message: JSX.Element;
|
|
5
|
+
type: 'success' | 'alert' | 'error';
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare type AlertContextProviderProps = {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare type AlertContextProps = {
|
|
12
|
+
handleShowAlert: (props: UseAlertModalProps) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const AlertContextProvider: React.FC<AlertContextProviderProps>;
|
|
15
|
+
export declare const useAlertModal: () => AlertContextProps;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=alert-context-provider.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { createContext, useCallback, useContext } from 'react';
|
|
2
|
+
import { useAlert } from 'react-alert';
|
|
3
|
+
import { AlertModalContent } from './alert-modal-content';
|
|
4
|
+
const AlertContext = createContext({});
|
|
5
|
+
export const AlertContextProvider = ({ children }) => {
|
|
6
|
+
const alert = useAlert();
|
|
7
|
+
const handleShowAlert = useCallback(({ title, message, type, onClose }) => {
|
|
8
|
+
alert.show(React.createElement(AlertModalContent, { title: title, message: message, type: type }), { onClose });
|
|
9
|
+
}, [alert.show]);
|
|
10
|
+
return (React.createElement(AlertContext.Provider, { value: { handleShowAlert } }, children));
|
|
11
|
+
};
|
|
12
|
+
export const useAlertModal = () => {
|
|
13
|
+
const context = useContext(AlertContext);
|
|
14
|
+
if (!context) {
|
|
15
|
+
throw new Error('useAlertModal must be used within an AlertModalProvider');
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type AlertModalContentProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
message: JSX.Element;
|
|
5
|
+
type: 'success' | 'alert' | 'error';
|
|
6
|
+
};
|
|
7
|
+
export declare const AlertModalContent: React.FC<AlertModalContentProps>;
|
|
8
|
+
//# sourceMappingURL=alert-modal-content.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useAlert } from 'react-alert';
|
|
3
|
+
import { Icon } from '../../atoms/icon';
|
|
4
|
+
export const AlertModalContent = ({ title, message, type }) => {
|
|
5
|
+
const alert = useAlert();
|
|
6
|
+
const color = useMemo(() => {
|
|
7
|
+
return {
|
|
8
|
+
success: '#221C46',
|
|
9
|
+
alert: '#FF7375',
|
|
10
|
+
error: '#B30000'
|
|
11
|
+
};
|
|
12
|
+
}, []);
|
|
13
|
+
const styles = {
|
|
14
|
+
header: {
|
|
15
|
+
width: '100%',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItens: 'center',
|
|
18
|
+
justifyContent: 'space-between',
|
|
19
|
+
paddingBottom: '0.5rem',
|
|
20
|
+
borderBottom: '1px solid #B5B2BC'
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
fontSize: '1.5rem',
|
|
24
|
+
fontWeight: '400'
|
|
25
|
+
},
|
|
26
|
+
closeButton: {
|
|
27
|
+
width: '1.5rem',
|
|
28
|
+
height: '1.5rem',
|
|
29
|
+
borderRadius: '999px',
|
|
30
|
+
border: 'none',
|
|
31
|
+
outline: 'none',
|
|
32
|
+
background: '#FF7375',
|
|
33
|
+
color: '#ffffff',
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'column',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center'
|
|
38
|
+
},
|
|
39
|
+
description: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
fontSize: '1.75rem',
|
|
42
|
+
fontWeight: '400',
|
|
43
|
+
padding: '3rem',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
textAlign: 'center',
|
|
47
|
+
color: color[type]
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (React.createElement("div", null,
|
|
51
|
+
React.createElement("div", { style: styles.header },
|
|
52
|
+
React.createElement("span", null, title),
|
|
53
|
+
React.createElement("button", { style: styles.closeButton, onClick: () => alert.removeAll() },
|
|
54
|
+
React.createElement(Icon, { icon: "fa-times" }))),
|
|
55
|
+
React.createElement("div", null,
|
|
56
|
+
React.createElement("div", { style: styles.description }, message))));
|
|
57
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Provider, positions } from 'react-alert';
|
|
3
|
+
import { AlertModalTemplate } from './alert-modal-template';
|
|
4
|
+
import { AlertContextProvider } from './alert-context-provider';
|
|
5
|
+
const options = {
|
|
6
|
+
position: positions.MIDDLE,
|
|
7
|
+
timeout: 10000
|
|
8
|
+
};
|
|
9
|
+
export const AlertModalProvider = ({ children }) => {
|
|
10
|
+
return (React.createElement(Provider, { ...options, template: AlertModalTemplate },
|
|
11
|
+
React.createElement(AlertContextProvider, null, children)));
|
|
12
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertTemplateProps } from 'react-alert';
|
|
3
|
+
export declare type AlertModalTemplatePropx = AlertTemplateProps;
|
|
4
|
+
export declare const AlertModalTemplate: (props: AlertModalTemplatePropx) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=alert-modal-template.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const style = {
|
|
3
|
+
content: {
|
|
4
|
+
width: '560px',
|
|
5
|
+
position: 'relative',
|
|
6
|
+
boxShadow: '0 0 15px rgb(0 0 0 / 10%)',
|
|
7
|
+
borderRadius: '0px',
|
|
8
|
+
border: '1px solid #ddd',
|
|
9
|
+
padding: '1rem',
|
|
10
|
+
background: '#f2f2f2'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const AlertModalTemplate = (props) => {
|
|
14
|
+
const { message } = props;
|
|
15
|
+
return (React.createElement("div", { style: style.content }, message));
|
|
16
|
+
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import { positions, Provider } from 'react-alert';
|
|
14
3
|
import { AlertTemplate } from './alert-template';
|
|
@@ -16,7 +5,6 @@ const options = {
|
|
|
16
5
|
position: positions.MIDDLE,
|
|
17
6
|
timeout: 10000
|
|
18
7
|
};
|
|
19
|
-
export const AlertProvider = (
|
|
20
|
-
|
|
21
|
-
return (React.createElement(Provider, Object.assign({}, options, props, { template: AlertTemplate }), children));
|
|
8
|
+
export const AlertProvider = ({ children, ...props }) => {
|
|
9
|
+
return (React.createElement(Provider, { ...options, ...props, template: AlertTemplate }, children));
|
|
22
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AlertComponentPropsWithStyle } from 'react-alert';
|
|
2
|
+
import { AlertTemplateProps as AlertComponentPropsWithStyle } from 'react-alert';
|
|
3
3
|
export declare type AlertTemplateProps = AlertComponentPropsWithStyle;
|
|
4
4
|
export declare const AlertTemplate: (props: AlertTemplateProps) => JSX.Element;
|
|
5
5
|
//# sourceMappingURL=alert-template.d.ts.map
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import { Button } from '../../../atoms/button';
|
|
14
3
|
export default function Input(props) {
|
|
15
4
|
var _a;
|
|
16
|
-
const { type = 'button', actions, color = 'primary', label, labelLoading = label, className, id
|
|
5
|
+
const { type = 'button', actions, color = 'primary', label, labelLoading = label, className, id, ...elements } = props;
|
|
17
6
|
return (React.createElement("div", null,
|
|
18
|
-
React.createElement(Button,
|
|
7
|
+
React.createElement(Button, { ...elements, className: className, type: type, color: color, disabled: actions.isSubmitting ? true : (_a = elements.disabled) !== null && _a !== void 0 ? _a : false, ...(id && { 'data-testid': id }) }, actions.isSubmitting
|
|
19
8
|
? labelLoading
|
|
20
9
|
: label)));
|
|
21
10
|
}
|
|
@@ -23,6 +23,6 @@ export default function Checkbox(props) {
|
|
|
23
23
|
};
|
|
24
24
|
const Tag = fastField ? FastField : Field;
|
|
25
25
|
return options.map((option, index) => (React.createElement("div", { className: "form-check", key: `${name}-${index}` },
|
|
26
|
-
React.createElement(Tag,
|
|
26
|
+
React.createElement(Tag, { value: option.value, name: name, id: `${id}-${index}`, "data-testid": `${id}-${index}`, checked: isChecked(option), ...{ disabled }, className: "form-check-input", type: "checkbox", tabIndex: tabIndex, onChange: handleChange }),
|
|
27
27
|
React.createElement("label", { className: "form-check-label", htmlFor: `${id}-${index}` }, option.label))));
|
|
28
28
|
}
|