feat : refacto de la config couleur

This commit is contained in:
2026-03-24 09:05:35 +01:00
parent 3deba3f369
commit 04f16c1f04
8 changed files with 59 additions and 56 deletions

View File

@@ -106,7 +106,7 @@ describe('MalioButtonIcon', () => {
const wrapper = mountComponent({icon: 'mdi:arrow-left', ariaLabel: 'Retour', disabled: true})
expect(wrapper.get('button').classes()).toContain('cursor-not-allowed')
expect(wrapper.get('button').classes()).toContain('bg-m-btn-disabled')
expect(wrapper.get('button').classes()).toContain('bg-m-disabled')
})
it('applies cursor-pointer when not disabled', () => {
@@ -124,7 +124,7 @@ describe('MalioButtonIcon', () => {
it('applies default background color', () => {
const wrapper = mountComponent()
expect(wrapper.get('button').classes()).toContain('bg-m-btn-default')
expect(wrapper.get('button').classes()).toContain('bg-m-btn-primary')
})
it('applies buttonClass', () => {
@@ -136,16 +136,16 @@ describe('MalioButtonIcon', () => {
it('applies ghost variant with no background and colored icon', () => {
const wrapper = mountComponent({icon: 'mdi:arrow-left', ariaLabel: 'Retour', variant: 'ghost'})
expect(wrapper.get('button').classes()).toContain('text-m-btn-default')
expect(wrapper.get('button').classes()).not.toContain('bg-m-btn-default')
expect(wrapper.get('button').classes()).toContain('text-m-btn-primary')
expect(wrapper.get('button').classes()).not.toContain('bg-m-btn-primary')
expect(wrapper.get('button').classes()).not.toContain('text-white')
})
it('applies ghost disabled styles with no background', () => {
const wrapper = mountComponent({icon: 'mdi:arrow-left', ariaLabel: 'Retour', variant: 'ghost', disabled: true})
expect(wrapper.get('button').classes()).toContain('text-m-btn-disabled')
expect(wrapper.get('button').classes()).toContain('text-m-disabled')
expect(wrapper.get('button').classes()).toContain('cursor-not-allowed')
expect(wrapper.get('button').classes()).not.toContain('bg-m-btn-disabled')
expect(wrapper.get('button').classes()).not.toContain('bg-m-disabled')
})
})

View File

@@ -55,11 +55,11 @@ const mergedButtonClass = computed(() =>
'inline-flex items-center justify-center rounded-md p-1 transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-m-primary/50',
isFilled.value
? props.disabled
? 'bg-m-btn-disabled text-white cursor-not-allowed'
: 'bg-m-btn-default hover:bg-m-btn-hover active:bg-m-btn-active text-white cursor-pointer'
? 'bg-m-disabled text-white cursor-not-allowed'
: 'bg-m-btn-primary hover:bg-m-btn-primary-hover active:bg-m-btn-primary-active text-white cursor-pointer'
: props.disabled
? 'text-m-btn-disabled cursor-not-allowed'
: 'text-m-btn-default hover:text-m-btn-hover active:text-m-btn-active cursor-pointer',
? 'text-m-disabled cursor-not-allowed'
: 'text-m-btn-primary hover:text-m-btn-primary-hover active:text-m-btn-primary-active cursor-pointer',
props.buttonClass,
),
)

View File

@@ -54,7 +54,7 @@
<NuxtLink
:to="item.to"
:class="twMerge(
'block truncate rounded-md text-[15px] text-m-text text-black transition-colors hover:bg-m-tertiary leading-[150%]',
'block truncate rounded-md text-[15px] text-m-text text-black transition-colors hover:bg-m-surface leading-[150%]',
collapsed ? 'px-3 text-center' : 'pl-[42px] pr-3',
)"
>
@@ -71,7 +71,7 @@
:class="twMerge(
'absolute top-1/2 -translate-y-1/2 right-0 translate-x-1/2 z-10',
'flex h-8 w-8 items-center justify-center rounded-full border border-m-border bg-white shadow-sm',
'cursor-pointer transition-colors hover:bg-m-tertiary',
'cursor-pointer transition-colors hover:bg-m-surface',
toggleClass,
)"
@click="toggleCollapse"

View File

@@ -2,7 +2,7 @@
<div v-bind="$attrs">
<div
role="tablist"
class="flex justify-center gap-[60px] border-b border-m-border"
class="flex justify-center gap-[60px] border-b border-m-primary"
>
<button
v-for="tab in tabs"