@eclass/ui-kit 1.57.0 → 1.57.2
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/eclass-ui-kit.es.js +37 -16
- package/dist/eclass-ui-kit.es.js.map +1 -1
- package/dist/eclass-ui-kit.umd.js +11 -11
- package/dist/eclass-ui-kit.umd.js.map +1 -1
- package/dist/molecules/Buttons/BtnLink.d.ts +2 -1
- package/dist/molecules/Buttons/BtnLink.d.ts.map +1 -1
- package/dist/organisms/Alerts/Alert.d.ts.map +1 -1
- package/dist/organisms/Alerts/FlashNotification.d.ts +1 -1
- package/dist/organisms/Alerts/FlashNotification.d.ts.map +1 -1
- package/dist/organisms/Alerts/types.d.ts +0 -1
- package/dist/organisms/Alerts/utils/useFlashNotification.d.ts +1 -1
- package/dist/organisms/Alerts/utils/useFlashNotification.d.ts.map +1 -1
- package/dist/organisms/Modals/ModalAlert/ModalAlertContent.d.ts.map +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/eclass-ui-kit.es.js
CHANGED
|
@@ -1763,6 +1763,7 @@ function BtnLink({
|
|
|
1763
1763
|
fontSize = "0.875rem",
|
|
1764
1764
|
href = "",
|
|
1765
1765
|
id,
|
|
1766
|
+
isDisable = false,
|
|
1766
1767
|
m: m2 = "0",
|
|
1767
1768
|
onClick,
|
|
1768
1769
|
role = "link",
|
|
@@ -1773,7 +1774,7 @@ function BtnLink({
|
|
|
1773
1774
|
}) {
|
|
1774
1775
|
const typeButton = {
|
|
1775
1776
|
button: {
|
|
1776
|
-
onClick,
|
|
1777
|
+
onClick: isDisable ? void 0 : onClick,
|
|
1777
1778
|
target
|
|
1778
1779
|
},
|
|
1779
1780
|
a: {
|
|
@@ -1782,22 +1783,24 @@ function BtnLink({
|
|
|
1782
1783
|
}
|
|
1783
1784
|
};
|
|
1784
1785
|
return /* @__PURE__ */ jsx(Box, {
|
|
1786
|
+
"aria-label": ariaLabel,
|
|
1785
1787
|
as,
|
|
1786
1788
|
autoFocus: false,
|
|
1787
|
-
"aria-label": ariaLabel,
|
|
1788
|
-
id,
|
|
1789
|
-
role,
|
|
1790
1789
|
backgroundColor: "transparent",
|
|
1791
1790
|
borderStyle: "none",
|
|
1792
1791
|
className: "linkButton",
|
|
1793
1792
|
color: vars("colors-main-deepSkyBlue"),
|
|
1793
|
+
cursor: isDisable ? "not-allowed" : "pointer",
|
|
1794
1794
|
fontFamily: "Roboto",
|
|
1795
|
+
fontSize,
|
|
1795
1796
|
fontStyle: "normal",
|
|
1796
1797
|
fontWeight: "500",
|
|
1797
|
-
|
|
1798
|
+
id,
|
|
1798
1799
|
lineHeight: "1rem",
|
|
1799
|
-
onClick,
|
|
1800
|
+
onClick: isDisable ? void 0 : onClick,
|
|
1801
|
+
opacity: isDisable ? 0.5 : 1,
|
|
1800
1802
|
padding: ".25em",
|
|
1803
|
+
role,
|
|
1801
1804
|
tabIndex,
|
|
1802
1805
|
textDecorationLine: textDecorationLine ? "underline" : "none",
|
|
1803
1806
|
width: "fit-content",
|
|
@@ -6794,6 +6797,7 @@ function Alert({
|
|
|
6794
6797
|
p: "1rem",
|
|
6795
6798
|
pr: canDismiss ? "1.75rem" : "1rem",
|
|
6796
6799
|
position: "relative",
|
|
6800
|
+
boxShadow: isFlash ? "0px 2px 8px 0px #5C5C5C33" : "",
|
|
6797
6801
|
sx,
|
|
6798
6802
|
children: [/* @__PURE__ */ jsxs(Box, {
|
|
6799
6803
|
display: "flex",
|
|
@@ -7266,10 +7270,10 @@ function FlashNotification({
|
|
|
7266
7270
|
message,
|
|
7267
7271
|
state,
|
|
7268
7272
|
show,
|
|
7269
|
-
m: m2
|
|
7270
|
-
width
|
|
7273
|
+
m: m2
|
|
7271
7274
|
}) {
|
|
7272
7275
|
const [shouldRenderToaster, setShouldRenderToaster] = useState(false);
|
|
7276
|
+
const [isMobile] = useMediaQuery("(max-width: 425px)");
|
|
7273
7277
|
useEffect(() => {
|
|
7274
7278
|
if (typeof window !== "undefined" && !window[GLOBAL_TOASTER_FLAG]) {
|
|
7275
7279
|
window[GLOBAL_TOASTER_FLAG] = true;
|
|
@@ -7282,15 +7286,21 @@ function FlashNotification({
|
|
|
7282
7286
|
state,
|
|
7283
7287
|
canDismiss: true,
|
|
7284
7288
|
onClick: () => n.dismiss(t2.id),
|
|
7285
|
-
width,
|
|
7286
|
-
maxContent: !width,
|
|
7287
7289
|
m: m2,
|
|
7290
|
+
sx: {
|
|
7291
|
+
w: "initial",
|
|
7292
|
+
maxWidth: "initial",
|
|
7293
|
+
...isMobile && {
|
|
7294
|
+
margin: "-4px -10px",
|
|
7295
|
+
borderRadius: 0
|
|
7296
|
+
}
|
|
7297
|
+
},
|
|
7288
7298
|
children: message
|
|
7289
7299
|
}), {
|
|
7290
7300
|
duration: state === "success" ? handleTime(message) : Infinity,
|
|
7291
7301
|
id: alertStates[state].id
|
|
7292
7302
|
});
|
|
7293
|
-
}, [message, state,
|
|
7303
|
+
}, [message, state, m2]);
|
|
7294
7304
|
useEffect(() => {
|
|
7295
7305
|
if (show) {
|
|
7296
7306
|
showToast();
|
|
@@ -7304,13 +7314,24 @@ function FlashNotification({
|
|
|
7304
7314
|
style: {
|
|
7305
7315
|
background: "transparent",
|
|
7306
7316
|
boxShadow: "none",
|
|
7307
|
-
maxWidth:
|
|
7317
|
+
maxWidth: "100vw",
|
|
7318
|
+
padding: 0,
|
|
7319
|
+
margin: 0
|
|
7308
7320
|
}
|
|
7321
|
+
},
|
|
7322
|
+
containerStyle: {
|
|
7323
|
+
left: 0,
|
|
7324
|
+
right: 0,
|
|
7325
|
+
...isMobile && {
|
|
7326
|
+
top: 0
|
|
7327
|
+
},
|
|
7328
|
+
padding: 0,
|
|
7329
|
+
margin: 0
|
|
7309
7330
|
}
|
|
7310
7331
|
})
|
|
7311
7332
|
});
|
|
7312
7333
|
}
|
|
7313
|
-
const useFlashNotification = ({ state, message
|
|
7334
|
+
const useFlashNotification = ({ state, message }) => {
|
|
7314
7335
|
const [show, setShow] = useState(false);
|
|
7315
7336
|
useEffect(() => {
|
|
7316
7337
|
if (show) {
|
|
@@ -7331,8 +7352,7 @@ const useFlashNotification = ({ state, message, width }) => {
|
|
|
7331
7352
|
active,
|
|
7332
7353
|
config: {
|
|
7333
7354
|
state,
|
|
7334
|
-
message
|
|
7335
|
-
width
|
|
7355
|
+
message
|
|
7336
7356
|
}
|
|
7337
7357
|
};
|
|
7338
7358
|
};
|
|
@@ -7579,6 +7599,7 @@ const ModalAlertContent = ({
|
|
|
7579
7599
|
children
|
|
7580
7600
|
}) => {
|
|
7581
7601
|
const [isDesktop] = useMediaQuery("(min-width: 641px)");
|
|
7602
|
+
const descriptionParsed = typeof description === "string" ? ReactParser(purify.sanitize(description)) : description;
|
|
7582
7603
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
7583
7604
|
children: [/* @__PURE__ */ jsxs(ModalBody, {
|
|
7584
7605
|
p: "32px",
|
|
@@ -7604,7 +7625,7 @@ const ModalAlertContent = ({
|
|
|
7604
7625
|
fontSize: "16px",
|
|
7605
7626
|
lineHeight: "24px",
|
|
7606
7627
|
mb: 0,
|
|
7607
|
-
children:
|
|
7628
|
+
children: descriptionParsed
|
|
7608
7629
|
})]
|
|
7609
7630
|
}), type !== "loading" && children ? children : /* @__PURE__ */ jsx(Fragment, {})]
|
|
7610
7631
|
});
|