@eclass/ui-kit 1.57.1 → 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.
@@ -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: 425px)");
7276
7277
  useEffect(() => {
7277
7278
  if (typeof window !== "undefined" && !window[GLOBAL_TOASTER_FLAG]) {
7278
7279
  window[GLOBAL_TOASTER_FLAG] = true;
@@ -7285,15 +7286,21 @@ 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
+ }
7297
+ },
7291
7298
  children: message
7292
7299
  }), {
7293
7300
  duration: state === "success" ? handleTime(message) : Infinity,
7294
7301
  id: alertStates[state].id
7295
7302
  });
7296
- }, [message, state, width, m2]);
7303
+ }, [message, state, m2]);
7297
7304
  useEffect(() => {
7298
7305
  if (show) {
7299
7306
  showToast();
@@ -7307,13 +7314,24 @@ function FlashNotification({
7307
7314
  style: {
7308
7315
  background: "transparent",
7309
7316
  boxShadow: "none",
7310
- maxWidth: width != null ? width : "max-content"
7317
+ maxWidth: "100vw",
7318
+ padding: 0,
7319
+ margin: 0
7311
7320
  }
7321
+ },
7322
+ containerStyle: {
7323
+ left: 0,
7324
+ right: 0,
7325
+ ...isMobile && {
7326
+ top: 0
7327
+ },
7328
+ padding: 0,
7329
+ margin: 0
7312
7330
  }
7313
7331
  })
7314
7332
  });
7315
7333
  }
7316
- const useFlashNotification = ({ state, message, width }) => {
7334
+ const useFlashNotification = ({ state, message }) => {
7317
7335
  const [show, setShow] = useState(false);
7318
7336
  useEffect(() => {
7319
7337
  if (show) {
@@ -7334,8 +7352,7 @@ const useFlashNotification = ({ state, message, width }) => {
7334
7352
  active,
7335
7353
  config: {
7336
7354
  state,
7337
- message,
7338
- width
7355
+ message
7339
7356
  }
7340
7357
  };
7341
7358
  };