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.
@@ -9,3 +9,4 @@ export declare const SuccessFullWidth: Story;
9
9
  export declare const SuccessFitContent: Story;
10
10
  export declare const Alert: Story;
11
11
  export declare const Warning: Story;
12
+ export declare const WithCustomContent: Story;
@@ -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: string | ReactNode;
6
- message: string | ReactNode;
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: string | ReactNode;
37
- message: string | ReactNode;
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 infoType = _a.infoType, title = _a.title, message = _a.message, onClose = _a.onClose, _c = _a.widthType, widthType = _c === void 0 ? "fitContent" : _c, _d = _a.hasDismissButton, hasDismissButton = _d === void 0 ? false : _d, props = __rest(_a, ["infoType", "title", "message", "onClose", "widthType", "hasDismissButton"]);
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 || message), className: styles$E.closeButton, onClick: function (e) {
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
  } },