@bythium/unisson 0.0.0-stage → 0.1.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +28 -0
- package/README.md +145 -2
- package/dist/CHANGELOG.md +22 -0
- package/dist/button-group.d.ts +29 -0
- package/dist/button-group.js +1 -0
- package/dist/button.d.ts +37 -0
- package/dist/button.js +1 -0
- package/dist/chunks/chunk-4GXKKP4T.js +460 -0
- package/dist/chunks/chunk-5TUKFRTD.js +376 -0
- package/dist/chunks/chunk-5VNPX7DT.js +1 -0
- package/dist/chunks/chunk-6TMCYM5S.js +436 -0
- package/dist/chunks/chunk-BAYUYXVR.js +1 -0
- package/dist/chunks/chunk-FGJHPGJI.js +1 -0
- package/dist/chunks/chunk-JOXL2SMV.js +373 -0
- package/dist/chunks/chunk-MWNIQCR3.js +298 -0
- package/dist/chunks/chunk-MYB6FQX2.js +394 -0
- package/dist/chunks/chunk-W3ASGVKH.js +1 -0
- package/dist/chunks/chunk-WKXQ2JMZ.js +557 -0
- package/dist/confirm-button.d.ts +37 -0
- package/dist/confirm-button.js +1 -0
- package/dist/copy-button.d.ts +25 -0
- package/dist/copy-button.js +1 -0
- package/dist/custom-elements.json +1480 -0
- package/dist/define.d.ts +8 -0
- package/dist/define.js +1 -0
- package/dist/icon-button.d.ts +33 -0
- package/dist/icon-button.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/react/attributes.d.ts +10 -0
- package/dist/react/attributes.js +25 -0
- package/dist/react/button-group.d.ts +27 -0
- package/dist/react/button-group.js +7 -0
- package/dist/react/button.d.ts +35 -0
- package/dist/react/button.js +7 -0
- package/dist/react/confirm-button.d.ts +35 -0
- package/dist/react/confirm-button.js +7 -0
- package/dist/react/copy-button.d.ts +23 -0
- package/dist/react/copy-button.js +7 -0
- package/dist/react/icon-button.d.ts +31 -0
- package/dist/react/icon-button.js +7 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.js +9 -0
- package/dist/react/runtime.js +11 -0
- package/dist/react/split-button.d.ts +31 -0
- package/dist/react/split-button.js +7 -0
- package/dist/react/toggle-button.d.ts +27 -0
- package/dist/react/toggle-button.js +7 -0
- package/dist/split-button.d.ts +33 -0
- package/dist/split-button.js +1 -0
- package/dist/svelte/OButton.svelte +14 -0
- package/dist/svelte/OButton.svelte.d.ts +36 -0
- package/dist/svelte/OButtonGroup.svelte +14 -0
- package/dist/svelte/OButtonGroup.svelte.d.ts +28 -0
- package/dist/svelte/OConfirmButton.svelte +14 -0
- package/dist/svelte/OConfirmButton.svelte.d.ts +36 -0
- package/dist/svelte/OCopyButton.svelte +14 -0
- package/dist/svelte/OCopyButton.svelte.d.ts +24 -0
- package/dist/svelte/OIconButton.svelte +14 -0
- package/dist/svelte/OIconButton.svelte.d.ts +32 -0
- package/dist/svelte/OSplitButton.svelte +14 -0
- package/dist/svelte/OSplitButton.svelte.d.ts +32 -0
- package/dist/svelte/OToggleButton.svelte +14 -0
- package/dist/svelte/OToggleButton.svelte.d.ts +28 -0
- package/dist/svelte/attributes.d.ts +10 -0
- package/dist/svelte/attributes.js +25 -0
- package/dist/svelte/index.d.ts +8 -0
- package/dist/svelte/index.js +8 -0
- package/dist/toggle-button.d.ts +29 -0
- package/dist/toggle-button.js +1 -0
- package/dist/tokens.css +200 -0
- package/dist/vue/attributes.d.ts +10 -0
- package/dist/vue/attributes.js +25 -0
- package/dist/vue/button-group.d.ts +27 -0
- package/dist/vue/button-group.js +6 -0
- package/dist/vue/button.d.ts +35 -0
- package/dist/vue/button.js +6 -0
- package/dist/vue/confirm-button.d.ts +35 -0
- package/dist/vue/confirm-button.js +6 -0
- package/dist/vue/copy-button.d.ts +23 -0
- package/dist/vue/copy-button.js +6 -0
- package/dist/vue/icon-button.d.ts +31 -0
- package/dist/vue/icon-button.js +6 -0
- package/dist/vue/index.d.ts +8 -0
- package/dist/vue/index.js +8 -0
- package/dist/vue/runtime.js +31 -0
- package/dist/vue/split-button.d.ts +31 -0
- package/dist/vue/split-button.js +6 -0
- package/dist/vue/toggle-button.d.ts +27 -0
- package/dist/vue/toggle-button.js +6 -0
- package/package.json +199 -4
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import{a as s,b as l,c as d}from"./chunk-FGJHPGJI.js";import{a as o,d as i,e as a}from"./chunk-W3ASGVKH.js";var c={label:{type:"string",default:"Ex\xE9cuter une action"},variant:{type:"string",default:"primary",enum:["primary","secondary","ghost","danger"]},size:{type:"string",default:"md",enum:["sm","md","lg"]},loading:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1},expanded:{type:"string",default:"none"},hint:{type:"string",default:""}},u=`/* Styles de base de toute tranche : repris de src/shared/base.styles.css d'Orchestre, aux r\xE8gles de la convention
|
|
2
|
+
(jetons --bythium-*, propri\xE9t\xE9s logiques, pas de !important, mouvement sous no-preference).
|
|
3
|
+
tools/wc.generate.ts les place devant la feuille de chaque tranche : m\xEAme cascade que l'ancien d\xE9p\xF4t. */
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
min-inline-size: 0;
|
|
7
|
+
max-inline-size: 100%;
|
|
8
|
+
color: var(--bythium-text-primary);
|
|
9
|
+
font-family: var(--font-sans);
|
|
10
|
+
font-size: var(--font-size-base);
|
|
11
|
+
line-height: var(--line-height-base);
|
|
12
|
+
font-feature-settings: var(--font-features, normal);
|
|
13
|
+
letter-spacing: -0.006em;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
}
|
|
16
|
+
:host([hidden]) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
/* D\xE9sactiv\xE9 : couleurs att\xE9nu\xE9es qui gardent 4,5:1 (texte) et 3:1 (contour), jamais d'opacit\xE9 sur l'h\xF4te, qui ferait
|
|
20
|
+
\xE9chouer le contraste du libell\xE9 et des textes voisins (axe, WC-R04). Une tranche peut pr\xE9ciser sa propre r\xE8gle. */
|
|
21
|
+
:host([disabled]) {
|
|
22
|
+
color: var(--bythium-text-muted);
|
|
23
|
+
}
|
|
24
|
+
*,
|
|
25
|
+
*::before,
|
|
26
|
+
*::after {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
button,
|
|
30
|
+
input,
|
|
31
|
+
a,
|
|
32
|
+
select,
|
|
33
|
+
textarea {
|
|
34
|
+
font: inherit;
|
|
35
|
+
color: inherit;
|
|
36
|
+
}
|
|
37
|
+
button,
|
|
38
|
+
a,
|
|
39
|
+
input {
|
|
40
|
+
touch-action: manipulation;
|
|
41
|
+
}
|
|
42
|
+
button {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
button:disabled,
|
|
46
|
+
input:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
button:disabled,
|
|
50
|
+
.control:disabled {
|
|
51
|
+
color: var(--bythium-text-muted);
|
|
52
|
+
}
|
|
53
|
+
/* Profil Linear : un bouton se lit par son fond et son libell\xE9, sa bordure reste d\xE9corative ; un champ garde un contour \xE0 3:1. */
|
|
54
|
+
button {
|
|
55
|
+
min-block-size: var(--control-height);
|
|
56
|
+
padding: 4px 10px;
|
|
57
|
+
border: 1px solid var(--bythium-border-subtle);
|
|
58
|
+
border-radius: var(--radius-control);
|
|
59
|
+
background-color: var(--bythium-surface-raised);
|
|
60
|
+
color: var(--bythium-text-primary);
|
|
61
|
+
font-size: var(--font-size-caption);
|
|
62
|
+
font-weight: var(--font-weight-medium);
|
|
63
|
+
}
|
|
64
|
+
.control {
|
|
65
|
+
min-block-size: var(--control-height);
|
|
66
|
+
padding: 4px 9px;
|
|
67
|
+
border: 1px solid var(--bythium-border-strong);
|
|
68
|
+
border-radius: var(--radius-control);
|
|
69
|
+
background-color: var(--bythium-surface-base);
|
|
70
|
+
color: var(--bythium-text-primary);
|
|
71
|
+
font-size: var(--font-size-base);
|
|
72
|
+
}
|
|
73
|
+
.control:hover:not(:disabled):not(:focus-visible) {
|
|
74
|
+
border-color: var(--bythium-text-muted);
|
|
75
|
+
}
|
|
76
|
+
button:hover:not(:disabled) {
|
|
77
|
+
background: color-mix(in oklch, var(--bythium-text-primary) 8%, var(--bythium-surface-raised));
|
|
78
|
+
}
|
|
79
|
+
button:active:not(:disabled) {
|
|
80
|
+
background: color-mix(in oklch, var(--bythium-text-primary) 12%, var(--bythium-surface-raised));
|
|
81
|
+
}
|
|
82
|
+
a {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: var(--space-2);
|
|
86
|
+
min-block-size: var(--target-touch-min);
|
|
87
|
+
color: var(--bythium-link);
|
|
88
|
+
text-decoration: underline;
|
|
89
|
+
text-underline-offset: 3px;
|
|
90
|
+
}
|
|
91
|
+
:where(button, input, a, select, textarea, [tabindex]):focus-visible {
|
|
92
|
+
outline: var(--focus-ring-width) solid var(--bythium-border-focus);
|
|
93
|
+
outline-offset: 1px;
|
|
94
|
+
}
|
|
95
|
+
input {
|
|
96
|
+
min-inline-size: 0;
|
|
97
|
+
max-inline-size: 100%;
|
|
98
|
+
accent-color: var(--bythium-brand-primary);
|
|
99
|
+
}
|
|
100
|
+
::placeholder {
|
|
101
|
+
color: var(--bythium-text-muted);
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
input[type='range'] {
|
|
105
|
+
min-block-size: var(--target-touch-min);
|
|
106
|
+
}
|
|
107
|
+
input[type='checkbox'],
|
|
108
|
+
input[type='radio'] {
|
|
109
|
+
inline-size: 16px;
|
|
110
|
+
block-size: 16px;
|
|
111
|
+
margin: 0;
|
|
112
|
+
}
|
|
113
|
+
label {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: var(--space-2);
|
|
117
|
+
font-size: var(--font-size-caption);
|
|
118
|
+
}
|
|
119
|
+
.field {
|
|
120
|
+
display: grid;
|
|
121
|
+
gap: var(--space-1-5);
|
|
122
|
+
}
|
|
123
|
+
.row {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-wrap: wrap;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: var(--space-2);
|
|
128
|
+
}
|
|
129
|
+
.sr-only {
|
|
130
|
+
position: absolute;
|
|
131
|
+
inline-size: 1px;
|
|
132
|
+
block-size: 1px;
|
|
133
|
+
padding: 0;
|
|
134
|
+
margin: -1px;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
clip-path: inset(50%);
|
|
137
|
+
white-space: nowrap;
|
|
138
|
+
border: 0;
|
|
139
|
+
}
|
|
140
|
+
/* A field inside a table whose column headers name its controls (bythium-slot-table labels="hidden") keeps its label
|
|
141
|
+
for assistive technologies only: the custom property inherits across the shadow boundaries down to the field. */
|
|
142
|
+
@container style(--bythium-field-labels: hidden) {
|
|
143
|
+
label[part=label][for],
|
|
144
|
+
legend[part=label] {
|
|
145
|
+
position: absolute;
|
|
146
|
+
inline-size: 1px;
|
|
147
|
+
block-size: 1px;
|
|
148
|
+
padding: 0;
|
|
149
|
+
margin: -1px;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
clip-path: inset(50%);
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
border: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
.muted {
|
|
157
|
+
color: var(--bythium-text-muted);
|
|
158
|
+
}
|
|
159
|
+
.error {
|
|
160
|
+
color: var(--bythium-status-danger);
|
|
161
|
+
font-size: var(--font-size-base);
|
|
162
|
+
}
|
|
163
|
+
.primary {
|
|
164
|
+
border-color: var(--bythium-brand-primary);
|
|
165
|
+
background: var(--bythium-brand-primary);
|
|
166
|
+
color: var(--bythium-on-brand-primary);
|
|
167
|
+
box-shadow: inset 0 1px 0 0 color-mix(in oklch, var(--bythium-on-brand-primary) 16%, transparent);
|
|
168
|
+
}
|
|
169
|
+
.primary:hover:not(:disabled) {
|
|
170
|
+
background: var(--bythium-brand-primary-hover);
|
|
171
|
+
color: var(--bythium-on-brand-primary);
|
|
172
|
+
}
|
|
173
|
+
[aria-current],
|
|
174
|
+
[aria-selected='true'],
|
|
175
|
+
[aria-pressed='true'] {
|
|
176
|
+
border-color: var(--bythium-border-subtle);
|
|
177
|
+
background: var(--bythium-state-selected, var(--bythium-surface-raised));
|
|
178
|
+
}
|
|
179
|
+
slot {
|
|
180
|
+
max-inline-size: 100%;
|
|
181
|
+
}
|
|
182
|
+
/* Cible tactile de 44 px sans changer la taille visuelle (WC-R05, WC-D03) : classe \xAB target \xBB sur le contr\xF4le.
|
|
183
|
+
Le pseudo-\xE9l\xE9ment d\xE9borde du contr\xF4le de fa\xE7on sym\xE9trique, donc identique en ltr et en rtl. */
|
|
184
|
+
.target {
|
|
185
|
+
position: relative;
|
|
186
|
+
isolation: isolate;
|
|
187
|
+
}
|
|
188
|
+
/* Sous le contenu du contr\xF4le (z-index -1 dans son propre contexte d'empilement) : il ne masque jamais un enfant. */
|
|
189
|
+
.target::after {
|
|
190
|
+
content: '';
|
|
191
|
+
position: absolute;
|
|
192
|
+
z-index: -1;
|
|
193
|
+
inset-block: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
194
|
+
inset-inline: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
195
|
+
}
|
|
196
|
+
/* Rang\xE9es denses (H-05, WCAG 2.2 AA 2.5.8) : quand des zones de 44 px se chevaucheraient (points de pagination,
|
|
197
|
+
\xE9toiles, \xD7 d'\xE9tiquettes, lignes de cases, onglets serr\xE9s), la classe \xAB target-dense \xBB donne une zone d'au moins
|
|
198
|
+
24 px ; au pointeur grossier, elle revient \xE0 44 px (WC-D03). \xC0 poser \xE0 la place de \xAB target \xBB, sur le contr\xF4le. */
|
|
199
|
+
.target-dense {
|
|
200
|
+
position: relative;
|
|
201
|
+
isolation: isolate;
|
|
202
|
+
}
|
|
203
|
+
.target-dense::after {
|
|
204
|
+
content: '';
|
|
205
|
+
position: absolute;
|
|
206
|
+
z-index: -1;
|
|
207
|
+
inset-block: min(0px, calc((100% - 24px) / 2));
|
|
208
|
+
inset-inline: min(0px, calc((100% - 24px) / 2));
|
|
209
|
+
}
|
|
210
|
+
@media (pointer: coarse) {
|
|
211
|
+
.target-dense::after {
|
|
212
|
+
inset-block: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
213
|
+
inset-inline: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/* Transition pos\xE9e \xE0 l'arriv\xE9e du survol seulement : une bascule de th\xE8me ne s'anime pas, l'audit de contraste mesure l'\xE9tat final. */
|
|
217
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
218
|
+
button:hover:not(:disabled),
|
|
219
|
+
.control:hover:not(:disabled) {
|
|
220
|
+
transition:
|
|
221
|
+
background-color var(--duration-fast) var(--ease-standard),
|
|
222
|
+
border-color var(--duration-fast) var(--ease-standard);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
@media (prefers-contrast: more) {
|
|
226
|
+
button,
|
|
227
|
+
.control {
|
|
228
|
+
border-color: currentColor;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
button,
|
|
233
|
+
input,
|
|
234
|
+
a {
|
|
235
|
+
border: 1px solid ButtonText;
|
|
236
|
+
}
|
|
237
|
+
:focus-visible {
|
|
238
|
+
outline-color: Highlight;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/* Densit\xE9 confortable sur les appareils tactiles ; focus explicite, jamais supprim\xE9. */
|
|
242
|
+
@media (pointer: coarse) {
|
|
243
|
+
button,
|
|
244
|
+
.control,
|
|
245
|
+
select {
|
|
246
|
+
min-block-size: var(--target-touch-min);
|
|
247
|
+
}
|
|
248
|
+
input[type='checkbox'],
|
|
249
|
+
input[type='radio'] {
|
|
250
|
+
inline-size: 20px;
|
|
251
|
+
block-size: 20px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/* Hint of a button-like control (core/hint.ts): a compact tooltip in the top layer, centred under the control and
|
|
255
|
+
flipped above it when the window is short of room, so a toolbar or a scrolling list never clips it. */
|
|
256
|
+
[part=base] {
|
|
257
|
+
anchor-name: --bythium-hint;
|
|
258
|
+
}
|
|
259
|
+
[part=hint] {
|
|
260
|
+
position: fixed;
|
|
261
|
+
inset: auto;
|
|
262
|
+
margin: 0;
|
|
263
|
+
inline-size: max-content;
|
|
264
|
+
max-inline-size: min(280px, 80vw);
|
|
265
|
+
padding-block: 4px;
|
|
266
|
+
padding-inline: 8px;
|
|
267
|
+
overflow: visible;
|
|
268
|
+
border: 1px solid var(--bythium-border-subtle);
|
|
269
|
+
border-radius: var(--radius-control);
|
|
270
|
+
background: var(--bythium-surface-overlay);
|
|
271
|
+
color: var(--bythium-text-primary);
|
|
272
|
+
box-shadow: var(--shadow-overlay);
|
|
273
|
+
font-size: 12px;
|
|
274
|
+
font-weight: 400;
|
|
275
|
+
line-height: 1.4;
|
|
276
|
+
text-align: start;
|
|
277
|
+
white-space: normal;
|
|
278
|
+
overflow-wrap: anywhere;
|
|
279
|
+
}
|
|
280
|
+
/* Hover bridge: the pointer crosses the gap to the hint without closing it (WCAG 1.4.13). */
|
|
281
|
+
[part=hint]::before {
|
|
282
|
+
content: "";
|
|
283
|
+
position: absolute;
|
|
284
|
+
inset-inline: 0;
|
|
285
|
+
inset-block: -7px -7px;
|
|
286
|
+
}
|
|
287
|
+
@supports (position-area: block-end) and (position-try-fallbacks: flip-block) {
|
|
288
|
+
[part=hint] {
|
|
289
|
+
position-anchor: --bythium-hint;
|
|
290
|
+
position-area: block-end;
|
|
291
|
+
margin-block-start: 6px;
|
|
292
|
+
position-try-fallbacks: flip-block;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/* Without anchor positioning the hint would float at the top of the window: it stays hidden, the name still speaks. */
|
|
296
|
+
@supports not ((position-area: block-end) and (position-try-fallbacks: flip-block)) {
|
|
297
|
+
[part=hint] {
|
|
298
|
+
display: none;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
@media (forced-colors: active) {
|
|
302
|
+
[part=hint] {
|
|
303
|
+
border-color: CanvasText;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/* Profil Linear : carr\xE9 de 28 px par d\xE9faut, 24 px en sm, 36 px en lg ; la cible de 44 px est port\xE9e par la classe \xAB target \xBB. */
|
|
307
|
+
button {
|
|
308
|
+
display: inline-flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
justify-content: center;
|
|
311
|
+
gap: 6px;
|
|
312
|
+
padding: 0 10px;
|
|
313
|
+
line-height: 1;
|
|
314
|
+
white-space: nowrap;
|
|
315
|
+
vertical-align: top;
|
|
316
|
+
user-select: none;
|
|
317
|
+
}
|
|
318
|
+
[part=content] {
|
|
319
|
+
display: inline-flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
gap: 6px;
|
|
322
|
+
}
|
|
323
|
+
:host([size=sm]) button {
|
|
324
|
+
min-block-size: 24px;
|
|
325
|
+
padding: 0 8px;
|
|
326
|
+
}
|
|
327
|
+
:host([size=lg]) button {
|
|
328
|
+
min-block-size: 36px;
|
|
329
|
+
padding: 0 14px;
|
|
330
|
+
font-size: 13px;
|
|
331
|
+
}
|
|
332
|
+
/* Le contrat donne \xAB primary \xBB par d\xE9faut : l'absence d'attribut se rend comme la variante principale. */
|
|
333
|
+
:host([variant=primary]) button,
|
|
334
|
+
:host(:not([variant])) button {
|
|
335
|
+
background: var(--bythium-brand-primary);
|
|
336
|
+
color: var(--bythium-on-brand-primary);
|
|
337
|
+
border-color: var(--bythium-brand-primary);
|
|
338
|
+
box-shadow: inset 0 1px 0 0 color-mix(in oklch, var(--bythium-on-brand-primary) 16%, transparent);
|
|
339
|
+
}
|
|
340
|
+
:host([variant=primary]) button:hover:not(:disabled),
|
|
341
|
+
:host([variant=primary]) button:active:not(:disabled),
|
|
342
|
+
:host(:not([variant])) button:hover:not(:disabled),
|
|
343
|
+
:host(:not([variant])) button:active:not(:disabled) {
|
|
344
|
+
background: var(--bythium-brand-primary-hover);
|
|
345
|
+
border-color: var(--bythium-brand-primary-hover);
|
|
346
|
+
}
|
|
347
|
+
:host([variant=ghost]) button {
|
|
348
|
+
background: transparent;
|
|
349
|
+
border-color: transparent;
|
|
350
|
+
color: var(--bythium-text-secondary);
|
|
351
|
+
}
|
|
352
|
+
:host([variant=ghost]) button:hover:not(:disabled) {
|
|
353
|
+
background: var(--bythium-state-hover);
|
|
354
|
+
color: var(--bythium-text-primary);
|
|
355
|
+
}
|
|
356
|
+
:host([variant=ghost]) button:active:not(:disabled) {
|
|
357
|
+
background: var(--bythium-state-selected);
|
|
358
|
+
color: var(--bythium-text-primary);
|
|
359
|
+
}
|
|
360
|
+
:host([variant=danger]) button {
|
|
361
|
+
background: transparent;
|
|
362
|
+
color: var(--bythium-status-danger);
|
|
363
|
+
border-color: color-mix(in oklch, var(--bythium-status-danger) 30%, var(--bythium-border-subtle));
|
|
364
|
+
}
|
|
365
|
+
:host([variant=danger]) button:hover:not(:disabled) {
|
|
366
|
+
background: color-mix(in oklch, var(--bythium-status-danger) 10%, var(--bythium-surface-base));
|
|
367
|
+
}
|
|
368
|
+
:host([variant=danger]) button:active:not(:disabled) {
|
|
369
|
+
background: color-mix(in oklch, var(--bythium-status-danger) 16%, var(--bythium-surface-base));
|
|
370
|
+
}
|
|
371
|
+
/* D\xE9sactiv\xE9 : neutre et lisible (texte att\xE9nu\xE9 \xE0 4,5:1), jamais d'aplat violet d\xE9lav\xE9. */
|
|
372
|
+
:host([disabled]) {
|
|
373
|
+
opacity: 1;
|
|
374
|
+
}
|
|
375
|
+
:host([disabled]) button {
|
|
376
|
+
background: var(--bythium-surface-raised);
|
|
377
|
+
color: var(--bythium-text-muted);
|
|
378
|
+
border-color: var(--bythium-border-subtle);
|
|
379
|
+
box-shadow: none;
|
|
380
|
+
}
|
|
381
|
+
:host([disabled][variant=ghost]) button,
|
|
382
|
+
:host([disabled][variant=danger]) button {
|
|
383
|
+
background: transparent;
|
|
384
|
+
}
|
|
385
|
+
:host([disabled][variant=ghost]) button {
|
|
386
|
+
border-color: transparent;
|
|
387
|
+
}
|
|
388
|
+
:host([loading]) button {
|
|
389
|
+
cursor: default;
|
|
390
|
+
}
|
|
391
|
+
/* Chargement : anneau fin dans la couleur du libell\xE9, la variante garde son apparence. */
|
|
392
|
+
[part=loader] {
|
|
393
|
+
display: inline-block;
|
|
394
|
+
flex: none;
|
|
395
|
+
inline-size: 12px;
|
|
396
|
+
block-size: 12px;
|
|
397
|
+
border: 1.5px solid currentColor;
|
|
398
|
+
border-inline-end-color: transparent;
|
|
399
|
+
border-radius: 50%;
|
|
400
|
+
font-size: 0;
|
|
401
|
+
opacity: 0.75;
|
|
402
|
+
}
|
|
403
|
+
[part=loader][hidden] {
|
|
404
|
+
display: none;
|
|
405
|
+
}
|
|
406
|
+
/* Toujours carr\xE9 : 28 px, 24 px en sm, 36 px en lg. */
|
|
407
|
+
button {
|
|
408
|
+
inline-size: 28px;
|
|
409
|
+
min-block-size: 28px;
|
|
410
|
+
padding: 0;
|
|
411
|
+
font-size: 14px;
|
|
412
|
+
}
|
|
413
|
+
:host([size=sm]) button {
|
|
414
|
+
inline-size: 24px;
|
|
415
|
+
min-block-size: 24px;
|
|
416
|
+
padding: 0;
|
|
417
|
+
font-size: 12px;
|
|
418
|
+
}
|
|
419
|
+
:host([size=lg]) button {
|
|
420
|
+
inline-size: 36px;
|
|
421
|
+
min-block-size: 36px;
|
|
422
|
+
padding: 0;
|
|
423
|
+
font-size: 16px;
|
|
424
|
+
}
|
|
425
|
+
:host([loading]) [part=content] {
|
|
426
|
+
display: none;
|
|
427
|
+
}
|
|
428
|
+
@media (pointer:coarse) {
|
|
429
|
+
button,
|
|
430
|
+
:host([size=sm]) button,
|
|
431
|
+
:host([size=lg]) button {
|
|
432
|
+
inline-size: 44px;
|
|
433
|
+
min-inline-size: 44px;
|
|
434
|
+
min-block-size: 44px;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
@keyframes spin {
|
|
438
|
+
to {
|
|
439
|
+
transform: rotate(360deg);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
443
|
+
/* Fond transparent : la couleur du texte ne transite pas, pour rester lisible \xE0 l'instant d'un changement de th\xE8me. */
|
|
444
|
+
:host([variant=ghost]) button:hover,
|
|
445
|
+
:host([variant=danger]) button:hover {
|
|
446
|
+
transition:
|
|
447
|
+
background-color var(--duration-fast) var(--ease-standard),
|
|
448
|
+
border-color var(--duration-fast) var(--ease-standard);
|
|
449
|
+
}
|
|
450
|
+
[part=loader] {
|
|
451
|
+
animation: spin 0.8s linear infinite;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
@media (forced-colors: active) {
|
|
455
|
+
:host([disabled]) button {
|
|
456
|
+
border-color: GrayText;
|
|
457
|
+
color: GrayText;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
`;function b(n){return n==="none"?null:n==="false"?"false":"true"}function p(n){let e=o("button",{part:"base",class:"target",type:"button","aria-label":n.label,"aria-busy":String(n.loading),"aria-expanded":b(n.expanded),"aria-describedby":l(n.hint,n.label),disabled:n.disabled||n.loading},o("span",{part:"loader","aria-hidden":"true",hidden:!n.loading},"\u25CC"),o("span",{part:"content"},o("slot",{},"\u2726"))),t=s(n.hint);return t?[e,t]:[e]}var r=class extends i{static props=c;static css=u;static delegatesFocus=!0;#n;constructor(){super(),this.root.addEventListener("click",e=>{let t=this.root.querySelector("button");t&&e.composedPath().includes(t)&&!this.disabled&&!this.loading&&this.emit("bythium-action",{source:"activation"})}),this.#n=d(this,this.root)}disconnected(){this.#n.close()}get expanded(){return this.props.expanded}set expanded(e){e==null?this.removeAttribute("expanded"):this.setAttribute("expanded",String(e))}view(){return p(this.props)}};a("bythium-icon-button",r);export{r as a};
|