fis-component 0.1.18 → 0.1.20
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/cjs/index.js +37 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Collapse/Collapse.stories.d.ts +1 -0
- package/dist/esm/index.js +37 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Collapse/Collapse.stories.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -65785,7 +65785,11 @@ const DivContainerSC$5 = styled.div `
|
|
|
65785
65785
|
display: flex;
|
|
65786
65786
|
flex-direction: column;
|
|
65787
65787
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
65788
|
-
|
|
65788
|
+
|
|
65789
|
+
/* Keep the default full width while letting consumer utility classes win. */
|
|
65790
|
+
:where(&) {
|
|
65791
|
+
width: 100%;
|
|
65792
|
+
}
|
|
65789
65793
|
`;
|
|
65790
65794
|
const SpanCountSC = styled.span `
|
|
65791
65795
|
${getTheme("Subheading/XS")}
|
|
@@ -66701,7 +66705,11 @@ const DicContainerSC = styled.div `
|
|
|
66701
66705
|
display: flex;
|
|
66702
66706
|
flex-direction: column;
|
|
66703
66707
|
gap: ${getTheme("sem/dimension/gap/xs")};
|
|
66704
|
-
|
|
66708
|
+
|
|
66709
|
+
/* Keep the default full width while letting consumer utility classes win. */
|
|
66710
|
+
:where(&) {
|
|
66711
|
+
width: 100%;
|
|
66712
|
+
}
|
|
66705
66713
|
`;
|
|
66706
66714
|
const DivResizeSC = styled.div `
|
|
66707
66715
|
position: absolute;
|
|
@@ -69859,10 +69867,10 @@ const FISCollapse = ({ className, collapseSize = "sm", expandIconPosition = "sta
|
|
|
69859
69867
|
});
|
|
69860
69868
|
}
|
|
69861
69869
|
};
|
|
69862
|
-
const renderHeader = (item, isActive) => {
|
|
69870
|
+
const renderHeader = (item, isActive, hasContent) => {
|
|
69863
69871
|
const { title, description, badge, leftIcon, customHeader } = item;
|
|
69864
69872
|
const handleClick = (e) => {
|
|
69865
|
-
if (collapsible === "disabled")
|
|
69873
|
+
if (!hasContent || collapsible === "disabled")
|
|
69866
69874
|
return;
|
|
69867
69875
|
e.stopPropagation();
|
|
69868
69876
|
handleToggle(item.key);
|
|
@@ -69870,9 +69878,13 @@ const FISCollapse = ({ className, collapseSize = "sm", expandIconPosition = "sta
|
|
|
69870
69878
|
const iconComponent = (jsxRuntime.jsx(DivIconWrapperSC, { "$collapseSize": collapseSize, className: isActive ? "open" : "", onClick: collapsible === "icon" ? handleClick : undefined, style: {
|
|
69871
69879
|
cursor: collapsible === "disabled" ? "not-allowed" : "pointer",
|
|
69872
69880
|
}, children: jsxRuntime.jsx(CaretIcon, {}) }));
|
|
69873
|
-
return (jsxRuntime.jsx("div", { onClick: collapsible === "header" ? handleClick : undefined, style: {
|
|
69874
|
-
cursor:
|
|
69875
|
-
|
|
69881
|
+
return (jsxRuntime.jsx("div", { onClick: hasContent && collapsible === "header" ? handleClick : undefined, style: {
|
|
69882
|
+
cursor: hasContent
|
|
69883
|
+
? collapsible === "disabled"
|
|
69884
|
+
? "not-allowed"
|
|
69885
|
+
: "pointer"
|
|
69886
|
+
: "default",
|
|
69887
|
+
}, children: customHeader ? (jsxRuntime.jsxs(DivCustomHeaderSC, { "$collapseSize": collapseSize, children: [hasContent && expandIconPosition === "start" && iconComponent, jsxRuntime.jsx(DivCustomSC, { children: customHeader }), hasContent && expandIconPosition === "end" && iconComponent] })) : (jsxRuntime.jsxs(DivHeaderSC, { "$collapseSize": collapseSize, children: [jsxRuntime.jsxs(DivLeftSC, { "$collapseSize": collapseSize, children: [hasContent && expandIconPosition === "start" && iconComponent, leftIcon && (jsxRuntime.jsx(DivLeftIconSC, { "$collapseSize": collapseSize, children: leftIcon })), jsxRuntime.jsxs(DivContentSC, { children: [jsxRuntime.jsx(PTitleSC, { "$collapseSize": collapseSize, children: title }), description && (jsxRuntime.jsx(SpanDescriptionSC, { children: description }))] })] }), badge && (jsxRuntime.jsx(FISBadge, { size: badgeSize, label: badge, color: "neutral-light", disabled: collapsible === "disabled" })), hasContent && expandIconPosition === "end" && iconComponent] })) }));
|
|
69876
69888
|
};
|
|
69877
69889
|
return (jsxRuntime.jsx(DivContainerSC$3, { className: className, children: jsxRuntime.jsx(StyledCollapse, { ...rest, "$collapseSize": collapseSize, ghost: true, bordered: false, activeKey: activeKeys, expandIcon: () => null, expandIconPosition: expandIconPosition, collapsible: collapsible, onChange: (keys) => {
|
|
69878
69890
|
if (collapsible === "disabled")
|
|
@@ -69885,8 +69897,9 @@ const FISCollapse = ({ className, collapseSize = "sm", expandIconPosition = "sta
|
|
|
69885
69897
|
setActiveKeys(Array.isArray(keys) ? keys : [keys]);
|
|
69886
69898
|
}
|
|
69887
69899
|
}, children: items.map((item) => {
|
|
69888
|
-
const
|
|
69889
|
-
|
|
69900
|
+
const hasContent = React.Children.count(item.children) > 0;
|
|
69901
|
+
const isActive = hasContent && isActiveKey(item.key);
|
|
69902
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(Collapse$1.Panel, { header: renderHeader(item, isActive, hasContent), showArrow: false, collapsible: hasContent ? collapsible : "icon", children: jsxRuntime.jsx(DivBodySC, { "$collapseSize": collapseSize, children: item.children }) }, item.key), jsxRuntime.jsx(FISDivider, {})] }, item.key));
|
|
69890
69903
|
}) }) }));
|
|
69891
69904
|
};
|
|
69892
69905
|
|
|
@@ -71973,7 +71986,11 @@ const DivTagSC = styled.div `
|
|
|
71973
71986
|
visibility: ${(props) => (props.$isVisible ? "visible" : "hidden")};
|
|
71974
71987
|
`;
|
|
71975
71988
|
const DivWrapperSC$3 = styled.div `
|
|
71976
|
-
width
|
|
71989
|
+
/* Keep the default full width while letting consumer utility classes win. */
|
|
71990
|
+
:where(&) {
|
|
71991
|
+
width: 100%;
|
|
71992
|
+
}
|
|
71993
|
+
|
|
71977
71994
|
display: flex;
|
|
71978
71995
|
flex-direction: column;
|
|
71979
71996
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
@@ -72927,7 +72944,11 @@ const DivContainerSC$2 = styled.div `
|
|
|
72927
72944
|
display: flex;
|
|
72928
72945
|
flex-direction: column;
|
|
72929
72946
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
72930
|
-
|
|
72947
|
+
|
|
72948
|
+
/* Keep the default full width while letting consumer utility classes win. */
|
|
72949
|
+
:where(&) {
|
|
72950
|
+
width: 100%;
|
|
72951
|
+
}
|
|
72931
72952
|
`;
|
|
72932
72953
|
const DivHintWrapperSC = styled.div `
|
|
72933
72954
|
display: flex;
|
|
@@ -75511,7 +75532,11 @@ const FISSelectItem = React.forwardRef((props, ref) => {
|
|
|
75511
75532
|
FISSelectItem.displayName = "FISSelectItem";
|
|
75512
75533
|
|
|
75513
75534
|
const DivWrapperSC = styled.div `
|
|
75514
|
-
width
|
|
75535
|
+
/* Keep the default full width while letting consumer utility classes win. */
|
|
75536
|
+
:where(&) {
|
|
75537
|
+
width: 100%;
|
|
75538
|
+
}
|
|
75539
|
+
|
|
75515
75540
|
display: flex;
|
|
75516
75541
|
flex-direction: column;
|
|
75517
75542
|
gap: ${getTheme("com/input/vertical-gap")};
|