@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.
- 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 +926 -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,51 @@
|
|
|
1
|
+
import type { Size, TextSize, TextWeight } from "../types";
|
|
2
|
+
type SearchSize = Extract<Size, "md" | "lg">;
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Attribut 'id' de l'input */
|
|
5
|
+
inputId: string;
|
|
6
|
+
/** Libellé de l'input */
|
|
7
|
+
inputLabel: string;
|
|
8
|
+
/** Libellé du bouton */
|
|
9
|
+
buttonLabel: string;
|
|
10
|
+
/** Titre du bouton */
|
|
11
|
+
buttonTitle: string;
|
|
12
|
+
/** Type du bouton */
|
|
13
|
+
buttonType: "button" | "submit";
|
|
14
|
+
/** Taille de la barre de recherche (défaut: md) */
|
|
15
|
+
size?: SearchSize;
|
|
16
|
+
/** Placeholder de l'input */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Valeur initiale du champs de saisie */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Désactive le champ de saisie */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Attribut form du composant */
|
|
23
|
+
form?: string;
|
|
24
|
+
/** Longueur maximale du champ de saisie */
|
|
25
|
+
maxlength?: number;
|
|
26
|
+
/** Longueur minimale du champ de saisie */
|
|
27
|
+
minlength?: number;
|
|
28
|
+
/** Attribut name du composant */
|
|
29
|
+
name?: string;
|
|
30
|
+
/** Attribut pattern du composant */
|
|
31
|
+
pattern?: string;
|
|
32
|
+
/** Rend le champ de saisie en lecture seule */
|
|
33
|
+
readonly?: boolean;
|
|
34
|
+
/** Rend le champ de saisie obligatoire */
|
|
35
|
+
required?: boolean;
|
|
36
|
+
/** `ElementInternals` interface pour l'association du composant aux formulaires */
|
|
37
|
+
internals?: ElementInternals;
|
|
38
|
+
/** Callback appelé lors du changement de valeur du champ de recherche */
|
|
39
|
+
onvaluechanged?: (value: string) => void;
|
|
40
|
+
/** Callback appelé lors de la soumission de la recherche */
|
|
41
|
+
onsearch?: (value: string) => void;
|
|
42
|
+
/** Applique une classe utilitaire de taille de texte DSFR (fr-text--xs à fr-text--xl, fr-text--lead) sur le label */
|
|
43
|
+
labelSize?: TextSize;
|
|
44
|
+
/** Applique une classe utilitaire de graisse DSFR (fr-text--light à fr-text--heavy) sur le label */
|
|
45
|
+
labelWeight?: TextWeight;
|
|
46
|
+
}
|
|
47
|
+
declare const DsfrSearch: import("svelte").Component<Props, {
|
|
48
|
+
setCustomValidity: (message: string) => void;
|
|
49
|
+
}, "value">;
|
|
50
|
+
type DsfrSearch = ReturnType<typeof DsfrSearch>;
|
|
51
|
+
export default DsfrSearch;
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: "dsfr-segmented",
|
|
4
|
+
props: {
|
|
5
|
+
size: { attribute: "size", type: "String" },
|
|
6
|
+
legend: { attribute: "legend", type: "String" },
|
|
7
|
+
legendInline: { attribute: "legend-inline", type: "Boolean" },
|
|
8
|
+
noLegend: { attribute: "no-legend", type: "Boolean" },
|
|
9
|
+
hint: { attribute: "hint", type: "String" },
|
|
10
|
+
hasIcon: { attribute: "has-icon", type: "Boolean" },
|
|
11
|
+
elements: { attribute: "elements", type: "Array" },
|
|
12
|
+
value: { attribute: "value", type: "String" },
|
|
13
|
+
},
|
|
14
|
+
extend: withIconsStyleSheet,
|
|
15
|
+
}}
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">import { withIconsStyleSheet, setIconClass, setThemeable } from "../utilitaires";
|
|
19
|
+
setThemeable($host());
|
|
20
|
+
let { size = "md", legend, legendInline = false, noLegend = false, hint, hasIcon = false, elements = [], value, onvaluechanged } = $props();
|
|
21
|
+
// `checked` sert de fallback si `value` n'est pas fourni
|
|
22
|
+
let currentValue = $derived(value ?? elements.find((e) => e.checked)?.value?.toString());
|
|
23
|
+
let fieldsetEl = $state();
|
|
24
|
+
let elementsEl = $state();
|
|
25
|
+
/**
|
|
26
|
+
* Redimensionne le composant en fonction de l'espace disponible (reproduit le comportement du JS DSFR).
|
|
27
|
+
*
|
|
28
|
+
* Vérifie la largeur du parent et bascule automatiquement le composant en mode vertical
|
|
29
|
+
* si la largeur totale des éléments dépasse la largeur disponible.
|
|
30
|
+
*
|
|
31
|
+
* @function resize
|
|
32
|
+
* @returns {void}
|
|
33
|
+
*/
|
|
34
|
+
function resize() {
|
|
35
|
+
if (!elementsEl || !fieldsetEl) return;
|
|
36
|
+
const host = $host() ?? fieldsetEl;
|
|
37
|
+
const parentWidth = host.parentElement?.offsetWidth ?? 0;
|
|
38
|
+
fieldsetEl.classList.remove("fr-segmented--vertical");
|
|
39
|
+
if (elementsEl.offsetWidth > parentWidth || elementsEl.scrollWidth > parentWidth) {
|
|
40
|
+
fieldsetEl.classList.add("fr-segmented--vertical");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Effectue le redimensionnement réactif du composant
|
|
45
|
+
*
|
|
46
|
+
* Observe les changements de largeur de l'élément parent
|
|
47
|
+
* et déclenche une fonction de redimensionnement lorsque la largeur change.
|
|
48
|
+
*
|
|
49
|
+
* Utilise ResizeObserver pour déterminer si la largeur de l'élément parent
|
|
50
|
+
* a changé et ne relance le redimensionnement que si nécessaire.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
$effect(() => {
|
|
54
|
+
const host = $host() ?? fieldsetEl;
|
|
55
|
+
const parent = host.parentElement;
|
|
56
|
+
if (!parent) return;
|
|
57
|
+
let previousWidth = parent.offsetWidth;
|
|
58
|
+
const observer = new ResizeObserver((entries) => {
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
for (const entry of entries) {
|
|
61
|
+
const width = Math.round(entry.contentRect.width);
|
|
62
|
+
if (width !== previousWidth) {
|
|
63
|
+
previousWidth = width;
|
|
64
|
+
resize();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
observer.observe(parent);
|
|
70
|
+
resize();
|
|
71
|
+
return () => observer.disconnect();
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Gère le changement de valeur du composant.
|
|
75
|
+
* Émet un événement 'valuechanged' avec la valeur actuelle sélectionnée.
|
|
76
|
+
*
|
|
77
|
+
* @param {Event} event - L'événement de changement déclenché par l'élément DOM
|
|
78
|
+
*/
|
|
79
|
+
function handleChange() {
|
|
80
|
+
if (currentValue !== undefined) {
|
|
81
|
+
onvaluechanged?.(currentValue);
|
|
82
|
+
$host()?.dispatchEvent(new CustomEvent("valuechanged", {
|
|
83
|
+
detail: currentValue,
|
|
84
|
+
bubbles: true
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<fieldset
|
|
91
|
+
bind:this={fieldsetEl}
|
|
92
|
+
class={["fr-segmented", `fr-segmented--${size}`]}
|
|
93
|
+
class:fr-segmented--no-legend={noLegend}
|
|
94
|
+
>
|
|
95
|
+
<legend class="fr-segmented__legend" class:fr-segmented__legend--inline={legendInline}>
|
|
96
|
+
{legend}
|
|
97
|
+
{#if hint}
|
|
98
|
+
<span class="fr-hint-text">{hint}</span>
|
|
99
|
+
{/if}
|
|
100
|
+
</legend>
|
|
101
|
+
<div class="fr-segmented__elements" bind:this={elementsEl}>
|
|
102
|
+
{#each elements as segmented (segmented.id)}
|
|
103
|
+
<div class="fr-segmented__element">
|
|
104
|
+
<input
|
|
105
|
+
type="radio"
|
|
106
|
+
id={segmented.id}
|
|
107
|
+
value={segmented.value}
|
|
108
|
+
name={segmented.name}
|
|
109
|
+
disabled={segmented.disabled}
|
|
110
|
+
bind:group={currentValue}
|
|
111
|
+
onchange={handleChange}
|
|
112
|
+
/>
|
|
113
|
+
<label
|
|
114
|
+
class={["fr-label", hasIcon && segmented.icon ? setIconClass(segmented.icon) : ""]}
|
|
115
|
+
for={segmented.id}
|
|
116
|
+
>
|
|
117
|
+
{segmented.label}
|
|
118
|
+
</label>
|
|
119
|
+
</div>
|
|
120
|
+
{/each}
|
|
121
|
+
</div>
|
|
122
|
+
</fieldset>
|
|
123
|
+
|
|
124
|
+
<style>@charset "UTF-8";
|
|
125
|
+
/*!
|
|
126
|
+
* DSFR v1.14.4 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions)
|
|
127
|
+
*/.fr-segmented{align-items:center;border:0;display:inline-flex;margin:0;padding:0;position:relative}.fr-segmented__legend{margin-bottom:.75rem;padding:0}.fr-segmented__legend .fr-hint-text{margin-top:.25rem}.fr-segmented__legend--inline{display:contents;float:left}.fr-segmented__legend--inline+.fr-segmented__elements{margin-left:1rem}.fr-segmented__elements{border-radius:.25rem;box-shadow:inset 0 0 0 1px var(--border-default-grey);display:flex;flex-direction:row}.fr-segmented__element{position:relative}.fr-segmented .fr-segmented__element input{opacity:0}.fr-segmented input{height:100%;margin:0;position:absolute;width:100%;z-index:-1}.fr-segmented input+label{align-items:center;border-radius:.25rem;display:inline-flex;font-size:1rem;font-weight:500;line-height:1.5rem;max-height:none;max-width:100%;min-height:2.5rem;overflow:initial;padding:.5rem 1rem;white-space:nowrap;width:100%}.fr-segmented input+label:before{--icon-size:1rem;margin-left:-.125rem;margin-right:.5rem}.fr-segmented input:not([disabled]):not(:checked)+label{-webkit-mask-image:linear-gradient(0deg,#fff,#fff),linear-gradient(0deg,#fff,#fff),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>");mask-image:linear-gradient(0deg,#fff,#fff),linear-gradient(0deg,#fff,#fff),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>"),url("data:image/svg+xml;charset=uft8,<svg xmlns='http://www.w3.org/2000/svg' width='4px' height='4px' viewBox='0 0 4 4'><circle fill='%23fff' r='2' cx='2' cy='2' /></svg>");-webkit-mask-position:.25rem .375rem,.375rem .25rem,.25rem .25rem,calc(100% - .25rem) .25rem,.25rem calc(100% - .25rem),calc(100% - .25rem) calc(100% - .25rem);mask-position:.25rem .375rem,.375rem .25rem,.25rem .25rem,calc(100% - .25rem) .25rem,.25rem calc(100% - .25rem),calc(100% - .25rem) calc(100% - .25rem);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:calc(100% - .5rem)calc(100% - .75rem),calc(100% - .75rem)calc(100% - .5rem),.25rem .25rem,.25rem .25rem,.25rem .25rem,.25rem .25rem;mask-size:calc(100% - .5rem)calc(100% - .75rem),calc(100% - .75rem)calc(100% - .5rem),.25rem .25rem,.25rem .25rem,.25rem .25rem,.25rem .25rem}.fr-segmented input:not([disabled]):not(:checked)+label:hover{background-color:var(--hover)}.fr-segmented input:not([disabled]):not(:checked)+label:active{background-color:var(--active)}.fr-segmented--vertical .fr-segmented__elements{flex-direction:column;margin-left:0}.fr-segmented--vertical .fr-segmented__legend--inline{display:block;float:none}.fr-segmented--no-legend legend{clip:rect(0,0,0,0);border:0;display:block;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.fr-segmented--no-legend legend+.fr-segmented__elements{margin-left:0}.fr-segmented__element input:focus+label{outline-color:#0a76f6;outline-offset:2px;outline-style:solid;outline-width:2px}.fr-segmented__element input:focus:not(:focus-visible)+label{outline-style:none}.fr-segmented__element input:focus-visible+label{outline-style:solid}.fr-segmented--sm .fr-segmented__legend,.fr-segmented--sm input+label{font-size:.875rem;line-height:1.5rem}.fr-segmented--sm input+label{max-height:none;max-width:100%;min-height:2rem;overflow:initial;padding:.25rem .75rem}.fr-segmented--sm input+label:before{--icon-size:1rem;margin-left:-.125rem;margin-right:.5rem}.fr-segmented__element label{color:var(--text-action-high-grey)}.fr-segmented__element input:checked+label{box-shadow:inset 0 0 0 1px var(--border-active-blue-france);color:var(--text-active-blue-france)}.fr-segmented__element input:checked:disabled+label{box-shadow:inset 0 0 0 1px var(--text-disabled-grey);color:var(--text-disabled-grey)}@media (min-width:36em){
|
|
128
|
+
/*! media sm */}@media (min-width:48em){
|
|
129
|
+
/*! media md */}@media (min-width:62em){
|
|
130
|
+
/*! media lg */}@media (min-width:78em){
|
|
131
|
+
/*! media xl */}@media (-ms-high-contrast:active),(forced-colors:active){.fr-segmented__elements{outline:1px solid}.fr-segmented input+label:before{background-color:buttontext}.fr-segmented input:checked:focus+label{outline:4px solid;outline-offset:0}.fr-segmented input:checked+label{color:highlight;outline:2px solid}.fr-segmented input:checked:disabled+label,.fr-segmented input:disabled+label{color:graytext}.fr-segmented input:not([disabled]):not(:checked)+label{color:buttontext}}@media (-ms-high-contrast:active) and (-ms-high-contrast:active),(-ms-high-contrast:active) and (forced-colors:active),(forced-colors:active) and (-ms-high-contrast:active),(forced-colors:active) and (forced-colors:active){.fr-segmented input:checked+label:before{background-color:highlight}.fr-segmented input:checked:disabled+label:before{background-color:graytext}}input,
|
|
132
|
+
select,
|
|
133
|
+
textarea {
|
|
134
|
+
-webkit-appearance: none;
|
|
135
|
+
-moz-appearance: none;
|
|
136
|
+
appearance: none;
|
|
137
|
+
font-family: "Marianne", arial, sans-serif;
|
|
138
|
+
text-rendering: optimizeLegibility;
|
|
139
|
+
-webkit-font-smoothing: antialiased;
|
|
140
|
+
-moz-osx-font-smoothing: grayscale;
|
|
141
|
+
-webkit-text-size-adjust: 100%;
|
|
142
|
+
border-radius: 0;
|
|
143
|
+
border: 0;
|
|
144
|
+
background-color: transparent;
|
|
145
|
+
margin: 0;
|
|
146
|
+
}
|
|
147
|
+
@media (-ms-high-contrast: active), (forced-colors: active) {
|
|
148
|
+
input,
|
|
149
|
+
select,
|
|
150
|
+
textarea {
|
|
151
|
+
border: 1px solid;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
input[type=search] {
|
|
156
|
+
-webkit-appearance: none;
|
|
157
|
+
-moz-appearance: none;
|
|
158
|
+
appearance: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
input[type=checkbox],
|
|
162
|
+
input[type=radio],
|
|
163
|
+
input[type=range] {
|
|
164
|
+
-webkit-appearance: auto;
|
|
165
|
+
-moz-appearance: auto;
|
|
166
|
+
appearance: auto;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
input::-webkit-contacts-auto-fill-button,
|
|
170
|
+
input::-webkit-credentials-auto-fill-button {
|
|
171
|
+
margin-left: 1rem;
|
|
172
|
+
margin-right: -1px;
|
|
173
|
+
width: 1.25rem;
|
|
174
|
+
height: 1.25rem;
|
|
175
|
+
-webkit-mask-size: 1.25rem 1.25rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
input[type=range]:focus::-webkit-slider-thumb {
|
|
179
|
+
outline-offset: 2px;
|
|
180
|
+
outline-width: 2px;
|
|
181
|
+
outline-color: #0a76f6;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
input[type=range]:focus::-moz-range-thumb {
|
|
185
|
+
outline-offset: 2px;
|
|
186
|
+
outline-width: 2px;
|
|
187
|
+
outline-color: #0a76f6;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
input[type=range]:focus::-ms-thumb {
|
|
191
|
+
outline-offset: 2px;
|
|
192
|
+
outline-width: 2px;
|
|
193
|
+
outline-color: #0a76f6;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
a:focus, button:focus, input:focus, input[type=checkbox]:focus + label::before, input[type=radio]:focus + label::before, input[type=button]:focus, input[type=image]:focus, input[type=reset]:focus, input[type=submit]:focus, select:focus, textarea:focus, [tabindex]:focus, video:focus[controls], audio:focus[controls], [contenteditable]:not([contenteditable=false]):focus, details:focus, details > summary:first-of-type:focus {
|
|
197
|
+
outline-offset: 2px;
|
|
198
|
+
outline-width: 2px;
|
|
199
|
+
outline-color: #0a76f6;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
input[type=range]:focus::-webkit-slider-thumb {
|
|
203
|
+
outline-style: solid;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
input[type=range]:focus::-moz-range-thumb {
|
|
207
|
+
outline-style: solid;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
input[type=range]:focus::-ms-thumb {
|
|
211
|
+
outline-style: solid;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
a:focus, button:focus, input:focus, input[type=checkbox]:focus + label::before, input[type=radio]:focus + label::before, input[type=button]:focus, input[type=image]:focus, input[type=reset]:focus, input[type=submit]:focus, select:focus, textarea:focus, [tabindex]:focus, video:focus[controls], audio:focus[controls], [contenteditable]:not([contenteditable=false]):focus, details:focus, details > summary:first-of-type:focus {
|
|
215
|
+
outline-style: solid;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
input[type=range]:focus:not(:focus-visible)::-webkit-slider-thumb {
|
|
219
|
+
outline-style: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
input[type=range]:focus:not(:focus-visible)::-moz-range-thumb {
|
|
223
|
+
outline-style: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
input[type=range]:focus:not(:focus-visible)::-ms-thumb {
|
|
227
|
+
outline-style: none;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
a:focus:not(:focus-visible), button:focus:not(:focus-visible), input:focus:not(:focus-visible), input[type=checkbox]:focus:not(:focus-visible) + label::before, input[type=radio]:focus:not(:focus-visible) + label::before, input[type=button]:focus:not(:focus-visible), input[type=image]:focus:not(:focus-visible), input[type=reset]:focus:not(:focus-visible), input[type=submit]:focus:not(:focus-visible), select:focus:not(:focus-visible), textarea:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible), video:focus:not(:focus-visible)[controls], audio:focus:not(:focus-visible)[controls], [contenteditable]:not([contenteditable=false]):focus:not(:focus-visible), details:focus:not(:focus-visible), details > summary:first-of-type:focus:not(:focus-visible) {
|
|
231
|
+
outline-style: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
input[type=range]:focus-visible::-webkit-slider-thumb {
|
|
235
|
+
outline-style: solid;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
input[type=range]:focus-visible::-moz-range-thumb {
|
|
239
|
+
outline-style: solid;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
input[type=range]:focus-visible::-ms-thumb {
|
|
243
|
+
outline-style: solid;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
a:focus-visible, button:focus-visible, input:focus-visible, input[type=checkbox]:focus-visible + label::before, input[type=radio]:focus-visible + label::before, input[type=button]:focus-visible, input[type=image]:focus-visible, input[type=reset]:focus-visible, input[type=submit]:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, video:focus-visible[controls], audio:focus-visible[controls], [contenteditable]:not([contenteditable=false]):focus-visible, details:focus-visible, details > summary:first-of-type:focus-visible {
|
|
247
|
+
outline-style: solid;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@media (hover: hover) and (pointer: fine) {
|
|
251
|
+
:root {
|
|
252
|
+
--brighten: -1;
|
|
253
|
+
}
|
|
254
|
+
a[href]:hover, button:not(:disabled):hover, input[type=button]:not(:disabled):hover, input[type=image]:not(:disabled):hover, input[type=reset]:not(:disabled):hover, input[type=submit]:not(:disabled):hover {
|
|
255
|
+
background-color: var(--hover-tint);
|
|
256
|
+
}
|
|
257
|
+
a[href]:active, button:not(:disabled):active, input[type=button]:not(:disabled):active, input[type=image]:not(:disabled):active, input[type=reset]:not(:disabled):active, input[type=submit]:not(:disabled):active {
|
|
258
|
+
background-color: var(--active-tint);
|
|
259
|
+
}
|
|
260
|
+
a[href]:hover, a[href]:active {
|
|
261
|
+
--underline-hover-width: var(--underline-max-width);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
button, input[type=button], input[type=image], input[type=reset], input[type=submit] {
|
|
265
|
+
--hover-tint: var(--hover);
|
|
266
|
+
--active-tint: var(--active);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
a {
|
|
270
|
+
--hover-tint: var(--idle);
|
|
271
|
+
--active-tint: var(--active);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
a, button, input[type=checkbox], input[type=checkbox] + label, input[type=radio], input[type=radio] + label, input[type=file], input[type=range], input[type=button], input[type=image], input[type=reset], input[type=submit], select, video[controls], audio[controls], details, details > summary:first-of-type {
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
input[type=range]:disabled::-webkit-slider-thumb, input[type=range]:disabled::-webkit-slider-thumb:active {
|
|
279
|
+
cursor: not-allowed;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
input[type=range]:disabled::-moz-range-thumb, input[type=range]:disabled::-moz-range-thumb:active {
|
|
283
|
+
cursor: not-allowed;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
input[type=range]:disabled::-ms-thumb, input[type=range]:disabled::-ms-thumb:active {
|
|
287
|
+
cursor: not-allowed;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
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, input[type=file]:disabled, input[type=range]:disabled, input[type=button]:disabled, input[type=image]:disabled, input[type=reset]:disabled, input[type=submit]:disabled, select:disabled, textarea:disabled, video:not([href])[controls], audio:not([href])[controls] {
|
|
291
|
+
cursor: not-allowed;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
input[type=range]::-webkit-slider-thumb {
|
|
295
|
+
cursor: grab;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
input[type=range]::-moz-range-thumb {
|
|
299
|
+
cursor: grab;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
input[type=range]::-ms-thumb {
|
|
303
|
+
cursor: grab;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
input[type=range]::-webkit-slider-thumb:active {
|
|
307
|
+
cursor: grabbing;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
input[type=range]::-moz-range-thumb:active {
|
|
311
|
+
cursor: grabbing;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
input[type=range]::-ms-thumb:active {
|
|
315
|
+
cursor: grabbing;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Override de l'opacité chrome sur un élément disabled
|
|
320
|
+
*/
|
|
321
|
+
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]) {
|
|
322
|
+
opacity: 1;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
*,
|
|
326
|
+
*::before,
|
|
327
|
+
*::after {
|
|
328
|
+
box-sizing: inherit;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
:root {
|
|
332
|
+
box-sizing: border-box;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
input,
|
|
336
|
+
select,
|
|
337
|
+
textarea,
|
|
338
|
+
label,
|
|
339
|
+
button,
|
|
340
|
+
a {
|
|
341
|
+
-webkit-tap-highlight-color: transparent;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
[class^=fr-icon-]::before, [class^=fr-icon-]::after, [class*=" fr-icon-"]::before, [class*=" fr-icon-"]::after, [class^=fr-fi-]::before, [class^=fr-fi-]::after, [class*=" fr-fi-"]::before, [class*=" fr-fi-"]::after {
|
|
345
|
+
flex: 0 0 auto;
|
|
346
|
+
display: inline-block;
|
|
347
|
+
vertical-align: calc((0.75em - var(--icon-size)) * 0.5);
|
|
348
|
+
background-color: currentColor;
|
|
349
|
+
width: var(--icon-size);
|
|
350
|
+
height: var(--icon-size);
|
|
351
|
+
-webkit-mask-size: 100% 100%;
|
|
352
|
+
mask-size: 100% 100%;
|
|
353
|
+
}
|
|
354
|
+
[class^=fr-icon-]::before, [class^=fr-icon-]::after, [class*=" fr-icon-"]::before, [class*=" fr-icon-"]::after, [class^=fr-fi-]::before, [class^=fr-fi-]::after, [class*=" fr-fi-"]::before, [class*=" fr-fi-"]::after {
|
|
355
|
+
--icon-size: 1.5rem;
|
|
356
|
+
}
|
|
357
|
+
[class^=fr-icon-]::before, [class*=" fr-icon-"]::before, [class^=fr-fi-]::before, [class*=" fr-fi-"]::before {
|
|
358
|
+
content: "";
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@media (-ms-high-contrast: active) and (-ms-high-contrast: active), (-ms-high-contrast: active) and (forced-colors: active), (forced-colors: active) and (-ms-high-contrast: active), (forced-colors: active) and (forced-colors: active) {
|
|
362
|
+
[class^=fr-icon-]::before, [class^=fr-icon-]::after, [class*=" fr-icon-"]::before, [class*=" fr-icon-"]::after, [class^=fr-fi-]::before, [class^=fr-fi-]::after, [class*=" fr-fi-"]::before, [class*=" fr-fi-"]::after {
|
|
363
|
+
forced-color-adjust: none;
|
|
364
|
+
background-color: canvastext;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
@media (-ms-high-contrast: active) and (-ms-high-contrast: active), (-ms-high-contrast: active) and (forced-colors: active), (forced-colors: active) and (-ms-high-contrast: active), (forced-colors: active) and (forced-colors: active) {
|
|
368
|
+
button[class^=fr-icon-]:not([disabled])::before, button[class^=fr-icon-]:not([disabled])::after, button[class*=" fr-icon-"]:not([disabled])::before, button[class*=" fr-icon-"]:not([disabled])::after, button[class^=fr-fi-]:not([disabled])::before, button[class^=fr-fi-]:not([disabled])::after, button[class*=" fr-fi-"]:not([disabled])::before, button[class*=" fr-fi-"]:not([disabled])::after {
|
|
369
|
+
background-color: buttontext;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
@media (-ms-high-contrast: active) and (-ms-high-contrast: active), (-ms-high-contrast: active) and (forced-colors: active), (forced-colors: active) and (-ms-high-contrast: active), (forced-colors: active) and (forced-colors: active) {
|
|
373
|
+
a[href][class^=fr-icon-]::before, a[href][class^=fr-icon-]::after, a[href][class*=" fr-icon-"]::before, a[href][class*=" fr-icon-"]::after, a[href][class^=fr-fi-]::before, a[href][class^=fr-fi-]::after, a[href][class*=" fr-fi-"]::before, a[href][class*=" fr-fi-"]::after {
|
|
374
|
+
background-color: linktext;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
@media (-ms-high-contrast: active) and (-ms-high-contrast: active), (-ms-high-contrast: active) and (forced-colors: active), (forced-colors: active) and (-ms-high-contrast: active), (forced-colors: active) and (forced-colors: active) {
|
|
378
|
+
a[class^=fr-icon-]:not([href])::before, a[class^=fr-icon-]:not([href])::after, a[class*=" fr-icon-"]:not([href])::before, a[class*=" fr-icon-"]:not([href])::after, a[class^=fr-fi-]:not([href])::before, a[class^=fr-fi-]:not([href])::after, a[class*=" fr-fi-"]:not([href])::before, a[class*=" fr-fi-"]:not([href])::after, button[class^=fr-icon-]:disabled::before, button[class^=fr-icon-]:disabled::after, button[class*=" fr-icon-"]:disabled::before, button[class*=" fr-icon-"]:disabled::after, button[class^=fr-fi-]:disabled::before, button[class^=fr-fi-]:disabled::after, button[class*=" fr-fi-"]:disabled::before, button[class*=" fr-fi-"]:disabled::after, input[class^=fr-icon-]:disabled::before, input[class^=fr-icon-]:disabled::after, input[class*=" fr-icon-"]:disabled::before, input[class*=" fr-icon-"]:disabled::after, input[class^=fr-fi-]:disabled::before, input[class^=fr-fi-]:disabled::after, input[class*=" fr-fi-"]:disabled::before, input[class*=" fr-fi-"]:disabled::after, input[type=checkbox][class^=fr-icon-]:disabled::before, input[type=checkbox][class^=fr-icon-]:disabled::after, input[type=checkbox][class*=" fr-icon-"]:disabled::before, input[type=checkbox][class*=" fr-icon-"]:disabled::after, input[type=checkbox][class^=fr-fi-]:disabled::before, input[type=checkbox][class^=fr-fi-]:disabled::after, input[type=checkbox][class*=" fr-fi-"]:disabled::before, input[type=checkbox][class*=" fr-fi-"]:disabled::after, input[type=checkbox]:disabled + label[class^=fr-icon-]::before, input[type=checkbox]:disabled + label[class^=fr-icon-]::after, input[type=checkbox]:disabled + label[class*=" fr-icon-"]::before, input[type=checkbox]:disabled + label[class*=" fr-icon-"]::after, input[type=checkbox]:disabled + label[class^=fr-fi-]::before, input[type=checkbox]:disabled + label[class^=fr-fi-]::after, input[type=checkbox]:disabled + label[class*=" fr-fi-"]::before, input[type=checkbox]:disabled + label[class*=" fr-fi-"]::after, input[type=radio][class^=fr-icon-]:disabled::before, input[type=radio][class^=fr-icon-]:disabled::after, input[type=radio][class*=" fr-icon-"]:disabled::before, input[type=radio][class*=" fr-icon-"]:disabled::after, input[type=radio][class^=fr-fi-]:disabled::before, input[type=radio][class^=fr-fi-]:disabled::after, input[type=radio][class*=" fr-fi-"]:disabled::before, input[type=radio][class*=" fr-fi-"]:disabled::after, input[type=radio]:disabled + label[class^=fr-icon-]::before, input[type=radio]:disabled + label[class^=fr-icon-]::after, input[type=radio]:disabled + label[class*=" fr-icon-"]::before, input[type=radio]:disabled + label[class*=" fr-icon-"]::after, input[type=radio]:disabled + label[class^=fr-fi-]::before, input[type=radio]:disabled + label[class^=fr-fi-]::after, input[type=radio]:disabled + label[class*=" fr-fi-"]::before, input[type=radio]:disabled + label[class*=" fr-fi-"]::after, select[class^=fr-icon-]:disabled::before, select[class^=fr-icon-]:disabled::after, select[class*=" fr-icon-"]:disabled::before, select[class*=" fr-icon-"]:disabled::after, select[class^=fr-fi-]:disabled::before, select[class^=fr-fi-]:disabled::after, select[class*=" fr-fi-"]:disabled::before, select[class*=" fr-fi-"]:disabled::after, textarea[class^=fr-icon-]:disabled::before, textarea[class^=fr-icon-]:disabled::after, textarea[class*=" fr-icon-"]:disabled::before, textarea[class*=" fr-icon-"]:disabled::after, textarea[class^=fr-fi-]:disabled::before, textarea[class^=fr-fi-]:disabled::after, textarea[class*=" fr-fi-"]:disabled::before, textarea[class*=" fr-fi-"]:disabled::after, video[class^=fr-icon-]:not([href])::before, video[class^=fr-icon-]:not([href])::after, video[class*=" fr-icon-"]:not([href])::before, video[class*=" fr-icon-"]:not([href])::after, video[class^=fr-fi-]:not([href])::before, video[class^=fr-fi-]:not([href])::after, video[class*=" fr-fi-"]:not([href])::before, video[class*=" fr-fi-"]:not([href])::after, audio[class^=fr-icon-]:not([href])::before, audio[class^=fr-icon-]:not([href])::after, audio[class*=" fr-icon-"]:not([href])::before, audio[class*=" fr-icon-"]:not([href])::after, audio[class^=fr-fi-]:not([href])::before, audio[class^=fr-fi-]:not([href])::after, audio[class*=" fr-fi-"]:not([href])::before, audio[class*=" fr-fi-"]:not([href])::after {
|
|
379
|
+
background-color: graytext;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
.fr-icon--xs::before, .fr-icon--xs::after {
|
|
383
|
+
--icon-size: 0.75rem;
|
|
384
|
+
}
|
|
385
|
+
.fr-icon--sm::before, .fr-icon--sm::after {
|
|
386
|
+
--icon-size: 1rem;
|
|
387
|
+
}
|
|
388
|
+
.fr-icon--md::before, .fr-icon--md::after {
|
|
389
|
+
--icon-size: 1.5rem;
|
|
390
|
+
}
|
|
391
|
+
.fr-icon--lg::before, .fr-icon--lg::after {
|
|
392
|
+
--icon-size: 2rem;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.fr-label {
|
|
396
|
+
display: block;
|
|
397
|
+
font-size: 1rem;
|
|
398
|
+
line-height: 1.5rem;
|
|
399
|
+
}
|
|
400
|
+
.fr-label + .fr-input, .fr-label + .fr-input-wrap, .fr-label + .fr-select {
|
|
401
|
+
margin-top: 0.5rem;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
:host {
|
|
405
|
+
display: inline-flex;
|
|
406
|
+
text-rendering: optimizeLegibility;
|
|
407
|
+
-webkit-font-smoothing: antialiased;
|
|
408
|
+
-moz-osx-font-smoothing: grayscale;
|
|
409
|
+
-webkit-text-size-adjust: 100%;
|
|
410
|
+
font-size: 1rem;
|
|
411
|
+
line-height: 1.5rem;
|
|
412
|
+
background-color: var(--background-default-grey);
|
|
413
|
+
--idle: transparent;
|
|
414
|
+
--hover: var(--background-default-grey-hover);
|
|
415
|
+
--active: var(--background-default-grey-active);
|
|
416
|
+
color: var(--text-default-grey);
|
|
417
|
+
background-color: transparent;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.fr-segmented {
|
|
421
|
+
box-sizing: border-box;
|
|
422
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Size } from "../types";
|
|
2
|
+
type SegmentedSize = Extract<Size, "sm" | "md">;
|
|
3
|
+
type Segmented = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
name: string;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
value?: string | number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon?: string;
|
|
11
|
+
};
|
|
12
|
+
interface Props {
|
|
13
|
+
/** Taille du contrôle segmenté */
|
|
14
|
+
size?: SegmentedSize;
|
|
15
|
+
/** Légende du contrôle segmenté */
|
|
16
|
+
legend?: string;
|
|
17
|
+
/** Si true, affiche la légende sur la même ligne que le contrôle segmenté */
|
|
18
|
+
legendInline?: boolean;
|
|
19
|
+
/** Si true, n'affiche pas la légende */
|
|
20
|
+
noLegend?: boolean;
|
|
21
|
+
/** Texte additionnel du contrôle segmenté */
|
|
22
|
+
hint?: string;
|
|
23
|
+
/** Le contrôle segmenté a une icône */
|
|
24
|
+
hasIcon?: boolean;
|
|
25
|
+
/** Les éléments du contrôle segmenté */
|
|
26
|
+
elements: Segmented[];
|
|
27
|
+
/** Valeur des segments */
|
|
28
|
+
value?: string | number;
|
|
29
|
+
/** Callback appelé lors du changement de segment actif */
|
|
30
|
+
onvaluechanged?: (value: string | number) => void;
|
|
31
|
+
}
|
|
32
|
+
declare const DsfrSegmented: import("svelte").Component<Props, {}, "">;
|
|
33
|
+
type DsfrSegmented = ReturnType<typeof DsfrSegmented>;
|
|
34
|
+
export default DsfrSegmented;
|