Skip to content

Commit

Permalink
Correction describedby sur input (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Boulerice <[email protected]>
  • Loading branch information
alexisletrotteur authored May 30, 2024
1 parent 3b56841 commit 1b0269d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 26 deletions.
14 changes: 9 additions & 5 deletions source/_patterns/02-components/entree-de-donnees/01-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"formGroupInputPlaceholder": {
"text": "Placeholder"
},
"formGroupInputDescribedBy": "input-text-help-text-id input-text-caracter-count",
"formGroupInputHelpText": {
"id": "input-text-help-text-id",
"text": "Texte d'assistance"
Expand All @@ -31,12 +32,13 @@
"formGroupInputPlaceholder": {
"text": "Placeholder"
},
"formGroupInputDescribedBy": "input-text-error-id",
"formGroupInputHelpText": false,
"formGroupInputError": {
"id": "input-text-error-id",
"text": "Texte d'erreur",
"formAriaInputError": true
}
"text": "Texte d'erreur"
},
"formAriaInputError": true
}
],
"inputTextState": [
Expand All @@ -45,7 +47,8 @@
"formGroupInputID": "form-control-input-text-disabled",
"formGroupInputLabel": "Désactivé",
"formGroupInputRequired": false,
"formGroupInputPlaceholder": "désactivé",
"formGroupInputPlaceholder": false,
"formGroupInputDescribedBy": false,
"formGroupInputHelpText": false,
"formGroupInputState": "disabled",
"formGroupBtnClear": false
Expand All @@ -56,7 +59,8 @@
"formGroupInputLabel": "Read-only",
"formGroupInputClass": false,
"formGroupInputRequired": false,
"formGroupInputPlaceholder": "read-only",
"formGroupInputPlaceholder": false,
"formGroupInputDescribedBy": false,
"formGroupInputHelpText": false,
"formGroupInputState": "readonly",
"formGroupBtnClear": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"formGroupInputPlaceholder": {
"text": "XX"
},
"formGroupInputDescribedBy": "input-number-help-text-id",
"formGroupInputHelpText": {
"id": "input-number-help-text-id",
"text": "Texte d'assistance"
},
"formGroupInputCounter": false

},
{
"formGroupClass": "required",
Expand All @@ -24,6 +26,7 @@
"formGroupInputPlaceholder": {
"text": "XX"
},
"formGroupInputDescribedBy": "input-number-help-text-id input-number-caracter-count",
"formGroupInputValue": "40",
"formGroupInputHelpText": {
"id": "input-number-help-text-id",
Expand All @@ -48,6 +51,7 @@
"formGroupInputRequired": true,
"formGroupInputLabel": "En erreur input vide",
"formGroupInputPlaceholder": false,
"formGroupInputDescribedBy": "input-text-error-id",
"formGroupInputHelpText": false,
"formGroupInputError": {
"id": "input-text-error-id",
Expand Down Expand Up @@ -76,7 +80,7 @@
"formGroupInputLabel": "Read-only",
"formGroupInputClass": false,
"formGroupInputRequired": false,
"formGroupInputPlaceholder": "read-only",
"formGroupInputPlaceholder": false,
"formGroupInputHelpText": false,
"formGroupInputState": "readonly",
"formGroupInputValue": "40"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"formGroupInputPlaceholder": {
"text": "Placeholder"
},
"formGroupInputDescribedBy": "form-group-textearea-help-text textarea-caracter-count",
"formGroupInputHelpText": {
"id": "form-group-textearea-help-text",
"text": "Texte d'assistance."
Expand All @@ -29,16 +30,17 @@
"formGroupInputPlaceholder": {
"text": "Placeholder"
},
"formGroupInputDescribedBy": "form-group-textearea-help-text form-group-textarea-error-text",
"formGroupInputHelpText": {
"id": "form-group-textearea-error-help-text",
"id": "form-group-textearea-help-text",
"text": "Texte d'assistance."
},
"formGroupTextareaRows": "5",
"formGroupInputError": {
"id": "form-group-textarea-error-text",
"text": "Texte d'erreur",
"formAriaInputError": true
}
"text": "Texte d'erreur"
},
"formAriaInputError": true
}
],
"textareaState": [
Expand All @@ -51,16 +53,13 @@
"formGroupInputPlaceholder": {
"text": "Placeholder"
},
"formGroupInputDescribedBy": "form-group-textearea-disabled-help-text ",
"formGroupInputHelpText": {
"id": "form-group-textearea-disabled-help-text",
"text": "Texte d'assistance"
},
"formGroupTextareaRows": "5",
"formGroupInputState": "disabled",
"formGroupInputError": {
"id": "form-group-textarea-disabled-error-text",
"text": "texte d'erreur"
}
"formGroupInputState": "disabled"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"formGroupClass": false,
"formGroupInputID": "form-control-input-file-v2",
"formGroupInputID": "form-control-input-file-v2-2",
"formGroupInputLabel": "Libellé",
"formGroupFileID": "file-droparea-v2",
"formGroupFileDropID": "form-group-file-upload",
"formGroupFileID": "file-droparea-v2-2",
"formGroupFileDropID": "form-group-file-upload-2",
"formGroupFileDropLabel": "Parcourir",
"formGroupFileDropHelpText": "ou déposer votre fichier ici",
"dropdownMenu": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"formGroupClass": false,
"formGroupInputID": "form-control-input-file-v2",
"formGroupInputID": "form-control-input-file-v2-3",
"formGroupInputLabel": "Libellé",
"formGroupFileID": "file-droparea-v2",
"formGroupFileDropID": "form-group-file-upload",
"formGroupFileID": "file-droparea-v2-3",
"formGroupFileDropID": "form-group-file-upload-3",
"formGroupFileDropLabel": "Parcourir",
"formGroupFileDropHelpText": "ou déposer votre fichier ici",
"dropdownMenu": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="form-group {{ formGroupClass }}">
{{^ formGroupNoLabel}}
<label for="{{formGroupInputID}}">{{ formGroupInputLabel}}</label>
<label for="{{formGroupFileDropID}}">{{ formGroupInputLabel}}</label>
{{/ formGroupNoLabel}}
{{# formGroupInputHelpText}}
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputHelpText}}
<div class="file-drop-container-v2 {{formGroupFileClass}}" id="{{formGroupFileID}}">
<div class="file-selector-button">
<input type="file" id="{{ formGroupFileDropID}}" class="sr-only {{formGroupFileClass}}"{{^formGroupInputError}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{/formGroupInputError}}{{#formGroupInputError}} aria-describedby="{{id}}"{{/formGroupInputError}}{{# formGroupFileState}} {{formGroupFileState}}{{/ formGroupFileState}}>
<input type="file" id="{{formGroupFileDropID}}" class="sr-only {{formGroupFileClass}}"{{^formGroupInputError}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{/ formGroupInputError}}{{#formGroupInputError}} aria-describedby="{{id}}"{{/ formGroupInputError}}{{# formGroupFileState}} {{formGroupFileState}}{{/ formGroupFileState}}>
<label class="btn btn-secondary btn-squared" for="{{ formGroupFileDropID}}">{{ formGroupFileDropLabel }}</label>
</div>
<span class="help-text">{{ formGroupFileDropHelpText }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{# formGroupInputHelpText}}
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputHelpText}}
<input type="number" class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputValue}}value="{{ formGroupInputValue}}"{{/ formGroupInputValue}}{{# formGroupInputPlaceholder}} placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{#formGroupInputError}} aria-describedby="{{id}}" {{#formAriaInputError}} aria-invalid="true" {{/formAriaInputError}}{{/formGroupInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}{{# boundary}}{{#min}} min="{{min}}"{{/min}}{{#max}} max="{{max}}"{{/max}}{{#step}} step="{{step}}"{{/step}}{{/boundary}}>
<input type="number" class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputValue}}value="{{ formGroupInputValue}}"{{/ formGroupInputValue}}{{# formGroupInputPlaceholder}} placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupInputDescribedBy}} aria-describedby="{{formGroupInputDescribedBy}}"{{/ formGroupInputDescribedBy}}{{#formGroupInputError}} aria-describedby="{{id}}" {{#formAriaInputError}} aria-invalid="true" {{/formAriaInputError}}{{/formGroupInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}{{# boundary}}{{#min}} min="{{min}}"{{/min}}{{#max}} max="{{max}}"{{/max}}{{#step}} step="{{step}}"{{/step}}{{/boundary}}>
{{# formGroupInputCounter}}
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputCounter}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputHelpText}}
{{# formGroupBtnClear}}<div class="input-group-icon">{{/ formGroupBtnClear}}
<input type="{{formGroupInputType}}" class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputPlaceholder}}placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{#formGroupInputError}} aria-describedby="{{id}}" {{#formAriaInputError}} aria-invalid="true" {{/formAriaInputError}}{{/formGroupInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}>
<input type="{{formGroupInputType}}" class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputPlaceholder}}placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupInputDescribedBy}} aria-describedby="{{formGroupInputDescribedBy}}"{{/ formGroupInputDescribedBy}}{{#formAriaInputError}} aria-invalid="true" {{/ formAriaInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}>
{{# formGroupBtnClear}}
<button class="btn-clear">
<span class="icon icon-x-circle icon-md" aria-hidden="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{# formGroupInputHelpText}}
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputHelpText}}
<textarea class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputPlaceholder}}placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupTextareaRows}} rows="{{formGroupTextareaRows}}"{{/ formGroupTextareaRows}}{{^formGroupInputError}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{/formGroupInputError}}{{#formGroupInputError}} aria-describedby="{{id}}" {{#formAriaInputError}} aria-invalid="true" {{/formAriaInputError}} {{/formGroupInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}></textarea>
<textarea class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputPlaceholder}}placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupTextareaRows}} rows="{{formGroupTextareaRows}}"{{/ formGroupTextareaRows}}{{# formGroupInputDescribedBy}} aria-describedby="{{formGroupInputDescribedBy}}"{{/ formGroupInputDescribedBy}}{{#formAriaInputError}} aria-invalid="true"{{/ formAriaInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}></textarea>
{{# formGroupInputCounter}}
<span id="{{id}}" class="form-text">{{ text }}</span>
{{/ formGroupInputCounter}}
Expand Down

0 comments on commit 1b0269d

Please sign in to comment.