react-better-html 1.1.271 → 1.1.273
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +27 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -520,6 +520,8 @@ type TabsProps = {
|
|
|
520
520
|
style?: "default" | "borderRadiusTop" | "box";
|
|
521
521
|
gap?: number;
|
|
522
522
|
noBottomLine?: boolean;
|
|
523
|
+
/** @default true */
|
|
524
|
+
keepUrlHistory?: boolean;
|
|
523
525
|
onChange?: (tab: Tab["id"]) => void;
|
|
524
526
|
children?: React.ReactNode;
|
|
525
527
|
} & ComponentMarginProps;
|
package/dist/index.d.ts
CHANGED
|
@@ -520,6 +520,8 @@ type TabsProps = {
|
|
|
520
520
|
style?: "default" | "borderRadiusTop" | "box";
|
|
521
521
|
gap?: number;
|
|
522
522
|
noBottomLine?: boolean;
|
|
523
|
+
/** @default true */
|
|
524
|
+
keepUrlHistory?: boolean;
|
|
523
525
|
onChange?: (tab: Tab["id"]) => void;
|
|
524
526
|
children?: React.ReactNode;
|
|
525
527
|
} & ComponentMarginProps;
|
package/dist/index.js
CHANGED
|
@@ -1606,7 +1606,11 @@ var IconElement = import_styled_components3.default.svg.withConfig({
|
|
|
1606
1606
|
var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...props }, ref) {
|
|
1607
1607
|
const theme2 = (0, import_react_better_core5.useTheme)();
|
|
1608
1608
|
const { icons: icons2 } = (0, import_react_better_core5.useBetterCoreContext)();
|
|
1609
|
-
const {
|
|
1609
|
+
const {
|
|
1610
|
+
style: { fill, stroke, strokeColor, ...restStyle },
|
|
1611
|
+
hoverStyle,
|
|
1612
|
+
restProps
|
|
1613
|
+
} = useComponentPropsGrouper(props);
|
|
1610
1614
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
1611
1615
|
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
1612
1616
|
const svgColor = props.color ?? theme2.colors.textPrimary;
|
|
@@ -1627,7 +1631,7 @@ var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...pr
|
|
|
1627
1631
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1628
1632
|
theme: theme2,
|
|
1629
1633
|
hoverColor: svgHoverColorColor,
|
|
1630
|
-
style,
|
|
1634
|
+
style: restStyle,
|
|
1631
1635
|
hoverStyle,
|
|
1632
1636
|
...restProps,
|
|
1633
1637
|
...dataProps,
|
|
@@ -1638,8 +1642,8 @@ var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...pr
|
|
|
1638
1642
|
{
|
|
1639
1643
|
...path,
|
|
1640
1644
|
className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
|
|
1641
|
-
fill: path.type === "fill" ? svgColor : void 0,
|
|
1642
|
-
stroke: path.type === "stroke" ? svgColor : void 0,
|
|
1645
|
+
fill: path.type === "fill" ? fill ?? svgColor : void 0,
|
|
1646
|
+
stroke: path.type === "stroke" ? strokeColor ?? stroke ?? svgColor : void 0,
|
|
1643
1647
|
key: path.d
|
|
1644
1648
|
}
|
|
1645
1649
|
))
|
|
@@ -7514,12 +7518,22 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
7514
7518
|
var tabBottomLineWidth = 2;
|
|
7515
7519
|
var tabDotSize = 6;
|
|
7516
7520
|
var defaultTabName = "tab";
|
|
7517
|
-
var TabsComponent = (0, import_react29.forwardRef)(function Tabs({
|
|
7521
|
+
var TabsComponent = (0, import_react29.forwardRef)(function Tabs({
|
|
7522
|
+
tabs,
|
|
7523
|
+
name,
|
|
7524
|
+
accentColor,
|
|
7525
|
+
style = "default",
|
|
7526
|
+
gap,
|
|
7527
|
+
noBottomLine,
|
|
7528
|
+
keepUrlHistory = true,
|
|
7529
|
+
onChange,
|
|
7530
|
+
children,
|
|
7531
|
+
...props
|
|
7532
|
+
}, ref) {
|
|
7518
7533
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
7519
7534
|
const theme2 = (0, import_react_better_core27.useTheme)();
|
|
7520
7535
|
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
7521
7536
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
7522
|
-
const { colorTheme } = (0, import_react_better_core27.useBetterCoreContext)();
|
|
7523
7537
|
const firstRenderPassedRef = (0, import_react29.useRef)(false);
|
|
7524
7538
|
const tabsRef = (0, import_react29.useRef)({});
|
|
7525
7539
|
const tabsGap = gap ?? (style === "box" ? theme2.styles.gap / 2 : 0);
|
|
@@ -7540,12 +7554,15 @@ var TabsComponent = (0, import_react29.forwardRef)(function Tabs({ tabs, name, a
|
|
|
7540
7554
|
setSelectedTabId(tabId);
|
|
7541
7555
|
onChange?.(tabId);
|
|
7542
7556
|
if (urlQuery) {
|
|
7543
|
-
urlQuery.setQuery(
|
|
7544
|
-
|
|
7545
|
-
|
|
7557
|
+
urlQuery.setQuery(
|
|
7558
|
+
{
|
|
7559
|
+
[name ?? defaultTabName]: tabId
|
|
7560
|
+
},
|
|
7561
|
+
keepUrlHistory
|
|
7562
|
+
);
|
|
7546
7563
|
}
|
|
7547
7564
|
},
|
|
7548
|
-
[onChange, name, urlQuery]
|
|
7565
|
+
[onChange, name, urlQuery, keepUrlHistory]
|
|
7549
7566
|
);
|
|
7550
7567
|
const width = (0, import_react29.useMemo)(
|
|
7551
7568
|
() => tabsRef.current[selectedTabId]?.getBoundingClientRect().width ?? 0,
|