pge-front-common 14.2.13 → 14.2.14
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/lib/components/InformativeBox/InformativeBox.stories.d.ts +1 -0
- package/lib/components/InformativeBox/index.d.ts +1 -1
- package/lib/components/InformativeBox/index.type.d.ts +3 -2
- package/lib/index.d.ts +6 -5
- package/lib/index.esm.js +5 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { InformativeBoxProps } from "./index.type";
|
|
3
|
-
declare const InformativeBox: ({ infoType, title, message, onClose, widthType, hasDismissButton, ...props }: InformativeBoxProps) => React.JSX.Element;
|
|
3
|
+
declare const InformativeBox: ({ infoType, title, message, children, onClose, widthType, hasDismissButton, ...props }: InformativeBoxProps) => React.JSX.Element;
|
|
4
4
|
export { InformativeBox };
|
|
@@ -2,8 +2,9 @@ import { HtmlHTMLAttributes, ReactNode } from "react";
|
|
|
2
2
|
export interface InformativeBoxProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
3
|
infoType: "success" | "alert" | "warning" | "informative";
|
|
4
4
|
widthType?: "fitContent" | "fullWidth";
|
|
5
|
-
title
|
|
6
|
-
message
|
|
5
|
+
title?: string | ReactNode;
|
|
6
|
+
message?: string | ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
7
8
|
hasDismissButton?: boolean;
|
|
8
9
|
onClose?: () => void;
|
|
9
10
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -33,13 +33,14 @@ declare const InputBase: ({ customClass, restrictionMessage, label, leftIcon, ri
|
|
|
33
33
|
interface InformativeBoxProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, "title"> {
|
|
34
34
|
infoType: "success" | "alert" | "warning" | "informative";
|
|
35
35
|
widthType?: "fitContent" | "fullWidth";
|
|
36
|
-
title
|
|
37
|
-
message
|
|
36
|
+
title?: string | ReactNode;
|
|
37
|
+
message?: string | ReactNode;
|
|
38
|
+
children?: ReactNode;
|
|
38
39
|
hasDismissButton?: boolean;
|
|
39
40
|
onClose?: () => void;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
declare const InformativeBox: ({ infoType, title, message, onClose, widthType, hasDismissButton, ...props }: InformativeBoxProps) => React__default.JSX.Element;
|
|
43
|
+
declare const InformativeBox: ({ infoType, title, message, children, onClose, widthType, hasDismissButton, ...props }: InformativeBoxProps) => React__default.JSX.Element;
|
|
43
44
|
|
|
44
45
|
type CheckboxProps = {
|
|
45
46
|
checked?: boolean;
|
|
@@ -91,8 +92,9 @@ declare const FileUpload: React__default.ForwardRefExoticComponent<{
|
|
|
91
92
|
maxFileSize?: `${number}KB` | `${number}MB` | `${number}GB`;
|
|
92
93
|
helperText?: React__default.ReactNode;
|
|
93
94
|
} & {
|
|
94
|
-
style?: React__default.CSSProperties | undefined;
|
|
95
95
|
disabled?: boolean | undefined | undefined;
|
|
96
|
+
onChange?: React__default.FormEventHandler<HTMLButtonElement> | undefined;
|
|
97
|
+
style?: React__default.CSSProperties | undefined;
|
|
96
98
|
className?: string | undefined | undefined;
|
|
97
99
|
value?: string | number | readonly string[] | undefined;
|
|
98
100
|
form?: string | undefined | undefined;
|
|
@@ -103,7 +105,6 @@ declare const FileUpload: React__default.ForwardRefExoticComponent<{
|
|
|
103
105
|
formTarget?: string | undefined | undefined;
|
|
104
106
|
name?: string | undefined | undefined;
|
|
105
107
|
type?: "submit" | "reset" | "button" | undefined | undefined;
|
|
106
|
-
onChange?: React__default.FormEventHandler<HTMLButtonElement> | undefined;
|
|
107
108
|
defaultChecked?: boolean | undefined | undefined;
|
|
108
109
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
109
110
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
package/lib/index.esm.js
CHANGED
|
@@ -546,7 +546,8 @@ styleInject(css_248z$I);
|
|
|
546
546
|
|
|
547
547
|
var InformativeBox = function (_a) {
|
|
548
548
|
var _b;
|
|
549
|
-
var
|
|
549
|
+
var _c;
|
|
550
|
+
var infoType = _a.infoType, title = _a.title, message = _a.message, children = _a.children, onClose = _a.onClose, _d = _a.widthType, widthType = _d === void 0 ? "fitContent" : _d, _e = _a.hasDismissButton, hasDismissButton = _e === void 0 ? false : _e, props = __rest(_a, ["infoType", "title", "message", "children", "onClose", "widthType", "hasDismissButton"]);
|
|
550
551
|
var getIcon = function () {
|
|
551
552
|
var iconClass = "".concat(styles$E.icon, " ").concat(styles$E[infoType] || "");
|
|
552
553
|
switch (infoType) {
|
|
@@ -567,7 +568,7 @@ var InformativeBox = function (_a) {
|
|
|
567
568
|
React__default.createElement("div", { className: styles$E.content },
|
|
568
569
|
React__default.createElement("div", { className: styles$E.info },
|
|
569
570
|
getIcon(),
|
|
570
|
-
React__default.createElement("div", { className: styles$E.text },
|
|
571
|
+
React__default.createElement("div", { className: styles$E.text }, children ? (children) : (React__default.createElement(React__default.Fragment, null,
|
|
571
572
|
title && !message && (React__default.createElement("strong", { className: "".concat(styles$E.title, " ").concat(styles$E[infoType]) }, title)),
|
|
572
573
|
!title && message && (React__default.createElement("span", { className: clsx(styles$E.textContent, (_b = {},
|
|
573
574
|
_b[styles$E.success] = infoType === "success",
|
|
@@ -577,8 +578,8 @@ var InformativeBox = function (_a) {
|
|
|
577
578
|
_b)) }, message)),
|
|
578
579
|
title && message && (React__default.createElement(React__default.Fragment, null,
|
|
579
580
|
React__default.createElement("strong", { className: "".concat(styles$E.title, " ").concat(styles$E[infoType]) }, title),
|
|
580
|
-
React__default.createElement("span", { className: styles$E.textContent }, message))))),
|
|
581
|
-
hasDismissButton && (React__default.createElement("button", { "aria-label": "Fechar campo informativo para ".concat(title
|
|
581
|
+
React__default.createElement("span", { className: styles$E.textContent }, message))))))),
|
|
582
|
+
hasDismissButton && (React__default.createElement("button", { "aria-label": "Fechar campo informativo para ".concat((_c = title !== null && title !== void 0 ? title : message) !== null && _c !== void 0 ? _c : "conteúdo"), className: styles$E.closeButton, onClick: function (e) {
|
|
582
583
|
e.stopPropagation();
|
|
583
584
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
584
585
|
} },
|