@bythium/unisson 0.0.0-stage → 0.1.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.
Files changed (92) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +28 -0
  3. package/README.md +145 -2
  4. package/dist/CHANGELOG.md +17 -0
  5. package/dist/button-group.d.ts +29 -0
  6. package/dist/button-group.js +1 -0
  7. package/dist/button.d.ts +37 -0
  8. package/dist/button.js +1 -0
  9. package/dist/chunks/chunk-4GXKKP4T.js +460 -0
  10. package/dist/chunks/chunk-5TUKFRTD.js +376 -0
  11. package/dist/chunks/chunk-5VNPX7DT.js +1 -0
  12. package/dist/chunks/chunk-6TMCYM5S.js +436 -0
  13. package/dist/chunks/chunk-BAYUYXVR.js +1 -0
  14. package/dist/chunks/chunk-FGJHPGJI.js +1 -0
  15. package/dist/chunks/chunk-JOXL2SMV.js +373 -0
  16. package/dist/chunks/chunk-MWNIQCR3.js +298 -0
  17. package/dist/chunks/chunk-MYB6FQX2.js +394 -0
  18. package/dist/chunks/chunk-W3ASGVKH.js +1 -0
  19. package/dist/chunks/chunk-WKXQ2JMZ.js +557 -0
  20. package/dist/confirm-button.d.ts +37 -0
  21. package/dist/confirm-button.js +1 -0
  22. package/dist/copy-button.d.ts +25 -0
  23. package/dist/copy-button.js +1 -0
  24. package/dist/custom-elements.json +1480 -0
  25. package/dist/define.d.ts +8 -0
  26. package/dist/define.js +1 -0
  27. package/dist/icon-button.d.ts +33 -0
  28. package/dist/icon-button.js +1 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.js +1 -0
  31. package/dist/react/attributes.d.ts +10 -0
  32. package/dist/react/attributes.js +25 -0
  33. package/dist/react/button-group.d.ts +27 -0
  34. package/dist/react/button-group.js +7 -0
  35. package/dist/react/button.d.ts +35 -0
  36. package/dist/react/button.js +7 -0
  37. package/dist/react/confirm-button.d.ts +35 -0
  38. package/dist/react/confirm-button.js +7 -0
  39. package/dist/react/copy-button.d.ts +23 -0
  40. package/dist/react/copy-button.js +7 -0
  41. package/dist/react/icon-button.d.ts +31 -0
  42. package/dist/react/icon-button.js +7 -0
  43. package/dist/react/index.d.ts +8 -0
  44. package/dist/react/index.js +9 -0
  45. package/dist/react/runtime.js +11 -0
  46. package/dist/react/split-button.d.ts +31 -0
  47. package/dist/react/split-button.js +7 -0
  48. package/dist/react/toggle-button.d.ts +27 -0
  49. package/dist/react/toggle-button.js +7 -0
  50. package/dist/split-button.d.ts +33 -0
  51. package/dist/split-button.js +1 -0
  52. package/dist/svelte/OButton.svelte +14 -0
  53. package/dist/svelte/OButton.svelte.d.ts +36 -0
  54. package/dist/svelte/OButtonGroup.svelte +14 -0
  55. package/dist/svelte/OButtonGroup.svelte.d.ts +28 -0
  56. package/dist/svelte/OConfirmButton.svelte +14 -0
  57. package/dist/svelte/OConfirmButton.svelte.d.ts +36 -0
  58. package/dist/svelte/OCopyButton.svelte +14 -0
  59. package/dist/svelte/OCopyButton.svelte.d.ts +24 -0
  60. package/dist/svelte/OIconButton.svelte +14 -0
  61. package/dist/svelte/OIconButton.svelte.d.ts +32 -0
  62. package/dist/svelte/OSplitButton.svelte +14 -0
  63. package/dist/svelte/OSplitButton.svelte.d.ts +32 -0
  64. package/dist/svelte/OToggleButton.svelte +14 -0
  65. package/dist/svelte/OToggleButton.svelte.d.ts +28 -0
  66. package/dist/svelte/attributes.d.ts +10 -0
  67. package/dist/svelte/attributes.js +25 -0
  68. package/dist/svelte/index.d.ts +8 -0
  69. package/dist/svelte/index.js +8 -0
  70. package/dist/toggle-button.d.ts +29 -0
  71. package/dist/toggle-button.js +1 -0
  72. package/dist/tokens.css +200 -0
  73. package/dist/vue/attributes.d.ts +10 -0
  74. package/dist/vue/attributes.js +25 -0
  75. package/dist/vue/button-group.d.ts +27 -0
  76. package/dist/vue/button-group.js +6 -0
  77. package/dist/vue/button.d.ts +35 -0
  78. package/dist/vue/button.js +6 -0
  79. package/dist/vue/confirm-button.d.ts +35 -0
  80. package/dist/vue/confirm-button.js +6 -0
  81. package/dist/vue/copy-button.d.ts +23 -0
  82. package/dist/vue/copy-button.js +6 -0
  83. package/dist/vue/icon-button.d.ts +31 -0
  84. package/dist/vue/icon-button.js +6 -0
  85. package/dist/vue/index.d.ts +8 -0
  86. package/dist/vue/index.js +8 -0
  87. package/dist/vue/runtime.js +31 -0
  88. package/dist/vue/split-button.d.ts +31 -0
  89. package/dist/vue/split-button.js +6 -0
  90. package/dist/vue/toggle-button.d.ts +27 -0
  91. package/dist/vue/toggle-button.js +6 -0
  92. package/package.json +199 -4
@@ -0,0 +1,373 @@
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={pressed:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1},"disabled-focusable":{type:"boolean",default:!1},label:{type:"string",default:""},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
+ /* Repos : fond transparent et texte secondaire ; enfonc\xE9 : voile de s\xE9lection et texte plein, jamais d\u2019aplat violet. */
307
+ button {
308
+ display: inline-flex;
309
+ align-items: center;
310
+ justify-content: center;
311
+ gap: 6px;
312
+ max-inline-size: 100%;
313
+ padding: 0 10px;
314
+ line-height: 1;
315
+ white-space: nowrap;
316
+ vertical-align: top;
317
+ background: transparent;
318
+ color: var(--bythium-text-secondary);
319
+ }
320
+ button:hover:not(:disabled, [aria-disabled='true']) {
321
+ background: var(--bythium-state-hover);
322
+ color: var(--bythium-text-primary);
323
+ }
324
+ button:active:not(:disabled, [aria-disabled='true']) {
325
+ background: var(--bythium-state-selected);
326
+ }
327
+ [aria-pressed='true'],
328
+ [aria-pressed='true']:hover:not(:disabled) {
329
+ background: var(--bythium-state-selected);
330
+ color: var(--bythium-text-primary);
331
+ border-color: color-mix(in oklch, var(--bythium-text-primary) 14%, var(--bythium-border-subtle));
332
+ }
333
+ /* D\xE9sactiv\xE9 : texte att\xE9nu\xE9 \xE0 4,5:1 au lieu d\u2019une opacit\xE9 globale. */
334
+ :host([disabled]) {
335
+ opacity: 1;
336
+ }
337
+ button:disabled,
338
+ button[aria-disabled='true'] {
339
+ color: var(--bythium-text-muted);
340
+ }
341
+ /* D\xE9sactiv\xE9 mais focalisable : m\xEAme apparence, le focus reste visible et le curseur dit le refus. */
342
+ button[aria-disabled='true'] {
343
+ cursor: not-allowed;
344
+ }
345
+ [aria-pressed='true']:disabled,
346
+ [aria-pressed='true'][aria-disabled='true'] {
347
+ color: var(--bythium-text-muted);
348
+ border-color: var(--bythium-border-subtle);
349
+ }
350
+ @media (pointer: coarse) {
351
+ button {
352
+ min-inline-size: var(--target-touch-min);
353
+ }
354
+ }
355
+ @media (prefers-reduced-motion: no-preference) {
356
+ button {
357
+ transition:
358
+ background-color var(--duration-fast) var(--ease-standard),
359
+ border-color var(--duration-fast) var(--ease-standard);
360
+ }
361
+ }
362
+ /* L\u2019\xE9tat enfonc\xE9 ne passe pas par la seule couleur (WC-N06) : contour \xE9pais sous les couleurs forc\xE9es. */
363
+ @media (forced-colors: active) {
364
+ [aria-pressed='true'] {
365
+ border: 2px solid Highlight;
366
+ }
367
+ button:disabled,
368
+ button[aria-disabled='true'] {
369
+ border-color: GrayText;
370
+ color: GrayText;
371
+ }
372
+ }
373
+ `;function p(n){let t=o("button",{part:"base",class:"target",type:"button","aria-pressed":String(n.pressed),"aria-label":n.label.trim()||null,"aria-describedby":l(n.hint,n.label),"aria-disabled":n.disabledFocusable&&!n.disabled?"true":null,disabled:n.disabled},o("slot",{},"Option")),e=s(n.hint);return e?[t,e]:[t]}var r=class extends i{static props=c;static css=u;static delegatesFocus=!0;#n;constructor(){super(),this.root.addEventListener("click",t=>{let e=this.root.querySelector("button");!e||!t.composedPath().includes(e)||this.disabled||this.disabledFocusable||(this.pressed=!this.pressed,this.emit("bythium-toggle",{pressed:this.pressed}))}),this.#n=d(this,this.root)}disconnected(){this.#n.close()}view(){return p(this.props)}};a("bythium-toggle-button",r);export{r as a};
@@ -0,0 +1,298 @@
1
+ import{a as r}from"./chunk-BAYUYXVR.js";import{a as t,d as c,e as d}from"./chunk-W3ASGVKH.js";var p={locale:{type:"string",default:"fr-CA"},value:{type:"string",default:""},disabled:{type:"boolean",default:!1}},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
+ /* Bouton de copie : bouton natif de la base, bulle d\u2019\xE9tat sous le bouton ; les couleurs viennent des jetons. */
255
+ :host {
256
+ position: relative;
257
+ }
258
+ /* D\xE9sactiv\xE9 lisible : opacit\xE9 pleine, texte att\xE9nu\xE9 sur fond transparent (au lieu de 60 % d\u2019opacit\xE9, 3,96:1 en clair). */
259
+ :host([disabled]) {
260
+ opacity: 1;
261
+ }
262
+ /* Libell\xE9 puis pictogramme (SVG en currentColor, donc juste en clair, en sombre et en couleurs forc\xE9es), centr\xE9s sur une ligne. */
263
+ button {
264
+ display: inline-flex;
265
+ align-items: center;
266
+ gap: 6px;
267
+ }
268
+ button svg {
269
+ flex: none;
270
+ }
271
+ button:disabled {
272
+ background: transparent;
273
+ color: var(--bythium-text-muted);
274
+ }
275
+ /* Confirmation visible pendant deux secondes : la zone d\u2019\xE9tat (vide au repos, donc masqu\xE9e) devient une bulle sous le bouton, sans d\xE9caler la mise en page. */
276
+ [part=feedback]:not(:empty) {
277
+ position: absolute;
278
+ z-index: 1;
279
+ inset-inline-start: 0;
280
+ inset-block-start: calc(100% + 4px);
281
+ inline-size: max-content;
282
+ max-inline-size: min(280px,80vw);
283
+ block-size: auto;
284
+ margin: 0;
285
+ padding: 4px 8px;
286
+ overflow: visible;
287
+ clip-path: none;
288
+ white-space: normal;
289
+ border: 1px solid var(--bythium-border-subtle);
290
+ border-radius: var(--radius-control);
291
+ background: var(--bythium-surface-overlay);
292
+ box-shadow: var(--shadow-overlay);
293
+ color: var(--bythium-text-primary);
294
+ font-size: 12px;
295
+ line-height: 1.4;
296
+ pointer-events: none;
297
+ }
298
+ `;var i={info:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 11v6m0-10v1"}]],more:[["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]],chevron:[["path",{d:"m7 10 5 5 5-5"}]],filter:[["path",{d:"M4 6h16M7 12h10m-7 6h4"}]],reset:[["path",{d:"M4 10a8 8 0 1 1 1 8M4 4v6h6"}]],save:[["path",{d:"M5 3h12l4 4v14H3V3h2Zm2 0v6h10V3M7 21v-8h10v8"}]],layout:[["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}],["rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"}]],restore:[["path",{d:"M4 4v6h6m-6 0a8 8 0 1 1 0 5m8-8v5l3 2"}]],copy:[["path",{d:"M10.5 8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-7.5a2.25 2.25 0 0 1 2.25-2.25ZM15.75 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v7.5A2.25 2.25 0 0 0 6 15.75h2.25"}]]},f=Object.keys(i);function b(o){let n=Object.hasOwn(i,o)?i[o]:i.more;return t("svg",{"aria-hidden":"true",focusable:"false",width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},n.map(([e,h])=>t(e,{...h})))}var a={fr:{label:"Copier",copied:"Copi\xE9",denied:"Copie non autoris\xE9e. S\xE9lectionnez et copiez le texte manuellement."},en:{label:"Copy",copied:"Copied",denied:"Copy not allowed. Select and copy the text manually."}},s={feedback:""};function m(o,n=s){return[t("button",{part:"base",class:"target",type:"button",disabled:o.disabled},t("slot",{},r(a,o.locale).label),b("copy")),t("span",{part:"feedback",role:"status",class:"sr-only"},n.feedback)]}var y=2e3,l=class extends c{static props=p;static css=u;static delegatesFocus=!0;#n=s;#e;constructor(){super(),this.root.addEventListener("click",n=>{let e=this.root.querySelector("button");e&&n.composedPath().includes(e)&&!this.disabled&&this.#t()})}view(){return m(this.props,this.#n)}disconnected(){clearTimeout(this.#e),this.#e=void 0}async#t(){let n=this.value,e=!1;try{if(!navigator.clipboard?.writeText)throw new Error("Presse-papiers indisponible dans ce contexte.");await navigator.clipboard.writeText(n),e=!0}catch{e=!1}this.#n={feedback:e?r(a,this.locale).copied:r(a,this.locale).denied},this.emit("bythium-copy",{value:n,success:e}),this.requestUpdate(),clearTimeout(this.#e),this.isConnectedElement&&(this.#e=setTimeout(()=>{this.#e=void 0,this.#n=s,this.requestUpdate()},y))}};d("bythium-copy-button",l);export{l as a};