@bythium/unisson 0.1.1-rc.0 → 0.2.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/README.md +61 -15
- package/dist/CHANGELOG.md +23 -0
- package/dist/badge.d.ts +27 -0
- package/dist/badge.js +1 -0
- package/dist/button.js +1 -1
- package/dist/card.d.ts +29 -0
- package/dist/card.js +1 -0
- package/dist/checkbox.d.ts +39 -0
- package/dist/checkbox.js +1 -0
- package/dist/chunks/chunk-4JVFLK3U.js +416 -0
- package/dist/chunks/chunk-4LYJO5OS.js +411 -0
- package/dist/chunks/chunk-53M4DJQN.js +406 -0
- package/dist/chunks/chunk-5UXAUVTG.js +1 -0
- package/dist/chunks/chunk-6OG5ZBWQ.js +334 -0
- package/dist/chunks/chunk-7YT6MUHG.js +383 -0
- package/dist/chunks/chunk-B2JFDWCV.js +265 -0
- package/dist/chunks/chunk-D52FUFUP.js +1 -0
- package/dist/chunks/{chunk-MYB6FQX2.js → chunk-FATZ4W4Y.js} +2 -2
- package/dist/chunks/chunk-GG2TGBO7.js +388 -0
- package/dist/chunks/chunk-HBQNWILJ.js +447 -0
- package/dist/chunks/chunk-HYLPNRSS.js +346 -0
- package/dist/chunks/chunk-I67ANBTP.js +328 -0
- package/dist/chunks/chunk-IGDZPHRL.js +338 -0
- package/dist/chunks/chunk-J5K4GGOS.js +269 -0
- package/dist/chunks/chunk-KDXXLMWM.js +1 -0
- package/dist/chunks/{chunk-WKXQ2JMZ.js → chunk-NHTQILO5.js} +2 -2
- package/dist/chunks/chunk-ORYY4OPY.js +307 -0
- package/dist/chunks/chunk-QMY5FB4F.js +293 -0
- package/dist/chunks/chunk-SADTI7JS.js +319 -0
- package/dist/chunks/chunk-SEAWGQLP.js +316 -0
- package/dist/chunks/chunk-SUDTJKQT.js +314 -0
- package/dist/chunks/chunk-SVPZPTWA.js +353 -0
- package/dist/chunks/{chunk-MWNIQCR3.js → chunk-U7UKQQ5V.js} +1 -1
- package/dist/chunks/chunk-YAVUNJL2.js +326 -0
- package/dist/chunks/chunk-ZOW53TBP.js +358 -0
- package/dist/confirm-button.js +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/custom-elements.json +3925 -0
- package/dist/define.d.ts +20 -0
- package/dist/define.js +1 -1
- package/dist/dialog.d.ts +29 -0
- package/dist/dialog.js +1 -0
- package/dist/field.d.ts +23 -0
- package/dist/field.js +1 -0
- package/dist/form.d.ts +29 -0
- package/dist/form.js +1 -0
- package/dist/heading.d.ts +21 -0
- package/dist/heading.js +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +1 -1
- package/dist/inline-alert.d.ts +25 -0
- package/dist/inline-alert.js +1 -0
- package/dist/input.d.ts +53 -0
- package/dist/input.js +1 -0
- package/dist/radio-group.d.ts +45 -0
- package/dist/radio-group.js +1 -0
- package/dist/react/badge.d.ts +25 -0
- package/dist/react/badge.js +7 -0
- package/dist/react/card.d.ts +27 -0
- package/dist/react/card.js +7 -0
- package/dist/react/checkbox.d.ts +37 -0
- package/dist/react/checkbox.js +7 -0
- package/dist/react/dialog.d.ts +27 -0
- package/dist/react/dialog.js +7 -0
- package/dist/react/field.d.ts +21 -0
- package/dist/react/field.js +7 -0
- package/dist/react/form.d.ts +27 -0
- package/dist/react/form.js +7 -0
- package/dist/react/heading.d.ts +19 -0
- package/dist/react/heading.js +7 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +20 -0
- package/dist/react/inline-alert.d.ts +23 -0
- package/dist/react/inline-alert.js +7 -0
- package/dist/react/input.d.ts +51 -0
- package/dist/react/input.js +7 -0
- package/dist/react/radio-group.d.ts +43 -0
- package/dist/react/radio-group.js +7 -0
- package/dist/react/select.d.ts +39 -0
- package/dist/react/select.js +7 -0
- package/dist/react/stack.d.ts +25 -0
- package/dist/react/stack.js +7 -0
- package/dist/react/switch.d.ts +37 -0
- package/dist/react/switch.js +7 -0
- package/dist/react/tab-panel.d.ts +23 -0
- package/dist/react/tab-panel.js +7 -0
- package/dist/react/tab.d.ts +23 -0
- package/dist/react/tab.js +7 -0
- package/dist/react/tabs.d.ts +27 -0
- package/dist/react/tabs.js +7 -0
- package/dist/react/text.d.ts +23 -0
- package/dist/react/text.js +7 -0
- package/dist/react/textarea.d.ts +43 -0
- package/dist/react/textarea.js +7 -0
- package/dist/react/toast.d.ts +25 -0
- package/dist/react/toast.js +7 -0
- package/dist/react/toaster.d.ts +21 -0
- package/dist/react/toaster.js +7 -0
- package/dist/select.d.ts +41 -0
- package/dist/select.js +1 -0
- package/dist/stack.d.ts +27 -0
- package/dist/stack.js +1 -0
- package/dist/svelte/OBadge.svelte +14 -0
- package/dist/svelte/OBadge.svelte.d.ts +26 -0
- package/dist/svelte/OCard.svelte +14 -0
- package/dist/svelte/OCard.svelte.d.ts +28 -0
- package/dist/svelte/OCheckbox.svelte +14 -0
- package/dist/svelte/OCheckbox.svelte.d.ts +38 -0
- package/dist/svelte/ODialog.svelte +14 -0
- package/dist/svelte/ODialog.svelte.d.ts +28 -0
- package/dist/svelte/OField.svelte +14 -0
- package/dist/svelte/OField.svelte.d.ts +22 -0
- package/dist/svelte/OForm.svelte +14 -0
- package/dist/svelte/OForm.svelte.d.ts +28 -0
- package/dist/svelte/OHeading.svelte +14 -0
- package/dist/svelte/OHeading.svelte.d.ts +20 -0
- package/dist/svelte/OInlineAlert.svelte +14 -0
- package/dist/svelte/OInlineAlert.svelte.d.ts +24 -0
- package/dist/svelte/OInput.svelte +14 -0
- package/dist/svelte/OInput.svelte.d.ts +52 -0
- package/dist/svelte/ORadioGroup.svelte +14 -0
- package/dist/svelte/ORadioGroup.svelte.d.ts +44 -0
- package/dist/svelte/OSelect.svelte +14 -0
- package/dist/svelte/OSelect.svelte.d.ts +40 -0
- package/dist/svelte/OStack.svelte +14 -0
- package/dist/svelte/OStack.svelte.d.ts +26 -0
- package/dist/svelte/OSwitch.svelte +14 -0
- package/dist/svelte/OSwitch.svelte.d.ts +38 -0
- package/dist/svelte/OTab.svelte +14 -0
- package/dist/svelte/OTab.svelte.d.ts +24 -0
- package/dist/svelte/OTabPanel.svelte +14 -0
- package/dist/svelte/OTabPanel.svelte.d.ts +24 -0
- package/dist/svelte/OTabs.svelte +14 -0
- package/dist/svelte/OTabs.svelte.d.ts +28 -0
- package/dist/svelte/OText.svelte +14 -0
- package/dist/svelte/OText.svelte.d.ts +24 -0
- package/dist/svelte/OTextarea.svelte +14 -0
- package/dist/svelte/OTextarea.svelte.d.ts +44 -0
- package/dist/svelte/OToast.svelte +14 -0
- package/dist/svelte/OToast.svelte.d.ts +26 -0
- package/dist/svelte/OToaster.svelte +14 -0
- package/dist/svelte/OToaster.svelte.d.ts +22 -0
- package/dist/svelte/index.d.ts +20 -0
- package/dist/svelte/index.js +20 -0
- package/dist/switch.d.ts +39 -0
- package/dist/switch.js +1 -0
- package/dist/tab-panel.d.ts +25 -0
- package/dist/tab-panel.js +1 -0
- package/dist/tab.d.ts +25 -0
- package/dist/tab.js +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.js +1 -0
- package/dist/text.d.ts +25 -0
- package/dist/text.js +1 -0
- package/dist/textarea.d.ts +45 -0
- package/dist/textarea.js +1 -0
- package/dist/toast.d.ts +27 -0
- package/dist/toast.js +1 -0
- package/dist/toaster.d.ts +23 -0
- package/dist/toaster.js +1 -0
- package/dist/vue/badge.d.ts +26 -0
- package/dist/vue/badge.js +6 -0
- package/dist/vue/card.d.ts +28 -0
- package/dist/vue/card.js +6 -0
- package/dist/vue/checkbox.d.ts +37 -0
- package/dist/vue/checkbox.js +6 -0
- package/dist/vue/dialog.d.ts +27 -0
- package/dist/vue/dialog.js +6 -0
- package/dist/vue/field.d.ts +22 -0
- package/dist/vue/field.js +6 -0
- package/dist/vue/form.d.ts +27 -0
- package/dist/vue/form.js +6 -0
- package/dist/vue/heading.d.ts +20 -0
- package/dist/vue/heading.js +6 -0
- package/dist/vue/index.d.ts +20 -0
- package/dist/vue/index.js +20 -0
- package/dist/vue/inline-alert.d.ts +23 -0
- package/dist/vue/inline-alert.js +6 -0
- package/dist/vue/input.d.ts +51 -0
- package/dist/vue/input.js +6 -0
- package/dist/vue/radio-group.d.ts +43 -0
- package/dist/vue/radio-group.js +6 -0
- package/dist/vue/select.d.ts +39 -0
- package/dist/vue/select.js +6 -0
- package/dist/vue/stack.d.ts +26 -0
- package/dist/vue/stack.js +6 -0
- package/dist/vue/switch.d.ts +37 -0
- package/dist/vue/switch.js +6 -0
- package/dist/vue/tab-panel.d.ts +24 -0
- package/dist/vue/tab-panel.js +6 -0
- package/dist/vue/tab.d.ts +24 -0
- package/dist/vue/tab.js +6 -0
- package/dist/vue/tabs.d.ts +27 -0
- package/dist/vue/tabs.js +6 -0
- package/dist/vue/text.d.ts +24 -0
- package/dist/vue/text.js +6 -0
- package/dist/vue/textarea.d.ts +43 -0
- package/dist/vue/textarea.js +6 -0
- package/dist/vue/toast.d.ts +25 -0
- package/dist/vue/toast.js +6 -0
- package/dist/vue/toaster.d.ts +22 -0
- package/dist/vue/toaster.js +6 -0
- package/package.json +346 -3
- package/dist/chunks/chunk-BAYUYXVR.js +0 -1
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import{b as h}from"./chunk-D52FUFUP.js";import{a,d as b,e as p}from"./chunk-W3ASGVKH.js";var m={label:{type:"string",default:"Onglets"},value:{type:"string",default:""},activation:{type:"string",default:"automatic",enum:["automatic","manual"]},orientation:{type:"string",default:"horizontal",enum:["horizontal","vertical"]},locale:{type:"string",default:"fr-CA"}},v=`/* 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
|
+
:host {
|
|
255
|
+
display: block;
|
|
256
|
+
min-inline-size: 0;
|
|
257
|
+
}
|
|
258
|
+
[part=base] {
|
|
259
|
+
color: var(--bythium-text-primary);
|
|
260
|
+
}
|
|
261
|
+
.strip {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
gap: 2px;
|
|
265
|
+
min-inline-size: 0;
|
|
266
|
+
box-shadow: inset 0 -1px 0 var(--bythium-border-subtle);
|
|
267
|
+
}
|
|
268
|
+
[part=viewport] {
|
|
269
|
+
flex: 1;
|
|
270
|
+
min-inline-size: 0;
|
|
271
|
+
overflow: auto;
|
|
272
|
+
scrollbar-width: none;
|
|
273
|
+
}
|
|
274
|
+
[part=tablist] {
|
|
275
|
+
display: flex;
|
|
276
|
+
gap: 4px;
|
|
277
|
+
inline-size: max-content;
|
|
278
|
+
}
|
|
279
|
+
button {
|
|
280
|
+
flex-shrink: 0;
|
|
281
|
+
min-inline-size: 24px;
|
|
282
|
+
min-block-size: 24px;
|
|
283
|
+
padding: 0;
|
|
284
|
+
border-color: transparent;
|
|
285
|
+
background: transparent;
|
|
286
|
+
color: var(--bythium-text-muted);
|
|
287
|
+
font-size: 14px;
|
|
288
|
+
line-height: 1;
|
|
289
|
+
}
|
|
290
|
+
button:hover:not(:disabled) {
|
|
291
|
+
background: var(--bythium-state-hover);
|
|
292
|
+
color: var(--bythium-text-primary);
|
|
293
|
+
}
|
|
294
|
+
button:disabled {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
button:focus-visible {
|
|
298
|
+
outline: 2px solid var(--bythium-border-focus);
|
|
299
|
+
outline-offset: 1px;
|
|
300
|
+
}
|
|
301
|
+
:host([orientation=vertical]) {
|
|
302
|
+
--bythium-tabs-indicator: none;
|
|
303
|
+
--bythium-tabs-selected: var(--bythium-state-selected);
|
|
304
|
+
}
|
|
305
|
+
:host([orientation=vertical]) [part=base] {
|
|
306
|
+
display: flex;
|
|
307
|
+
gap: 16px;
|
|
308
|
+
}
|
|
309
|
+
:host([orientation=vertical]) .strip {
|
|
310
|
+
flex-direction: column;
|
|
311
|
+
align-items: stretch;
|
|
312
|
+
max-block-size: 320px;
|
|
313
|
+
padding-inline-end: 8px;
|
|
314
|
+
box-shadow: none;
|
|
315
|
+
border-inline-end: 1px solid var(--bythium-border-subtle);
|
|
316
|
+
}
|
|
317
|
+
:host([orientation=vertical]) [part=tablist] {
|
|
318
|
+
flex-direction: column;
|
|
319
|
+
gap: 2px;
|
|
320
|
+
inline-size: auto;
|
|
321
|
+
min-inline-size: 140px;
|
|
322
|
+
}
|
|
323
|
+
:host([orientation=vertical]) [part=viewport] {
|
|
324
|
+
min-block-size: 0;
|
|
325
|
+
max-block-size: 224px;
|
|
326
|
+
}
|
|
327
|
+
:host([orientation=vertical]) [part=panels] {
|
|
328
|
+
flex: 1;
|
|
329
|
+
min-inline-size: 0;
|
|
330
|
+
}
|
|
331
|
+
:host([orientation=vertical]) button {
|
|
332
|
+
transform: rotate(90deg);
|
|
333
|
+
align-self: center;
|
|
334
|
+
}
|
|
335
|
+
@media (pointer:coarse) {
|
|
336
|
+
button {
|
|
337
|
+
min-inline-size: 44px;
|
|
338
|
+
min-block-size: 44px;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
342
|
+
button:hover {
|
|
343
|
+
transition: background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
`;var d={canPrevious:!1,canNext:!1},f={fr:{label:"Onglets",previous:"Faire d\xE9filer les onglets pr\xE9c\xE9dents",next:"Faire d\xE9filer les onglets suivants"},en:{label:"Tabs",previous:"Scroll to the previous tabs",next:"Scroll to the next tabs"}};function x(o,e=d){let t=h(f,o.locale);return[a("div",{part:"base"},a("div",{class:"strip"},a("button",{part:"scroll-previous",class:"target",type:"button","data-scroll":-1,"aria-label":t.previous,disabled:!e.canPrevious},"\u2039"),a("div",{part:"viewport"},a("div",{part:"tablist",role:"tablist","aria-label":o.label&&o.label!==f.fr.label?o.label:t.label,"aria-orientation":o.orientation},a("slot",{name:"tabs"}))),a("button",{part:"scroll-next",class:"target",type:"button","data-scroll":1,"aria-label":t.next,disabled:!e.canNext},"\u203A")),a("div",{part:"panels"},a("slot")))]}var u=class extends b{static props=m;static css=v;static delegatesFocus=!0;#e=d;constructor(){super(),this.addEventListener("click",e=>{let t=e.target.closest("bythium-tab");t&&this.tabs.includes(t)&&this.choose(t);let n=e.composedPath().find(r=>r instanceof HTMLElement&&r.hasAttribute("data-scroll"));if(n){let r=matchMedia("(prefers-reduced-motion: reduce)").matches;this.viewport?.scrollBy({[this.orientation==="vertical"?"top":"left"]:Number(n.dataset.scroll)*160,behavior:r?"instant":"smooth"})}}),this.addEventListener("keydown",e=>this.#n(e)),this.root.addEventListener("slotchange",()=>this.sync())}get tabs(){return[...this.children].filter(e=>e.localName==="bythium-tab")}get panels(){return[...this.children].filter(e=>e.localName==="bythium-tab-panel")}get viewport(){return this.root.querySelector("[part=viewport]")}view(){return x(this.props,this.#e)}updated(){this.sync()}connected(){let e=new MutationObserver(()=>this.sync());e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled","slot"]});let t=new ResizeObserver(()=>this.#t()),n=this.viewport;n&&(t.observe(n),n.addEventListener("scroll",()=>this.#t(),{passive:!0,signal:this.signal})),this.signal.addEventListener("abort",()=>{e.disconnect(),t.disconnect()})}sync(){let e=this.tabs,t=e.filter(i=>!i.hasAttribute("disabled")),n=t.find(i=>i.getAttribute("value")===this.value)??t[0],r=n?.getAttribute("value")??"";n&&r!==this.value&&(this.value=r);for(let i of e)i.hasAttribute("selected")!==(i===n)&&i.toggleAttribute("selected",i===n);for(let i of this.panels){let s=!n||i.getAttribute("value")!==r;i.hasAttribute("hidden")!==s&&i.toggleAttribute("hidden",s)}this.#t()}choose(e){if(e.hasAttribute("disabled"))return;let t=e.getAttribute("value")??"";this.value!==t&&(this.value=t,this.emit("bythium-tab-change",{value:t})),this.sync()}#n(e){let t=e.composedPath().find(l=>l instanceof HTMLElement&&this.tabs.includes(l));if(!t)return;let n=this.tabs.filter(l=>!l.hasAttribute("disabled"));if(!n.length)return;let r=n.indexOf(t),i=this.orientation==="vertical",s=getComputedStyle(this).direction==="rtl";if(e.key==="Home")r=0;else if(e.key==="End")r=n.length-1;else if(e.key===(i?"ArrowDown":s?"ArrowLeft":"ArrowRight"))r=(r+1)%n.length;else if(e.key===(i?"ArrowUp":s?"ArrowRight":"ArrowLeft"))r=(r-1+n.length)%n.length;else if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.choose(t);return}else return;e.preventDefault();let c=n[r];c.focus(),c.scrollIntoView({block:"nearest",inline:"nearest"}),this.activation!=="manual"&&this.choose(c)}#t(){let e=this.viewport;if(!e)return;let t=this.orientation==="vertical",n=t?e.scrollTop:Math.abs(e.scrollLeft),r=t?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth,i={canPrevious:n>1,canNext:n<r-1};(i.canPrevious!==this.#e.canPrevious||i.canNext!==this.#e.canNext)&&(this.#e=i,this.requestUpdate())}};p("bythium-tabs",u);export{u as a};
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import{c as g}from"./chunk-5UXAUVTG.js";import{a as h,b as s,d as f,f as v}from"./chunk-D52FUFUP.js";import{a as o,b as c,d as p,e as b}from"./chunk-W3ASGVKH.js";var y={label:{type:"string",default:"Formulaire"},"heading-level":{type:"number",default:2,minimum:1,maximum:6},locale:{type:"string",default:"fr"}},x=`/* 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
|
+
:host {
|
|
255
|
+
display: block;
|
|
256
|
+
inline-size: 100%;
|
|
257
|
+
min-inline-size: 0;
|
|
258
|
+
accent-color: var(--bythium-brand-primary);
|
|
259
|
+
}
|
|
260
|
+
[part=base] {
|
|
261
|
+
display: grid;
|
|
262
|
+
gap: 12px;
|
|
263
|
+
color: var(--bythium-text-primary);
|
|
264
|
+
}
|
|
265
|
+
[hidden] {
|
|
266
|
+
display: none;
|
|
267
|
+
}
|
|
268
|
+
/* R\xE9sum\xE9 d\u2019erreurs sobre : teinte du r\xF4le en fond et bordure fine par m\xE9lange, sans cadre \xE9pais. */
|
|
269
|
+
[part=summary] {
|
|
270
|
+
display: grid;
|
|
271
|
+
gap: 4px;
|
|
272
|
+
padding: 10px 12px;
|
|
273
|
+
border: 1px solid color-mix(in oklch, var(--bythium-status-danger) 30%, var(--bythium-border-subtle));
|
|
274
|
+
border-radius: var(--radius-control);
|
|
275
|
+
background: color-mix(in oklch, var(--bythium-status-danger) 10%, var(--bythium-surface-base));
|
|
276
|
+
overflow-wrap: anywhere;
|
|
277
|
+
}
|
|
278
|
+
[part=summary][hidden] {
|
|
279
|
+
display: none;
|
|
280
|
+
}
|
|
281
|
+
[part=title] {
|
|
282
|
+
margin: 0;
|
|
283
|
+
color: var(--bythium-status-danger);
|
|
284
|
+
font-size: 13px;
|
|
285
|
+
font-weight: 600;
|
|
286
|
+
letter-spacing: -0.01em;
|
|
287
|
+
}
|
|
288
|
+
ul {
|
|
289
|
+
margin: 0;
|
|
290
|
+
padding-inline-start: 18px;
|
|
291
|
+
font-size: 13px;
|
|
292
|
+
}
|
|
293
|
+
ul:empty {
|
|
294
|
+
display: none;
|
|
295
|
+
}
|
|
296
|
+
li::marker {
|
|
297
|
+
color: var(--bythium-status-danger);
|
|
298
|
+
}
|
|
299
|
+
/* 24 px visibles ; liens empil\xE9s : la classe \xAB target-dense \xBB donne 24 px, 44 px au pointeur grossier (H-05). */
|
|
300
|
+
a {
|
|
301
|
+
min-block-size: 24px;
|
|
302
|
+
border-radius: var(--radius-sm);
|
|
303
|
+
color: var(--bythium-text-primary);
|
|
304
|
+
text-decoration-color: color-mix(in oklch, var(--bythium-status-danger) 60%, transparent);
|
|
305
|
+
}
|
|
306
|
+
a:hover {
|
|
307
|
+
text-decoration-color: currentColor;
|
|
308
|
+
}
|
|
309
|
+
@media (pointer: coarse) {
|
|
310
|
+
a {
|
|
311
|
+
min-block-size: 44px;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
@media (forced-colors: active) {
|
|
315
|
+
[part=summary] {
|
|
316
|
+
border-color: CanvasText;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/* Le formulaire natif reste dans le DOM l\xE9ger : espacement par d\xE9faut, que la page peut remplacer. */
|
|
320
|
+
::slotted(form) {
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-wrap: wrap;
|
|
323
|
+
align-items: center;
|
|
324
|
+
gap: 8px 12px;
|
|
325
|
+
margin: 0;
|
|
326
|
+
font-size: 13px;
|
|
327
|
+
}
|
|
328
|
+
`;var l={errors:[]},d={fr:{titleOne:"Corrigez {n} erreur",titleOther:"Corrigez {n} erreurs",field:"Champ",invalid:"Valeur invalide.",separator:" : "},en:{titleOne:"Fix {n} error",titleOther:"Fix {n} errors",field:"Field",invalid:"Invalid value.",separator:": "}},F=new Map;function z(i,e){let t=h(e),r=F.get(t);r||F.set(t,r=new Intl.NumberFormat(t==="en"?"en-CA":"fr-FR"));let n=s(d,e);return f(v(i,e)?n.titleOne:n.titleOther,{n:r.format(i)})}function k(i,e=l){let t=e.errors.length,{separator:r}=s(d,i.locale);return[o("section",{part:"base","aria-label":i.label},o("div",{part:"summary",tabindex:"-1","aria-labelledby":"form-errors-title",role:t?"alert":null,hidden:t===0},c(i.headingLevel,{part:"title",id:"form-errors-title"},z(t,i.locale)),o("ul",{part:"errors"},e.errors.map(n=>o("li",{key:n.id},o("a",{class:"target-dense",href:`#${encodeURIComponent(n.id)}`,"data-target":n.id},`${n.label}${r}${n.message}`))))),o("slot"))]}var E=0;function S(i){let e=i.assignedSlot?.getRootNode()?.host;return e&&e!==i&&e.constructor.formAssociated===!0?e:null}var u=class extends p{static props=y;static css=x;static delegatesFocus=!1;#n=l;#e=null;constructor(){super(),this.root.addEventListener("click",e=>{let t=e.target.closest("[data-target]");if(!t)return;e.preventDefault();let r=t.dataset.target??"";this.nativeForm?.querySelector(`[id="${CSS.escape(r)}"]`)?.focus()})}get nativeForm(){return this.querySelector("form")??this.closest("form")}get errors(){return this.#n.errors.map(e=>({...e}))}validate(){let e=this.nativeForm;if(!e)return!1;let t=[],r=s(d,this.locale);for(let n of Array.from(e.elements)){if(S(n)||n===this||n.disabled||n.matches(":disabled")||!n.validity||n.validity.valid||n.willValidate===!1)continue;n.id||(n.id=`bythium-form-field-${++E}`);let a=n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement,m=typeof n.label=="string"&&n.label||n.getAttribute("aria-label")||n.labels?.[0]?.textContent?.trim()||n.name||r.field;t.push({id:n.id,label:m,message:(a?g(n,{},this.locale):n.validationMessage)||r.invalid}),n.dispatchEvent(new Event("invalid",{cancelable:!0}))}return this.#n={errors:t},this.update(),t.length?(this.emit("bythium-invalid",{errors:this.errors}),queueMicrotask(()=>this.root.querySelector("[part=summary]")?.focus()),!1):!0}requestSubmit(){this.nativeForm?.requestSubmit()}reset(){this.nativeForm?.reset()}view(){return k(this.props,this.#n)}connected(){this.#t();let e=new MutationObserver(()=>this.#t());e.observe(this,{childList:!0}),this.signal.addEventListener("abort",()=>{e.disconnect(),this.#r()})}#t(){if(!this.querySelector("form")&&!this.closest("form")&&this.childNodes.length){let e=document.createElement("form");e.noValidate=!0,e.append(...this.childNodes),this.append(e)}this.#i()}#i(){let e=this.nativeForm;if(this.#e?.form===e||(this.#r(),!e))return;let t=new AbortController;this.#e={form:e,noValidate:e.noValidate,abort:t},e.noValidate||(e.noValidate=!0);let r=t.signal;e.addEventListener("submit",n=>{if(n.target!==e)return;if(!this.validate()){n.preventDefault();return}let a=n.submitter,m=this.emit("bythium-submit",{formData:new FormData(e,a),form:e},{cancelable:!0}),w=a?.hasAttribute("formmethod")?a.formMethod:e.method;(!m||!e.hasAttribute("action")||w!=="post")&&n.preventDefault()},{signal:r}),e.addEventListener("reset",()=>{this.#n=l,this.update(),this.emit("bythium-reset",{form:e})},{signal:r})}#r(){if(!this.#e)return;let{form:e,noValidate:t,abort:r}=this.#e;r.abort(),e.noValidate!==t&&(e.noValidate=t),this.#e=null}};b("bythium-form",u);export{u as a};
|