@latte-macchiat-io/latte-vanilla-components 0.0.485 → 0.0.486
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/package.json
CHANGED
|
@@ -20,7 +20,10 @@ import { Paragraph } from '../../Paragraph';
|
|
|
20
20
|
export type ExpandCollapseItemsProps = {
|
|
21
21
|
title: string;
|
|
22
22
|
text: string;
|
|
23
|
-
icon?:
|
|
23
|
+
icon?: {
|
|
24
|
+
path?: string;
|
|
25
|
+
size?: number;
|
|
26
|
+
};
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export const ExpandCollapseItem = ({ title, text, icon }: ExpandCollapseItemsProps): React.ReactElement => {
|
|
@@ -37,9 +40,9 @@ export const ExpandCollapseItem = ({ title, text, icon }: ExpandCollapseItemsPro
|
|
|
37
40
|
className={collapseExpandItemTitle}
|
|
38
41
|
onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && toggleList()}>
|
|
39
42
|
<Icon
|
|
40
|
-
|
|
43
|
+
size={icon?.size || 20}
|
|
41
44
|
className={collapseExpandTitleIcon}
|
|
42
|
-
|
|
45
|
+
iconPath={icon?.path || icons.caret}
|
|
43
46
|
color={themeContract.expandCollapse.item.title.icon.color || themeContract.icon.color}
|
|
44
47
|
/>
|
|
45
48
|
<Heading as="h3" size="sm">
|
|
@@ -8,16 +8,15 @@ import { Heading } from '../Heading';
|
|
|
8
8
|
|
|
9
9
|
export type ExpandCollapseProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
10
10
|
title?: string;
|
|
11
|
-
icon?: string;
|
|
12
11
|
list: ExpandCollapseItemsProps[];
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
export const ExpandCollapse = ({ title,
|
|
14
|
+
export const ExpandCollapse = ({ title, list, className }: ExpandCollapseProps): React.ReactElement => (
|
|
16
15
|
<div className={cn(collapseExpand, className)}>
|
|
17
16
|
{title && <Heading as="h2">{title}</Heading>}
|
|
18
17
|
<div className={collapseExpandList}>
|
|
19
18
|
{list.map((expandCollapseItem, index) => (
|
|
20
|
-
<ExpandCollapseItem {...expandCollapseItem} key={`expandCollapseItem-${index}`}
|
|
19
|
+
<ExpandCollapseItem {...expandCollapseItem} key={`expandCollapseItem-${index}`} />
|
|
21
20
|
))}
|
|
22
21
|
</div>
|
|
23
22
|
</div>
|