import {
typographyDictionary,
typographyVariationsDictionary,
} from '@dictionary/typography'
import { h } from '@stencil/core'
import { useState } from 'react'
import { tagsDictionary, textAnimateDictionary } from '../meta/dictionary'
import { truncateDictionary } from '@dictionary/text'
export default {
title: 'Design / Typography',
argTypes: {
animation: {
control: { type: 'select' },
description: 'Specifies if the text is animated when it is rendered',
options: textAnimateDictionary,
},
tag: {
control: { type: 'select' },
description: 'Specifies the HTML tag of the element',
options: tagsDictionary,
},
text: {
type: { name: 'string' },
description:
'Specifies the text string to the component instead of passing an HTML node',
},
truncate: {
control: { type: 'select' },
description:
'Specifies if the text shoud be truncated or should behave as a normal text',
options: truncateDictionary,
},
typography: {
control: { type: 'select' },
description: 'Specifies the font typography of the element',
options: typographyDictionary,
},
variant: {
control: { type: 'select' },
description: 'Specifies the variant for `typography`',
options: typographyVariationsDictionary,
},
},
}
const Template = args => (
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dictum nec
eros vitae dictum. Nunc lobortis pharetra lectus. Mauris egestas velit et
mattis molestie. Sed risus purus, laoreet a massa in, tincidunt iaculis sem.
Nam congue, ipsum viverra condimentum dignissim, mauris mi lacinia tortor,
eu sodales magna augue a dui.
)
const AnimateTemplate = () => {
const [text, setText] = useState('Choose a song...')
const setValue = (event: Event): void | undefined => {
const selectEl = event.target as HTMLSelectElement
setText(selectEl.value)
}
return (