@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.
@@ -1,11 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const AccordionItem: ({ children, className, headerClassName, iconSrc, isOpen, onOpen, onClose, title, }: {
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
- title: string;
9
+ label: React.ReactNode;
11
10
  }) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.27.15",
3
+ "version": "0.27.16",
4
4
  "author": "Vincent Audoire <vincent@getpopsure.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -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
- title,
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
- title: string;
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
- {!!iconSrc && <img src={iconSrc} alt={`${title} icon`} />}
60
- <h4 className="p-h4">{title}</h4>
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
- title={String(headerGroup.label)}
157
+ label={headerGroup.label}
158
158
  headerClassName="p24 br8"
159
159
  isOpen={selectedSection === String(headerGroup.label)}
160
160
  onOpen={() =>