@popsure/dirty-swan 0.27.15 → 0.27.16
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 +3 -4
- 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 +1 -1
|
@@ -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}`}
|
|
@@ -154,7 +154,7 @@ const ComparisonTable = <T extends { id: number }>(
|
|
|
154
154
|
{headerGroup.label && collapsibleSections ? (
|
|
155
155
|
<AccordionItem
|
|
156
156
|
className="mt8"
|
|
157
|
-
|
|
157
|
+
label={headerGroup.label}
|
|
158
158
|
headerClassName="p24 br8"
|
|
159
159
|
isOpen={selectedSection === String(headerGroup.label)}
|
|
160
160
|
onOpen={() =>
|