[OUDS] Manage mandatory fields indication#3439
Conversation
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
MaxLardenois
left a comment
There was a problem hiding this comment.
I think it's the right direction
| position: absolute; | ||
| margin-left: $form-label-required-margin-left; | ||
| color: $form-label-required-color; | ||
| margin-left: 4px; |
There was a problem hiding this comment.
Should we/did you ask for tokens for this?
There was a problem hiding this comment.
I asked for it in Figma
| @@ -18,8 +18,9 @@ | |||
|
|
|||
| .is-required::after { | |||
There was a problem hiding this comment.
Maybe we should put the is-required common css elsewhere as the content of this file is mostly Bootstrap... Idk where though
There was a problem hiding this comment.
I asked myself the question... We can still change that later
Co-authored-by: Maxime Lardenois <maxime.lardenois@orange.com>
Co-authored-by: Maxime Lardenois <maxime.lardenois@orange.com>
MaxLardenois
left a comment
There was a problem hiding this comment.
I'm wondering if we should add a mention in migration for the addition of is-required?
Also Idk if the behavior is different from Boosted, if so we should add something in migration from boosted
# Conflicts: # site/src/content/docs/components/text-area.mdx # site/src/content/docs/components/text-input.mdx
MaxLardenois
left a comment
There was a problem hiding this comment.
Approved as soon as the supplementaries examples are removed
@vprothais Like I said to Maxime, this is the same behaviour than with Boosted (add a class |
There was a problem hiding this comment.
Pull request overview
This PR updates the OUDS documentation and styles to better define and demonstrate how to indicate mandatory fields across form components, including adding a reusable shortcode for consistent guidance.
Changes:
- Add new “Mandatory field indication” documentation sections and examples across multiple form components (plus broader rules in form validation docs).
- Introduce a new
<MandatoryFieldIndication />shortcode and register it for MDX auto-import typing. - Adjust SCSS for required-indicator styling and some label/layout behaviors, and add missing
buttonLabels for examples.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/types/auto-import.d.ts | Registers the new MandatoryFieldIndication shortcode for typed auto-import use in MDX. |
| site/src/content/docs/foundation/form-validation.mdx | Adds global guidance and examples for when/how to indicate mandatory fields. |
| site/src/content/docs/components/text-input.mdx | Adds mandatory indication section + example; adds missing buttonLabels in examples. |
| site/src/content/docs/components/text-area.mdx | Adds mandatory indication section + example; adds missing buttonLabel for max-width example. |
| site/src/content/docs/components/switch.mdx | Adds mandatory indication section + examples; adds missing buttonLabel for max-width example. |
| site/src/content/docs/components/select-input.mdx | Adds mandatory indication section + example; adds missing buttonLabels. |
| site/src/content/docs/components/radio-button.mdx | Adds mandatory indication section + examples; adds missing buttonLabel for max-width example. |
| site/src/content/docs/components/password-input.mdx | Adds a mandatory password example inside the “all variations” example. |
| site/src/content/docs/components/checkbox.mdx | Adds mandatory indication section + examples; adds missing buttonLabel for max-width example. |
| site/src/components/shortcodes/MandatoryFieldIndication.astro | New shortcode that centralizes mandatory indication guidance and links to relevant docs. |
| scss/forms/_text-input.scss | Updates required-label styling for floating labels and adjusts trailing-action padding logic. |
| scss/forms/_select-input.scss | Changes label sizing rule from max-width to width in the select label container. |
| scss/forms/_labels.scss | Updates .is-required::after styling (spacing, weight, color). |
| scss/_variables.scss | Removes SCSS variables previously exposed for required-label styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into ouds/main-his-mandatory-fields
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into ouds/main-his-mandatory-fields
Types of change
Related issues
Closes #
Context & Motivation
For info, what mandatory text inputs look like in many labels' combinations:

For info, what mandatory select inputs look like in many labels' combinations:

Description
Checklists
Checklist (for Core Team only)
Progression (for Core Team only)
ouds/mainfollowing conventional commitLive previews