@lab-anssi/ui-kit 1.61.3 → 1.62.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 (221) hide show
  1. package/README.md +102 -21
  2. package/dist/assets/assets.d.ts +1 -0
  3. package/dist/assets/assets.js +1 -0
  4. package/dist/assets/dsfr-icons.css +1 -0
  5. package/dist/composants/Alerte.svelte +83 -0
  6. package/dist/composants/Alerte.svelte.d.ts +32 -0
  7. package/dist/composants/AncresParcours.svelte +132 -0
  8. package/dist/composants/AncresParcours.svelte.d.ts +11 -0
  9. package/dist/composants/BandeauPage.svelte +218 -0
  10. package/dist/composants/BandeauPage.svelte.d.ts +58 -0
  11. package/dist/composants/BlocFonctionnalites.svelte +570 -0
  12. package/dist/composants/BlocFonctionnalites.svelte.d.ts +105 -0
  13. package/dist/composants/Bouton.svelte +156 -0
  14. package/dist/composants/Bouton.svelte.d.ts +36 -0
  15. package/dist/composants/CentreAide.svelte +223 -0
  16. package/dist/composants/CentreAide.svelte.d.ts +41 -0
  17. package/dist/composants/FiltresCatalogue.svelte +147 -0
  18. package/dist/composants/FiltresCatalogue.svelte.d.ts +15 -0
  19. package/dist/composants/Icone.svelte +42 -0
  20. package/dist/composants/Icone.svelte.d.ts +7 -0
  21. package/dist/composants/Lien.svelte +233 -0
  22. package/dist/composants/Lien.svelte.d.ts +39 -0
  23. package/dist/composants/MultiSelect.svelte +931 -0
  24. package/dist/composants/MultiSelect.svelte.d.ts +51 -0
  25. package/dist/composants/Reactions.svelte +360 -0
  26. package/dist/composants/Reactions.svelte.d.ts +23 -0
  27. package/dist/composants/ResumePssi.svelte +92 -0
  28. package/dist/composants/ResumePssi.svelte.d.ts +6 -0
  29. package/dist/composants/Tag.svelte +113 -0
  30. package/dist/composants/Tag.svelte.d.ts +35 -0
  31. package/dist/composants/blog/BandeauTitre.svelte +150 -0
  32. package/dist/composants/blog/BandeauTitre.svelte.d.ts +29 -0
  33. package/dist/composants/blog/CarteArticle.svelte +69 -0
  34. package/dist/composants/blog/CarteArticle.svelte.d.ts +8 -0
  35. package/dist/composants/blog/IconeChevronBas.svelte +22 -0
  36. package/dist/composants/blog/IconeChevronBas.svelte.d.ts +26 -0
  37. package/dist/composants/blog/IconeMenuLateral.svelte +15 -0
  38. package/dist/composants/blog/IconeMenuLateral.svelte.d.ts +26 -0
  39. package/dist/composants/blog/ListeArticles.svelte +62 -0
  40. package/dist/composants/blog/ListeArticles.svelte.d.ts +9 -0
  41. package/dist/composants/blog/ListeDeroulante.svelte +57 -0
  42. package/dist/composants/blog/ListeDeroulante.svelte.d.ts +10 -0
  43. package/dist/composants/blog/PageCrisp.svelte +244 -0
  44. package/dist/composants/blog/PageCrisp.svelte.d.ts +8 -0
  45. package/dist/composants/blog/SommaireBureau.svelte +64 -0
  46. package/dist/composants/blog/SommaireBureau.svelte.d.ts +9 -0
  47. package/dist/composants/blog/SommaireMobile.svelte +115 -0
  48. package/dist/composants/blog/SommaireMobile.svelte.d.ts +9 -0
  49. package/dist/composants/carrousel-tuiles/CarrouselTuiles.svelte +184 -0
  50. package/dist/composants/carrousel-tuiles/CarrouselTuiles.svelte.d.ts +34 -0
  51. package/dist/composants/carrousel-tuiles/IconeFlecheDroite.svelte +16 -0
  52. package/dist/composants/carrousel-tuiles/IconeFlecheDroite.svelte.d.ts +26 -0
  53. package/dist/composants/carrousel-tuiles/IconeFlecheGauche.svelte +12 -0
  54. package/dist/composants/carrousel-tuiles/IconeFlecheGauche.svelte.d.ts +26 -0
  55. package/dist/composants/carrousel-tuiles/Tuile.svelte +72 -0
  56. package/dist/composants/carrousel-tuiles/Tuile.svelte.d.ts +10 -0
  57. package/dist/composants/icones/Fleche.svelte +25 -0
  58. package/dist/composants/icones/Fleche.svelte.d.ts +6 -0
  59. package/dist/composants/icones/LienExterne.svelte +20 -0
  60. package/dist/composants/icones/LienExterne.svelte.d.ts +6 -0
  61. package/dist/composants/marelle/Etape.svelte +165 -0
  62. package/dist/composants/marelle/Etape.svelte.d.ts +32 -0
  63. package/dist/composants/marelle/Marelle.svelte +97 -0
  64. package/dist/composants/marelle/Marelle.svelte.d.ts +44 -0
  65. package/dist/composants/mes-services-cyber/bandeau/Bandeau.svelte +158 -0
  66. package/dist/composants/mes-services-cyber/bandeau/Bandeau.svelte.d.ts +3 -0
  67. package/dist/composants/mes-services-cyber/lien/LienDiagnosticCyber.svelte +125 -0
  68. package/dist/composants/mes-services-cyber/lien/LienDiagnosticCyber.svelte.d.ts +7 -0
  69. package/dist/composants/pied-de-page/NavigationPiedDePage.svelte +62 -0
  70. package/dist/composants/pied-de-page/NavigationPiedDePage.svelte.d.ts +6 -0
  71. package/dist/composants/suite-cyber/AccueilSuiteCyber.svelte +96 -0
  72. package/dist/composants/suite-cyber/AccueilSuiteCyber.svelte.d.ts +6 -0
  73. package/dist/composants/suite-cyber/LiensSuiteCyber.svelte +99 -0
  74. package/dist/composants/suite-cyber/LiensSuiteCyber.svelte.d.ts +14 -0
  75. package/dist/composants/suite-cyber/SuiteCyber.svelte +296 -0
  76. package/dist/composants/suite-cyber/SuiteCyber.svelte.d.ts +6 -0
  77. package/dist/composants/vitrines-produits/briques/Brique.svelte +50 -0
  78. package/dist/composants/vitrines-produits/briques/Brique.svelte.d.ts +9 -0
  79. package/dist/composants/vitrines-produits/briques/BriqueContenuADeuxColonnes.svelte +144 -0
  80. package/dist/composants/vitrines-produits/briques/BriqueContenuADeuxColonnes.svelte.d.ts +29 -0
  81. package/dist/composants/vitrines-produits/briques/BriqueHero.svelte +246 -0
  82. package/dist/composants/vitrines-produits/briques/BriqueHero.svelte.d.ts +31 -0
  83. package/dist/composants/vitrines-produits/briques/BriqueTitreMultimedia.svelte +50 -0
  84. package/dist/composants/vitrines-produits/briques/BriqueTitreMultimedia.svelte.d.ts +25 -0
  85. package/dist/composants/vitrines-produits/briques/LecteurVideo.svelte +14 -0
  86. package/dist/composants/vitrines-produits/briques/LecteurVideo.svelte.d.ts +9 -0
  87. package/dist/composants/vitrines-produits/briques/PresentationANSSI.svelte +148 -0
  88. package/dist/composants/vitrines-produits/briques/PresentationANSSI.svelte.d.ts +37 -0
  89. package/dist/composants/vitrines-produits/briques/RejoindreLaCommunaute.svelte +139 -0
  90. package/dist/composants/vitrines-produits/briques/RejoindreLaCommunaute.svelte.d.ts +36 -0
  91. package/dist/composants/vitrines-produits/briques/temoignages/IconeTemoignage.svelte +18 -0
  92. package/dist/composants/vitrines-produits/briques/temoignages/IconeTemoignage.svelte.d.ts +26 -0
  93. package/dist/composants/vitrines-produits/briques/temoignages/Temoignages.svelte +168 -0
  94. package/dist/composants/vitrines-produits/briques/temoignages/Temoignages.svelte.d.ts +13 -0
  95. package/dist/directives/actions.svelte.d.ts +32 -0
  96. package/dist/directives/actions.svelte.js +158 -0
  97. package/dist/dsfr/DsfrAccordion.svelte +889 -0
  98. package/dist/dsfr/DsfrAccordion.svelte.d.ts +40 -0
  99. package/dist/dsfr/DsfrAlert.svelte +2097 -0
  100. package/dist/dsfr/DsfrAlert.svelte.d.ts +36 -0
  101. package/dist/dsfr/DsfrBadge.svelte +532 -0
  102. package/dist/dsfr/DsfrBadge.svelte.d.ts +41 -0
  103. package/dist/dsfr/DsfrBadgesGroup.svelte +610 -0
  104. package/dist/dsfr/DsfrBadgesGroup.svelte.d.ts +25 -0
  105. package/dist/dsfr/DsfrBreadcrumb.svelte +657 -0
  106. package/dist/dsfr/DsfrBreadcrumb.svelte.d.ts +25 -0
  107. package/dist/dsfr/DsfrButton.svelte +1821 -0
  108. package/dist/dsfr/DsfrButton.svelte.d.ts +68 -0
  109. package/dist/dsfr/DsfrButtonsGroup.svelte +1896 -0
  110. package/dist/dsfr/DsfrButtonsGroup.svelte.d.ts +36 -0
  111. package/dist/dsfr/DsfrCallout.svelte +242 -0
  112. package/dist/dsfr/DsfrCallout.svelte.d.ts +46 -0
  113. package/dist/dsfr/DsfrCard.svelte +10223 -0
  114. package/dist/dsfr/DsfrCard.svelte.d.ts +102 -0
  115. package/dist/dsfr/DsfrCheckbox.svelte +1280 -0
  116. package/dist/dsfr/DsfrCheckbox.svelte.d.ts +69 -0
  117. package/dist/dsfr/DsfrCheckboxesGroup.svelte +1532 -0
  118. package/dist/dsfr/DsfrCheckboxesGroup.svelte.d.ts +73 -0
  119. package/dist/dsfr/DsfrConnect.svelte +511 -0
  120. package/dist/dsfr/DsfrConnect.svelte.d.ts +15 -0
  121. package/dist/dsfr/DsfrContainer.svelte +894 -0
  122. package/dist/dsfr/DsfrContainer.svelte.d.ts +31 -0
  123. package/dist/dsfr/DsfrContent.svelte +1140 -0
  124. package/dist/dsfr/DsfrContent.svelte.d.ts +60 -0
  125. package/dist/dsfr/DsfrDropdown.svelte +335 -0
  126. package/dist/dsfr/DsfrDropdown.svelte.d.ts +73 -0
  127. package/dist/dsfr/DsfrFooter.svelte +2370 -0
  128. package/dist/dsfr/DsfrFooter.svelte.d.ts +77 -0
  129. package/dist/dsfr/DsfrHeader.svelte +4162 -0
  130. package/dist/dsfr/DsfrHeader.svelte.d.ts +131 -0
  131. package/dist/dsfr/DsfrHighlight.svelte +294 -0
  132. package/dist/dsfr/DsfrHighlight.svelte.d.ts +33 -0
  133. package/dist/dsfr/DsfrInput.svelte +1270 -0
  134. package/dist/dsfr/DsfrInput.svelte.d.ts +86 -0
  135. package/dist/dsfr/DsfrLabel.svelte +438 -0
  136. package/dist/dsfr/DsfrLabel.svelte.d.ts +65 -0
  137. package/dist/dsfr/DsfrLink.svelte +1007 -0
  138. package/dist/dsfr/DsfrLink.svelte.d.ts +66 -0
  139. package/dist/dsfr/DsfrLogo.svelte +228 -0
  140. package/dist/dsfr/DsfrLogo.svelte.d.ts +11 -0
  141. package/dist/dsfr/DsfrMessagesGroup.svelte +260 -0
  142. package/dist/dsfr/DsfrMessagesGroup.svelte.d.ts +46 -0
  143. package/dist/dsfr/DsfrModal.svelte +2983 -0
  144. package/dist/dsfr/DsfrModal.svelte.d.ts +56 -0
  145. package/dist/dsfr/DsfrNavigation.svelte +7626 -0
  146. package/dist/dsfr/DsfrNotice.svelte +2948 -0
  147. package/dist/dsfr/DsfrNotice.svelte.d.ts +37 -0
  148. package/dist/dsfr/DsfrPagination.svelte +1036 -0
  149. package/dist/dsfr/DsfrPagination.svelte.d.ts +35 -0
  150. package/dist/dsfr/DsfrQuote.svelte +646 -0
  151. package/dist/dsfr/DsfrQuote.svelte.d.ts +29 -0
  152. package/dist/dsfr/DsfrRadio.svelte +1307 -0
  153. package/dist/dsfr/DsfrRadio.svelte.d.ts +37 -0
  154. package/dist/dsfr/DsfrRadiosGroup.svelte +1629 -0
  155. package/dist/dsfr/DsfrRadiosGroup.svelte.d.ts +76 -0
  156. package/dist/dsfr/DsfrRange.svelte +1329 -0
  157. package/dist/dsfr/DsfrRange.svelte.d.ts +77 -0
  158. package/dist/dsfr/DsfrSearch.svelte +2015 -0
  159. package/dist/dsfr/DsfrSearch.svelte.d.ts +51 -0
  160. package/dist/dsfr/DsfrSegmented.svelte +422 -0
  161. package/dist/dsfr/DsfrSegmented.svelte.d.ts +34 -0
  162. package/dist/dsfr/DsfrSelect.svelte +1068 -0
  163. package/dist/dsfr/DsfrSelect.svelte.d.ts +86 -0
  164. package/dist/dsfr/DsfrShare.svelte +2228 -0
  165. package/dist/dsfr/DsfrShare.svelte.d.ts +40 -0
  166. package/dist/dsfr/DsfrSideMenu.svelte +1211 -0
  167. package/dist/dsfr/DsfrSideMenu.svelte.d.ts +34 -0
  168. package/dist/dsfr/DsfrSkipLink.svelte +990 -0
  169. package/dist/dsfr/DsfrSkipLink.svelte.d.ts +13 -0
  170. package/dist/dsfr/DsfrStepper.svelte +340 -0
  171. package/dist/dsfr/DsfrStepper.svelte.d.ts +18 -0
  172. package/dist/dsfr/DsfrTable.svelte +829 -0
  173. package/dist/dsfr/DsfrTable.svelte.d.ts +202 -0
  174. package/dist/dsfr/DsfrTabnav.svelte +1149 -0
  175. package/dist/dsfr/DsfrTabnav.svelte.d.ts +36 -0
  176. package/dist/dsfr/DsfrTabs.svelte +926 -0
  177. package/dist/dsfr/DsfrTabs.svelte.d.ts +28 -0
  178. package/dist/dsfr/DsfrTag.svelte +1269 -0
  179. package/dist/dsfr/DsfrTag.svelte.d.ts +59 -0
  180. package/dist/dsfr/DsfrTagsGroup.svelte +1351 -0
  181. package/dist/dsfr/DsfrTagsGroup.svelte.d.ts +37 -0
  182. package/dist/dsfr/DsfrTextarea.svelte +1385 -0
  183. package/dist/dsfr/DsfrTextarea.svelte.d.ts +72 -0
  184. package/dist/dsfr/DsfrTile.svelte +7645 -0
  185. package/dist/dsfr/DsfrTile.svelte.d.ts +79 -0
  186. package/dist/dsfr/DsfrToggle.svelte +1453 -0
  187. package/dist/dsfr/DsfrToggle.svelte.d.ts +56 -0
  188. package/dist/dsfr/DsfrTooltip.svelte +396 -0
  189. package/dist/dsfr/DsfrTooltip.svelte.d.ts +36 -0
  190. package/dist/dsfr/DsfrTranscription.svelte +2962 -0
  191. package/dist/dsfr/DsfrTranscription.svelte.d.ts +39 -0
  192. package/dist/dsfr/DsfrTranslate.svelte +1384 -0
  193. package/dist/dsfr/DsfrTranslate.svelte.d.ts +19 -0
  194. package/dist/dsfr/DsfrUser.svelte +736 -0
  195. package/dist/dsfr/DsfrUser.svelte.d.ts +65 -0
  196. package/dist/index.d.ts +79 -0
  197. package/dist/index.js +79 -0
  198. package/dist/styles/apparence-bouton.scss +154 -0
  199. package/dist/styles/dsfr-icons.css +1 -0
  200. package/dist/styles/dsfr-icons.scss +4 -0
  201. package/dist/styles/dsfr-variables.scss +28 -0
  202. package/dist/styles/mixins-dsfr.scss +226 -0
  203. package/dist/styles/mixins.scss +51 -0
  204. package/dist/types/commun.d.ts +63 -0
  205. package/dist/types/commun.js +1 -0
  206. package/dist/types/global.d.ts +24 -0
  207. package/dist/types/global.js +9 -0
  208. package/dist/types/index.d.ts +2 -0
  209. package/dist/types/index.js +1 -0
  210. package/dist/ui-kit-components.json +142 -100
  211. package/dist/utilitaires/createFormValidation.svelte.d.ts +34 -0
  212. package/dist/utilitaires/createFormValidation.svelte.js +183 -0
  213. package/dist/utilitaires/icons-stylesheet.d.ts +370 -0
  214. package/dist/utilitaires/icons-stylesheet.js +33 -0
  215. package/dist/utilitaires/index.d.ts +14 -0
  216. package/dist/utilitaires/index.js +26 -0
  217. package/dist/web-types.json +149 -101
  218. package/dist/webcomponents/lab-anssi-ui-kit.iife.js +36 -9
  219. package/dist/webcomponents/lab-anssi-ui-kit.jsx.d.ts +42 -24
  220. package/package.json +49 -43
  221. package/dist/index.html +0 -0
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Crée un état de validation pour les composants de formulaire.
3
+ * Encapsule la logique de validation des contraintes HTML pour les custom elements.
4
+ *
5
+ * @returns Un objet contenant l'état de validation et les méthodes associées
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const validation = createFormValidation();
10
+ *
11
+ * // Dans un $effect
12
+ * validation.setup(internals, formControlElement, host, () => value);
13
+ *
14
+ * // Dans le template
15
+ * <input
16
+ * bind:this={formControlElement}
17
+ * onblur={validation.handleBlur}
18
+ * oninvalid={validation.handleInvalid}
19
+ * />
20
+ * ```
21
+ */
22
+ export function createFormValidation() {
23
+ let customValidityMessage = $state("");
24
+ let hasInteracted = $state(false);
25
+ let localStatus = $state("default");
26
+ let localErrorMessage = $state("");
27
+ let internals;
28
+ let formControlElement;
29
+ let host;
30
+ let resetValueCallback;
31
+ /**
32
+ * Met à jour la validité du champ de formulaire.
33
+ * Vérifie les messages de validité personnalisés et la validité native du formulaire.
34
+ * Met à jour l'état local et le message d'erreur si l'utilisateur a interagi avec le champ.
35
+ */
36
+ function updateValidity() {
37
+ if (!internals || !formControlElement)
38
+ return;
39
+ if (customValidityMessage) {
40
+ internals.setValidity({ customError: true }, customValidityMessage, formControlElement);
41
+ if (hasInteracted) {
42
+ localStatus = "error";
43
+ localErrorMessage = customValidityMessage;
44
+ }
45
+ }
46
+ else if (!formControlElement.validity.valid) {
47
+ internals.setValidity(formControlElement.validity, formControlElement.validationMessage, formControlElement);
48
+ if (hasInteracted) {
49
+ localStatus = "error";
50
+ localErrorMessage = formControlElement.validationMessage;
51
+ }
52
+ }
53
+ else {
54
+ internals.setValidity({});
55
+ if (hasInteracted) {
56
+ localStatus = "default";
57
+ localErrorMessage = "";
58
+ }
59
+ }
60
+ }
61
+ /**
62
+ * Gère l'événement blur du champ de formulaire.
63
+ * Marque le composant comme ayant interagi si la valeur n'est pas vide.
64
+ *
65
+ * @param {Event} event - L'événement blur déclenché
66
+ */
67
+ function handleBlur(event) {
68
+ const target = event.target;
69
+ if (!hasInteracted && "value" in target && target.value) {
70
+ hasInteracted = true;
71
+ updateValidity();
72
+ }
73
+ }
74
+ /**
75
+ * Gère l'événement invalid du champ de formulaire.
76
+ * Marque le composant comme ayant interagi et met à jour la validité.
77
+ *
78
+ * @param {Event} event - L'événement invalid déclenché
79
+ */
80
+ function handleInvalid(event) {
81
+ event.preventDefault();
82
+ hasInteracted = true;
83
+ updateValidity();
84
+ }
85
+ /**
86
+ * Gère l'événement formreset du formulaire.
87
+ * Réinitialise l'état du composant lors du reset du formulaire.
88
+ */
89
+ function handleFormReset() {
90
+ if (resetValueCallback) {
91
+ resetValueCallback();
92
+ }
93
+ hasInteracted = false;
94
+ localStatus = "default";
95
+ localErrorMessage = "";
96
+ customValidityMessage = "";
97
+ if (internals) {
98
+ internals.setValidity({});
99
+ }
100
+ }
101
+ /**
102
+ * Définit un message de validité personnalisé pour le champ.
103
+ * Met à jour le message de validité personnalisé et déclenche la vérification de validité.
104
+ *
105
+ * @param {string} message - Le message de validité personnalisé à définir
106
+ */
107
+ function setCustomValidity(message) {
108
+ customValidityMessage = message;
109
+ updateValidity();
110
+ }
111
+ /**
112
+ * Stocke les références nécessaires à la validation.
113
+ * À appeler une fois au montage du composant dans un $effect.
114
+ *
115
+ * @param {ElementInternals} internalsRef - L'interface ElementInternals du custom element
116
+ * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} element - L'élément de formulaire natif
117
+ * @param {HTMLElement} hostElement - L'élément hôte du custom element
118
+ * @param {() => void} resetCallback - Fonction pour réinitialiser la valeur lors du reset
119
+ */
120
+ function setup(internalsRef, element, hostElement, resetCallback) {
121
+ internals = internalsRef;
122
+ formControlElement = element;
123
+ host = hostElement;
124
+ resetValueCallback = resetCallback;
125
+ }
126
+ /**
127
+ * Synchronise la valeur du formulaire et met à jour la validité.
128
+ * À appeler dans un $effect qui observe les changements de valeur.
129
+ *
130
+ * @param {string | undefined} value - La valeur actuelle du champ
131
+ * @param {boolean} bypassNativeValidation - Permet de "bypasser" la validation native
132
+ */
133
+ function syncFormValue(value, bypassNativeValidation = false) {
134
+ if (!internals || !formControlElement)
135
+ return;
136
+ internals.setFormValue(value ?? "");
137
+ if (bypassNativeValidation) {
138
+ internals.setValidity({});
139
+ }
140
+ else {
141
+ updateValidity();
142
+ }
143
+ }
144
+ /**
145
+ * Attache les event listeners pour la validation.
146
+ * À appeler dans un $effect pour gérer le cycle de vie.
147
+ *
148
+ * @returns Fonction de cleanup pour retirer les listeners
149
+ */
150
+ function attachListeners() {
151
+ if (!host || !internals)
152
+ return;
153
+ host.addEventListener("invalid", handleInvalid);
154
+ internals.form?.addEventListener("reset", handleFormReset);
155
+ return () => {
156
+ host?.removeEventListener("invalid", handleInvalid);
157
+ internals?.form?.removeEventListener("reset", handleFormReset);
158
+ };
159
+ }
160
+ return {
161
+ // État réactif
162
+ get customValidityMessage() {
163
+ return customValidityMessage;
164
+ },
165
+ get hasInteracted() {
166
+ return hasInteracted;
167
+ },
168
+ get localStatus() {
169
+ return localStatus;
170
+ },
171
+ get localErrorMessage() {
172
+ return localErrorMessage;
173
+ },
174
+ // Méthodes
175
+ setup,
176
+ updateValidity,
177
+ handleBlur,
178
+ handleInvalid,
179
+ setCustomValidity,
180
+ syncFormValue,
181
+ attachListeners,
182
+ };
183
+ }
@@ -0,0 +1,370 @@
1
+ /**
2
+ * Retourne la feuille de style partagée des icônes DSFR.
3
+ */
4
+ export declare function getIconsStyleSheet(): CSSStyleSheet;
5
+ type CustomElementConstructor = new (...args: unknown[]) => HTMLElement;
6
+ /**
7
+ * Permet d'étendre la class des WebComponents afin d'injecter la feuille de style des icônes DSFR dans le Shadow DOM.
8
+ */
9
+ export declare function withIconsStyleSheet(CustomElementClass: CustomElementConstructor): {
10
+ new (...args: unknown[]): {
11
+ connectedCallback(): void;
12
+ accessKey: string;
13
+ readonly accessKeyLabel: string;
14
+ autocapitalize: string;
15
+ autocorrect: boolean;
16
+ dir: string;
17
+ draggable: boolean;
18
+ hidden: boolean | "until-found";
19
+ inert: boolean;
20
+ innerText: string;
21
+ lang: string;
22
+ readonly offsetHeight: number;
23
+ readonly offsetLeft: number;
24
+ readonly offsetParent: Element | null;
25
+ readonly offsetTop: number;
26
+ readonly offsetWidth: number;
27
+ outerText: string;
28
+ popover: string | null;
29
+ spellcheck: boolean;
30
+ title: string;
31
+ translate: boolean;
32
+ writingSuggestions: string;
33
+ attachInternals(): ElementInternals;
34
+ click(): void;
35
+ hidePopover(): void;
36
+ showPopover(options?: ShowPopoverOptions): void;
37
+ togglePopover(options?: TogglePopoverOptions | boolean): boolean;
38
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
39
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
40
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
41
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
42
+ readonly attributes: NamedNodeMap;
43
+ get classList(): DOMTokenList;
44
+ set classList(value: string);
45
+ className: string;
46
+ readonly clientHeight: number;
47
+ readonly clientLeft: number;
48
+ readonly clientTop: number;
49
+ readonly clientWidth: number;
50
+ readonly currentCSSZoom: number;
51
+ readonly customElementRegistry: CustomElementRegistry | null;
52
+ id: string;
53
+ innerHTML: string;
54
+ readonly localName: string;
55
+ readonly namespaceURI: string | null;
56
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
57
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
58
+ outerHTML: string;
59
+ readonly ownerDocument: Document;
60
+ get part(): DOMTokenList;
61
+ set part(value: string);
62
+ readonly prefix: string | null;
63
+ readonly scrollHeight: number;
64
+ scrollLeft: number;
65
+ scrollTop: number;
66
+ readonly scrollWidth: number;
67
+ readonly shadowRoot: ShadowRoot | null;
68
+ slot: string;
69
+ readonly tagName: string;
70
+ attachShadow(init: ShadowRootInit): ShadowRoot;
71
+ checkVisibility(options?: CheckVisibilityOptions): boolean;
72
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
73
+ closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
74
+ closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
75
+ closest<E extends Element = Element>(selectors: string): E | null;
76
+ computedStyleMap(): StylePropertyMapReadOnly;
77
+ getAttribute(qualifiedName: string): string | null;
78
+ getAttributeNS(namespace: string | null, localName: string): string | null;
79
+ getAttributeNames(): string[];
80
+ getAttributeNode(qualifiedName: string): Attr | null;
81
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
82
+ getBoundingClientRect(): DOMRect;
83
+ getClientRects(): DOMRectList;
84
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
85
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
86
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
87
+ getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
88
+ getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
89
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
90
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
91
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
92
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
93
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
94
+ getHTML(options?: GetHTMLOptions): string;
95
+ hasAttribute(qualifiedName: string): boolean;
96
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
97
+ hasAttributes(): boolean;
98
+ hasPointerCapture(pointerId: number): boolean;
99
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
100
+ insertAdjacentHTML(position: InsertPosition, string: string): void;
101
+ insertAdjacentText(where: InsertPosition, data: string): void;
102
+ matches<K extends keyof HTMLElementTagNameMap>(selectors: K): this is HTMLElementTagNameMap[K];
103
+ matches<K extends keyof SVGElementTagNameMap>(selectors: K): this is SVGElementTagNameMap[K];
104
+ matches<K extends keyof MathMLElementTagNameMap>(selectors: K): this is MathMLElementTagNameMap[K];
105
+ matches(selectors: string): boolean;
106
+ releasePointerCapture(pointerId: number): void;
107
+ removeAttribute(qualifiedName: string): void;
108
+ removeAttributeNS(namespace: string | null, localName: string): void;
109
+ removeAttributeNode(attr: Attr): Attr;
110
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
111
+ requestPointerLock(options?: PointerLockOptions): Promise<void>;
112
+ scroll(options?: ScrollToOptions): void;
113
+ scroll(x: number, y: number): void;
114
+ scrollBy(options?: ScrollToOptions): void;
115
+ scrollBy(x: number, y: number): void;
116
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
117
+ scrollTo(options?: ScrollToOptions): void;
118
+ scrollTo(x: number, y: number): void;
119
+ setAttribute(qualifiedName: string, value: string): void;
120
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
121
+ setAttributeNode(attr: Attr): Attr | null;
122
+ setAttributeNodeNS(attr: Attr): Attr | null;
123
+ setHTMLUnsafe(html: string): void;
124
+ setPointerCapture(pointerId: number): void;
125
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
126
+ webkitMatchesSelector(selectors: string): boolean;
127
+ get textContent(): string;
128
+ set textContent(value: string | null);
129
+ readonly baseURI: string;
130
+ readonly childNodes: NodeListOf<ChildNode>;
131
+ readonly firstChild: ChildNode | null;
132
+ readonly isConnected: boolean;
133
+ readonly lastChild: ChildNode | null;
134
+ readonly nextSibling: ChildNode | null;
135
+ readonly nodeName: string;
136
+ readonly nodeType: number;
137
+ nodeValue: string | null;
138
+ readonly parentElement: HTMLElement | null;
139
+ readonly parentNode: ParentNode | null;
140
+ readonly previousSibling: ChildNode | null;
141
+ appendChild<T extends Node>(node: T): T;
142
+ cloneNode(subtree?: boolean): Node;
143
+ compareDocumentPosition(other: Node): number;
144
+ contains(other: Node | null): boolean;
145
+ getRootNode(options?: GetRootNodeOptions): Node;
146
+ hasChildNodes(): boolean;
147
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
148
+ isDefaultNamespace(namespace: string | null): boolean;
149
+ isEqualNode(otherNode: Node | null): boolean;
150
+ isSameNode(otherNode: Node | null): boolean;
151
+ lookupNamespaceURI(prefix: string | null): string | null;
152
+ lookupPrefix(namespace: string | null): string | null;
153
+ normalize(): void;
154
+ removeChild<T extends Node>(child: T): T;
155
+ replaceChild<T extends Node>(node: Node, child: T): T;
156
+ readonly ELEMENT_NODE: 1;
157
+ readonly ATTRIBUTE_NODE: 2;
158
+ readonly TEXT_NODE: 3;
159
+ readonly CDATA_SECTION_NODE: 4;
160
+ readonly ENTITY_REFERENCE_NODE: 5;
161
+ readonly ENTITY_NODE: 6;
162
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
163
+ readonly COMMENT_NODE: 8;
164
+ readonly DOCUMENT_NODE: 9;
165
+ readonly DOCUMENT_TYPE_NODE: 10;
166
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
167
+ readonly NOTATION_NODE: 12;
168
+ readonly DOCUMENT_POSITION_DISCONNECTED: 1;
169
+ readonly DOCUMENT_POSITION_PRECEDING: 2;
170
+ readonly DOCUMENT_POSITION_FOLLOWING: 4;
171
+ readonly DOCUMENT_POSITION_CONTAINS: 8;
172
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
173
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
174
+ dispatchEvent(event: Event): boolean;
175
+ ariaActiveDescendantElement: Element | null;
176
+ ariaAtomic: string | null;
177
+ ariaAutoComplete: string | null;
178
+ ariaBrailleLabel: string | null;
179
+ ariaBrailleRoleDescription: string | null;
180
+ ariaBusy: string | null;
181
+ ariaChecked: string | null;
182
+ ariaColCount: string | null;
183
+ ariaColIndex: string | null;
184
+ ariaColIndexText: string | null;
185
+ ariaColSpan: string | null;
186
+ ariaControlsElements: ReadonlyArray<Element> | null;
187
+ ariaCurrent: string | null;
188
+ ariaDescribedByElements: ReadonlyArray<Element> | null;
189
+ ariaDescription: string | null;
190
+ ariaDetailsElements: ReadonlyArray<Element> | null;
191
+ ariaDisabled: string | null;
192
+ ariaErrorMessageElements: ReadonlyArray<Element> | null;
193
+ ariaExpanded: string | null;
194
+ ariaFlowToElements: ReadonlyArray<Element> | null;
195
+ ariaHasPopup: string | null;
196
+ ariaHidden: string | null;
197
+ ariaInvalid: string | null;
198
+ ariaKeyShortcuts: string | null;
199
+ ariaLabel: string | null;
200
+ ariaLabelledByElements: ReadonlyArray<Element> | null;
201
+ ariaLevel: string | null;
202
+ ariaLive: string | null;
203
+ ariaModal: string | null;
204
+ ariaMultiLine: string | null;
205
+ ariaMultiSelectable: string | null;
206
+ ariaOrientation: string | null;
207
+ ariaOwnsElements: ReadonlyArray<Element> | null;
208
+ ariaPlaceholder: string | null;
209
+ ariaPosInSet: string | null;
210
+ ariaPressed: string | null;
211
+ ariaReadOnly: string | null;
212
+ ariaRelevant: string | null;
213
+ ariaRequired: string | null;
214
+ ariaRoleDescription: string | null;
215
+ ariaRowCount: string | null;
216
+ ariaRowIndex: string | null;
217
+ ariaRowIndexText: string | null;
218
+ ariaRowSpan: string | null;
219
+ ariaSelected: string | null;
220
+ ariaSetSize: string | null;
221
+ ariaSort: string | null;
222
+ ariaValueMax: string | null;
223
+ ariaValueMin: string | null;
224
+ ariaValueNow: string | null;
225
+ ariaValueText: string | null;
226
+ role: string | null;
227
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
228
+ getAnimations(options?: GetAnimationsOptions): Animation[];
229
+ after(...nodes: (Node | string)[]): void;
230
+ before(...nodes: (Node | string)[]): void;
231
+ remove(): void;
232
+ replaceWith(...nodes: (Node | string)[]): void;
233
+ readonly nextElementSibling: Element | null;
234
+ readonly previousElementSibling: Element | null;
235
+ readonly childElementCount: number;
236
+ readonly children: HTMLCollection;
237
+ readonly firstElementChild: Element | null;
238
+ readonly lastElementChild: Element | null;
239
+ append(...nodes: (Node | string)[]): void;
240
+ moveBefore(node: Node, child: Node | null): void;
241
+ prepend(...nodes: (Node | string)[]): void;
242
+ querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
243
+ querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
244
+ querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
245
+ querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
246
+ querySelector<E extends Element = Element>(selectors: string): E | null;
247
+ querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
248
+ querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
249
+ querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
250
+ querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
251
+ querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
252
+ replaceChildren(...nodes: (Node | string)[]): void;
253
+ readonly assignedSlot: HTMLSlotElement | null;
254
+ readonly attributeStyleMap: StylePropertyMap;
255
+ get style(): CSSStyleDeclaration;
256
+ set style(cssText: string);
257
+ contentEditable: string;
258
+ enterKeyHint: string;
259
+ inputMode: string;
260
+ readonly isContentEditable: boolean;
261
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
262
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
263
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
264
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
265
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
266
+ onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
267
+ onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
268
+ onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
269
+ onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
270
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
271
+ oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
+ onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
276
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
+ oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
280
+ oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
+ oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
282
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
+ oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
284
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
285
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
286
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
287
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
288
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
289
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
290
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
291
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
292
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
293
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
294
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onerror: OnErrorEventHandler;
296
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
297
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
298
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
299
+ oninput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
300
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
302
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
303
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
304
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
305
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
306
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
307
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
308
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
309
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
310
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
311
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
312
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
313
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
314
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
315
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
316
+ onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
317
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
318
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
319
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
320
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
321
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
322
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
323
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
324
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
325
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
326
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
327
+ onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
328
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
329
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
330
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
331
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
332
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
333
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
334
+ onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
335
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
336
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
337
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
338
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
339
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
340
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
341
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
342
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
343
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
344
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
345
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
346
+ ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
347
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
348
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
349
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
350
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
351
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
352
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
353
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
354
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
355
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
356
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
357
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
358
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
359
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
360
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
361
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
362
+ autofocus: boolean;
363
+ readonly dataset: DOMStringMap;
364
+ nonce: string;
365
+ tabIndex: number;
366
+ blur(): void;
367
+ focus(options?: FocusOptions): void;
368
+ };
369
+ };
370
+ export {};
@@ -0,0 +1,33 @@
1
+ import dsfrIcons from "../styles/dsfr-icons.css?inline";
2
+ let iconsStyleSheet = null;
3
+ /**
4
+ * Retourne la feuille de style partagée des icônes DSFR.
5
+ */
6
+ export function getIconsStyleSheet() {
7
+ if (!iconsStyleSheet) {
8
+ iconsStyleSheet = new CSSStyleSheet();
9
+ iconsStyleSheet.replaceSync(dsfrIcons);
10
+ }
11
+ return iconsStyleSheet;
12
+ }
13
+ /**
14
+ * Permet d'étendre la class des WebComponents afin d'injecter la feuille de style des icônes DSFR dans le Shadow DOM.
15
+ */
16
+ export function withIconsStyleSheet(CustomElementClass) {
17
+ const ParentClass = CustomElementClass;
18
+ return class extends ParentClass {
19
+ connectedCallback() {
20
+ super.connectedCallback?.();
21
+ const iconsStyleSheet = getIconsStyleSheet();
22
+ const shadow = this.shadowRoot;
23
+ if (!shadow)
24
+ return;
25
+ const styleSheets = shadow?.adoptedStyleSheets;
26
+ if (!Array.isArray(styleSheets))
27
+ return;
28
+ if (!styleSheets.includes(iconsStyleSheet)) {
29
+ shadow.adoptedStyleSheets = [iconsStyleSheet, ...shadow.adoptedStyleSheets];
30
+ }
31
+ }
32
+ };
33
+ }
@@ -0,0 +1,14 @@
1
+ export { getIconsStyleSheet, withIconsStyleSheet } from "./icons-stylesheet";
2
+ /**
3
+ * Génère une classe d'icône FR avec validation
4
+ * @param {string} icon - Le nom de l'icône
5
+ * @returns {string} La classe CSS complète ou une classe par défaut
6
+ */
7
+ export declare function setIconClass(icon: string): string | undefined;
8
+ /**
9
+ * Marque un Web Component comme thématisable via l'attribut data-themeable
10
+ * Permet d'appliquer des styles conditionnels basés sur cet attribut
11
+ * @param {HTMLElement | undefined} host - L'élément host du Web Component ($host)
12
+ * @param {boolean} [active=true] - Indique si le thème est actif ou non
13
+ */
14
+ export declare function setThemeable(host: HTMLElement | undefined, active?: boolean): void;
@@ -0,0 +1,26 @@
1
+ export { getIconsStyleSheet, withIconsStyleSheet } from "./icons-stylesheet";
2
+ /**
3
+ * Génère une classe d'icône FR avec validation
4
+ * @param {string} icon - Le nom de l'icône
5
+ * @returns {string} La classe CSS complète ou une classe par défaut
6
+ */
7
+ export function setIconClass(icon) {
8
+ if (!icon || typeof icon !== "string") {
9
+ console.warn("iconClass: La prop `icon` doit être une chaîne de caractères");
10
+ return;
11
+ }
12
+ return `fr-icon-${icon}`;
13
+ }
14
+ /**
15
+ * Marque un Web Component comme thématisable via l'attribut data-themeable
16
+ * Permet d'appliquer des styles conditionnels basés sur cet attribut
17
+ * @param {HTMLElement | undefined} host - L'élément host du Web Component ($host)
18
+ * @param {boolean} [active=true] - Indique si le thème est actif ou non
19
+ */
20
+ export function setThemeable(host, active = true) {
21
+ if (!host)
22
+ return;
23
+ if (host.hasAttribute("data-themeable") && host.getAttribute("data-themeable") === "false")
24
+ return;
25
+ host.setAttribute("data-themeable", active ? "true" : "false");
26
+ }