diff --git a/components/molecule/accordion/demo/articles/ArticleLabelWrap.js b/components/molecule/accordion/demo/articles/ArticleLabelWrap.js new file mode 100644 index 0000000000..0ca4a4ba66 --- /dev/null +++ b/components/molecule/accordion/demo/articles/ArticleLabelWrap.js @@ -0,0 +1,92 @@ +import {useState} from 'react' + +import PropTypes from 'prop-types' + +import { + Article, + Cell, + Code, + Grid, + H2, + Label, + Paragraph, + RadioButton, + RadioButtonGroup +} from '@s-ui/documentation-library' + +import Accordion, { + moleculeAccordionHeaderLabelWraps, + MoleculeAccordionItem as AccordionItem +} from '../../src/index.js' +import LoremIpsum from '../LoremIpsum.js' + +const ArticleLabelWrap = ({className}) => { + const [currentLabelWrap, setCurrentLabelWrap] = useState() + + return ( +
+

Label wrap

+ + You can customize your header title label wrap style under the{' '} + headerLabelWraps prop. + + + + + setCurrentLabelWrap(value)} + > + {[ + undefined, + ...Object.values(moleculeAccordionHeaderLabelWraps) + ].map(labelWrap => ( + + ))} + + +
+ + +

Accordion Item Content 1

+

+ +

+ + } + /> + +

Accordion Item Content 2

+

+ +

+ + } + /> +
+
+
+
+ ) +} + +ArticleLabelWrap.displayName = 'ArticleLabelWrap' + +ArticleLabelWrap.propTypes = { + className: PropTypes.string +} + +export default ArticleLabelWrap diff --git a/components/molecule/accordion/demo/index.js b/components/molecule/accordion/demo/index.js index 2d77baab26..d576c9d7c0 100644 --- a/components/molecule/accordion/demo/index.js +++ b/components/molecule/accordion/demo/index.js @@ -6,6 +6,7 @@ import ArticleDefault from './articles/ArticleDefault.js' import ArticleDisabled from './articles/ArticleDisabled.js' import ArticleHeight from './articles/ArticleHeight.js' import ArticleIcon from './articles/ArticleIcon.js' +import ArticleLabelWrap from './articles/ArticleLabelWrap.js' import ArticleSpacing from './articles/ArticleSpacing.js' import ArticleTransition from './articles/ArticleTransition.js' import {CLASS_SECTION} from './settings.js' @@ -37,6 +38,8 @@ const Demo = () => {
+
+ ) } diff --git a/components/molecule/accordion/src/styles/index.scss b/components/molecule/accordion/src/styles/index.scss index d727f3afce..c34119c4ab 100644 --- a/components/molecule/accordion/src/styles/index.scss +++ b/components/molecule/accordion/src/styles/index.scss @@ -109,6 +109,7 @@ $base-class-item-panel: '#{$base-class-item}Panel'; text-align: inherit; &--wrap { white-space: wrap; + text-wrap: balance; } &--noWrap { text-overflow: ellipsis;