-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[86bye3tve][accordion] added use prop (#1474)
## Motivation and Context For a long time our design has both compact and non compact accordions. Alongside react component were not supporting non compact accordion without hacks. This PR adds simple `compact` prop that is `true` by default for backward capability. ## How has this been tested? Manually and with VR. ## Screenshots (if appropriate): <img width="748" alt="Screenshot 2024-06-27 at 17 43 14" src="https://github.com/semrush/intergalactic/assets/31261408/96cb7a4e-71ad-4013-a053-721261f3cf5a"> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue). - [x] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). - [ ] Nice improve. ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code follows the code style of this project. - [x] I have updated the documentation accordingly or it's not required. - [x] Unit tests are not broken. - [x] I have added changelog note to corresponding `CHANGELOG.md` file with planned publish date. - [x] I have added new unit tests on added of fixed functionality. --------- Co-authored-by: Julia Mnizhek <[email protected]>
- Loading branch information
Showing
45 changed files
with
126 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+7.5 KB
...tests__/__image_snapshots__/accordion-should-compact-false-render-correctly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.04 KB
(120%)
...e/accordion/__tests__/__image_snapshots__/accordion-should-render-correctly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.73 KB
...__tests__/__image_snapshots__/accordion-should-render-primary-use-correctly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-279 Bytes
(98%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+138 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-794 Bytes
(93%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-287 Bytes
(97%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+142 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-2-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-765 Bytes
(93%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-2-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-49 Bytes
(100%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+137 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-3-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-816 Bytes
(92%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-3-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-41 Bytes
(100%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+141 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-4-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-812 Bytes
(93%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-4-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-55 Bytes
(100%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-5-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+147 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-5-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-777 Bytes
(94%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-5-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-55 Bytes
(100%)
...browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-6-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+147 Bytes
(100%)
....browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-6-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-763 Bytes
(95%)
...n.browser-test.tsx-snapshots/Accordion-Handles-with-keyboard-6-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-615 Bytes
(94%)
...apshots/Accordion-Handles-with-keyboard-and-custom-trigger-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-779 Bytes
(97%)
...napshots/Accordion-Handles-with-keyboard-and-custom-trigger-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-519 Bytes
(95%)
...snapshots/Accordion-Handles-with-keyboard-and-custom-trigger-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-32 Bytes
(100%)
...on.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+151 Bytes
(100%)
...ion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-1-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-818 Bytes
(93%)
...dion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-1-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-49 Bytes
(100%)
...on.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-2-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+145 Bytes
(100%)
...ion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-2-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-804 Bytes
(92%)
...dion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-2-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-12 Bytes
(100%)
...on.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-3-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+151 Bytes
(100%)
...ion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-3-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-818 Bytes
(93%)
...dion.browser-test.tsx-snapshots/Accordion-Handles-with-mouse-3-webkit-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
26 changes: 0 additions & 26 deletions
26
website/docs/components/accordion/examples/custom_trigger.tsx
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
website/docs/components/accordion/examples/non_compact.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import Accordion from 'intergalactic/accordion'; | ||
import { Text } from 'intergalactic/typography'; | ||
import { Flex, Box } from 'intergalactic/flex-box'; | ||
|
||
const Demo = () => { | ||
return ( | ||
<Accordion use='primary'> | ||
{[...new Array(3)].map((_, index) => ( | ||
<Accordion.Item value={index} key={index} disabled={index === 2}> | ||
<Accordion.Item.Toggle pb={2}> | ||
<Flex alignItems='center'> | ||
<Accordion.Item.Chevron mr={2} /> | ||
<Text size={300} my={0}>{`Section ${index + 1}`}</Text> | ||
</Flex> | ||
</Accordion.Item.Toggle> | ||
<Accordion.Item.Collapse> | ||
<Box p='12px 24px 24px'>{`Hello Section ${index + 1}`}</Box> | ||
</Accordion.Item.Collapse> | ||
</Accordion.Item> | ||
))} | ||
</Accordion> | ||
); | ||
}; | ||
|
||
export default Demo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters