-
Notifications
You must be signed in to change notification settings - Fork 58
[OUDS] Manage mandatory fields indication #3439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ouds/main
Are you sure you want to change the base?
Changes from 17 commits
60caefd
014a5c1
5c94c28
cf5670f
df51fca
e403074
0ece7fd
bb1ef89
400d17e
e61898d
ea11036
0178468
1251127
0afcb5e
5a5b9a5
d80743c
85f4c9a
f63d4f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,9 @@ | |
|
|
||
| .is-required::after { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should put the is-required common css elsewhere as the content of this file is mostly Bootstrap... Idk where though
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I asked myself the question... We can still change that later |
||
| position: absolute; | ||
| margin-left: $form-label-required-margin-left; | ||
| color: $form-label-required-color; | ||
| margin-left: 4px; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we/did you ask for tokens for this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I asked for it in Figma |
||
| font-weight: $ouds-font-weight-system-web-strong; | ||
| color: $ouds-color-content-status-negative; | ||
| content: "*"; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||
| --- | ||||
| /* | ||||
| * Outputs mandatory fields indication | ||||
| */ | ||||
|
|
||||
| import {getConfig} from "@libs/config.ts"; | ||||
|
||||
| import {getConfig} from "@libs/config.ts"; |
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
componentName is optional, but when it’s omitted name/link become empty strings and the rendered markup still includes a “design guidelines” <a> with an empty href. Consider making componentName required, or conditionally rendering the guideline link/text only when it’s provided.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,9 +293,9 @@ You can align horizontally up to three checkboxes if their labels are short, add | |
|
|
||
| ### Max width | ||
|
|
||
| By default checkboxes will span the whole width of their parent container, to limit the width of the checkbox on wider parent container, add a `.component-max-width` to the `.checkbox-item` container. More information on checkbox sizing in the [design guidelines](https://r.orange.fr/r/S-ouds-doc-checkbox-responsiveness). | ||
| By default, checkboxes will span the whole width of their parent container, to limit the width of the checkbox on wider parent container, add a `.component-max-width` to the `.checkbox-item` container. More information on checkbox sizing in the [design guidelines](https://r.orange.fr/r/S-ouds-doc-checkbox-responsiveness). | ||
|
|
||
| <Example code={`<fieldset class="control-items-list"> | ||
| <Example buttonLabel="checkbox max width" code={`<fieldset class="control-items-list"> | ||
| <div class="checkbox-item component-max-width"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="checkbox" aria-describedby="checkboxMWDescription" id="checkboxWithMaxWidth" value="" /> | ||
|
|
@@ -660,3 +660,39 @@ For the standalone checkbox, we provide a completely different architecture to e | |
| <input class="form-check-input" type="checkbox" id="checkboxNoLabel" value="" aria-label="Standalone checkbox (Bootstrap compatible)" /> | ||
| </div>`} /> | ||
| </BootstrapCompatibility> | ||
|
|
||
| ## Mandatory field indication | ||
|
|
||
| <MandatoryFieldIndication componentName="checkbox" /> | ||
|
|
||
| <Example buttonLabel="mandatory checkboxes indication" code={`<div class="checkbox-item-container"> | ||
| <div class="checkbox-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="checkbox" value="" id="checkboxUniqueMandatory" name="mandatoryCheckbox" /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label is-required" for="checkboxUniqueMandatory">Mandatory unique checkbox</label> | ||
| </div> | ||
|
Comment on lines
+669
to
+675
|
||
| </div> | ||
| </div> | ||
| <hr class="my-xlarge"> | ||
| <fieldset class="control-items-list"> | ||
| <legend class="is-required">Mandatory checkboxes</legend> | ||
| <div class="checkbox-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="checkbox" value="" id="mandatoryCheckbox1" name="mandatoryCheckboxes" required /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label" for="mandatoryCheckbox1">Default checkbox</label> | ||
| </div> | ||
| </div> | ||
| <div class="checkbox-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input checked class="control-item-indicator" type="checkbox" value="" id="mandatoryCheckbox2" name="mandatoryCheckboxes" required /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label" for="mandatoryCheckbox2">Checked checkbox</label> | ||
| </div> | ||
| </div> | ||
| </fieldset>`} /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,7 +124,7 @@ A `placeholder` attribute is required on each `<input>` as our CSS-only floating | |||||||||
| <p id="inputPasswordInvalidHelper" class="helper-text">Enter a password with at least 8 characters (without the DEV- prefix).</p> | ||||||||||
| <p id="inputPasswordInvalidError" class="error-text">Password must be at least 8 characters (without the DEV- prefix).</p> | ||||||||||
| </div> | ||||||||||
| <div class="text-input"> | ||||||||||
| <div class="text-input mb-medium"> | ||||||||||
| <div class="text-input-container text-input-container-outlined"> | ||||||||||
| <svg aria-hidden="true"> | ||||||||||
| <use xlink:href="${getVersionedDocsPath('/assets/img/ouds-web-sprite.svg#lock-closed')}"/> | ||||||||||
|
|
@@ -142,4 +142,16 @@ A `placeholder` attribute is required on each `<input>` as our CSS-only floating | |||||||||
| </div> | ||||||||||
| <p id="inputPasswordOutlinedInvalidHelper" class="helper-text">Enter a password with at least 8 characters (without the DEV- prefix).</p> | ||||||||||
| <p id="inputPasswordOutlinedInvalidError" class="error-text">Password must be at least 8 characters (without the DEV- prefix).</p> | ||||||||||
| </div> | ||||||||||
| <div class="text-input"> | ||||||||||
| <div class="text-input-container"> | ||||||||||
| <label for="madatoryPassword" class="is-required">Password</label> | ||||||||||
| <input type="password" id="madatoryPassword" class="text-input-field" placeholder=" " required> | ||||||||||
|
Comment on lines
+148
to
+149
|
||||||||||
| <label for="madatoryPassword" class="is-required">Password</label> | |
| <input type="password" id="madatoryPassword" class="text-input-field" placeholder=" " required> | |
| <label for="mandatoryPassword" class="is-required">Password</label> | |
| <input type="password" id="mandatoryPassword" class="text-input-field" placeholder=" " required> |
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR metadata links to #mandatory-field-indication, but this page doesn’t include a “## Mandatory field indication” heading/anchor (and doesn’t use the new <MandatoryFieldIndication /> shortcode like other form components). Consider adding the dedicated section at the end of the page so the anchor exists and the docs stay consistent.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,9 +330,9 @@ You can align horizontally up to three radio buttons if their labels are short, | |
|
|
||
| ### Max width | ||
|
|
||
| By default radio buttons will span the whole width of their parent container, to limit the width of the radio button on wider parent container, add a `.component-max-width` to the `.radio-button-item` container. More information on radio button sizing in the [design guidelines](https://r.orange.fr/r/S-ouds-doc-radio-button-responsiveness). | ||
| By default, radio buttons will span the whole width of their parent container, to limit the width of the radio button on wider parent container, add a `.component-max-width` to the `.radio-button-item` container. More information on radio button sizing in the [design guidelines](https://r.orange.fr/r/S-ouds-doc-radio-button-responsiveness). | ||
|
|
||
| <Example code={`<fieldset class="control-items-list"> | ||
| <Example buttonLabel="radio button max width" code={`<fieldset class="control-items-list"> | ||
| <div class="radio-button-item component-max-width"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="radio" aria-describedby="radioMWDescription" id="radioWithMaxWidth" value="" name="radioMaxWidth" /> | ||
|
|
@@ -604,3 +604,39 @@ For the standalone radio button, we provide a completely different architecture | |
| <input class="form-check-input" type="radio" value="" aria-label="Default standalone radio button (Bootstrap compatible)" /> | ||
| </div>`} /> | ||
| </BootstrapCompatibility> | ||
|
|
||
|
|
||
| ## Mandatory field indication | ||
|
|
||
| <MandatoryFieldIndication componentName="radio button" /> | ||
|
|
||
| <Example buttonLabel="mandatory radio buttons indication" code={`<div class="radio-button-item-container"> | ||
| <div class="radio-button-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="radio" value="" id="radioUniqueMandatory" name="mandatoryRadio" /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label is-required" for="radioUniqueMandatory">Mandatory unique radio button</label> | ||
| </div> | ||
|
Comment on lines
+614
to
+620
|
||
| </div> | ||
| </div> | ||
| <hr class="my-xlarge"> | ||
| <fieldset class="control-items-list"> | ||
| <legend class="is-required">Mandatory radio buttons</legend> | ||
| <div class="radio-button-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input class="control-item-indicator" type="radio" value="" id="mandatoryRadio1" name="mandatoryRadios" required /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label" for="mandatoryRadio1">Default radio button</label> | ||
| </div> | ||
| </div> | ||
| <div class="radio-button-item"> | ||
| <div class="control-item-assets-container"> | ||
| <input checked class="control-item-indicator" type="radio" value="" id="mandatoryRadio2" name="mandatoryRadios" required /> | ||
| </div> | ||
| <div class="control-item-text-container"> | ||
| <label class="control-item-label" for="mandatoryRadio2">Checked radio button</label> | ||
| </div> | ||
| </div> | ||
| </fieldset>`} /> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the
!defaultSCSS variables for required label styling (previously in theform-label-variablessection) is a breaking change for downstream consumers who override them. Consider keeping them (possibly deprecated) and mapping them to the new token-based values to preserve the SCSS API.