react-better-html 1.1.129 → 1.1.131

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.mjs CHANGED
@@ -1517,7 +1517,7 @@ var assets = {
1517
1517
  var appConfig = {
1518
1518
  contentMaxWidth: 1100
1519
1519
  };
1520
- var defaultAlertDuration = 3e3;
1520
+ var defaultAlertDuration = 2.3 * 1e3;
1521
1521
 
1522
1522
  // src/components/alerts/AlertsHolder.tsx
1523
1523
  import { memo as memo7 } from "react";
@@ -1869,7 +1869,7 @@ var ButtonComponent = function Button({
1869
1869
  const theme2 = useTheme();
1870
1870
  const isLoadingHook = useLoader(loaderName);
1871
1871
  const betterHtmlContext2 = useBetterHtmlContextInternal();
1872
- const isLoadingElement = isLoading ?? isLoadingHook;
1872
+ const isLoadingElement = isLoading || isLoadingHook;
1873
1873
  const styledComponentStyles = useStyledComponentStyles(
1874
1874
  {
1875
1875
  ...betterHtmlContext2.components.button?.style?.default,
@@ -2146,6 +2146,7 @@ var StyledDiv2 = styled6.div.withConfig({
2146
2146
  }
2147
2147
  }
2148
2148
  `;
2149
+ var minWidth = 250;
2149
2150
  var updateInterval = 20;
2150
2151
  var getAnimationInName = (position) => ({
2151
2152
  left: "fadeInFromLeft",
@@ -2263,7 +2264,9 @@ function Alert2({ alert }) {
2263
2264
  return /* @__PURE__ */ jsx6(StyledDiv2, { theme: theme2, children: /* @__PURE__ */ jsx6(
2264
2265
  Div_default.box,
2265
2266
  {
2266
- maxWidth: pluginConfig.maxWidth,
2267
+ width: "fit-content",
2268
+ maxWidth: Math.max(minWidth, pluginConfig.maxWidth ?? defaultAlertsPluginOptions.maxWidth),
2269
+ minWidth,
2267
2270
  boxShadow: "0px 10px 20px #00000020",
2268
2271
  onMouseEnter,
2269
2272
  onMouseMove: onMouseEnter,
@@ -2293,7 +2296,7 @@ function Alert2({ alert }) {
2293
2296
  ),
2294
2297
  /* @__PURE__ */ jsxs3(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
2295
2298
  /* @__PURE__ */ jsx6(Text_default, { fontSize: 18, fontWeight: 700, children: alert.title ?? alertData[alert.type].title }),
2296
- /* @__PURE__ */ jsx6(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: alert.message })
2299
+ /* @__PURE__ */ jsx6(Text_default, { color: theme2.colors.textSecondary, children: alert.message })
2297
2300
  ] }),
2298
2301
  pluginConfig.withCloseButton && /* @__PURE__ */ jsx6(Button_default.icon, { icon: "XMark", alignSelf: "flex-start", onClick: onClickCloseAlert })
2299
2302
  ] }),
@@ -2343,6 +2346,7 @@ function AlertsHolder() {
2343
2346
  left,
2344
2347
  right,
2345
2348
  gap: theme2.styles.gap,
2349
+ alignItems: pluginConfig.align === "center" ? "center" : pluginConfig.align === "right" ? "flex-end" : void 0,
2346
2350
  transform: pluginConfig.align === "center" ? "translateX(-50%)" : void 0,
2347
2351
  children: alerts.map((alert) => /* @__PURE__ */ jsx7(Alert_default, { alert }, alert.id))
2348
2352
  }