diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdc46eb..50f634a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Components - Message ciblé: Ajout de la variante hyperlien. +- Components - Entree de données: Ajout d'exemple pour champ numérique (input type="number"). ### Changed - Components - Entree de données: Ajustement espacement input + message d'erreur. +### Fixed +- Components - Entrée de données: Modification display du label pour corriger problème d'alignement avec ou sans popover. + ### PatternLab - PL: Mise à jour des gabarits. - PL: Retrait composants flyout et cookie consent. diff --git a/source/_patterns/02-components/entree-de-donnees/01-inputs.md b/source/_patterns/02-components/entree-de-donnees/01-inputs.md index 0fb7fbce..90247f2e 100755 --- a/source/_patterns/02-components/entree-de-donnees/01-inputs.md +++ b/source/_patterns/02-components/entree-de-donnees/01-inputs.md @@ -1,11 +1,3 @@ --- title: Champ de texte --- - -## Tailles - -Les inputs par défaut sont de taille médium. - -## Validation - -Seuls les inputs sans icônes peuvent avoir une icône de validation. Dans ce cas il faut ajouter un div avec la classe feedback-icon et la classe de la validation soit .valid-feedback ou bien .invalid-feedback. diff --git a/source/_patterns/02-components/entree-de-donnees/02-inputs-number.json b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.json new file mode 100644 index 00000000..94676eac --- /dev/null +++ b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.json @@ -0,0 +1,85 @@ +{ + "inputTextSize": [ + { + "formGroupClass": "required", + "formGroupInputID": "form-control-number-default-one", + "formGroupInputRequired": true, + "formGroupInputLabel": "Libellé", + "formGroupPopover": true, + "formGroupInputPlaceholder": { + "text": "XX" + }, + "formGroupInputHelpText": { + "id": "input-number-help-text-id", + "text": "Texte d'assistance" + }, + "formGroupInputCounter": false + }, + { + "formGroupClass": "required", + "formGroupInputID": "form-control-number-default-two", + "formGroupInputRequired": true, + "formGroupInputLabel": "Libellé", + "formGroupPopover": false, + "formGroupInputPlaceholder": { + "text": "XX" + }, + "formGroupInputValue": "40", + "formGroupInputHelpText": { + "id": "input-number-help-text-id", + "text": "Texte d'assistance" + }, + "formGroupInputCounter": { + "id": "input-number-caracter-count", + "text": "La valeur doit se situer entre 20 et 60" + }, + "boundary": { + "min": 20, + "max": 60, + "step": 5 + } + } + ], + "inputTextSizeValidation": [ + { + "formGroupClass": "required", + "formGroupInputID": "form-control-number-default-error-one", + "formGroupInputClass": "is-invalid", + "formGroupInputRequired": true, + "formGroupInputLabel": "En erreur input vide", + "formGroupInputPlaceholder": false, + "formGroupInputHelpText": false, + "formGroupInputError": { + "id": "input-text-error-id", + "text": "Texte d'erreur", + "formAriaInputError": true + }, + "boundary": { + "min": 10, + "max": 100 + } + } + ], + "inputTextState": [ + { + "formGroupClass": false, + "formGroupInputID": "form-control-input-number-disabled", + "formGroupInputLabel": "Désactivé", + "formGroupInputRequired": false, + "formGroupInputPlaceholder": "désactivé", + "formGroupInputHelpText": false, + "formGroupInputState": "disabled" + }, + { + "formGroupClass": false, + "formGroupInputID": "form-control-input-number-readonly", + "formGroupInputLabel": "Read-only", + "formGroupInputClass": false, + "formGroupInputRequired": false, + "formGroupInputPlaceholder": "read-only", + "formGroupInputHelpText": false, + "formGroupInputState": "readonly", + "formGroupInputValue": "40" + } + ] +} diff --git a/source/_patterns/02-components/entree-de-donnees/02-inputs-number.md b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.md new file mode 100755 index 00000000..f5e299d6 --- /dev/null +++ b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.md @@ -0,0 +1,4 @@ +--- +title: Champ numérique +--- + diff --git a/source/_patterns/02-components/entree-de-donnees/02-inputs-number.mustache b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.mustache new file mode 100755 index 00000000..823aca33 --- /dev/null +++ b/source/_patterns/02-components/entree-de-donnees/02-inputs-number.mustache @@ -0,0 +1,25 @@ +
+ {{# inputTextSize}} +
+ {{> components-input-number }} +
+ {{/ inputTextSize}} +
+ +

Validation

+
+ {{# inputTextSizeValidation}} +
+ {{> components-input-number }} +
+ {{/ inputTextSizeValidation}} +
+ +

États

+
+ {{# inputTextState}} +
+ {{> components-input-number}} +
+ {{/ inputTextState}} +
diff --git a/source/_patterns/02-components/entree-de-donnees/01-textareas.json b/source/_patterns/02-components/entree-de-donnees/03-textareas.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/01-textareas.json rename to source/_patterns/02-components/entree-de-donnees/03-textareas.json diff --git a/source/_patterns/02-components/entree-de-donnees/01-textareas.md b/source/_patterns/02-components/entree-de-donnees/03-textareas.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/01-textareas.md rename to source/_patterns/02-components/entree-de-donnees/03-textareas.md diff --git a/source/_patterns/02-components/entree-de-donnees/01-textareas.mustache b/source/_patterns/02-components/entree-de-donnees/03-textareas.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/01-textareas.mustache rename to source/_patterns/02-components/entree-de-donnees/03-textareas.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/02-searchbar.json b/source/_patterns/02-components/entree-de-donnees/04-searchbar.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/02-searchbar.json rename to source/_patterns/02-components/entree-de-donnees/04-searchbar.json diff --git a/source/_patterns/02-components/entree-de-donnees/02-searchbar.md b/source/_patterns/02-components/entree-de-donnees/04-searchbar.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/02-searchbar.md rename to source/_patterns/02-components/entree-de-donnees/04-searchbar.md diff --git a/source/_patterns/02-components/entree-de-donnees/02-searchbar.mustache b/source/_patterns/02-components/entree-de-donnees/04-searchbar.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/02-searchbar.mustache rename to source/_patterns/02-components/entree-de-donnees/04-searchbar.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/03-selects.json b/source/_patterns/02-components/entree-de-donnees/05-selects.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/03-selects.json rename to source/_patterns/02-components/entree-de-donnees/05-selects.json diff --git a/source/_patterns/02-components/entree-de-donnees/03-selects.md b/source/_patterns/02-components/entree-de-donnees/05-selects.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/03-selects.md rename to source/_patterns/02-components/entree-de-donnees/05-selects.md diff --git a/source/_patterns/02-components/entree-de-donnees/03-selects.mustache b/source/_patterns/02-components/entree-de-donnees/05-selects.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/03-selects.mustache rename to source/_patterns/02-components/entree-de-donnees/05-selects.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier.json b/source/_patterns/02-components/entree-de-donnees/06-fichier.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier.json rename to source/_patterns/02-components/entree-de-donnees/06-fichier.json diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier.md b/source/_patterns/02-components/entree-de-donnees/06-fichier.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier.md rename to source/_patterns/02-components/entree-de-donnees/06-fichier.md diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier.mustache b/source/_patterns/02-components/entree-de-donnees/06-fichier.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier.mustache rename to source/_patterns/02-components/entree-de-donnees/06-fichier.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier~apercu-off.json b/source/_patterns/02-components/entree-de-donnees/06-fichier~apercu-off.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier~apercu-off.json rename to source/_patterns/02-components/entree-de-donnees/06-fichier~apercu-off.json diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier~apercu-on.json b/source/_patterns/02-components/entree-de-donnees/06-fichier~apercu-on.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier~apercu-on.json rename to source/_patterns/02-components/entree-de-donnees/06-fichier~apercu-on.json diff --git a/source/_patterns/02-components/entree-de-donnees/04-fichier~erreur.json b/source/_patterns/02-components/entree-de-donnees/06-fichier~erreur.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/04-fichier~erreur.json rename to source/_patterns/02-components/entree-de-donnees/06-fichier~erreur.json diff --git a/source/_patterns/02-components/entree-de-donnees/05-checkbox.json b/source/_patterns/02-components/entree-de-donnees/08-checkbox.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/05-checkbox.json rename to source/_patterns/02-components/entree-de-donnees/08-checkbox.json diff --git a/source/_patterns/02-components/entree-de-donnees/05-checkbox.md b/source/_patterns/02-components/entree-de-donnees/08-checkbox.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/05-checkbox.md rename to source/_patterns/02-components/entree-de-donnees/08-checkbox.md diff --git a/source/_patterns/02-components/entree-de-donnees/05-checkbox.mustache b/source/_patterns/02-components/entree-de-donnees/08-checkbox.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/05-checkbox.mustache rename to source/_patterns/02-components/entree-de-donnees/08-checkbox.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/07-radio.json b/source/_patterns/02-components/entree-de-donnees/09-radio.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/07-radio.json rename to source/_patterns/02-components/entree-de-donnees/09-radio.json diff --git a/source/_patterns/02-components/entree-de-donnees/07-radio.md b/source/_patterns/02-components/entree-de-donnees/09-radio.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/07-radio.md rename to source/_patterns/02-components/entree-de-donnees/09-radio.md diff --git a/source/_patterns/02-components/entree-de-donnees/07-radio.mustache b/source/_patterns/02-components/entree-de-donnees/09-radio.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/07-radio.mustache rename to source/_patterns/02-components/entree-de-donnees/09-radio.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/09-switches.json b/source/_patterns/02-components/entree-de-donnees/10-switches.json similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/09-switches.json rename to source/_patterns/02-components/entree-de-donnees/10-switches.json diff --git a/source/_patterns/02-components/entree-de-donnees/09-switches.md b/source/_patterns/02-components/entree-de-donnees/10-switches.md similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/09-switches.md rename to source/_patterns/02-components/entree-de-donnees/10-switches.md diff --git a/source/_patterns/02-components/entree-de-donnees/09-switches.mustache b/source/_patterns/02-components/entree-de-donnees/10-switches.mustache similarity index 100% rename from source/_patterns/02-components/entree-de-donnees/09-switches.mustache rename to source/_patterns/02-components/entree-de-donnees/10-switches.mustache diff --git a/source/_patterns/02-components/entree-de-donnees/_input-number.mustache b/source/_patterns/02-components/entree-de-donnees/_input-number.mustache new file mode 100644 index 00000000..c9effe21 --- /dev/null +++ b/source/_patterns/02-components/entree-de-donnees/_input-number.mustache @@ -0,0 +1,20 @@ +
+ {{# formGroupPopover}}
{{/ formGroupPopover}} + + {{# formGroupPopover}}{{/ formGroupPopover}} + {{# formGroupPopover}}
{{/ formGroupPopover}} + {{# formGroupInputHelpText}} + {{ text }} + {{/ formGroupInputHelpText}} + + {{# formGroupInputCounter}} + {{ text }} + {{/ formGroupInputCounter}} + {{# formGroupInputError}} +
+ + Erreur + {{ formGroupInputError.text }} +
+ {{/ formGroupInputError}} +
diff --git a/source/css/scss/_forms.scss b/source/css/scss/_forms.scss index 4a6ccc1a..7d43fdaf 100644 --- a/source/css/scss/_forms.scss +++ b/source/css/scss/_forms.scss @@ -13,6 +13,7 @@ label { font-weight: $font-weight-bold; color: $neutral-primary; margin-bottom: .5rem; + display: block; span { @include font-size($font-size-sm); font-weight: $font-weight-normal;