@popsure/dirty-swan 0.27.15 → 0.27.17
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.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/components/comparisonTable/components/AccordionItem/AccordionItem.d.ts +2 -3
- package/package.json +1 -1
- package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx +7 -6
- package/src/lib/components/comparisonTable/index.tsx +6 -6
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const AccordionItem: ({ children, className, headerClassName,
|
|
2
|
+
export declare const AccordionItem: ({ children, className, headerClassName, isOpen, onOpen, onClose, label, }: {
|
|
3
3
|
children: React.ReactNode | string;
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
headerClassName?: string | undefined;
|
|
6
|
-
iconSrc?: string | undefined;
|
|
7
6
|
isOpen: boolean;
|
|
8
7
|
onOpen: () => void;
|
|
9
8
|
onClose: () => void;
|
|
10
|
-
|
|
9
|
+
label: React.ReactNode;
|
|
11
10
|
}) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -25,20 +25,18 @@ export const AccordionItem = ({
|
|
|
25
25
|
children,
|
|
26
26
|
className = '',
|
|
27
27
|
headerClassName = '',
|
|
28
|
-
iconSrc = '',
|
|
29
28
|
isOpen,
|
|
30
29
|
onOpen,
|
|
31
30
|
onClose,
|
|
32
|
-
|
|
31
|
+
label,
|
|
33
32
|
}: {
|
|
34
33
|
children: React.ReactNode | string;
|
|
35
34
|
className?: string;
|
|
36
35
|
headerClassName?: string;
|
|
37
|
-
iconSrc?: string;
|
|
38
36
|
isOpen: boolean;
|
|
39
37
|
onOpen: () => void;
|
|
40
38
|
onClose: () => void;
|
|
41
|
-
|
|
39
|
+
label: React.ReactNode;
|
|
42
40
|
}) => {
|
|
43
41
|
const handleClick = () => {
|
|
44
42
|
if (!isOpen) {
|
|
@@ -56,8 +54,11 @@ export const AccordionItem = ({
|
|
|
56
54
|
type="button"
|
|
57
55
|
>
|
|
58
56
|
<div className={`d-flex ai-center ${styles.iconAndTextContainer}`}>
|
|
59
|
-
{
|
|
60
|
-
|
|
57
|
+
{typeof label === 'string' ? (
|
|
58
|
+
<h4 className="p-h4">{label}</h4>
|
|
59
|
+
) : (
|
|
60
|
+
<>{label}</>
|
|
61
|
+
)}
|
|
61
62
|
</div>
|
|
62
63
|
<ChevronSVG
|
|
63
64
|
className={`${styles.chevron} ${!isOpen && styles.chevronClosed}`}
|
|
@@ -149,19 +149,19 @@ const ComparisonTable = <T extends { id: number }>(
|
|
|
149
149
|
);
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
+
const idString = `headerGroup-${headerGroup.id}`;
|
|
153
|
+
|
|
152
154
|
return (
|
|
153
155
|
<>
|
|
154
156
|
{headerGroup.label && collapsibleSections ? (
|
|
155
157
|
<AccordionItem
|
|
156
158
|
className="mt8"
|
|
157
|
-
|
|
159
|
+
label={headerGroup.label}
|
|
158
160
|
headerClassName="p24 br8"
|
|
159
|
-
isOpen={selectedSection ===
|
|
160
|
-
onOpen={() =>
|
|
161
|
-
setSelectedSection(String(headerGroup.label))
|
|
162
|
-
}
|
|
161
|
+
isOpen={selectedSection === idString}
|
|
162
|
+
onOpen={() => setSelectedSection(idString)}
|
|
163
163
|
onClose={() => setSelectedSection('')}
|
|
164
|
-
key={
|
|
164
|
+
key={idString}
|
|
165
165
|
>
|
|
166
166
|
<ScrollSyncPane>
|
|
167
167
|
<div
|