feat : Ajout du composant email

This commit is contained in:
2026-05-11 10:53:27 +02:00
parent eb21827686
commit 085c70d320
19 changed files with 1000 additions and 31 deletions

View File

@@ -139,4 +139,16 @@ describe('MalioCheckbox', () => {
expect(wrapper.get('p').text()).toBe('Valid')
expect(wrapper.get('p').classes()).toContain('text-m-success')
})
it('uses muted label color when unchecked', () => {
const wrapper = mountCheckbox({label: 'Accept terms', modelValue: false})
expect(wrapper.get('label').classes()).toContain('text-m-muted')
})
it('uses black label color when checked', () => {
const wrapper = mountCheckbox({label: 'Accept terms', modelValue: true})
expect(wrapper.get('label').classes()).toContain('text-black')
})
})

View File

@@ -108,7 +108,8 @@ const mergedInputClass = computed(() =>
const mergedLabelClass = computed(() =>
twMerge(
'cbx text-black text-lg',
'cbx text-lg',
isChecked.value ? 'text-black' : 'text-m-muted',
disabled.value ? 'cursor-not-allowed text-black/60' : '',
hasError.value ? 'text-m-error' : '',
hasSuccess.value ? 'text-m-success' : '',
@@ -161,10 +162,14 @@ const onChange = (event: Event) => {
height: 18px;
flex: 0 0 18px;
transform: scale(1);
border: 2px solid rgb(0, 0, 0);
border: 2px solid rgb(var(--m-muted) / 1);
transition: all 0.1s ease;
}
.inp-cbx:checked + .cbx span:first-child {
border-color: rgb(0, 0, 0);
}
.cbx span:first-child svg {
position: absolute;
top: 2px;