Skip to content

Commit 32bff44

Browse files
authored
🐛(ats-presentation) fix disabled btn states rendering (#688)
1 parent 2661aec commit 32bff44

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/web/presentation/frontend/src/components/base/CspButton/CspButton.stories.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ export const States: Story = {
287287
>
288288
<p class="w-24">{{ v }}</p>
289289
<CspButton
290-
:variant="v"
291290
v-bind="args"
292-
label="Default"
291+
:variant="v"
292+
label="Activé"
293293
/>
294294
<CspButton
295-
:variant="v"
296295
v-bind="args"
296+
:variant="v"
297297
:disabled="true"
298-
label="Disabled"
298+
label="Désactivé"
299299
/>
300300
</div>
301301
</div>

src/web/presentation/frontend/src/components/base/CspButton/CspButton.vue

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ const isIconOnly = computed(() => Boolean(props.icon) && !props.label)
7777
}
7878
7979
&:disabled {
80-
pointer-events: none;
81-
background-color: var(--background-disabled-grey);
82-
color: var(--text-disabled-grey);
80+
cursor: not-allowed;
8381
box-shadow: none;
8482
}
8583
}
@@ -95,6 +93,11 @@ const isIconOnly = computed(() => Boolean(props.icon) && !props.label)
9593
&:active {
9694
background-color: var(--background-action-high-blue-france-active);
9795
}
96+
97+
&:disabled {
98+
background-color: var(--background-disabled-grey);
99+
color: var(--text-disabled-grey);
100+
}
98101
}
99102
100103
.csp-btn--secondary {
@@ -109,6 +112,12 @@ const isIconOnly = computed(() => Boolean(props.icon) && !props.label)
109112
&:active {
110113
background-color: var(--background-default-grey-active);
111114
}
115+
116+
&:disabled {
117+
background-color: transparent;
118+
color: var(--text-disabled-grey);
119+
box-shadow: inset 0 0 0 1px var(--border-disabled-grey);
120+
}
112121
}
113122
114123
.csp-btn--tertiary {
@@ -123,6 +132,12 @@ const isIconOnly = computed(() => Boolean(props.icon) && !props.label)
123132
&:active {
124133
background-color: var(--background-default-grey-active);
125134
}
135+
136+
&:disabled {
137+
background-color: transparent;
138+
color: var(--text-disabled-grey);
139+
box-shadow: inset 0 0 0 1px var(--border-disabled-grey);
140+
}
126141
}
127142
128143
.csp-btn--tertiary-no-outline {
@@ -136,6 +151,11 @@ const isIconOnly = computed(() => Boolean(props.icon) && !props.label)
136151
&:active {
137152
background-color: var(--background-default-grey-active);
138153
}
154+
155+
&:disabled {
156+
background-color: transparent;
157+
color: var(--text-disabled-grey);
158+
}
139159
}
140160
141161
.csp-btn__icon {

0 commit comments

Comments
 (0)