react-better-html 1.1.266 → 1.1.268

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.d.mts CHANGED
@@ -694,7 +694,7 @@ type IconComponent = {
694
694
  };
695
695
  declare const _default: IconComponent;
696
696
 
697
- type ModalProps = {
697
+ type InternalModalProps = {
698
698
  /**
699
699
  * If you want to have a small modal, you can use 660px as it looks good on most screens.
700
700
  *
@@ -717,8 +717,10 @@ type ModalProps = {
717
717
  defaultIsOpened?: boolean;
718
718
  onOpen?: () => void;
719
719
  onClose?: () => void;
720
+ isAlert?: boolean;
720
721
  children?: React.ReactNode;
721
722
  };
723
+ type ModalProps = OmitProps<InternalModalProps, "isAlert">;
722
724
  type ModalRef = {
723
725
  isOpened: boolean;
724
726
  open: () => void;
package/dist/index.d.ts CHANGED
@@ -694,7 +694,7 @@ type IconComponent = {
694
694
  };
695
695
  declare const _default: IconComponent;
696
696
 
697
- type ModalProps = {
697
+ type InternalModalProps = {
698
698
  /**
699
699
  * If you want to have a small modal, you can use 660px as it looks good on most screens.
700
700
  *
@@ -717,8 +717,10 @@ type ModalProps = {
717
717
  defaultIsOpened?: boolean;
718
718
  onOpen?: () => void;
719
719
  onClose?: () => void;
720
+ isAlert?: boolean;
720
721
  children?: React.ReactNode;
721
722
  };
723
+ type ModalProps = OmitProps<InternalModalProps, "isAlert">;
722
724
  type ModalRef = {
723
725
  isOpened: boolean;
724
726
  open: () => void;
package/dist/index.js CHANGED
@@ -2183,7 +2183,10 @@ var ButtonElement = import_styled_components6.default.button.withConfig({
2183
2183
  ${(props) => props.hoverStyle}
2184
2184
  }
2185
2185
  `;
2186
- var ButtonComponent = function Button(buttonProps) {
2186
+ var ButtonComponent = function Button({
2187
+ fromSubcomponent,
2188
+ ...buttonProps
2189
+ }) {
2187
2190
  const betterHtmlContextInternal = useBetterHtmlContextInternal();
2188
2191
  const {
2189
2192
  href,
@@ -2209,7 +2212,7 @@ var ButtonComponent = function Button(buttonProps) {
2209
2212
  onClickWithValue,
2210
2213
  ...props
2211
2214
  } = useComponentsPropsMerger(
2212
- !buttonProps.fromSubcomponent ? betterHtmlContextInternal.components.button?.style?.default : {},
2215
+ !fromSubcomponent ? betterHtmlContextInternal.components.button?.style?.default : {},
2213
2216
  buttonProps
2214
2217
  );
2215
2218
  const theme2 = (0, import_react_better_core9.useTheme)();
@@ -2425,6 +2428,9 @@ var import_react_dom = require("react-dom");
2425
2428
  var import_react_better_core10 = require("react-better-core");
2426
2429
  var import_styled_components7 = __toESM(require("styled-components"));
2427
2430
  var import_jsx_runtime9 = require("react/jsx-runtime");
2431
+ var isAlertModalProps = {
2432
+ isAlert: true
2433
+ };
2428
2434
  var DialogStylesElement = import_styled_components7.default.dialog.withConfig({
2429
2435
  shouldForwardProp: (prop) => !["theme", "colorTheme", "opacity"].includes(prop)
2430
2436
  })`
@@ -2481,10 +2487,11 @@ var ModalComponent = (0, import_react11.forwardRef)(function Modal({
2481
2487
  defaultIsOpened = false,
2482
2488
  onOpen,
2483
2489
  onClose,
2490
+ isAlert,
2484
2491
  children
2485
2492
  }, ref) {
2486
2493
  const reactRouterDomPlugin2 = usePlugin("react-router-dom");
2487
- const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
2494
+ const urlQuery = reactRouterDomPlugin2 && !isAlert ? useUrlQuery() : void 0;
2488
2495
  const theme2 = (0, import_react_better_core10.useTheme)();
2489
2496
  const { app } = useBetterHtmlContextInternal();
2490
2497
  const { colorTheme } = (0, import_react_better_core10.useBetterCoreContext)();
@@ -2990,7 +2997,7 @@ function Alert2({ alert }) {
2990
2997
  const animation = `${isRemoved ? getAnimationOutName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align] : getAnimationInName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align]} ${theme2.styles.transition}`;
2991
2998
  const alertTitle = alert.title ?? alertData[alert.type].title;
2992
2999
  return defaultAlertDisplay === "prominent" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2993
- Modal_default,
3000
+ ModalComponent,
2994
3001
  {
2995
3002
  defaultIsOpened: true,
2996
3003
  icon: alertData[alert.type].icon,
@@ -3002,6 +3009,7 @@ function Alert2({ alert }) {
3002
3009
  headerBackgroundColor: alertData[alert.type].backgroundColor,
3003
3010
  withoutCloseButton: true,
3004
3011
  ref: modalRef,
3012
+ ...isAlertModalProps,
3005
3013
  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default.row, { width: "100%", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3006
3014
  Button_default,
3007
3015
  {