react-better-html 1.1.220 → 1.1.222

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
@@ -348,6 +348,8 @@ type DivComponentType = {
348
348
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
349
349
  box: <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value> & OmitProps<PageHeaderProps, "marginBottom"> & {
350
350
  headerBackgroundColor?: string;
351
+ /** @default theme.colors.primary */
352
+ activeColor?: string;
351
353
  isActive?: boolean;
352
354
  }>) => React.ReactElement;
353
355
  };
@@ -368,7 +370,7 @@ type LoaderProps = {
368
370
  width?: number;
369
371
  /** @default false */
370
372
  disabled?: boolean;
371
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
373
+ } & OmitProps<DivProps, "children" | "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
372
374
  type LoaderComponentType = {
373
375
  (props: LoaderProps): React.ReactElement;
374
376
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -974,7 +976,7 @@ type FoldableProps = {
974
976
  renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
975
977
  onOpenChange?: (isOpen: boolean) => void;
976
978
  children?: React.ReactNode;
977
- } & DivProps;
979
+ } & OmitProps<DivProps, "ref">;
978
980
  type FoldableRef = {
979
981
  isOpen: boolean;
980
982
  open: () => void;
@@ -982,8 +984,8 @@ type FoldableRef = {
982
984
  toggle: () => void;
983
985
  };
984
986
  type FoldableComponentType = {
985
- (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>): React.ReactElement;
986
- box: (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>) => React.ReactElement;
987
+ (props: ComponentPropWithRef<FoldableRef, FoldableProps>): React.ReactElement;
988
+ box: (props: ComponentPropWithRef<FoldableRef, FoldableProps>) => React.ReactElement;
987
989
  };
988
990
  declare const FoldableComponent: FoldableComponentType;
989
991
  declare const Foldable: typeof FoldableComponent & {
package/dist/index.d.ts CHANGED
@@ -348,6 +348,8 @@ type DivComponentType = {
348
348
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
349
349
  box: <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value> & OmitProps<PageHeaderProps, "marginBottom"> & {
350
350
  headerBackgroundColor?: string;
351
+ /** @default theme.colors.primary */
352
+ activeColor?: string;
351
353
  isActive?: boolean;
352
354
  }>) => React.ReactElement;
353
355
  };
@@ -368,7 +370,7 @@ type LoaderProps = {
368
370
  width?: number;
369
371
  /** @default false */
370
372
  disabled?: boolean;
371
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
373
+ } & OmitProps<DivProps, "children" | "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
372
374
  type LoaderComponentType = {
373
375
  (props: LoaderProps): React.ReactElement;
374
376
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -974,7 +976,7 @@ type FoldableProps = {
974
976
  renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
975
977
  onOpenChange?: (isOpen: boolean) => void;
976
978
  children?: React.ReactNode;
977
- } & DivProps;
979
+ } & OmitProps<DivProps, "ref">;
978
980
  type FoldableRef = {
979
981
  isOpen: boolean;
980
982
  open: () => void;
@@ -982,8 +984,8 @@ type FoldableRef = {
982
984
  toggle: () => void;
983
985
  };
984
986
  type FoldableComponentType = {
985
- (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>): React.ReactElement;
986
- box: (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>) => React.ReactElement;
987
+ (props: ComponentPropWithRef<FoldableRef, FoldableProps>): React.ReactElement;
988
+ box: (props: ComponentPropWithRef<FoldableRef, FoldableProps>) => React.ReactElement;
987
989
  };
988
990
  declare const FoldableComponent: FoldableComponentType;
989
991
  declare const Foldable: typeof FoldableComponent & {
package/dist/index.js CHANGED
@@ -1296,6 +1296,12 @@ function useUrlQuery() {
1296
1296
  );
1297
1297
  }
1298
1298
  const reactRouterDomPluginConfig = reactRouterDomPlugin2.getConfig();
1299
+ const isInRouterContext = reactRouterDomPluginConfig.useInRouterContext();
1300
+ if (!isInRouterContext) {
1301
+ throw new Error(
1302
+ "`useUrlQuery` hook must be used inside a React Router context. Make sure your component is wrapped in a `<BrowserRouter>`, or another Router component."
1303
+ );
1304
+ }
1299
1305
  const navigate = reactRouterDomPluginConfig.useNavigate();
1300
1306
  const [searchParams] = reactRouterDomPluginConfig.useSearchParams();
1301
1307
  const createSearchParams2 = reactRouterDomPluginConfig.createSearchParams;
@@ -1771,20 +1777,22 @@ DivComponent.box = (0, import_react8.forwardRef)(function Box({
1771
1777
  rightElement,
1772
1778
  lightMode,
1773
1779
  headerBackgroundColor,
1780
+ activeColor,
1774
1781
  isActive,
1775
1782
  children,
1776
1783
  ...props
1777
1784
  }, ref) {
1778
1785
  const theme2 = (0, import_react_better_core7.useTheme)();
1779
1786
  const withClick = props.onClick || props.onClickWithValue;
1787
+ const readyActiveColor = activeColor ?? theme2.colors.primary;
1780
1788
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1781
1789
  DivComponent,
1782
1790
  {
1783
1791
  color: isActive ? theme2.colors.base : void 0,
1784
- backgroundColor: isActive ? theme2.colors.primary : theme2.colors.backgroundContent,
1785
- border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
1792
+ backgroundColor: isActive ? readyActiveColor : theme2.colors.backgroundContent,
1793
+ border: `1px solid ${isActive ? readyActiveColor : theme2.colors.border}`,
1786
1794
  borderRadius: theme2.styles.borderRadius,
1787
- borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
1795
+ borderColorHover: withClick && !isActive ? readyActiveColor : void 0,
1788
1796
  filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
1789
1797
  cursor: withClick ? "pointer" : void 0,
1790
1798
  paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
@@ -7136,18 +7144,14 @@ var FoldableComponent = (0, import_react30.forwardRef)(function Foldable({
7136
7144
  observer.disconnect();
7137
7145
  };
7138
7146
  }, [isOpen]);
7139
- (0, import_react30.useImperativeHandle)(
7140
- ref,
7141
- () => {
7142
- return {
7143
- open,
7144
- close,
7145
- toggle: toggleOpen,
7146
- isOpen
7147
- };
7148
- },
7149
- [open, close, toggleOpen, isOpen]
7150
- );
7147
+ (0, import_react30.useImperativeHandle)(ref, () => {
7148
+ return {
7149
+ open,
7150
+ close,
7151
+ toggle: toggleOpen,
7152
+ isOpen
7153
+ };
7154
+ }, [open, close, toggleOpen, isOpen]);
7151
7155
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.column, { width: "100%", ...props, children: [
7152
7156
  renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
7153
7157
  Div_default.row,