Skip to content

Commit 5923d6f

Browse files
committed
chore: Bump package version to 1.0.178 and update Accordion component
1 parent dd4c84a commit 5923d6f

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@programmer_network/yail",
3-
"version": "1.0.177",
3+
"version": "1.0.178",
44
"description": "Programmer Network's official UI library for React",
55
"author": "Aleksandar Grbic - (https://programmer.network)",
66
"publishConfig": {

src/Components/Accordion/Accordion.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const meta = {
1818

1919
export default meta;
2020

21-
const dummySections = Array(2)
21+
const dummySections = Array(5)
2222
.fill(0)
2323
.map((_, index) => ({
2424
id: index,

src/Components/Accordion/Accordion.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe("Accordion component", () => {
6868
/>
6969
);
7070

71-
fireEvent.click(screen.getByText("Section 1"));
71+
fireEvent.click(screen.getByTestId("icon-expand-less"));
7272
expect(setExpanded).toHaveBeenCalledWith([]);
7373
});
7474

src/Components/Accordion/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ const Accordion: FC<IAccordionProps> = ({
103103
sectionTitleClassName,
104104
{ "yl-bg-primary-text-color/5": expanded.includes(section.id) }
105105
)}
106-
onClick={() => toggleExpand(section.id)}
107106
onKeyDown={e =>
108107
["Enter", " "].includes(e.key) && toggleExpand(section.id)
109108
}
@@ -118,9 +117,15 @@ const Accordion: FC<IAccordionProps> = ({
118117
)}
119118
<div className='yl-flex yl-flex-col yl-gap-1 yl-overflow-hidden yl-text-ellipsis yl-whitespace-nowrap yl-text-base'>
120119
{expanded.includes(section.id) ? (
121-
<IconExpandLess className='yl-absolute yl-right-2 yl-w-6 yl-cursor-pointer yl-fill-primary-text-color hover:yl-fill-primary' />
120+
<IconExpandLess
121+
onClick={() => toggleExpand(section.id)}
122+
className='yl-absolute yl-right-2 yl-w-6 yl-cursor-pointer yl-fill-primary-text-color hover:yl-fill-primary'
123+
/>
122124
) : (
123-
<IconExpandMore className='yl-absolute yl-right-2 yl-w-6 yl-cursor-pointer yl-fill-primary-text-color hover:yl-fill-primary' />
125+
<IconExpandMore
126+
onClick={() => toggleExpand(section.id)}
127+
className='yl-absolute yl-right-2 yl-w-6 yl-cursor-pointer yl-fill-primary-text-color hover:yl-fill-primary'
128+
/>
124129
)}
125130
{section.title}
126131
{section.description && (

0 commit comments

Comments
 (0)