diff --git a/packages/core/src/components/accordion/accordion.scss b/packages/core/src/components/accordion/accordion.scss index ab9ce4d54..3857a7f63 100644 --- a/packages/core/src/components/accordion/accordion.scss +++ b/packages/core/src/components/accordion/accordion.scss @@ -17,6 +17,7 @@ .ods-accordion-item { overflow: hidden; + position: relative; &:not(:last-child) { border-bottom: 1px solid helpers.color('border-separator'); @@ -85,15 +86,15 @@ &.-with-separator { position: relative; + } - &::before { - border-bottom: 1px solid helpers.color('border-separator'); - content: ''; - left: var(--padding); - position: absolute; - right: var(--padding); - top: 0; - } + &.-with-separator::before { + border-bottom: 1px solid helpers.color('border-separator'); + content: ''; + left: var(--padding); + position: absolute; + right: var(--padding); + top: 0; } } diff --git a/packages/react/src/components/accordion/accordion.stories.tsx b/packages/react/src/components/accordion/accordion.stories.tsx index 0ff4f40d5..860e47e97 100644 --- a/packages/react/src/components/accordion/accordion.stories.tsx +++ b/packages/react/src/components/accordion/accordion.stories.tsx @@ -1,4 +1,4 @@ -import { Accordion, type AccordionProps } from '@onfido/castor-react'; +import { Accordion, Icon, type AccordionProps } from '@onfido/castor-react'; import React from 'react'; import { Meta, Story } from '../../../../../docs'; @@ -8,13 +8,89 @@ export default { args: { list: [ { - title: 'A title with an icon', - iconName: 'bolt', - content:
Content example.
, + title: <>Long text, + name: '1', + iconName: 'book-open', + content: ( +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Vestibulum non augue facilisis, accumsan magna ut, tempus turpis. + Aenean quis bibendum nulla, ut luctus arcu. Sed et porta ante. + Donec commodo mi sit amet est pharetra, ut sagittis velit rhoncus. + Fusce risus arcu, feugiat a dapibus eget, commodo eleifend dui. + Nunc quam leo, aliquam id nisi a, dictum eleifend orci. Morbi + lacinia felis dolor, sed sagittis nisi hendrerit ut. Phasellus + iaculis rutrum ipsum in sollicitudin. Mauris faucibus commodo + elementum. Nunc in augue sit amet sem elementum congue. Fusce + mollis lorem augue. Aenean quis sem iaculis, tempor nunc ut, + sollicitudin risus. Nulla sem sem, bibendum eu velit vel, semper + placerat risus. +

+

+ Nunc aliquam elit erat, semper egestas nisi volutpat non. Duis sed + ultrices ipsum. Nulla non nisl a magna sodales interdum tempor ut + mi. Quisque ut aliquet sem. Aliquam erat volutpat. In molestie + fermentum mi eu scelerisque. Vestibulum in lacinia quam. +

+

+ Integer sit amet tristique est. Nunc porttitor nunc nec luctus + dignissim. Integer at nisi ipsum. Cras aliquet justo leo, a + condimentum dolor imperdiet quis. Cras viverra erat at ornare + venenatis. Donec in facilisis mauris. Aliquam sit amet maximus + ligula. Proin gravida elit mi, eget maximus mi consequat auctor. + Aliquam erat volutpat. +

+

+ Nunc ultrices ligula sit amet elit placerat, eu rutrum massa + bibendum. Praesent et pulvinar ipsum. Vestibulum justo justo, + auctor sed ligula sit amet, posuere maximus ipsum. Aenean nec arcu + dui. Integer non sagittis nisi. Aenean placerat vehicula lacinia. + Mauris blandit massa dui. Vivamus ut nisl nunc. Suspendisse non + risus non nibh mattis maximus at id enim. Mauris bibendum est + eros, eu consequat tellus finibus eu. Sed euismod nec tellus ac + elementum. Duis non lectus congue, rhoncus mi eget, vestibulum + odio. Morbi iaculis venenatis augue non euismod. +

+

+ Class aptent taciti sociosqu ad litora torquent per conubia + nostra, per inceptos himenaeos. Ut lectus elit, mollis ut lectus + at, tempor bibendum purus. Donec volutpat facilisis mi, id laoreet + purus fermentum a. Proin pharetra tristique magna, non fermentum + odio accumsan in. In neque odio, pretium at lectus nec, pulvinar + eleifend massa. Sed placerat urna at lorem auctor rhoncus. Morbi + metus ligula, ullamcorper ut erat fringilla, congue tempor arcu. + Vestibulum dapibus nec elit et iaculis. +

+
+ ), }, { - title: 'Another title without icon', - content:
Another content example.
, + title: <>List, + iconName: 'list-ul', + name: '2', + content: ( + + ), + }, + { + title: <>Empty, + name: '2', + secondaryContent: