react-better-html 1.1.220 → 1.1.221
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 +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +19 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1225,6 +1225,12 @@ function useUrlQuery() {
|
|
|
1225
1225
|
);
|
|
1226
1226
|
}
|
|
1227
1227
|
const reactRouterDomPluginConfig = reactRouterDomPlugin2.getConfig();
|
|
1228
|
+
const isInRouterContext = reactRouterDomPluginConfig.useInRouterContext();
|
|
1229
|
+
if (!isInRouterContext) {
|
|
1230
|
+
throw new Error(
|
|
1231
|
+
"`useUrlQuery` hook must be used inside a React Router context. Make sure your component is wrapped in a `<BrowserRouter>`, or another Router component."
|
|
1232
|
+
);
|
|
1233
|
+
}
|
|
1228
1234
|
const navigate = reactRouterDomPluginConfig.useNavigate();
|
|
1229
1235
|
const [searchParams] = reactRouterDomPluginConfig.useSearchParams();
|
|
1230
1236
|
const createSearchParams2 = reactRouterDomPluginConfig.createSearchParams;
|
|
@@ -1700,20 +1706,22 @@ DivComponent.box = forwardRef6(function Box({
|
|
|
1700
1706
|
rightElement,
|
|
1701
1707
|
lightMode,
|
|
1702
1708
|
headerBackgroundColor,
|
|
1709
|
+
activeColor,
|
|
1703
1710
|
isActive,
|
|
1704
1711
|
children,
|
|
1705
1712
|
...props
|
|
1706
1713
|
}, ref) {
|
|
1707
1714
|
const theme2 = useTheme7();
|
|
1708
1715
|
const withClick = props.onClick || props.onClickWithValue;
|
|
1716
|
+
const readyActiveColor = activeColor ?? theme2.colors.primary;
|
|
1709
1717
|
return /* @__PURE__ */ jsxs3(
|
|
1710
1718
|
DivComponent,
|
|
1711
1719
|
{
|
|
1712
1720
|
color: isActive ? theme2.colors.base : void 0,
|
|
1713
|
-
backgroundColor: isActive ?
|
|
1714
|
-
border: `1px solid ${isActive ?
|
|
1721
|
+
backgroundColor: isActive ? readyActiveColor : theme2.colors.backgroundContent,
|
|
1722
|
+
border: `1px solid ${isActive ? readyActiveColor : theme2.colors.border}`,
|
|
1715
1723
|
borderRadius: theme2.styles.borderRadius,
|
|
1716
|
-
borderColorHover: withClick && !isActive ?
|
|
1724
|
+
borderColorHover: withClick && !isActive ? readyActiveColor : void 0,
|
|
1717
1725
|
filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
|
|
1718
1726
|
cursor: withClick ? "pointer" : void 0,
|
|
1719
1727
|
paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
|
|
@@ -7097,18 +7105,14 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
7097
7105
|
observer.disconnect();
|
|
7098
7106
|
};
|
|
7099
7107
|
}, [isOpen]);
|
|
7100
|
-
useImperativeHandle5(
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
};
|
|
7109
|
-
},
|
|
7110
|
-
[open, close, toggleOpen, isOpen]
|
|
7111
|
-
);
|
|
7108
|
+
useImperativeHandle5(ref, () => {
|
|
7109
|
+
return {
|
|
7110
|
+
open,
|
|
7111
|
+
close,
|
|
7112
|
+
toggle: toggleOpen,
|
|
7113
|
+
isOpen
|
|
7114
|
+
};
|
|
7115
|
+
}, [open, close, toggleOpen, isOpen]);
|
|
7112
7116
|
return /* @__PURE__ */ jsxs22(Div_default.column, { width: "100%", ...props, children: [
|
|
7113
7117
|
renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ jsxs22(
|
|
7114
7118
|
Div_default.row,
|