@lab-anssi/ui-kit 1.61.3 → 1.62.1
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 +102 -21
- package/dist/assets/assets.d.ts +1 -0
- package/dist/assets/assets.js +1 -0
- package/dist/assets/dsfr-icons.css +1 -0
- package/dist/composants/Alerte.svelte +83 -0
- package/dist/composants/Alerte.svelte.d.ts +32 -0
- package/dist/composants/AncresParcours.svelte +132 -0
- package/dist/composants/AncresParcours.svelte.d.ts +11 -0
- package/dist/composants/BandeauPage.svelte +218 -0
- package/dist/composants/BandeauPage.svelte.d.ts +58 -0
- package/dist/composants/BlocFonctionnalites.svelte +570 -0
- package/dist/composants/BlocFonctionnalites.svelte.d.ts +105 -0
- package/dist/composants/Bouton.svelte +156 -0
- package/dist/composants/Bouton.svelte.d.ts +36 -0
- package/dist/composants/CentreAide.svelte +223 -0
- package/dist/composants/CentreAide.svelte.d.ts +41 -0
- package/dist/composants/FiltresCatalogue.svelte +147 -0
- package/dist/composants/FiltresCatalogue.svelte.d.ts +15 -0
- package/dist/composants/Icone.svelte +42 -0
- package/dist/composants/Icone.svelte.d.ts +7 -0
- package/dist/composants/Lien.svelte +233 -0
- package/dist/composants/Lien.svelte.d.ts +39 -0
- package/dist/composants/MultiSelect.svelte +931 -0
- package/dist/composants/MultiSelect.svelte.d.ts +51 -0
- package/dist/composants/Reactions.svelte +360 -0
- package/dist/composants/Reactions.svelte.d.ts +23 -0
- package/dist/composants/ResumePssi.svelte +92 -0
- package/dist/composants/ResumePssi.svelte.d.ts +6 -0
- package/dist/composants/Tag.svelte +113 -0
- package/dist/composants/Tag.svelte.d.ts +35 -0
- package/dist/composants/blog/BandeauTitre.svelte +150 -0
- package/dist/composants/blog/BandeauTitre.svelte.d.ts +29 -0
- package/dist/composants/blog/CarteArticle.svelte +69 -0
- package/dist/composants/blog/CarteArticle.svelte.d.ts +8 -0
- package/dist/composants/blog/IconeChevronBas.svelte +22 -0
- package/dist/composants/blog/IconeChevronBas.svelte.d.ts +26 -0
- package/dist/composants/blog/IconeMenuLateral.svelte +15 -0
- package/dist/composants/blog/IconeMenuLateral.svelte.d.ts +26 -0
- package/dist/composants/blog/ListeArticles.svelte +62 -0
- package/dist/composants/blog/ListeArticles.svelte.d.ts +9 -0
- package/dist/composants/blog/ListeDeroulante.svelte +57 -0
- package/dist/composants/blog/ListeDeroulante.svelte.d.ts +10 -0
- package/dist/composants/blog/PageCrisp.svelte +244 -0
- package/dist/composants/blog/PageCrisp.svelte.d.ts +8 -0
- package/dist/composants/blog/SommaireBureau.svelte +64 -0
- package/dist/composants/blog/SommaireBureau.svelte.d.ts +9 -0
- package/dist/composants/blog/SommaireMobile.svelte +115 -0
- package/dist/composants/blog/SommaireMobile.svelte.d.ts +9 -0
- package/dist/composants/carrousel-tuiles/CarrouselTuiles.svelte +184 -0
- package/dist/composants/carrousel-tuiles/CarrouselTuiles.svelte.d.ts +34 -0
- package/dist/composants/carrousel-tuiles/IconeFlecheDroite.svelte +16 -0
- package/dist/composants/carrousel-tuiles/IconeFlecheDroite.svelte.d.ts +26 -0
- package/dist/composants/carrousel-tuiles/IconeFlecheGauche.svelte +12 -0
- package/dist/composants/carrousel-tuiles/IconeFlecheGauche.svelte.d.ts +26 -0
- package/dist/composants/carrousel-tuiles/Tuile.svelte +72 -0
- package/dist/composants/carrousel-tuiles/Tuile.svelte.d.ts +10 -0
- package/dist/composants/icones/Fleche.svelte +25 -0
- package/dist/composants/icones/Fleche.svelte.d.ts +6 -0
- package/dist/composants/icones/LienExterne.svelte +20 -0
- package/dist/composants/icones/LienExterne.svelte.d.ts +6 -0
- package/dist/composants/marelle/Etape.svelte +165 -0
- package/dist/composants/marelle/Etape.svelte.d.ts +32 -0
- package/dist/composants/marelle/Marelle.svelte +97 -0
- package/dist/composants/marelle/Marelle.svelte.d.ts +44 -0
- package/dist/composants/mes-services-cyber/bandeau/Bandeau.svelte +158 -0
- package/dist/composants/mes-services-cyber/bandeau/Bandeau.svelte.d.ts +3 -0
- package/dist/composants/mes-services-cyber/lien/LienDiagnosticCyber.svelte +125 -0
- package/dist/composants/mes-services-cyber/lien/LienDiagnosticCyber.svelte.d.ts +7 -0
- package/dist/composants/pied-de-page/NavigationPiedDePage.svelte +62 -0
- package/dist/composants/pied-de-page/NavigationPiedDePage.svelte.d.ts +6 -0
- package/dist/composants/suite-cyber/AccueilSuiteCyber.svelte +96 -0
- package/dist/composants/suite-cyber/AccueilSuiteCyber.svelte.d.ts +6 -0
- package/dist/composants/suite-cyber/LiensSuiteCyber.svelte +99 -0
- package/dist/composants/suite-cyber/LiensSuiteCyber.svelte.d.ts +14 -0
- package/dist/composants/suite-cyber/SuiteCyber.svelte +296 -0
- package/dist/composants/suite-cyber/SuiteCyber.svelte.d.ts +6 -0
- package/dist/composants/vitrines-produits/briques/Brique.svelte +50 -0
- package/dist/composants/vitrines-produits/briques/Brique.svelte.d.ts +9 -0
- package/dist/composants/vitrines-produits/briques/BriqueContenuADeuxColonnes.svelte +144 -0
- package/dist/composants/vitrines-produits/briques/BriqueContenuADeuxColonnes.svelte.d.ts +29 -0
- package/dist/composants/vitrines-produits/briques/BriqueHero.svelte +246 -0
- package/dist/composants/vitrines-produits/briques/BriqueHero.svelte.d.ts +31 -0
- package/dist/composants/vitrines-produits/briques/BriqueTitreMultimedia.svelte +50 -0
- package/dist/composants/vitrines-produits/briques/BriqueTitreMultimedia.svelte.d.ts +25 -0
- package/dist/composants/vitrines-produits/briques/LecteurVideo.svelte +14 -0
- package/dist/composants/vitrines-produits/briques/LecteurVideo.svelte.d.ts +9 -0
- package/dist/composants/vitrines-produits/briques/PresentationANSSI.svelte +148 -0
- package/dist/composants/vitrines-produits/briques/PresentationANSSI.svelte.d.ts +37 -0
- package/dist/composants/vitrines-produits/briques/RejoindreLaCommunaute.svelte +139 -0
- package/dist/composants/vitrines-produits/briques/RejoindreLaCommunaute.svelte.d.ts +36 -0
- package/dist/composants/vitrines-produits/briques/temoignages/IconeTemoignage.svelte +18 -0
- package/dist/composants/vitrines-produits/briques/temoignages/IconeTemoignage.svelte.d.ts +26 -0
- package/dist/composants/vitrines-produits/briques/temoignages/Temoignages.svelte +168 -0
- package/dist/composants/vitrines-produits/briques/temoignages/Temoignages.svelte.d.ts +13 -0
- package/dist/directives/actions.svelte.d.ts +32 -0
- package/dist/directives/actions.svelte.js +158 -0
- package/dist/dsfr/DsfrAccordion.svelte +889 -0
- package/dist/dsfr/DsfrAccordion.svelte.d.ts +40 -0
- package/dist/dsfr/DsfrAlert.svelte +2097 -0
- package/dist/dsfr/DsfrAlert.svelte.d.ts +36 -0
- package/dist/dsfr/DsfrBadge.svelte +532 -0
- package/dist/dsfr/DsfrBadge.svelte.d.ts +41 -0
- package/dist/dsfr/DsfrBadgesGroup.svelte +610 -0
- package/dist/dsfr/DsfrBadgesGroup.svelte.d.ts +25 -0
- package/dist/dsfr/DsfrBreadcrumb.svelte +657 -0
- package/dist/dsfr/DsfrBreadcrumb.svelte.d.ts +25 -0
- package/dist/dsfr/DsfrButton.svelte +1821 -0
- package/dist/dsfr/DsfrButton.svelte.d.ts +68 -0
- package/dist/dsfr/DsfrButtonsGroup.svelte +1896 -0
- package/dist/dsfr/DsfrButtonsGroup.svelte.d.ts +36 -0
- package/dist/dsfr/DsfrCallout.svelte +242 -0
- package/dist/dsfr/DsfrCallout.svelte.d.ts +46 -0
- package/dist/dsfr/DsfrCard.svelte +10223 -0
- package/dist/dsfr/DsfrCard.svelte.d.ts +102 -0
- package/dist/dsfr/DsfrCheckbox.svelte +1280 -0
- package/dist/dsfr/DsfrCheckbox.svelte.d.ts +69 -0
- package/dist/dsfr/DsfrCheckboxesGroup.svelte +1532 -0
- package/dist/dsfr/DsfrCheckboxesGroup.svelte.d.ts +73 -0
- package/dist/dsfr/DsfrConnect.svelte +511 -0
- package/dist/dsfr/DsfrConnect.svelte.d.ts +15 -0
- package/dist/dsfr/DsfrContainer.svelte +894 -0
- package/dist/dsfr/DsfrContainer.svelte.d.ts +31 -0
- package/dist/dsfr/DsfrContent.svelte +1140 -0
- package/dist/dsfr/DsfrContent.svelte.d.ts +60 -0
- package/dist/dsfr/DsfrDropdown.svelte +335 -0
- package/dist/dsfr/DsfrDropdown.svelte.d.ts +73 -0
- package/dist/dsfr/DsfrFooter.svelte +2370 -0
- package/dist/dsfr/DsfrFooter.svelte.d.ts +77 -0
- package/dist/dsfr/DsfrHeader.svelte +4162 -0
- package/dist/dsfr/DsfrHeader.svelte.d.ts +131 -0
- package/dist/dsfr/DsfrHighlight.svelte +294 -0
- package/dist/dsfr/DsfrHighlight.svelte.d.ts +33 -0
- package/dist/dsfr/DsfrInput.svelte +1270 -0
- package/dist/dsfr/DsfrInput.svelte.d.ts +86 -0
- package/dist/dsfr/DsfrLabel.svelte +438 -0
- package/dist/dsfr/DsfrLabel.svelte.d.ts +65 -0
- package/dist/dsfr/DsfrLink.svelte +1007 -0
- package/dist/dsfr/DsfrLink.svelte.d.ts +66 -0
- package/dist/dsfr/DsfrLogo.svelte +228 -0
- package/dist/dsfr/DsfrLogo.svelte.d.ts +11 -0
- package/dist/dsfr/DsfrMessagesGroup.svelte +260 -0
- package/dist/dsfr/DsfrMessagesGroup.svelte.d.ts +46 -0
- package/dist/dsfr/DsfrModal.svelte +2983 -0
- package/dist/dsfr/DsfrModal.svelte.d.ts +56 -0
- package/dist/dsfr/DsfrNavigation.svelte +7626 -0
- package/dist/dsfr/DsfrNotice.svelte +2948 -0
- package/dist/dsfr/DsfrNotice.svelte.d.ts +37 -0
- package/dist/dsfr/DsfrPagination.svelte +1036 -0
- package/dist/dsfr/DsfrPagination.svelte.d.ts +35 -0
- package/dist/dsfr/DsfrQuote.svelte +646 -0
- package/dist/dsfr/DsfrQuote.svelte.d.ts +29 -0
- package/dist/dsfr/DsfrRadio.svelte +1307 -0
- package/dist/dsfr/DsfrRadio.svelte.d.ts +37 -0
- package/dist/dsfr/DsfrRadiosGroup.svelte +1629 -0
- package/dist/dsfr/DsfrRadiosGroup.svelte.d.ts +76 -0
- package/dist/dsfr/DsfrRange.svelte +1329 -0
- package/dist/dsfr/DsfrRange.svelte.d.ts +77 -0
- package/dist/dsfr/DsfrSearch.svelte +2015 -0
- package/dist/dsfr/DsfrSearch.svelte.d.ts +51 -0
- package/dist/dsfr/DsfrSegmented.svelte +422 -0
- package/dist/dsfr/DsfrSegmented.svelte.d.ts +34 -0
- package/dist/dsfr/DsfrSelect.svelte +1068 -0
- package/dist/dsfr/DsfrSelect.svelte.d.ts +86 -0
- package/dist/dsfr/DsfrShare.svelte +2228 -0
- package/dist/dsfr/DsfrShare.svelte.d.ts +40 -0
- package/dist/dsfr/DsfrSideMenu.svelte +1211 -0
- package/dist/dsfr/DsfrSideMenu.svelte.d.ts +34 -0
- package/dist/dsfr/DsfrSkipLink.svelte +990 -0
- package/dist/dsfr/DsfrSkipLink.svelte.d.ts +13 -0
- package/dist/dsfr/DsfrStepper.svelte +340 -0
- package/dist/dsfr/DsfrStepper.svelte.d.ts +18 -0
- package/dist/dsfr/DsfrTable.svelte +829 -0
- package/dist/dsfr/DsfrTable.svelte.d.ts +202 -0
- package/dist/dsfr/DsfrTabnav.svelte +1149 -0
- package/dist/dsfr/DsfrTabnav.svelte.d.ts +36 -0
- package/dist/dsfr/DsfrTabs.svelte +925 -0
- package/dist/dsfr/DsfrTabs.svelte.d.ts +28 -0
- package/dist/dsfr/DsfrTag.svelte +1269 -0
- package/dist/dsfr/DsfrTag.svelte.d.ts +59 -0
- package/dist/dsfr/DsfrTagsGroup.svelte +1351 -0
- package/dist/dsfr/DsfrTagsGroup.svelte.d.ts +37 -0
- package/dist/dsfr/DsfrTextarea.svelte +1385 -0
- package/dist/dsfr/DsfrTextarea.svelte.d.ts +72 -0
- package/dist/dsfr/DsfrTile.svelte +7645 -0
- package/dist/dsfr/DsfrTile.svelte.d.ts +79 -0
- package/dist/dsfr/DsfrToggle.svelte +1453 -0
- package/dist/dsfr/DsfrToggle.svelte.d.ts +56 -0
- package/dist/dsfr/DsfrTooltip.svelte +396 -0
- package/dist/dsfr/DsfrTooltip.svelte.d.ts +36 -0
- package/dist/dsfr/DsfrTranscription.svelte +2962 -0
- package/dist/dsfr/DsfrTranscription.svelte.d.ts +39 -0
- package/dist/dsfr/DsfrTranslate.svelte +1384 -0
- package/dist/dsfr/DsfrTranslate.svelte.d.ts +19 -0
- package/dist/dsfr/DsfrUser.svelte +736 -0
- package/dist/dsfr/DsfrUser.svelte.d.ts +65 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +79 -0
- package/dist/styles/apparence-bouton.scss +154 -0
- package/dist/styles/dsfr-icons.css +1 -0
- package/dist/styles/dsfr-icons.scss +4 -0
- package/dist/styles/dsfr-variables.scss +28 -0
- package/dist/styles/mixins-dsfr.scss +226 -0
- package/dist/styles/mixins.scss +51 -0
- package/dist/types/commun.d.ts +63 -0
- package/dist/types/commun.js +1 -0
- package/dist/types/global.d.ts +24 -0
- package/dist/types/global.js +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/ui-kit-components.json +142 -100
- package/dist/utilitaires/createFormValidation.svelte.d.ts +34 -0
- package/dist/utilitaires/createFormValidation.svelte.js +183 -0
- package/dist/utilitaires/icons-stylesheet.d.ts +370 -0
- package/dist/utilitaires/icons-stylesheet.js +33 -0
- package/dist/utilitaires/index.d.ts +14 -0
- package/dist/utilitaires/index.js +26 -0
- package/dist/web-types.json +149 -101
- package/dist/webcomponents/lab-anssi-ui-kit.iife.js +36 -9
- package/dist/webcomponents/lab-anssi-ui-kit.jsx.d.ts +42 -24
- package/package.json +49 -43
- package/dist/index.html +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { TextSize, TextWeight } from "../types";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Attribut id du champs de saisie */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Libellé du champs de saisie */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Permet de masquer le label */
|
|
8
|
+
hideLabel?: boolean;
|
|
9
|
+
/** Texte additionnel sous le libellé du champs de saisie */
|
|
10
|
+
hint?: string;
|
|
11
|
+
/** Type du champs de saisie, par défaut: "text" */
|
|
12
|
+
type?: "date" | "email" | "password" | "number" | "search" | "tel" | "text" | "url";
|
|
13
|
+
/** Ajoute une icône dans le champs de saisie */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Associe un bouton d'envoi à l'input (variation addon) */
|
|
16
|
+
addon?: boolean;
|
|
17
|
+
/** Associe un bouton d'action à l'input (variation action) */
|
|
18
|
+
action?: boolean;
|
|
19
|
+
/** Valeur initiale du champs de saisie */
|
|
20
|
+
value?: string;
|
|
21
|
+
/** Texte avant saisie dans le champs de saisie */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Attribut name du champs de saisie */
|
|
24
|
+
name?: string;
|
|
25
|
+
/** Attribut autocomplete du champs de saisie, voir la liste des valeurs possibles sur MDN */
|
|
26
|
+
autocomplete?: string;
|
|
27
|
+
/** Désactive le champs de saisie */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Statut du message */
|
|
30
|
+
status?: "default" | "valid" | "error" | "info";
|
|
31
|
+
/** Texte du message d'erreur */
|
|
32
|
+
errorMessage?: string;
|
|
33
|
+
/** Texte du message de succès */
|
|
34
|
+
validMessage?: string;
|
|
35
|
+
/** Texte du message d'information */
|
|
36
|
+
infoMessage?: string;
|
|
37
|
+
/** Attribut form du composant */
|
|
38
|
+
form?: string;
|
|
39
|
+
/** Valeur de l'attribut max du champs de saisie _(valable uniquement dans ce composant pour les champs de type "date" et "number")_ */
|
|
40
|
+
max?: string;
|
|
41
|
+
/** Longueur maximale du champs de saisie _(valable uniquement pour les champs de type "text", "search", "url", "tel", "email", "password")_ */
|
|
42
|
+
maxlength?: number;
|
|
43
|
+
/** Valeur de l'attribut min du champs de saisie _(valable uniquement dans ce composant pour les champs de type "date" et "number")_ */
|
|
44
|
+
min?: string;
|
|
45
|
+
/** Longueur minimale du champs de saisie _(valable uniquement pour les champs de type "text", "search", "url", "tel", "email", "password")_ */
|
|
46
|
+
minlength?: number;
|
|
47
|
+
/** Attribut pattern du champs de saisie _(valable uniquement pour les champs de type "text", "search", "url", "tel", "email", "password")_ */
|
|
48
|
+
pattern?: string;
|
|
49
|
+
/** Rend le champs de saisie en lecture seule */
|
|
50
|
+
readonly?: boolean;
|
|
51
|
+
/** Rend le champs de saisie obligatoire */
|
|
52
|
+
required?: boolean;
|
|
53
|
+
/** Valeur de l'attribut step du champs de saisie _(valable uniquement dans ce composant pour les champs de type "date" et "number")_ */
|
|
54
|
+
step?: number;
|
|
55
|
+
/** `ElementInternals` interface pour l'association du composant aux formulaires */
|
|
56
|
+
internals?: ElementInternals;
|
|
57
|
+
/** Callback appelé lors du changement de valeur du champ de saisie */
|
|
58
|
+
onvaluechanged?: (value: string) => void;
|
|
59
|
+
/** Applique une classe utilitaire de taille de texte DSFR (fr-text--xs à fr-text--xl, fr-text--lead) sur le label */
|
|
60
|
+
labelSize?: TextSize;
|
|
61
|
+
/** Applique une classe utilitaire de graisse DSFR (fr-text--light à fr-text--heavy) sur le label */
|
|
62
|
+
labelWeight?: TextWeight;
|
|
63
|
+
}
|
|
64
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
65
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
66
|
+
$$bindings?: Bindings;
|
|
67
|
+
} & Exports;
|
|
68
|
+
(internal: unknown, props: Props & {
|
|
69
|
+
$$events?: Events;
|
|
70
|
+
$$slots?: Slots;
|
|
71
|
+
}): Exports & {
|
|
72
|
+
$set?: any;
|
|
73
|
+
$on?: any;
|
|
74
|
+
};
|
|
75
|
+
z_$$bindings?: Bindings;
|
|
76
|
+
}
|
|
77
|
+
declare const DsfrInput: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
78
|
+
[evt: string]: CustomEvent<any>;
|
|
79
|
+
}, {
|
|
80
|
+
button: {};
|
|
81
|
+
'messages-group': {};
|
|
82
|
+
}, {
|
|
83
|
+
setCustomValidity: (message: string) => void;
|
|
84
|
+
}, "value">;
|
|
85
|
+
type DsfrInput = InstanceType<typeof DsfrInput>;
|
|
86
|
+
export default DsfrInput;
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: "dsfr-label",
|
|
4
|
+
props: {
|
|
5
|
+
for: { attribute: "for", type: "String" },
|
|
6
|
+
label: { attribute: "label", type: "String" },
|
|
7
|
+
hint: { attribute: "hint", type: "String" },
|
|
8
|
+
hidden: { attribute: "hidden", type: "Boolean" },
|
|
9
|
+
id: { attribute: "id", type: "String" },
|
|
10
|
+
class: { attribute: "class", type: "String" },
|
|
11
|
+
context: { attribute: "context", type: "String" },
|
|
12
|
+
inline: { attribute: "inline", type: "Boolean" },
|
|
13
|
+
status: { attribute: "status", type: "String" },
|
|
14
|
+
disabled: { attribute: "disabled", type: "Boolean" },
|
|
15
|
+
labelSize: { attribute: "label-size", type: "String" },
|
|
16
|
+
labelWeight: { attribute: "label-weight", type: "String" },
|
|
17
|
+
},
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">const { for: forAttr, label, hint, hidden = false, id, class: extraClass, context = "default", inline = false, status = "default", disabled = false, labelSize, labelWeight } = $props();
|
|
22
|
+
export {};
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<label
|
|
26
|
+
class={[
|
|
27
|
+
"fr-label",
|
|
28
|
+
extraClass,
|
|
29
|
+
{
|
|
30
|
+
"fr-sr-only": hidden,
|
|
31
|
+
"fr-label--field": context === "field",
|
|
32
|
+
"fr-label--inline": inline,
|
|
33
|
+
"fr-label--error": status === "error",
|
|
34
|
+
"fr-label--success": status === "valid",
|
|
35
|
+
"fr-label--info": status === "info",
|
|
36
|
+
"fr-label--disabled": disabled,
|
|
37
|
+
},
|
|
38
|
+
]}
|
|
39
|
+
for={forAttr}
|
|
40
|
+
{id}
|
|
41
|
+
>
|
|
42
|
+
<span class={[labelSize && `fr-text--${labelSize}`, labelWeight && `fr-text--${labelWeight}`]}>
|
|
43
|
+
<slot>{label}</slot>
|
|
44
|
+
</span>
|
|
45
|
+
{#if hint || $$slots.hint}
|
|
46
|
+
<span class="fr-hint-text">
|
|
47
|
+
<slot name="hint">
|
|
48
|
+
{hint}
|
|
49
|
+
</slot>
|
|
50
|
+
</span>
|
|
51
|
+
{/if}
|
|
52
|
+
</label>
|
|
53
|
+
|
|
54
|
+
<style>@charset "UTF-8";
|
|
55
|
+
/**
|
|
56
|
+
* Override de l'opacité chrome sur un élément disabled
|
|
57
|
+
*/
|
|
58
|
+
a:not([href]), button:disabled, input:disabled, input[type=checkbox]:disabled, input[type=checkbox]:disabled + label, input[type=radio]:disabled, input[type=radio]:disabled + label, select:disabled, textarea:disabled, video:not([href]), audio:not([href]) {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
input,
|
|
63
|
+
select,
|
|
64
|
+
textarea,
|
|
65
|
+
label,
|
|
66
|
+
button,
|
|
67
|
+
a {
|
|
68
|
+
-webkit-tap-highlight-color: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:root {
|
|
72
|
+
--text-spacing: 0 0 1.5rem;
|
|
73
|
+
--title-spacing: 0 0 1.5rem;
|
|
74
|
+
--display-spacing: 0 0 2rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.fr-h6 {
|
|
78
|
+
font-weight: 700 !important;
|
|
79
|
+
font-size: 1.125rem !important;
|
|
80
|
+
line-height: 1.5rem !important;
|
|
81
|
+
}
|
|
82
|
+
@media (min-width: 48em) {
|
|
83
|
+
.fr-h6 {
|
|
84
|
+
font-size: 1.25rem !important;
|
|
85
|
+
line-height: 1.75rem !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.fr-h6 {
|
|
89
|
+
margin: var(--title-spacing);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.fr-h5 {
|
|
93
|
+
font-weight: 700 !important;
|
|
94
|
+
font-size: 1.25rem !important;
|
|
95
|
+
line-height: 1.75rem !important;
|
|
96
|
+
}
|
|
97
|
+
@media (min-width: 48em) {
|
|
98
|
+
.fr-h5 {
|
|
99
|
+
font-size: 1.375rem !important;
|
|
100
|
+
line-height: 1.75rem !important;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.fr-h5 {
|
|
104
|
+
margin: var(--title-spacing);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.fr-h4 {
|
|
108
|
+
font-weight: 700 !important;
|
|
109
|
+
font-size: 1.375rem !important;
|
|
110
|
+
line-height: 1.75rem !important;
|
|
111
|
+
}
|
|
112
|
+
@media (min-width: 48em) {
|
|
113
|
+
.fr-h4 {
|
|
114
|
+
font-size: 1.5rem !important;
|
|
115
|
+
line-height: 2rem !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.fr-h4 {
|
|
119
|
+
margin: var(--title-spacing);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.fr-h3 {
|
|
123
|
+
font-weight: 700 !important;
|
|
124
|
+
font-size: 1.5rem !important;
|
|
125
|
+
line-height: 2rem !important;
|
|
126
|
+
}
|
|
127
|
+
@media (min-width: 48em) {
|
|
128
|
+
.fr-h3 {
|
|
129
|
+
font-size: 1.75rem !important;
|
|
130
|
+
line-height: 2.25rem !important;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
.fr-h3 {
|
|
134
|
+
margin: var(--title-spacing);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.fr-h2 {
|
|
138
|
+
font-weight: 700 !important;
|
|
139
|
+
font-size: 1.75rem !important;
|
|
140
|
+
line-height: 2.25rem !important;
|
|
141
|
+
}
|
|
142
|
+
@media (min-width: 48em) {
|
|
143
|
+
.fr-h2 {
|
|
144
|
+
font-size: 2rem !important;
|
|
145
|
+
line-height: 2.5rem !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.fr-h2 {
|
|
149
|
+
margin: var(--title-spacing);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.fr-h1 {
|
|
153
|
+
font-weight: 700 !important;
|
|
154
|
+
font-size: 2rem !important;
|
|
155
|
+
line-height: 2.5rem !important;
|
|
156
|
+
}
|
|
157
|
+
@media (min-width: 48em) {
|
|
158
|
+
.fr-h1 {
|
|
159
|
+
font-size: 2.5rem !important;
|
|
160
|
+
line-height: 3rem !important;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.fr-h1 {
|
|
164
|
+
margin: var(--title-spacing);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.fr-display--xs {
|
|
168
|
+
font-weight: 700 !important;
|
|
169
|
+
font-size: 2.5rem !important;
|
|
170
|
+
line-height: 3rem !important;
|
|
171
|
+
}
|
|
172
|
+
@media (min-width: 48em) {
|
|
173
|
+
.fr-display--xs {
|
|
174
|
+
font-size: 3rem !important;
|
|
175
|
+
line-height: 3.5rem !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
.fr-display--xs {
|
|
179
|
+
margin: var(--display-spacing);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.fr-display--sm {
|
|
183
|
+
font-weight: 700 !important;
|
|
184
|
+
font-size: 3rem !important;
|
|
185
|
+
line-height: 3.5rem !important;
|
|
186
|
+
}
|
|
187
|
+
@media (min-width: 48em) {
|
|
188
|
+
.fr-display--sm {
|
|
189
|
+
font-size: 3.5rem !important;
|
|
190
|
+
line-height: 4rem !important;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
.fr-display--sm {
|
|
194
|
+
margin: var(--display-spacing);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.fr-display--md {
|
|
198
|
+
font-weight: 700 !important;
|
|
199
|
+
font-size: 3.5rem !important;
|
|
200
|
+
line-height: 4rem !important;
|
|
201
|
+
}
|
|
202
|
+
@media (min-width: 48em) {
|
|
203
|
+
.fr-display--md {
|
|
204
|
+
font-size: 4rem !important;
|
|
205
|
+
line-height: 4.5rem !important;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
.fr-display--md {
|
|
209
|
+
margin: var(--display-spacing);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.fr-display--lg {
|
|
213
|
+
font-weight: 700 !important;
|
|
214
|
+
font-size: 4rem !important;
|
|
215
|
+
line-height: 4.5rem !important;
|
|
216
|
+
}
|
|
217
|
+
@media (min-width: 48em) {
|
|
218
|
+
.fr-display--lg {
|
|
219
|
+
font-size: 4.5rem !important;
|
|
220
|
+
line-height: 5rem !important;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
.fr-display--lg {
|
|
224
|
+
margin: var(--display-spacing);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.fr-display--xl {
|
|
228
|
+
font-weight: 700 !important;
|
|
229
|
+
font-size: 4.5rem !important;
|
|
230
|
+
line-height: 5rem !important;
|
|
231
|
+
}
|
|
232
|
+
@media (min-width: 48em) {
|
|
233
|
+
.fr-display--xl {
|
|
234
|
+
font-size: 5rem !important;
|
|
235
|
+
line-height: 5.5rem !important;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
.fr-display--xl {
|
|
239
|
+
margin: var(--display-spacing);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.fr-text--alt {
|
|
243
|
+
font-family: "Spectral", georgia, serif !important;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.fr-text--xs {
|
|
247
|
+
font-size: 0.75rem !important;
|
|
248
|
+
line-height: 1.25rem !important;
|
|
249
|
+
margin: var(--text-spacing);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.fr-text--sm {
|
|
253
|
+
font-size: 0.875rem !important;
|
|
254
|
+
line-height: 1.5rem !important;
|
|
255
|
+
margin: var(--text-spacing);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.fr-text--md {
|
|
259
|
+
font-size: 1rem !important;
|
|
260
|
+
line-height: 1.5rem !important;
|
|
261
|
+
margin: var(--text-spacing);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.fr-text--lg {
|
|
265
|
+
font-size: 1.125rem !important;
|
|
266
|
+
line-height: 1.75rem !important;
|
|
267
|
+
margin: var(--text-spacing);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.fr-text--xl, .fr-text--lead {
|
|
271
|
+
font-size: 1.25rem !important;
|
|
272
|
+
line-height: 2rem !important;
|
|
273
|
+
margin: var(--text-spacing);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.fr-text--light {
|
|
277
|
+
font-weight: 300 !important;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.fr-text--regular {
|
|
281
|
+
font-weight: 400 !important;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.fr-text--bold {
|
|
285
|
+
font-weight: 700 !important;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.fr-text--heavy {
|
|
289
|
+
font-weight: 900 !important;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.fr-hint-text {
|
|
293
|
+
display: block;
|
|
294
|
+
font-size: 0.75rem;
|
|
295
|
+
line-height: 1.25rem;
|
|
296
|
+
--text-spacing: 0 0 1rem;
|
|
297
|
+
}
|
|
298
|
+
.fr-hint-text + .fr-hint-text {
|
|
299
|
+
margin-top: 0.25rem;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.fr-label {
|
|
303
|
+
display: block;
|
|
304
|
+
font-size: 1rem;
|
|
305
|
+
line-height: 1.5rem;
|
|
306
|
+
}
|
|
307
|
+
.fr-label + .fr-input, .fr-label + .fr-input-wrap, .fr-label + .fr-select {
|
|
308
|
+
margin-top: 0.5rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.fr-select-group--valid label, .fr-input-group--valid label, .fr-range-group--valid label, .fr-upload-group--valid label {
|
|
312
|
+
color: var(--text-default-success);
|
|
313
|
+
}
|
|
314
|
+
.fr-select-group--error label, .fr-input-group--error label, .fr-range-group--error label, .fr-upload-group--error label {
|
|
315
|
+
color: var(--text-default-error);
|
|
316
|
+
}
|
|
317
|
+
.fr-select-group--info label, .fr-input-group--info label, .fr-range-group--info label, .fr-upload-group--info label {
|
|
318
|
+
color: var(--text-default-info);
|
|
319
|
+
}
|
|
320
|
+
.fr-select-group--disabled label,
|
|
321
|
+
.fr-select-group--disabled .fr-hint-text, .fr-input-group--disabled label,
|
|
322
|
+
.fr-input-group--disabled .fr-hint-text, .fr-range-group--disabled label,
|
|
323
|
+
.fr-range-group--disabled .fr-hint-text, .fr-upload-group--disabled label,
|
|
324
|
+
.fr-upload-group--disabled .fr-hint-text {
|
|
325
|
+
color: var(--text-disabled-grey);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.fr-label {
|
|
329
|
+
color: var(--text-label-grey);
|
|
330
|
+
}
|
|
331
|
+
.fr-label--error {
|
|
332
|
+
color: var(--text-default-error);
|
|
333
|
+
}
|
|
334
|
+
.fr-label--success {
|
|
335
|
+
color: var(--text-default-success);
|
|
336
|
+
}
|
|
337
|
+
.fr-label--info {
|
|
338
|
+
color: var(--text-default-info);
|
|
339
|
+
}
|
|
340
|
+
.fr-label--disabled, .fr-label--disabled .fr-hint-text {
|
|
341
|
+
color: var(--text-disabled-grey);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.fr-hint-text,
|
|
345
|
+
.fr-message {
|
|
346
|
+
color: var(--text-mention-grey);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.fr-message--error {
|
|
350
|
+
color: var(--text-default-error);
|
|
351
|
+
}
|
|
352
|
+
.fr-message--valid {
|
|
353
|
+
color: var(--text-default-success);
|
|
354
|
+
}
|
|
355
|
+
.fr-message--info {
|
|
356
|
+
color: var(--text-default-info);
|
|
357
|
+
}
|
|
358
|
+
.fr-message--warning {
|
|
359
|
+
color: var(--text-default-warning);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.fr-fieldset:disabled .fr-label,
|
|
363
|
+
.fr-fieldset:disabled .fr-hint-text,
|
|
364
|
+
.fr-fieldset:disabled .fr-fieldset__legend {
|
|
365
|
+
color: var(--text-disabled-grey);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.fr-fieldset input:disabled + label,
|
|
369
|
+
.fr-fieldset input:disabled + label .fr-hint-text,
|
|
370
|
+
.fr-fieldset input:disabled + label + .fr-hint-text {
|
|
371
|
+
color: var(--text-disabled-grey);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.fr-fieldset__legend {
|
|
375
|
+
color: var(--text-label-grey);
|
|
376
|
+
}
|
|
377
|
+
.fr-fieldset--error, .fr-fieldset--error .fr-fieldset__legend {
|
|
378
|
+
background-image: linear-gradient(0deg, var(--border-plain-error), var(--border-plain-error));
|
|
379
|
+
}
|
|
380
|
+
.fr-fieldset--error .fr-fieldset__legend, .fr-fieldset--error .fr-label {
|
|
381
|
+
color: var(--text-default-error);
|
|
382
|
+
}
|
|
383
|
+
.fr-fieldset--valid, .fr-fieldset--valid .fr-fieldset__legend {
|
|
384
|
+
background-image: linear-gradient(0deg, var(--border-plain-success), var(--border-plain-success));
|
|
385
|
+
}
|
|
386
|
+
.fr-fieldset--valid .fr-fieldset__legend, .fr-fieldset--valid .fr-label {
|
|
387
|
+
color: var(--text-default-success);
|
|
388
|
+
}
|
|
389
|
+
.fr-fieldset--info, .fr-fieldset--info .fr-fieldset__legend {
|
|
390
|
+
background-image: linear-gradient(0deg, var(--border-plain-info), var(--border-plain-info));
|
|
391
|
+
}
|
|
392
|
+
.fr-fieldset--info .fr-fieldset__legend, .fr-fieldset--info .fr-label {
|
|
393
|
+
color: var(--text-default-info);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
:host {
|
|
397
|
+
display: block;
|
|
398
|
+
text-rendering: optimizeLegibility;
|
|
399
|
+
-webkit-font-smoothing: antialiased;
|
|
400
|
+
-moz-osx-font-smoothing: grayscale;
|
|
401
|
+
-webkit-text-size-adjust: 100%;
|
|
402
|
+
font-size: 1rem;
|
|
403
|
+
line-height: 1.5rem;
|
|
404
|
+
background-color: var(--background-default-grey);
|
|
405
|
+
--idle: transparent;
|
|
406
|
+
--hover: var(--background-default-grey-hover);
|
|
407
|
+
--active: var(--background-default-grey-active);
|
|
408
|
+
color: var(--text-default-grey);
|
|
409
|
+
background-color: transparent;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.fr-label {
|
|
413
|
+
box-sizing: border-box;
|
|
414
|
+
--text-spacing: 0;
|
|
415
|
+
}
|
|
416
|
+
.fr-label--field {
|
|
417
|
+
margin-bottom: 0.5rem;
|
|
418
|
+
}
|
|
419
|
+
.fr-label--field .fr-hint-text {
|
|
420
|
+
margin-top: 0.25rem;
|
|
421
|
+
}
|
|
422
|
+
.fr-label--inline .fr-hint-text {
|
|
423
|
+
margin: 0;
|
|
424
|
+
width: 100%;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.fr-sr-only {
|
|
428
|
+
position: absolute;
|
|
429
|
+
width: 1px;
|
|
430
|
+
height: 1px;
|
|
431
|
+
padding: 0;
|
|
432
|
+
margin: -1px;
|
|
433
|
+
overflow: hidden;
|
|
434
|
+
clip: rect(0, 0, 0, 0);
|
|
435
|
+
white-space: nowrap; /* added line */
|
|
436
|
+
border: 0;
|
|
437
|
+
display: block;
|
|
438
|
+
}</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { TextSize, TextWeight } from "../types";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Attribut for du label (id du champ associé) */
|
|
4
|
+
for: string;
|
|
5
|
+
/** Texte du label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Texte additionnel sous le label */
|
|
8
|
+
hint?: string;
|
|
9
|
+
/** Masque visuellement le label tout en le gardant accessible */
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
/** Attribut id du label */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Classe(s) additionnelle(s) */
|
|
14
|
+
class?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Contexte d'affichage du composant.
|
|
17
|
+
* - "field" : inside input-group ou select-group → fr-hint-text reçoit une marge supérieure
|
|
18
|
+
* - "default" (défaut) : checkbox, radio, segmented… → pas de marge spécifique
|
|
19
|
+
*/
|
|
20
|
+
context?: "field" | "default";
|
|
21
|
+
/** Gère les états du label lorsque celui-ci est aligné horizontalement avec le champ */
|
|
22
|
+
inline?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Statut du champ associé, applique la couleur correspondante sur le label.
|
|
25
|
+
* - "error" → fr-label--error
|
|
26
|
+
* - "valid" → fr-label--success
|
|
27
|
+
* - "info" → fr-label--info
|
|
28
|
+
*/
|
|
29
|
+
status?: "default" | "valid" | "error" | "info";
|
|
30
|
+
/** Désactive le label (applique la couleur désactivée) */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Applique une classe utilitaire de taille de texte DSFR (fr-text--xs à fr-text--xl, fr-text--lead) */
|
|
33
|
+
labelSize?: TextSize;
|
|
34
|
+
/** Applique une classe utilitaire de graisse DSFR (fr-text--light à fr-text--heavy) */
|
|
35
|
+
labelWeight?: TextWeight;
|
|
36
|
+
}
|
|
37
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
38
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
39
|
+
$$bindings?: Bindings;
|
|
40
|
+
} & Exports;
|
|
41
|
+
(internal: unknown, props: Props & {
|
|
42
|
+
$$events?: Events;
|
|
43
|
+
$$slots?: Slots;
|
|
44
|
+
}): Exports & {
|
|
45
|
+
$set?: any;
|
|
46
|
+
$on?: any;
|
|
47
|
+
};
|
|
48
|
+
z_$$bindings?: Bindings;
|
|
49
|
+
}
|
|
50
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
51
|
+
default: any;
|
|
52
|
+
} ? Props extends Record<string, never> ? any : {
|
|
53
|
+
children?: any;
|
|
54
|
+
} : {});
|
|
55
|
+
declare const DsfrLabel: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Props, {
|
|
56
|
+
default: {};
|
|
57
|
+
hint: {};
|
|
58
|
+
}>, {
|
|
59
|
+
[evt: string]: CustomEvent<any>;
|
|
60
|
+
}, {
|
|
61
|
+
default: {};
|
|
62
|
+
hint: {};
|
|
63
|
+
}, {}, "">;
|
|
64
|
+
type DsfrLabel = InstanceType<typeof DsfrLabel>;
|
|
65
|
+
export default DsfrLabel;
|