react-better-html 1.1.81 → 1.1.82
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 +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -649,6 +649,7 @@ type TabsContentProps = {
|
|
|
649
649
|
tab: string;
|
|
650
650
|
tabWithDot?: boolean;
|
|
651
651
|
tabsGroupName?: string;
|
|
652
|
+
isInitialTab?: boolean;
|
|
652
653
|
children?: React.ReactNode;
|
|
653
654
|
};
|
|
654
655
|
declare const Tabs: typeof TabsComponent & {
|
|
@@ -662,6 +663,7 @@ type FoldableProps = {
|
|
|
662
663
|
description?: string;
|
|
663
664
|
icon?: IconName | AnyOtherString;
|
|
664
665
|
image?: AssetName | AnyOtherString;
|
|
666
|
+
headerPaddingBlock?: React.CSSProperties["paddingBlock"];
|
|
665
667
|
headerPaddingInline?: React.CSSProperties["paddingInline"];
|
|
666
668
|
renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
|
|
667
669
|
onOpenChange?: (isOpen: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -649,6 +649,7 @@ type TabsContentProps = {
|
|
|
649
649
|
tab: string;
|
|
650
650
|
tabWithDot?: boolean;
|
|
651
651
|
tabsGroupName?: string;
|
|
652
|
+
isInitialTab?: boolean;
|
|
652
653
|
children?: React.ReactNode;
|
|
653
654
|
};
|
|
654
655
|
declare const Tabs: typeof TabsComponent & {
|
|
@@ -662,6 +663,7 @@ type FoldableProps = {
|
|
|
662
663
|
description?: string;
|
|
663
664
|
icon?: IconName | AnyOtherString;
|
|
664
665
|
image?: AssetName | AnyOtherString;
|
|
666
|
+
headerPaddingBlock?: React.CSSProperties["paddingBlock"];
|
|
665
667
|
headerPaddingInline?: React.CSSProperties["paddingInline"];
|
|
666
668
|
renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
|
|
667
669
|
onOpenChange?: (isOpen: boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -6753,7 +6753,7 @@ var TabsComponent = function Tabs({
|
|
|
6753
6753
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Div_default, { width: "100%", children })
|
|
6754
6754
|
] });
|
|
6755
6755
|
};
|
|
6756
|
-
TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, children }) {
|
|
6756
|
+
TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isInitialTab, children }) {
|
|
6757
6757
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
6758
6758
|
const thisTabGroupData = (0, import_react24.useMemo)(
|
|
6759
6759
|
() => componentsState.tabs.tabGroups.find((item) => item.name === (tabsGroupName ?? defaultTabName)),
|
|
@@ -6768,7 +6768,7 @@ TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, child
|
|
|
6768
6768
|
);
|
|
6769
6769
|
}
|
|
6770
6770
|
}, [tabWithDot]);
|
|
6771
|
-
return thisTabGroupData
|
|
6771
|
+
return (thisTabGroupData ? thisTabGroupData.selectedTab === tab : isInitialTab) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Div_default, { width: "100%", children }) : void 0;
|
|
6772
6772
|
};
|
|
6773
6773
|
var Tabs2 = (0, import_react24.memo)(TabsComponent);
|
|
6774
6774
|
Tabs2.content = TabsComponent.content;
|
|
@@ -6786,6 +6786,7 @@ var FoldableComponent = (0, import_react25.forwardRef)(function Foldable({
|
|
|
6786
6786
|
description,
|
|
6787
6787
|
icon,
|
|
6788
6788
|
image,
|
|
6789
|
+
headerPaddingBlock,
|
|
6789
6790
|
headerPaddingInline,
|
|
6790
6791
|
renderHeader,
|
|
6791
6792
|
onOpenChange,
|
|
@@ -6832,7 +6833,7 @@ var FoldableComponent = (0, import_react25.forwardRef)(function Foldable({
|
|
|
6832
6833
|
width: "100%",
|
|
6833
6834
|
alignItems: "center",
|
|
6834
6835
|
gap: theme2.styles.gap,
|
|
6835
|
-
paddingBlock: theme2.styles.gap,
|
|
6836
|
+
paddingBlock: headerPaddingBlock ?? theme2.styles.gap,
|
|
6836
6837
|
paddingInline: headerPaddingInline,
|
|
6837
6838
|
cursor: "pointer",
|
|
6838
6839
|
onClick: toggleOpen,
|
|
@@ -6842,7 +6843,7 @@ var FoldableComponent = (0, import_react25.forwardRef)(function Foldable({
|
|
|
6842
6843
|
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
|
|
6843
6844
|
image && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Image_default.profileImage, { name: image, size: 24, flexShrink: 0 }),
|
|
6844
6845
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
6845
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { as: "h3", fontWeight: 700, children: title }),
|
|
6846
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { as: "h3", fontWeight: 700, lineHeight: "20px", children: title }),
|
|
6846
6847
|
description && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
|
|
6847
6848
|
] })
|
|
6848
6849
|
] }),
|
|
@@ -6880,6 +6881,7 @@ FoldableComponent.box = (0, import_react25.forwardRef)(function Box3({ ...props
|
|
|
6880
6881
|
backgroundColor: theme2.colors.backgroundContent,
|
|
6881
6882
|
border: `1px solid ${theme2.colors.border}`,
|
|
6882
6883
|
borderRadius: theme2.styles.borderRadius,
|
|
6884
|
+
headerPaddingBlock: (theme2.styles.gap + theme2.styles.space) / 2,
|
|
6883
6885
|
headerPaddingInline: theme2.styles.space,
|
|
6884
6886
|
...props,
|
|
6885
6887
|
ref
|