react-native-better-html 1.0.19 → 1.0.20

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/index.js CHANGED
@@ -1341,6 +1341,7 @@ var getAlertDurationFromAuto = (duration, alert) => {
1341
1341
  };
1342
1342
  function Alert({ alert }) {
1343
1343
  const theme2 = (0, import_react_better_core9.useTheme)();
1344
+ const device = useDevice();
1344
1345
  const alertControls2 = useAlertControls();
1345
1346
  const alertsPlugin2 = usePlugin("alerts");
1346
1347
  const pluginConfig = alertsPlugin2?.getConfig() ?? {};
@@ -1393,9 +1394,12 @@ function Alert({ alert }) {
1393
1394
  clearTimeout(timeout);
1394
1395
  };
1395
1396
  }, [onPressCloseAlert, defaultAlertDurationNumber]);
1397
+ const iconSize = 16;
1398
+ const iconPadding = (theme2.styles.space + theme2.styles.gap) / 2;
1396
1399
  return defaultAlertDisplay === "prominent" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1397
1400
  Animate_default.View,
1398
1401
  {
1402
+ maxWidth: "100%",
1399
1403
  initialOpacity: 0,
1400
1404
  animateOpacity: isRemoved ? 0 : 1,
1401
1405
  initialX: 40,
@@ -1408,20 +1412,29 @@ function Alert({ alert }) {
1408
1412
  justifyContent: "center",
1409
1413
  backgroundColor: alertData[alert.type].backgroundColor,
1410
1414
  borderRadius: 999,
1411
- padding: (theme2.styles.space + theme2.styles.gap) / 2,
1415
+ padding: iconPadding,
1412
1416
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1413
1417
  Icon_default,
1414
1418
  {
1415
1419
  name: alertData[alert.type].icon,
1420
+ nameIOS: alertData[alert.type].iconIOS,
1421
+ size: iconSize,
1416
1422
  color: alertData[alert.type].iconColor ?? theme2.colors.base
1417
1423
  }
1418
1424
  )
1419
1425
  }
1420
1426
  ),
1421
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(View_default, { children: [
1422
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { fontSize: 18, fontWeight: 700, children: alert.title ?? alertData[alert.type].title }),
1423
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default.body, { children: alert.message })
1424
- ] }),
1427
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1428
+ View_default,
1429
+ {
1430
+ maxWidth: device.windowDimensions.width - theme2.styles.space - theme2.styles.space - (iconPadding + iconSize + iconPadding) - theme2.styles.space - 60 - theme2.styles.space - theme2.styles.space - theme2.styles.space,
1431
+ gap: theme2.styles.gap / 3,
1432
+ children: [
1433
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { fontSize: 18, fontWeight: 700, children: alert.title ?? alertData[alert.type].title }),
1434
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default.body, { children: alert.message })
1435
+ ]
1436
+ }
1437
+ ),
1425
1438
  pluginConfig.withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button_default.icon, { icon: "XMark", onPress: onPressCloseAlert })
1426
1439
  ] }) })
1427
1440
  }