feat(select) : tags SelectCheckbox radius 20px + couleur de texte par option (MUI-49)

- Radius des tags et du badge +N porté à 20px
- Champ textColor optionnel par option (couleur du texte du tag, ignorée en disabled)
- Tests, COMPONENTS.md et CHANGELOG.md mis à jour

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 13:33:29 +02:00
parent da3239ce44
commit 14ca23e2f2
5 changed files with 39 additions and 11 deletions
@@ -7,6 +7,7 @@ type Option = {
label: string
value: string | number
color?: string
textColor?: string
}
type SelectCheckboxProps = {
@@ -441,4 +442,23 @@ describe('MalioSelectCheckbox', () => {
expect(tag.classes()).toContain('bg-m-bg')
expect(tag.attributes('style')).toBeFalsy()
})
it('applique la couleur de texte fournie par loption', () => {
const wrapper = mount(SelectCheckboxForTest, {
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true},
})
const tag = wrapper.findAll('span.inline-flex')[0]
expect(tag.attributes('style')).toContain('color')
})
it('napplique pas la couleur de texte custom en disabled (reste grisé)', () => {
const wrapper = mount(SelectCheckboxForTest, {
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true, disabled: true},
})
const tag = wrapper.findAll('span.inline-flex')[0]
expect(tag.classes()).toContain('text-black/60')
expect(tag.attributes('style') ?? '').not.toContain('color')
})
})