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.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1603,7 +1603,7 @@ var assets = {
|
|
|
1603
1603
|
var appConfig = {
|
|
1604
1604
|
contentMaxWidth: 1100
|
|
1605
1605
|
};
|
|
1606
|
-
var defaultAlertDuration =
|
|
1606
|
+
var defaultAlertDuration = 2.3 * 1e3;
|
|
1607
1607
|
|
|
1608
1608
|
// src/components/alerts/AlertsHolder.tsx
|
|
1609
1609
|
var import_react8 = require("react");
|
|
@@ -1955,7 +1955,7 @@ var ButtonComponent = function Button({
|
|
|
1955
1955
|
const theme2 = useTheme();
|
|
1956
1956
|
const isLoadingHook = useLoader(loaderName);
|
|
1957
1957
|
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
1958
|
-
const isLoadingElement = isLoading
|
|
1958
|
+
const isLoadingElement = isLoading || isLoadingHook;
|
|
1959
1959
|
const styledComponentStyles = useStyledComponentStyles(
|
|
1960
1960
|
{
|
|
1961
1961
|
...betterHtmlContext2.components.button?.style?.default,
|
|
@@ -2232,6 +2232,7 @@ var StyledDiv2 = import_styled_components6.default.div.withConfig({
|
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
2234
|
`;
|
|
2235
|
+
var minWidth = 250;
|
|
2235
2236
|
var updateInterval = 20;
|
|
2236
2237
|
var getAnimationInName = (position) => ({
|
|
2237
2238
|
left: "fadeInFromLeft",
|
|
@@ -2349,7 +2350,9 @@ function Alert2({ alert }) {
|
|
|
2349
2350
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StyledDiv2, { theme: theme2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2350
2351
|
Div_default.box,
|
|
2351
2352
|
{
|
|
2352
|
-
|
|
2353
|
+
width: "fit-content",
|
|
2354
|
+
maxWidth: Math.max(minWidth, pluginConfig.maxWidth ?? defaultAlertsPluginOptions.maxWidth),
|
|
2355
|
+
minWidth,
|
|
2353
2356
|
boxShadow: "0px 10px 20px #00000020",
|
|
2354
2357
|
onMouseEnter,
|
|
2355
2358
|
onMouseMove: onMouseEnter,
|
|
@@ -2379,7 +2382,7 @@ function Alert2({ alert }) {
|
|
|
2379
2382
|
),
|
|
2380
2383
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
2381
2384
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { fontSize: 18, fontWeight: 700, children: alert.title ?? alertData[alert.type].title }),
|
|
2382
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, {
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { color: theme2.colors.textSecondary, children: alert.message })
|
|
2383
2386
|
] }),
|
|
2384
2387
|
pluginConfig.withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button_default.icon, { icon: "XMark", alignSelf: "flex-start", onClick: onClickCloseAlert })
|
|
2385
2388
|
] }),
|
|
@@ -2429,6 +2432,7 @@ function AlertsHolder() {
|
|
|
2429
2432
|
left,
|
|
2430
2433
|
right,
|
|
2431
2434
|
gap: theme2.styles.gap,
|
|
2435
|
+
alignItems: pluginConfig.align === "center" ? "center" : pluginConfig.align === "right" ? "flex-end" : void 0,
|
|
2432
2436
|
transform: pluginConfig.align === "center" ? "translateX(-50%)" : void 0,
|
|
2433
2437
|
children: alerts.map((alert) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Alert_default, { alert }, alert.id))
|
|
2434
2438
|
}
|