react-better-html 1.1.128 → 1.1.130
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 +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1753,7 +1753,7 @@ var import_styled_components5 = __toESM(require("styled-components"));
|
|
|
1753
1753
|
var import_react4 = require("react");
|
|
1754
1754
|
var import_styled_components3 = __toESM(require("styled-components"));
|
|
1755
1755
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1756
|
-
var StyledDiv =
|
|
1756
|
+
var StyledDiv = import_styled_components3.default.div`
|
|
1757
1757
|
@keyframes loaderAnimation {
|
|
1758
1758
|
to {
|
|
1759
1759
|
transform: rotate(360deg);
|
|
@@ -1777,8 +1777,8 @@ var LoaderComponent = function Loader({
|
|
|
1777
1777
|
const readyColor = color ?? theme2.colors.textPrimary;
|
|
1778
1778
|
const readyWidth = width ?? size / 3;
|
|
1779
1779
|
const mask = `radial-gradient(farthest-side, #0000 calc(100% - ${readyWidth}px), #000 0)`;
|
|
1780
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1781
|
-
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledDiv, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1781
|
+
Div_default,
|
|
1782
1782
|
{
|
|
1783
1783
|
width: size + readyWidth * 2,
|
|
1784
1784
|
height: size + readyWidth * 2,
|
|
@@ -1790,7 +1790,7 @@ var LoaderComponent = function Loader({
|
|
|
1790
1790
|
animation: !disabled ? "loaderAnimation .6s infinite linear" : void 0,
|
|
1791
1791
|
...props
|
|
1792
1792
|
}
|
|
1793
|
-
);
|
|
1793
|
+
) });
|
|
1794
1794
|
};
|
|
1795
1795
|
LoaderComponent.box = function Box({ text = "Loading...", size = 20, ...props }) {
|
|
1796
1796
|
const theme2 = useTheme();
|
|
@@ -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
|
}
|