@designbasekorea/figma-ui 0.1.78 → 0.1.79
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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +2 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -103,7 +103,6 @@ FigmaHeader.displayName = 'FigmaHeader';
|
|
|
103
103
|
|
|
104
104
|
const FigmaSection = ({ title, dataCategory, iconButton, children, marginBottom, isEnabled = true, onToggle, className, enableScrollNavigation = false, headerHeight = 94, onActiveSectionChange, t, collapsible = false, defaultCollapsed = false, onCollapseChange }) => {
|
|
105
105
|
const sectionRef = useRef(null);
|
|
106
|
-
const contentRef = useRef(null);
|
|
107
106
|
const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);
|
|
108
107
|
const sectionStyle = marginBottom ? { marginBottom: `${marginBottom}px` } : {};
|
|
109
108
|
const classes = [
|
|
@@ -124,16 +123,6 @@ const FigmaSection = ({ title, dataCategory, iconButton, children, marginBottom,
|
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
|
-
React.useEffect(() => {
|
|
128
|
-
if (collapsible && contentRef.current) {
|
|
129
|
-
if (!isCollapsed) {
|
|
130
|
-
contentRef.current.style.maxHeight = `${contentRef.current.scrollHeight}px`;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
contentRef.current.style.maxHeight = '0px';
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}, [isCollapsed, collapsible]);
|
|
137
126
|
useEffect(() => {
|
|
138
127
|
if (!enableScrollNavigation || !onActiveSectionChange || !sectionRef.current)
|
|
139
128
|
return;
|
|
@@ -162,7 +151,8 @@ const FigmaSection = ({ title, dataCategory, iconButton, children, marginBottom,
|
|
|
162
151
|
collapsible && (React.createElement("span", { className: `designbase-figma-section__collapse-icon ${isCollapsed ? 'designbase-figma-section__collapse-icon--collapsed' : ''}` },
|
|
163
152
|
React.createElement(ChevronDownIcon, { size: 16 }))),
|
|
164
153
|
onToggle && (React.createElement(Toggle, { checked: isEnabled, onChange: () => onToggle(dataCategory), size: "s" }))))),
|
|
165
|
-
React.createElement("div", {
|
|
154
|
+
React.createElement("div", { className: `designbase-figma-section__content ${!isEnabled ? 'designbase-figma-section__content--hidden' : ''} ${isCollapsed && collapsible ? 'designbase-figma-section__content--collapsed' : ''}` },
|
|
155
|
+
React.createElement("div", { className: "designbase-figma-section__content-inner" }, children))));
|
|
166
156
|
};
|
|
167
157
|
FigmaSection.displayName = 'FigmaSection';
|
|
168
158
|
const scrollToSection = (category, headerHeight = 94) => {
|