@eclass/ui-kit 1.57.1 → 1.57.3

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.
@@ -6797,6 +6797,7 @@ function Alert({
6797
6797
  p: "1rem",
6798
6798
  pr: canDismiss ? "1.75rem" : "1rem",
6799
6799
  position: "relative",
6800
+ boxShadow: isFlash ? "0px 2px 8px 0px #5C5C5C33" : "",
6800
6801
  sx,
6801
6802
  children: [/* @__PURE__ */ jsxs(Box, {
6802
6803
  display: "flex",
@@ -7269,10 +7270,10 @@ function FlashNotification({
7269
7270
  message,
7270
7271
  state,
7271
7272
  show,
7272
- m: m2,
7273
- width
7273
+ m: m2
7274
7274
  }) {
7275
7275
  const [shouldRenderToaster, setShouldRenderToaster] = useState(false);
7276
+ const [isMobile] = useMediaQuery("(max-width: 440px)");
7276
7277
  useEffect(() => {
7277
7278
  if (typeof window !== "undefined" && !window[GLOBAL_TOASTER_FLAG]) {
7278
7279
  window[GLOBAL_TOASTER_FLAG] = true;
@@ -7285,15 +7286,22 @@ function FlashNotification({
7285
7286
  state,
7286
7287
  canDismiss: true,
7287
7288
  onClick: () => n.dismiss(t2.id),
7288
- width,
7289
- maxContent: !width,
7290
7289
  m: m2,
7290
+ sx: {
7291
+ w: "initial",
7292
+ maxWidth: "initial",
7293
+ ...isMobile && {
7294
+ margin: "-4px -10px",
7295
+ borderRadius: 0,
7296
+ w: "100vw!important"
7297
+ }
7298
+ },
7291
7299
  children: message
7292
7300
  }), {
7293
7301
  duration: state === "success" ? handleTime(message) : Infinity,
7294
7302
  id: alertStates[state].id
7295
7303
  });
7296
- }, [message, state, width, m2]);
7304
+ }, [message, state, m2]);
7297
7305
  useEffect(() => {
7298
7306
  if (show) {
7299
7307
  showToast();
@@ -7307,13 +7315,24 @@ function FlashNotification({
7307
7315
  style: {
7308
7316
  background: "transparent",
7309
7317
  boxShadow: "none",
7310
- maxWidth: width != null ? width : "max-content"
7318
+ maxWidth: "100vw",
7319
+ padding: 0,
7320
+ margin: 0
7311
7321
  }
7322
+ },
7323
+ containerStyle: {
7324
+ left: 0,
7325
+ right: 0,
7326
+ ...isMobile && {
7327
+ top: 0
7328
+ },
7329
+ padding: 0,
7330
+ margin: 0
7312
7331
  }
7313
7332
  })
7314
7333
  });
7315
7334
  }
7316
- const useFlashNotification = ({ state, message, width }) => {
7335
+ const useFlashNotification = ({ state, message }) => {
7317
7336
  const [show, setShow] = useState(false);
7318
7337
  useEffect(() => {
7319
7338
  if (show) {
@@ -7334,8 +7353,7 @@ const useFlashNotification = ({ state, message, width }) => {
7334
7353
  active,
7335
7354
  config: {
7336
7355
  state,
7337
- message,
7338
- width
7356
+ message
7339
7357
  }
7340
7358
  };
7341
7359
  };