Skip to content

[OUDS] Manage mandatory fields indication#3439

Open
hannahiss wants to merge 27 commits intoouds/mainfrom
ouds/main-his-mandatory-fields
Open

[OUDS] Manage mandatory fields indication#3439
hannahiss wants to merge 27 commits intoouds/mainfrom
ouds/main-his-mandatory-fields

Conversation

@hannahiss
Copy link
Copy Markdown
Member

@hannahiss hannahiss commented Mar 13, 2026

Types of change

  • Non-breaking change
  • Breaking change (fix or feature that would change existing functionality and usage)

Related issues

Closes #

Context & Motivation

  • Add some indications on when to indicate fields are mandatory in form-validation (plus examples)
  • Add examples of mandatory field indication for each form component at the en of the page
  • Add shortcode introdution for mandatory field indication
  • Add some missing buttonLabels

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

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

Description

Checklists

  • I have read the contributing guidelines
  • My change follows the developer guide
  • My change pass all tests
  • My change is compatible with a responsive display
  • I have added tests (Javascript unit test or visual) to cover my changes
  • My change introduces changes to the documentation that I have updated accordingly
    • Title and DOM structure is correct
    • Links have been updated (title changes impact links)
    • CSS for the documentation
  • I have checked all states and combinations of the component with my change
  • I have checked all the impacts for the other components and core behavior (grid, reboot, utilities)

Checklist (for Core Team only)

  • The changes need to be in the migration guide
  • The changes are well displayed in Storybook (be careful if example order has changed for DSM)
  • The changes are compatible with RTL
  • Manually test browser compatibility with BrowserStack (Chrome 120, Firefox 121, Edge 120, Safari 15.6, iOS Safari, Chrome & Firefox on Android)

Progression (for Core Team only)

Live previews

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 39a296c
🔍 Latest deploy log https://app.netlify.com/projects/boosted/deploys/69d6780531bece00080d195f
😎 Deploy Preview https://deploy-preview-3439--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Collaborator

@MaxLardenois MaxLardenois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the right direction

position: absolute;
margin-left: $form-label-required-margin-left;
color: $form-label-required-color;
margin-left: 4px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we/did you ask for tokens for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked for it in Figma

@@ -18,8 +18,9 @@

.is-required::after {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked myself the question... We can still change that later

@hannahiss hannahiss marked this pull request as ready for review March 18, 2026 16:55
@boosted-bot boosted-bot moved this from In Progress / Draft to Need Dev Review in 🟣 [Orange-Boosted-Bootstrap] PRs Board Mar 18, 2026
Copy link
Copy Markdown
Collaborator

@MaxLardenois MaxLardenois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@boosted-bot boosted-bot moved this from Need Dev Review to Dev Review In Progress in 🟣 [Orange-Boosted-Bootstrap] PRs Board Mar 20, 2026
# Conflicts:
#	site/src/content/docs/components/text-area.mdx
#	site/src/content/docs/components/text-input.mdx
Copy link
Copy Markdown
Collaborator

@MaxLardenois MaxLardenois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as soon as the supplementaries examples are removed

@boosted-bot boosted-bot moved this from Dev Review In Progress to Need Lead Dev Review in 🟣 [Orange-Boosted-Bootstrap] PRs Board Mar 23, 2026
@hannahiss
Copy link
Copy Markdown
Member Author

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

@vprothais Like I said to Maxime, this is the same behaviour than with Boosted (add a class is-required to have the asterisk) except in the case of .form-check-input (i.e. checkboxes/radios/switches) where the required attribute was sufficient, but not sure it is mandatory to mention this in the migration form boosted guide... what do you think ?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Lead Dev Review

Development

Successfully merging this pull request may close these issues.

5 participants